Skip to content

Commit

Permalink
Implement sceNetInetInetAddr which seems to be used too by many games…
Browse files Browse the repository at this point in the history
… along with sceHttp syscalls
  • Loading branch information
anr2me committed Aug 28, 2023
1 parent 841de7d commit d032ad4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Core/HLE/sceNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,17 @@ static int sceNetApctlDelHandler(u32 handlerID) {
return NetApctl_DelHandler(handlerID);
}

static u32_le sceNetInetInetAddr(const char* hostname) {
INFO_LOG(SCENET, "sceNetInetInetAddr(%s)", safe_string(hostname));
if (hostname == nullptr || hostname[0] == '\0')
return hleLogError(SCENET, INADDR_NONE, "invalid arg");

u32 ipv4 = INADDR_NONE;
inet_pton(AF_INET, hostname, &ipv4); // Alternative to the deprecated inet_addr(hostname)

return hleLogSuccessX(SCENET, ipv4);
}

static int sceNetInetInetAton(const char *hostname, u32 addrPtr) {
ERROR_LOG(SCENET, "UNIMPL sceNetInetInetAton(%s, %08x)", hostname, addrPtr);
return -1;
Expand Down Expand Up @@ -1524,7 +1535,7 @@ const HLEFunction sceNetInet[] = {
{0X774E36F4, nullptr, "sceNetInetSendmsg", '?', "" },
{0XFBABE411, &WrapI_V<sceNetInetGetErrno>, "sceNetInetGetErrno", 'i', "" },
{0X1A33F9AE, nullptr, "sceNetInetBind", '?', "" },
{0XB75D5B0A, nullptr, "sceNetInetInetAddr", '?', "" },
{0XB75D5B0A, &WrapU_C<sceNetInetInetAddr>, "sceNetInetInetAddr", 'x', "s" },
{0X1BDF5D13, &WrapI_CU<sceNetInetInetAton>, "sceNetInetInetAton", 'i', "sx" },
{0XD0792666, nullptr, "sceNetInetInetNtop", '?', "" },
{0XE30B8C19, nullptr, "sceNetInetInetPton", '?', "" },
Expand Down

0 comments on commit d032ad4

Please sign in to comment.