mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 02:33:43 +01:00
Logging API change (refactor) (#19324)
* Rename LogType to Log * Explicitly use the Log:: enum when logging. Allows for autocomplete when editing. * Mac/ARM64 buildfix * Do the same with the hle result log macros * Rename the log names to mixed case while at it. * iOS buildfix * Qt buildfix attempt, ARM32 buildfix
This commit is contained in:
1 parent
ae3ff686f0
commit
e01ca5b057
393 files changed
+6198
-6193
No files matched your search
+114
-114
@@ -106,7 +106,7 @@ void AfterApctlMipsCall::DoState(PointerWrap & p) {
|
||||
|
||||
void AfterApctlMipsCall::run(MipsCall& call) {
|
||||
u32 v0 = currentMIPS->r[MIPS_REG_V0];
|
||||
DEBUG_LOG(SCENET, "AfterApctlMipsCall::run [ID=%i][OldState=%d][NewState=%d][Event=%d][Error=%d][ArgsPtr=%08x] [cbId: %u][retV0: %08x]", handlerID, oldState, newState, event, error, argsAddr, call.cbId, v0);
|
||||
DEBUG_LOG(Log::sceNet, "AfterApctlMipsCall::run [ID=%i][OldState=%d][NewState=%d][Event=%d][Error=%d][ArgsPtr=%08x] [cbId: %u][retV0: %08x]", handlerID, oldState, newState, event, error, argsAddr, call.cbId, v0);
|
||||
//call.setReturnValue(v0);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ static void __ApctlState(u64 userdata, int cyclesLate) {
|
||||
|
||||
SceUID waitID = __KernelGetWaitID(threadID, WAITTYPE_NET, error);
|
||||
if (waitID == 0 || error != 0) {
|
||||
WARN_LOG(SCENET, "sceNetApctl State WaitID(%i) on Thread(%i) already woken up? (error: %08x)", uid, threadID, error);
|
||||
WARN_LOG(Log::sceNet, "sceNetApctl State WaitID(%i) on Thread(%i) already woken up? (error: %08x)", uid, threadID, error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ static void __ApctlState(u64 userdata, int cyclesLate) {
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, result);
|
||||
DEBUG_LOG(SCENET, "Returning (WaitID: %d, error: %08x) Result (%08x) of sceNetApctl - Event: %d, State: %d", waitID, error, (int)result, event, netApctlState);
|
||||
DEBUG_LOG(Log::sceNet, "Returning (WaitID: %d, error: %08x) Result (%08x) of sceNetApctl - Event: %d, State: %d", waitID, error, (int)result, event, netApctlState);
|
||||
}
|
||||
|
||||
// Used to change Apctl State after a delay and before executing callback mipscall (since we don't have beforeAction)
|
||||
@@ -210,7 +210,7 @@ void __NetInit() {
|
||||
|
||||
SceNetEtherAddr mac;
|
||||
getLocalMac(&mac);
|
||||
INFO_LOG(SCENET, "LocalHost IP will be %s [%s]", ip2str(g_localhostIP.in.sin_addr).c_str(), mac2str(&mac).c_str());
|
||||
INFO_LOG(Log::sceNet, "LocalHost IP will be %s [%s]", ip2str(g_localhostIP.in.sin_addr).c_str(), mac2str(&mac).c_str());
|
||||
|
||||
// TODO: May be we should initialize & cleanup somewhere else than here for PortManager to be used as general purpose for whatever port forwarding PPSSPP needed
|
||||
__UPnPInit();
|
||||
@@ -440,7 +440,7 @@ void __NetApctlCallbacks()
|
||||
int handlerID = id - 1;
|
||||
for (std::map<int, NpAuthHandler>::iterator it = npAuthHandlers.begin(); it != npAuthHandlers.end(); ++it) {
|
||||
if (it->first == handlerID) {
|
||||
DEBUG_LOG(SCENET, "NpAuthCallback [HandlerID=%i][RequestID=%d][Result=%d][ArgsPtr=%08x]", it->first, id, result, it->second.argument);
|
||||
DEBUG_LOG(Log::sceNet, "NpAuthCallback [HandlerID=%i][RequestID=%d][Result=%d][ArgsPtr=%08x]", it->first, id, result, it->second.argument);
|
||||
// TODO: Update result / args.data[1] with the actual ticket length (or error code?)
|
||||
hleEnqueueCall(it->second.entryPoint, 3, args.data);
|
||||
}
|
||||
@@ -537,7 +537,7 @@ void __NetApctlCallbacks()
|
||||
|
||||
// Run mipscall. Should we skipped executing the mipscall if oldState == newState?
|
||||
for (std::map<int, ApctlHandler>::iterator it = apctlHandlers.begin(); it != apctlHandlers.end(); ++it) {
|
||||
DEBUG_LOG(SCENET, "ApctlCallback [ID=%i][OldState=%d][NewState=%d][Event=%d][Error=%08x][ArgsPtr=%08x]", it->first, oldState, newState, event, error, it->second.argument);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlCallback [ID=%i][OldState=%d][NewState=%d][Event=%d][Error=%08x][ArgsPtr=%08x]", it->first, oldState, newState, event, error, it->second.argument);
|
||||
args.data[4] = it->second.argument;
|
||||
AfterApctlMipsCall* after = (AfterApctlMipsCall*)__KernelCreateAction(actionAfterApctlMipsCall);
|
||||
after->SetData(it->first, oldState, newState, event, error, it->second.argument);
|
||||
@@ -599,7 +599,7 @@ u32 Net_Term() {
|
||||
}
|
||||
|
||||
static u32 sceNetTerm() {
|
||||
WARN_LOG(SCENET, "sceNetTerm() at %08x", currentMIPS->pc);
|
||||
WARN_LOG(Log::sceNet, "sceNetTerm() at %08x", currentMIPS->pc);
|
||||
int retval = Net_Term();
|
||||
|
||||
// Give time to make sure everything are cleaned up
|
||||
@@ -623,11 +623,11 @@ static int sceNetInit(u32 poolSize, u32 calloutPri, u32 calloutStack, u32 netini
|
||||
Net_Term(); // This cleanup attempt might not worked when SaveState were loaded in the middle of multiplayer game and re-entering multiplayer, thus causing memory leaks & wasting binded ports. May be we shouldn't save/load "Inited" vars on SaveState?
|
||||
|
||||
if (poolSize == 0) {
|
||||
return hleLogError(SCENET, SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE, "invalid pool size");
|
||||
return hleLogError(Log::sceNet, SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE, "invalid pool size");
|
||||
} else if (calloutPri < 0x08 || calloutPri > 0x77) {
|
||||
return hleLogError(SCENET, SCE_KERNEL_ERROR_ILLEGAL_PRIORITY, "invalid callout thread priority");
|
||||
return hleLogError(Log::sceNet, SCE_KERNEL_ERROR_ILLEGAL_PRIORITY, "invalid callout thread priority");
|
||||
} else if (netinitPri < 0x08 || netinitPri > 0x77) {
|
||||
return hleLogError(SCENET, SCE_KERNEL_ERROR_ILLEGAL_PRIORITY, "invalid init thread priority");
|
||||
return hleLogError(Log::sceNet, SCE_KERNEL_ERROR_ILLEGAL_PRIORITY, "invalid init thread priority");
|
||||
}
|
||||
|
||||
// TODO: Should also start the threads, probably? For now, let's just allocate.
|
||||
@@ -635,22 +635,22 @@ static int sceNetInit(u32 poolSize, u32 calloutPri, u32 calloutStack, u32 netini
|
||||
u32 stackSize = 4096;
|
||||
netThread1Addr = AllocUser(stackSize, true, "netstack1");
|
||||
if (netThread1Addr == 0) {
|
||||
return hleLogError(SCENET, SCE_KERNEL_ERROR_NO_MEMORY, "unable to allocate thread");
|
||||
return hleLogError(Log::sceNet, SCE_KERNEL_ERROR_NO_MEMORY, "unable to allocate thread");
|
||||
}
|
||||
netThread2Addr = AllocUser(stackSize, true, "netstack2");
|
||||
if (netThread2Addr == 0) {
|
||||
FreeUser(netThread1Addr);
|
||||
return hleLogError(SCENET, SCE_KERNEL_ERROR_NO_MEMORY, "unable to allocate thread");
|
||||
return hleLogError(Log::sceNet, SCE_KERNEL_ERROR_NO_MEMORY, "unable to allocate thread");
|
||||
}
|
||||
|
||||
netPoolAddr = AllocUser(poolSize, false, "netpool");
|
||||
if (netPoolAddr == 0) {
|
||||
FreeUser(netThread1Addr);
|
||||
FreeUser(netThread2Addr);
|
||||
return hleLogError(SCENET, SCE_KERNEL_ERROR_NO_MEMORY, "unable to allocate pool");
|
||||
return hleLogError(Log::sceNet, SCE_KERNEL_ERROR_NO_MEMORY, "unable to allocate pool");
|
||||
}
|
||||
|
||||
WARN_LOG(SCENET, "sceNetInit(poolsize=%d, calloutpri=%i, calloutstack=%d, netintrpri=%i, netintrstack=%d) at %08x", poolSize, calloutPri, calloutStack, netinitPri, netinitStack, currentMIPS->pc);
|
||||
WARN_LOG(Log::sceNet, "sceNetInit(poolsize=%d, calloutpri=%i, calloutstack=%d, netintrpri=%i, netintrstack=%d) at %08x", poolSize, calloutPri, calloutStack, netinitPri, netinitStack, currentMIPS->pc);
|
||||
|
||||
netMallocStat.pool = poolSize - 0x20; // On Vantage Master Portable this is slightly (32 bytes) smaller than the poolSize arg when tested with JPCSP + prx files
|
||||
netMallocStat.maximum = 0x4050; // Dummy maximum foot print
|
||||
@@ -660,20 +660,20 @@ static int sceNetInit(u32 poolSize, u32 calloutPri, u32 calloutStack, u32 netini
|
||||
memset(&adhocSockets, 0, sizeof(adhocSockets));
|
||||
|
||||
netInited = true;
|
||||
return hleLogSuccessI(SCENET, 0);
|
||||
return hleLogSuccessI(Log::sceNet, 0);
|
||||
}
|
||||
|
||||
// Free(delete) thread info / data.
|
||||
// Normal usage: sceKernelDeleteThread followed by sceNetFreeThreadInfo with the same threadID as argument
|
||||
static int sceNetFreeThreadinfo(SceUID thid) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetFreeThreadinfo(%i)", thid);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetFreeThreadinfo(%i)", thid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Abort a thread.
|
||||
static int sceNetThreadAbort(SceUID thid) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetThreadAbort(%i)", thid);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetThreadAbort(%i)", thid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -681,7 +681,7 @@ static int sceNetThreadAbort(SceUID thid) {
|
||||
static u32 sceWlanGetEtherAddr(u32 addrAddr) {
|
||||
if (!Memory::IsValidRange(addrAddr, 6)) {
|
||||
// More correctly, it should crash.
|
||||
return hleLogError(SCENET, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "illegal address");
|
||||
return hleLogError(Log::sceNet, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "illegal address");
|
||||
}
|
||||
|
||||
u8 *addr = Memory::GetPointerWriteUnchecked(addrAddr);
|
||||
@@ -692,34 +692,34 @@ static u32 sceWlanGetEtherAddr(u32 addrAddr) {
|
||||
} else {
|
||||
// Read MAC Address from config
|
||||
if (!ParseMacAddress(g_Config.sMACAddress, addr)) {
|
||||
ERROR_LOG(SCENET, "Error parsing mac address %s", g_Config.sMACAddress.c_str());
|
||||
ERROR_LOG(Log::sceNet, "Error parsing mac address %s", g_Config.sMACAddress.c_str());
|
||||
Memory::Memset(addrAddr, 0, 6);
|
||||
}
|
||||
}
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, addrAddr, 6, "WlanEtherAddr");
|
||||
|
||||
return hleLogSuccessI(SCENET, hleDelayResult(0, "get ether mac", 200));
|
||||
return hleLogSuccessI(Log::sceNet, hleDelayResult(0, "get ether mac", 200));
|
||||
}
|
||||
|
||||
static u32 sceNetGetLocalEtherAddr(u32 addrAddr) {
|
||||
// FIXME: Return 0x80410180 (pspnet[_core] error code?) before successful attempt to Create/Connect/Join a Group? (ie. adhocctlCurrentMode == ADHOCCTL_MODE_NONE)
|
||||
if (adhocctlCurrentMode == ADHOCCTL_MODE_NONE)
|
||||
return hleLogDebug(SCENET, 0x80410180, "address not available?");
|
||||
return hleLogDebug(Log::sceNet, 0x80410180, "address not available?");
|
||||
|
||||
return sceWlanGetEtherAddr(addrAddr);
|
||||
}
|
||||
|
||||
static u32 sceWlanDevIsPowerOn() {
|
||||
return hleLogSuccessVerboseI(SCENET, g_Config.bEnableWlan ? 1 : 0);
|
||||
return hleLogSuccessVerboseI(Log::sceNet, g_Config.bEnableWlan ? 1 : 0);
|
||||
}
|
||||
|
||||
static u32 sceWlanGetSwitchState() {
|
||||
return hleLogSuccessVerboseI(SCENET, g_Config.bEnableWlan ? 1 : 0);
|
||||
return hleLogSuccessVerboseI(Log::sceNet, g_Config.bEnableWlan ? 1 : 0);
|
||||
}
|
||||
|
||||
// Probably a void function, but often returns a useful value.
|
||||
static void sceNetEtherNtostr(u32 macPtr, u32 bufferPtr) {
|
||||
DEBUG_LOG(SCENET, "sceNetEtherNtostr(%08x, %08x) at %08x", macPtr, bufferPtr, currentMIPS->pc);
|
||||
DEBUG_LOG(Log::sceNet, "sceNetEtherNtostr(%08x, %08x) at %08x", macPtr, bufferPtr, currentMIPS->pc);
|
||||
|
||||
if (Memory::IsValidAddress(bufferPtr) && Memory::IsValidAddress(macPtr)) {
|
||||
char *buffer = (char *)Memory::GetPointerWriteUnchecked(bufferPtr);
|
||||
@@ -729,7 +729,7 @@ static void sceNetEtherNtostr(u32 macPtr, u32 bufferPtr) {
|
||||
sprintf(buffer, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
|
||||
|
||||
VERBOSE_LOG(SCENET, "sceNetEtherNtostr - [%s]", buffer);
|
||||
VERBOSE_LOG(Log::sceNet, "sceNetEtherNtostr - [%s]", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -745,7 +745,7 @@ static int hex_to_digit(int c) {
|
||||
|
||||
// Probably a void function, but sometimes returns a useful-ish value.
|
||||
static void sceNetEtherStrton(u32 bufferPtr, u32 macPtr) {
|
||||
DEBUG_LOG(SCENET, "sceNetEtherStrton(%08x, %08x)", bufferPtr, macPtr);
|
||||
DEBUG_LOG(Log::sceNet, "sceNetEtherStrton(%08x, %08x)", bufferPtr, macPtr);
|
||||
|
||||
if (Memory::IsValidAddress(bufferPtr) && Memory::IsValidAddress(macPtr)) {
|
||||
const char *buffer = (const char *)Memory::GetPointerUnchecked(bufferPtr);
|
||||
@@ -775,7 +775,7 @@ static void sceNetEtherStrton(u32 bufferPtr, u32 macPtr) {
|
||||
}
|
||||
}
|
||||
|
||||
VERBOSE_LOG(SCENET, "sceNetEtherStrton - [%s]", mac2str((SceNetEtherAddr*)Memory::GetPointer(macPtr)).c_str());
|
||||
VERBOSE_LOG(Log::sceNet, "sceNetEtherStrton - [%s]", mac2str((SceNetEtherAddr*)Memory::GetPointer(macPtr)).c_str());
|
||||
// Seems to maybe kinda return the last value. Probably returns void.
|
||||
//return value;
|
||||
}
|
||||
@@ -784,10 +784,10 @@ static void sceNetEtherStrton(u32 bufferPtr, u32 macPtr) {
|
||||
|
||||
// Write static data since we don't actually manage any memory for sceNet* yet.
|
||||
static int sceNetGetMallocStat(u32 statPtr) {
|
||||
VERBOSE_LOG(SCENET, "UNTESTED sceNetGetMallocStat(%x) at %08x", statPtr, currentMIPS->pc);
|
||||
VERBOSE_LOG(Log::sceNet, "UNTESTED sceNetGetMallocStat(%x) at %08x", statPtr, currentMIPS->pc);
|
||||
auto stat = PSPPointer<SceNetMallocStat>::Create(statPtr);
|
||||
if (!stat.IsValid())
|
||||
return hleLogError(SCENET, 0, "invalid address");
|
||||
return hleLogError(Log::sceNet, 0, "invalid address");
|
||||
|
||||
*stat = netMallocStat;
|
||||
stat.NotifyWrite("sceNetGetMallocStat");
|
||||
@@ -795,7 +795,7 @@ static int sceNetGetMallocStat(u32 statPtr) {
|
||||
}
|
||||
|
||||
static int sceNetInetInit() {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetInit()");
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetInit()");
|
||||
if (netInetInited) return ERROR_NET_INET_ALREADY_INITIALIZED;
|
||||
netInetInited = true;
|
||||
|
||||
@@ -803,7 +803,7 @@ static int sceNetInetInit() {
|
||||
}
|
||||
|
||||
int sceNetInetTerm() {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetTerm()");
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetTerm()");
|
||||
netInetInited = false;
|
||||
|
||||
return 0;
|
||||
@@ -836,7 +836,7 @@ void NetApctl_InitInfo() {
|
||||
}
|
||||
|
||||
static int sceNetApctlInit(int stackSize, int initPriority) {
|
||||
WARN_LOG(SCENET, "UNTESTED %s(%i, %i)", __FUNCTION__, stackSize, initPriority);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%i, %i)", __FUNCTION__, stackSize, initPriority);
|
||||
if (netApctlInited)
|
||||
return ERROR_NET_APCTL_ALREADY_INITIALIZED;
|
||||
|
||||
@@ -884,144 +884,144 @@ int NetApctl_Term() {
|
||||
}
|
||||
|
||||
int sceNetApctlTerm() {
|
||||
WARN_LOG(SCENET, "UNTESTED %s()", __FUNCTION__);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s()", __FUNCTION__);
|
||||
return NetApctl_Term();
|
||||
}
|
||||
|
||||
static int sceNetApctlGetInfo(int code, u32 pInfoAddr) {
|
||||
WARN_LOG(SCENET, "UNTESTED %s(%i, %08x)", __FUNCTION__, code, pInfoAddr);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%i, %08x)", __FUNCTION__, code, pInfoAddr);
|
||||
|
||||
if (!netApctlInited)
|
||||
return hleLogError(SCENET, ERROR_NET_APCTL_NOT_IN_BSS, "apctl not in bss"); // Only have valid info after joining an AP and got an IP, right?
|
||||
return hleLogError(Log::sceNet, ERROR_NET_APCTL_NOT_IN_BSS, "apctl not in bss"); // Only have valid info after joining an AP and got an IP, right?
|
||||
|
||||
switch (code) {
|
||||
case PSP_NET_APCTL_INFO_PROFILE_NAME:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_PROFILENAME_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.name, APCTL_PROFILENAME_MAXLEN);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, APCTL_PROFILENAME_MAXLEN, "NetApctlGetInfo");
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - ProfileName: %s", netApctlInfo.name);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - ProfileName: %s", netApctlInfo.name);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_BSSID:
|
||||
if (!Memory::IsValidRange(pInfoAddr, ETHER_ADDR_LEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.bssid, ETHER_ADDR_LEN);
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - BSSID: %s", mac2str((SceNetEtherAddr*)&netApctlInfo.bssid).c_str());
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - BSSID: %s", mac2str((SceNetEtherAddr*)&netApctlInfo.bssid).c_str());
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, ETHER_ADDR_LEN, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_SSID:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_SSID_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.ssid, APCTL_SSID_MAXLEN);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, APCTL_SSID_MAXLEN, "NetApctlGetInfo");
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - SSID: %s", netApctlInfo.ssid);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - SSID: %s", netApctlInfo.ssid);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_SSID_LENGTH:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 4))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U32(netApctlInfo.ssidLength, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 4, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_SECURITY_TYPE:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 4))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U32(netApctlInfo.securityType, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 4, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_STRENGTH:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 1))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U8(netApctlInfo.strength, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 1, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_CHANNEL:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 1))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U8(netApctlInfo.channel, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 1, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_POWER_SAVE:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 1))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U8(netApctlInfo.powerSave, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 1, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_IP:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_IPADDR_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.ip, APCTL_IPADDR_MAXLEN);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, APCTL_IPADDR_MAXLEN, "NetApctlGetInfo");
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - IP: %s", netApctlInfo.ip);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - IP: %s", netApctlInfo.ip);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_SUBNETMASK:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_IPADDR_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.subNetMask, APCTL_IPADDR_MAXLEN);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, APCTL_IPADDR_MAXLEN, "NetApctlGetInfo");
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - SubNet Mask: %s", netApctlInfo.subNetMask);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - SubNet Mask: %s", netApctlInfo.subNetMask);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_GATEWAY:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_IPADDR_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.gateway, APCTL_IPADDR_MAXLEN);
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - Gateway IP: %s", netApctlInfo.gateway);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - Gateway IP: %s", netApctlInfo.gateway);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_PRIMDNS:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_IPADDR_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.primaryDns, APCTL_IPADDR_MAXLEN);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, APCTL_IPADDR_MAXLEN, "NetApctlGetInfo");
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - Primary DNS: %s", netApctlInfo.primaryDns);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - Primary DNS: %s", netApctlInfo.primaryDns);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_SECDNS:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_IPADDR_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.secondaryDns, APCTL_IPADDR_MAXLEN);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, APCTL_IPADDR_MAXLEN, "NetApctlGetInfo");
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - Secondary DNS: %s", netApctlInfo.secondaryDns);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - Secondary DNS: %s", netApctlInfo.secondaryDns);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_USE_PROXY:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 4))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U32(netApctlInfo.useProxy, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 4, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_PROXY_URL:
|
||||
if (!Memory::IsValidRange(pInfoAddr, APCTL_URL_MAXLEN))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::MemcpyUnchecked(pInfoAddr, netApctlInfo.proxyUrl, APCTL_URL_MAXLEN);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, APCTL_URL_MAXLEN, "NetApctlGetInfo");
|
||||
DEBUG_LOG(SCENET, "ApctlInfo - Proxy URL: %s", netApctlInfo.proxyUrl);
|
||||
DEBUG_LOG(Log::sceNet, "ApctlInfo - Proxy URL: %s", netApctlInfo.proxyUrl);
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_PROXY_PORT:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 2))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U16(netApctlInfo.proxyPort, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 2, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_8021_EAP_TYPE:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 4))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U32(netApctlInfo.eapType, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 4, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_START_BROWSER:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 4))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U32(netApctlInfo.startBrowser, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 4, "NetApctlGetInfo");
|
||||
break;
|
||||
case PSP_NET_APCTL_INFO_WIFISP:
|
||||
if (!Memory::IsValidRange(pInfoAddr, 4))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg");
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg");
|
||||
Memory::WriteUnchecked_U32(netApctlInfo.wifisp, pInfoAddr);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 4, "NetApctlGetInfo");
|
||||
break;
|
||||
default:
|
||||
return hleLogError(SCENET, ERROR_NET_APCTL_INVALID_CODE, "apctl invalid code");
|
||||
return hleLogError(Log::sceNet, ERROR_NET_APCTL_INVALID_CODE, "apctl invalid code");
|
||||
}
|
||||
|
||||
return hleLogSuccessI(SCENET, 0);
|
||||
return hleLogSuccessI(Log::sceNet, 0);
|
||||
}
|
||||
|
||||
int NetApctl_AddHandler(u32 handlerPtr, u32 handlerArg) {
|
||||
@@ -1045,15 +1045,15 @@ int NetApctl_AddHandler(u32 handlerPtr, u32 handlerArg) {
|
||||
|
||||
if (!foundHandler && Memory::IsValidAddress(handlerPtr)) {
|
||||
if (apctlHandlers.size() >= MAX_APCTL_HANDLERS) {
|
||||
ERROR_LOG(SCENET, "Failed to Add handler(%x, %x): Too many handlers", handlerPtr, handlerArg);
|
||||
ERROR_LOG(Log::sceNet, "Failed to Add handler(%x, %x): Too many handlers", handlerPtr, handlerArg);
|
||||
retval = ERROR_NET_ADHOCCTL_TOO_MANY_HANDLERS; // TODO: What's the proper error code for Apctl's TOO_MANY_HANDLERS?
|
||||
return retval;
|
||||
}
|
||||
apctlHandlers[retval] = handler;
|
||||
WARN_LOG(SCENET, "Added Apctl handler(%x, %x): %d", handlerPtr, handlerArg, retval);
|
||||
WARN_LOG(Log::sceNet, "Added Apctl handler(%x, %x): %d", handlerPtr, handlerArg, retval);
|
||||
}
|
||||
else {
|
||||
ERROR_LOG(SCENET, "Existing Apctl handler(%x, %x)", handlerPtr, handlerArg);
|
||||
ERROR_LOG(Log::sceNet, "Existing Apctl handler(%x, %x)", handlerPtr, handlerArg);
|
||||
}
|
||||
|
||||
// The id to return is the number of handlers currently registered
|
||||
@@ -1063,33 +1063,33 @@ int NetApctl_AddHandler(u32 handlerPtr, u32 handlerArg) {
|
||||
// TODO: How many handlers can the PSP actually have for Apctl?
|
||||
// TODO: Should we allow the same handler to be added more than once?
|
||||
static u32 sceNetApctlAddHandler(u32 handlerPtr, u32 handlerArg) {
|
||||
INFO_LOG(SCENET, "%s(%08x, %08x)", __FUNCTION__, handlerPtr, handlerArg);
|
||||
INFO_LOG(Log::sceNet, "%s(%08x, %08x)", __FUNCTION__, handlerPtr, handlerArg);
|
||||
return NetApctl_AddHandler(handlerPtr, handlerArg);
|
||||
}
|
||||
|
||||
int NetApctl_DelHandler(u32 handlerID) {
|
||||
if (apctlHandlers.find(handlerID) != apctlHandlers.end()) {
|
||||
apctlHandlers.erase(handlerID);
|
||||
WARN_LOG(SCENET, "Deleted Apctl handler: %d", handlerID);
|
||||
WARN_LOG(Log::sceNet, "Deleted Apctl handler: %d", handlerID);
|
||||
}
|
||||
else {
|
||||
ERROR_LOG(SCENET, "Invalid Apctl handler: %d", handlerID);
|
||||
ERROR_LOG(Log::sceNet, "Invalid Apctl handler: %d", handlerID);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetApctlDelHandler(u32 handlerID) {
|
||||
INFO_LOG(SCENET, "%s(%d)", __FUNCTION__, handlerID);
|
||||
INFO_LOG(Log::sceNet, "%s(%d)", __FUNCTION__, handlerID);
|
||||
return NetApctl_DelHandler(handlerID);
|
||||
}
|
||||
|
||||
static int sceNetInetInetAton(const char *hostname, u32 addrPtr) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetInetAton(%s, %08x)", hostname, addrPtr);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetInetAton(%s, %08x)", hostname, addrPtr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int sceNetInetPoll(void *fds, u32 nfds, int timeout) { // timeout in miliseconds
|
||||
DEBUG_LOG(SCENET, "UNTESTED sceNetInetPoll(%p, %d, %i) at %08x", fds, nfds, timeout, currentMIPS->pc);
|
||||
DEBUG_LOG(Log::sceNet, "UNTESTED sceNetInetPoll(%p, %d, %i) at %08x", fds, nfds, timeout, currentMIPS->pc);
|
||||
int retval = -1;
|
||||
SceNetInetPollfd *fdarray = (SceNetInetPollfd *)fds; // SceNetInetPollfd/pollfd, sceNetInetPoll() have similarity to BSD poll() but pollfd have different size on 64bit
|
||||
//#ifdef _WIN32
|
||||
@@ -1144,17 +1144,17 @@ int sceNetInetPoll(void *fds, u32 nfds, int timeout) { // timeout in miliseconds
|
||||
}
|
||||
|
||||
static int sceNetInetRecv(int socket, u32 bufPtr, u32 bufLen, u32 flags) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetRecv(%i, %08x, %i, %08x)", socket, bufPtr, bufLen, flags);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetRecv(%i, %08x, %i, %08x)", socket, bufPtr, bufLen, flags);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int sceNetInetSend(int socket, u32 bufPtr, u32 bufLen, u32 flags) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetSend(%i, %08x, %i, %08x)", socket, bufPtr, bufLen, flags);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetSend(%i, %08x, %i, %08x)", socket, bufPtr, bufLen, flags);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int sceNetInetGetErrno() {
|
||||
ERROR_LOG(SCENET, "UNTESTED sceNetInetGetErrno()");
|
||||
ERROR_LOG(Log::sceNet, "UNTESTED sceNetInetGetErrno()");
|
||||
int error = errno;
|
||||
switch (error) {
|
||||
case ETIMEDOUT:
|
||||
@@ -1170,22 +1170,22 @@ static int sceNetInetGetErrno() {
|
||||
}
|
||||
|
||||
static int sceNetInetSocket(int domain, int type, int protocol) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetSocket(%i, %i, %i)", domain, type, protocol);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetSocket(%i, %i, %i)", domain, type, protocol);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int sceNetInetSetsockopt(int socket, int level, int optname, u32 optvalPtr, int optlen) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetSetsockopt(%i, %i, %i, %08x, %i)", socket, level, optname, optvalPtr, optlen);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetSetsockopt(%i, %i, %i, %08x, %i)", socket, level, optname, optvalPtr, optlen);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int sceNetInetConnect(int socket, u32 sockAddrInternetPtr, int addressLength) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetInetConnect(%i, %08x, %i)", socket, sockAddrInternetPtr, addressLength);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL sceNetInetConnect(%i, %08x, %i)", socket, sockAddrInternetPtr, addressLength);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int sceNetApctlConnect(int connIndex) {
|
||||
WARN_LOG(SCENET, "UNTESTED %s(%i)", __FUNCTION__, connIndex);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%i)", __FUNCTION__, connIndex);
|
||||
// Is this connIndex is the index to the scanning's result data or sceNetApctlGetBSSDescIDListUser result?
|
||||
__UpdateApctlHandlers(0, 0, PSP_NET_APCTL_EVENT_CONNECT_REQUEST, 0);
|
||||
//hleDelayResult(0, "give time to init/cleanup", adhocEventDelayMS * 1000);
|
||||
@@ -1193,7 +1193,7 @@ int sceNetApctlConnect(int connIndex) {
|
||||
}
|
||||
|
||||
static int sceNetApctlDisconnect() {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s()", __FUNCTION__);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s()", __FUNCTION__);
|
||||
// Like its 'sister' function sceNetAdhocctlDisconnect, we need to alert Apctl handlers that a disconnect took place
|
||||
// or else games like Phantasy Star Portable 2 will hang at certain points (e.g. returning to the main menu after trying to connect to PSN).
|
||||
|
||||
@@ -1206,30 +1206,30 @@ int NetApctl_GetState() {
|
||||
}
|
||||
|
||||
static int sceNetApctlGetState(u32 pStateAddr) {
|
||||
//if (!netApctlInited) return hleLogError(SCENET, ERROR_NET_APCTL_NOT_IN_BSS, "apctl not in bss");
|
||||
//if (!netApctlInited) return hleLogError(Log::sceNet, ERROR_NET_APCTL_NOT_IN_BSS, "apctl not in bss");
|
||||
|
||||
// Valid Arguments
|
||||
if (Memory::IsValidAddress(pStateAddr)) {
|
||||
// Return Thread Status
|
||||
Memory::Write_U32(NetApctl_GetState(), pStateAddr);
|
||||
// Return Success
|
||||
return hleLogSuccessI(SCENET, 0);
|
||||
return hleLogSuccessI(Log::sceNet, 0);
|
||||
}
|
||||
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg"); // 0x8002013A or ERROR_NET_WLAN_INVALID_ARG ?
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg"); // 0x8002013A or ERROR_NET_WLAN_INVALID_ARG ?
|
||||
}
|
||||
|
||||
int NetApctl_ScanUser() {
|
||||
// Scan probably only works when not in connected state, right?
|
||||
if (netApctlState != PSP_NET_APCTL_STATE_DISCONNECTED)
|
||||
return hleLogError(SCENET, ERROR_NET_APCTL_NOT_DISCONNECTED, "apctl not disconnected");
|
||||
return hleLogError(Log::sceNet, ERROR_NET_APCTL_NOT_DISCONNECTED, "apctl not disconnected");
|
||||
|
||||
__UpdateApctlHandlers(0, 0, PSP_NET_APCTL_EVENT_SCAN_REQUEST, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetApctlScanUser() {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s()", __FUNCTION__);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s()", __FUNCTION__);
|
||||
return NetApctl_ScanUser();
|
||||
}
|
||||
|
||||
@@ -1238,7 +1238,7 @@ int NetApctl_GetBSSDescIDListUser(u32 sizeAddr, u32 bufAddr) {
|
||||
// Faking 4 entries, games like MGS:PW Recruit will need to have a different AP for each entry
|
||||
int entries = 4;
|
||||
if (!Memory::IsValidAddress(sizeAddr) || !Memory::IsValidAddress(bufAddr))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg"); // 0x8002013A or ERROR_NET_WLAN_INVALID_ARG ?
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg"); // 0x8002013A or ERROR_NET_WLAN_INVALID_ARG ?
|
||||
|
||||
int size = Memory::Read_U32(sizeAddr);
|
||||
// Return size required
|
||||
@@ -1252,7 +1252,7 @@ int NetApctl_GetBSSDescIDListUser(u32 sizeAddr, u32 bufAddr) {
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG_LOG(SCENET, "%s writing ID#%d to %08x", __FUNCTION__, i, bufAddr + offset);
|
||||
DEBUG_LOG(Log::sceNet, "%s writing ID#%d to %08x", __FUNCTION__, i, bufAddr + offset);
|
||||
|
||||
// Pointer to next Network structure in list
|
||||
Memory::Write_U32((i + 1) * userInfoSize + bufAddr, bufAddr + offset);
|
||||
@@ -1271,13 +1271,13 @@ int NetApctl_GetBSSDescIDListUser(u32 sizeAddr, u32 bufAddr) {
|
||||
}
|
||||
|
||||
static int sceNetApctlGetBSSDescIDListUser(u32 sizeAddr, u32 bufAddr) {
|
||||
WARN_LOG(SCENET, "UNTESTED %s(%08x, %08x)", __FUNCTION__, sizeAddr, bufAddr);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%08x, %08x)", __FUNCTION__, sizeAddr, bufAddr);
|
||||
return NetApctl_GetBSSDescIDListUser(sizeAddr, bufAddr);
|
||||
}
|
||||
|
||||
int NetApctl_GetBSSDescEntryUser(int entryId, int infoId, u32 resultAddr) {
|
||||
if (!Memory::IsValidAddress(resultAddr))
|
||||
return hleLogError(SCENET, -1, "apctl invalid arg"); // 0x8002013A or ERROR_NET_WLAN_INVALID_ARG ?
|
||||
return hleLogError(Log::sceNet, -1, "apctl invalid arg"); // 0x8002013A or ERROR_NET_WLAN_INVALID_ARG ?
|
||||
|
||||
// Generate an SSID name
|
||||
char dummySSID[APCTL_SSID_MAXLEN] = "WifiAP0";
|
||||
@@ -1336,19 +1336,19 @@ int NetApctl_GetBSSDescEntryUser(int entryId, int infoId, u32 resultAddr) {
|
||||
Memory::Write_U32(netApctlInfo.securityType, resultAddr);
|
||||
break;
|
||||
default:
|
||||
return hleLogError(SCENET, ERROR_NET_APCTL_INVALID_CODE, "unknown info id");
|
||||
return hleLogError(Log::sceNet, ERROR_NET_APCTL_INVALID_CODE, "unknown info id");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetApctlGetBSSDescEntryUser(int entryId, int infoId, u32 resultAddr) {
|
||||
WARN_LOG(SCENET, "UNTESTED %s(%i, %i, %08x)", __FUNCTION__, entryId, infoId, resultAddr);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%i, %i, %08x)", __FUNCTION__, entryId, infoId, resultAddr);
|
||||
return NetApctl_GetBSSDescEntryUser(entryId, infoId, resultAddr);
|
||||
}
|
||||
|
||||
static int sceNetApctlScanSSID2() {
|
||||
WARN_LOG(SCENET, "UNTESTED %s() at %08x", __FUNCTION__, currentMIPS->pc);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s() at %08x", __FUNCTION__, currentMIPS->pc);
|
||||
return NetApctl_ScanUser();
|
||||
}
|
||||
|
||||
@@ -1359,7 +1359,7 @@ static int sceNetApctlScanSSID2() {
|
||||
* Arg4 = input flag? (initially 0/1 ?)
|
||||
***************/
|
||||
static int sceNetApctlGetBSSDescIDList2(u32 Arg1, u32 Arg2, u32 Arg3, u32 Arg4) {
|
||||
WARN_LOG(SCENET, "UNTESTED %s(%08x, %08x, %08x, %08x) at %08x", __FUNCTION__, Arg1, Arg2, Arg3, Arg4, currentMIPS->pc);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%08x, %08x, %08x, %08x) at %08x", __FUNCTION__, Arg1, Arg2, Arg3, Arg4, currentMIPS->pc);
|
||||
return NetApctl_GetBSSDescIDListUser(Arg1, Arg2);
|
||||
}
|
||||
|
||||
@@ -1369,97 +1369,97 @@ static int sceNetApctlGetBSSDescIDList2(u32 Arg1, u32 Arg2, u32 Arg3, u32 Arg4)
|
||||
* Arg3 = output buffer for retrieved entry data? (max size = 32 bytes? ie. APCTL_SSID_MAXLEN ? or similar to SceNetApctlInfoInternal union ?)
|
||||
***************/
|
||||
static int sceNetApctlGetBSSDescEntry2(int entryId, int infoId, u32 resultAddr) {
|
||||
WARN_LOG(SCENET, "UNTESTED %s(%i, %i, %08x) at %08x", __FUNCTION__, entryId, infoId, resultAddr, currentMIPS->pc);
|
||||
WARN_LOG(Log::sceNet, "UNTESTED %s(%i, %i, %08x) at %08x", __FUNCTION__, entryId, infoId, resultAddr, currentMIPS->pc);
|
||||
return NetApctl_GetBSSDescEntryUser(entryId, infoId, resultAddr);
|
||||
}
|
||||
|
||||
static int sceNetResolverInit()
|
||||
{
|
||||
ERROR_LOG(SCENET, "UNIMPL %s()", __FUNCTION__);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s()", __FUNCTION__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetApctlAddInternalHandler(u32 handlerPtr, u32 handlerArg) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%08x, %08x)", __FUNCTION__, handlerPtr, handlerArg);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%08x, %08x)", __FUNCTION__, handlerPtr, handlerArg);
|
||||
// This seems to be a 2nd kind of handler
|
||||
return NetApctl_AddHandler(handlerPtr, handlerArg);
|
||||
}
|
||||
|
||||
static int sceNetApctlDelInternalHandler(u32 handlerID) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%i)", __FUNCTION__, handlerID);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%i)", __FUNCTION__, handlerID);
|
||||
// This seems to be a 2nd kind of handler
|
||||
return NetApctl_DelHandler(handlerID);
|
||||
}
|
||||
|
||||
static int sceNetApctl_A7BB73DF(u32 handlerPtr, u32 handlerArg) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%08x, %08x)", __FUNCTION__, handlerPtr, handlerArg);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%08x, %08x)", __FUNCTION__, handlerPtr, handlerArg);
|
||||
// This seems to be a 3rd kind of handler
|
||||
return sceNetApctlAddHandler(handlerPtr, handlerArg);
|
||||
}
|
||||
|
||||
static int sceNetApctl_6F5D2981(u32 handlerID) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%i)", __FUNCTION__, handlerID);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%i)", __FUNCTION__, handlerID);
|
||||
// This seems to be a 3rd kind of handler
|
||||
return sceNetApctlDelHandler(handlerID);
|
||||
}
|
||||
|
||||
static int sceNetApctl_lib2_69745F0A(int handlerId) {
|
||||
return hleLogError(SCENET, 0, "unimplemented");
|
||||
return hleLogError(Log::sceNet, 0, "unimplemented");
|
||||
}
|
||||
|
||||
static int sceNetApctl_lib2_4C19731F(int code, u32 pInfoAddr) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%i, %08x)", __FUNCTION__, code, pInfoAddr);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%i, %08x)", __FUNCTION__, code, pInfoAddr);
|
||||
return sceNetApctlGetInfo(code, pInfoAddr);
|
||||
}
|
||||
|
||||
static int sceNetApctlScan() {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s()", __FUNCTION__);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s()", __FUNCTION__);
|
||||
return NetApctl_ScanUser();
|
||||
}
|
||||
|
||||
static int sceNetApctlGetBSSDescIDList(u32 sizeAddr, u32 bufAddr) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%08x, %08x)", __FUNCTION__, sizeAddr, bufAddr);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%08x, %08x)", __FUNCTION__, sizeAddr, bufAddr);
|
||||
return sceNetApctlGetBSSDescIDListUser(sizeAddr, bufAddr);
|
||||
}
|
||||
|
||||
static int sceNetApctlGetBSSDescEntry(int entryId, int infoId, u32 resultAddr) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%i, %i, %08x)", __FUNCTION__, entryId, infoId, resultAddr);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%i, %i, %08x)", __FUNCTION__, entryId, infoId, resultAddr);
|
||||
return sceNetApctlGetBSSDescEntryUser(entryId, infoId, resultAddr);
|
||||
}
|
||||
|
||||
static int sceNetApctl_lib2_C20A144C(int connIndex, u32 ps3MacAddressPtr) {
|
||||
ERROR_LOG(SCENET, "UNIMPL %s(%i, %08x)", __FUNCTION__, connIndex, ps3MacAddressPtr);
|
||||
ERROR_LOG(Log::sceNet, "UNIMPL %s(%i, %08x)", __FUNCTION__, connIndex, ps3MacAddressPtr);
|
||||
return sceNetApctlConnect(connIndex);
|
||||
}
|
||||
|
||||
|
||||
static int sceNetUpnpInit(int unknown1,int unknown2)
|
||||
{
|
||||
ERROR_LOG_REPORT_ONCE(sceNetUpnpInit, SCENET, "UNIMPLsceNetUpnpInit %d,%d",unknown1,unknown2);
|
||||
ERROR_LOG_REPORT_ONCE(sceNetUpnpInit, Log::sceNet, "UNIMPLsceNetUpnpInit %d,%d",unknown1,unknown2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetUpnpStart()
|
||||
{
|
||||
ERROR_LOG(SCENET, "UNIMPLsceNetUpnpStart");
|
||||
ERROR_LOG(Log::sceNet, "UNIMPLsceNetUpnpStart");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetUpnpStop()
|
||||
{
|
||||
ERROR_LOG(SCENET, "UNIMPLsceNetUpnpStop");
|
||||
ERROR_LOG(Log::sceNet, "UNIMPLsceNetUpnpStop");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetUpnpTerm()
|
||||
{
|
||||
ERROR_LOG(SCENET, "UNIMPLsceNetUpnpTerm");
|
||||
ERROR_LOG(Log::sceNet, "UNIMPLsceNetUpnpTerm");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sceNetUpnpGetNatInfo()
|
||||
{
|
||||
ERROR_LOG(SCENET, "UNIMPLsceNetUpnpGetNatInfo");
|
||||
ERROR_LOG(Log::sceNet, "UNIMPLsceNetUpnpGetNatInfo");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1467,14 +1467,14 @@ static int sceNetGetDropRate(u32 dropRateAddr, u32 dropDurationAddr)
|
||||
{
|
||||
Memory::Write_U32(netDropRate, dropRateAddr);
|
||||
Memory::Write_U32(netDropDuration, dropDurationAddr);
|
||||
return hleLogSuccessInfoI(SCENET, 0);
|
||||
return hleLogSuccessInfoI(Log::sceNet, 0);
|
||||
}
|
||||
|
||||
static int sceNetSetDropRate(u32 dropRate, u32 dropDuration)
|
||||
{
|
||||
netDropRate = dropRate;
|
||||
netDropDuration = dropDuration;
|
||||
return hleLogSuccessInfoI(SCENET, 0);
|
||||
return hleLogSuccessInfoI(Log::sceNet, 0);
|
||||
}
|
||||
|
||||
const HLEFunction sceNet[] = {
|
||||
|
||||
Reference in new issue
Block a user