diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp index a4779e7e7e..1b42d3b213 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp @@ -1813,6 +1813,7 @@ int getLocalIp(sockaddr_in* SocketAddress) { } #else // Alternative way + // Socket doesn't "leak" to the game. int sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock != SOCKET_ERROR) { const char* kGoogleDnsIp = "8.8.8.8"; // Needs to be an IP string so it can be resolved as fast as possible to IP, doesn't need to be reachable diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index f0f3e811cf..7fa2275b41 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -1379,6 +1379,7 @@ int sceNetAdhocPdpCreate(const char *mac, int port, int bufferSize, u32 flag) { // Valid MAC supplied. FIXME: MAC only valid after successful attempt to Create/Connect/Join a Group? (ie. adhocctlCurrentMode != ADHOCCTL_MODE_NONE) if ((adhocctlCurrentMode != ADHOCCTL_MODE_NONE) && isLocalMAC(saddr)) { // Create Internet UDP Socket + // Socket is remapped through adhocSockets int usocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); // Valid Socket produced if (usocket != INVALID_SOCKET) { @@ -3257,6 +3258,7 @@ int RecreatePtpSocket(int ptpId) { closesocket(sock->data.ptp.id); // Create a new socket + // Socket is remapped through adhocSockets int tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); // Valid Socket produced @@ -3375,7 +3377,8 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac, // Valid Arguments if (bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0) { - // Create Infrastructure Socket + // Create Infrastructure Socket (?) + // Socket is remapped through adhocSockets int tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); // Valid Socket produced @@ -3977,7 +3980,8 @@ static int sceNetAdhocPtpListen(const char *srcmac, int sport, int bufsize, int // Valid Arguments if (bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0 && backlog > 0) { - // Create Infrastructure Socket + // Create Infrastructure Socket (?) + // Socket is remapped through adhocSockets int tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); // Valid Socket produced diff --git a/Core/HLE/sceNetInet.cpp b/Core/HLE/sceNetInet.cpp index 3252445321..489da3096c 100644 --- a/Core/HLE/sceNetInet.cpp +++ b/Core/HLE/sceNetInet.cpp @@ -321,6 +321,7 @@ int sceNetInetPoll(u32 fdsPtr, u32 nfds, int timeout) { // timeout in milisecond FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); for (int i = 0; i < (s32)nfds; i++) { if (fdarray[i].fd < 0) { + // In Unix, this is OK and means it the fd should be ignored, except fdarray[i].revents should be zeroed. inetLastErrno = EINVAL; return hleLogError(Log::sceNet, -1, "invalid socket id"); } diff --git a/Core/HLE/sceNetInet.h b/Core/HLE/sceNetInet.h index fb84e14350..25496e4a35 100644 --- a/Core/HLE/sceNetInet.h +++ b/Core/HLE/sceNetInet.h @@ -96,8 +96,8 @@ typedef struct SceNetInetLinger { // Polling Event Field typedef struct SceNetInetPollfd { //similar format to pollfd in 32bit (pollfd in 64bit have different size) s32_le fd; - s16_le events; - s16_le revents; + s16_le events; // requested events + s16_le revents; // returned events } PACK SceNetInetPollfd; // TCP & UDP Socket Union (Internal use only) diff --git a/UI/OnScreenDisplay.cpp b/UI/OnScreenDisplay.cpp index 893bdb80a3..fc5e4b4765 100644 --- a/UI/OnScreenDisplay.cpp +++ b/UI/OnScreenDisplay.cpp @@ -77,7 +77,6 @@ static void MeasureNotice(const UIContext &dc, NoticeLevel level, const std::str if (!details.empty()) { dc.MeasureText(dc.theme->uiFont, extraTextScale, extraTextScale, details, &width2, &height2, align); *width = std::max(*width, width2); - *height += 5.0f + height2; } float iconW = 0.0f; @@ -100,7 +99,8 @@ static void MeasureNotice(const UIContext &dc, NoticeLevel level, const std::str iconW += 5.0f; *width += iconW + 12.0f; - *height = std::max(*height, iconH + 5.0f); + *height1 = std::max(*height1, iconH + 2.0f); + *height = std::max(*height1 + height2 + 8.0f, iconH + 5.0f); } // Align only matters here for the ASCII-only flag. @@ -156,14 +156,17 @@ static void RenderNotice(UIContext &dc, Bounds bounds, float height1, NoticeLeve bounds.x += iconW + 5.0f; bounds.w -= iconW + 5.0f; - dc.DrawTextShadowRect(text, bounds.Inset(0.0f, 1.0f, 0.0f, 0.0f), foreGround, (align & FLAG_DYNAMIC_ASCII)); + Bounds primaryBounds = bounds; + primaryBounds.h = height1; + + dc.DrawTextShadowRect(text, primaryBounds.Inset(2.0f, 0.0f, 1.0f, 0.0f), foreGround, (align & FLAG_DYNAMIC_ASCII) | ALIGN_VCENTER); if (!details.empty()) { Bounds bottomTextBounds = bounds.Inset(3.0f, height1 + 5.0f, 3.0f, 3.0f); UI::Drawable backgroundDark = UI::Drawable(colorAlpha(darkenColor(GetNoticeBackgroundColor(level)), alpha)); dc.FillRect(backgroundDark, bottomTextBounds); dc.SetFontScale(extraTextScale, extraTextScale); - dc.DrawTextRect(details, bottomTextBounds, foreGround, (align & FLAG_DYNAMIC_ASCII) | ALIGN_LEFT); + dc.DrawTextRect(details, bottomTextBounds.Inset(1.0f, 1.0f), foreGround, (align & FLAG_DYNAMIC_ASCII) | ALIGN_LEFT); } dc.SetFontScale(1.0f, 1.0f); }