Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wlan channel Fix - Ridge Racer 2 & Warriors Orochi 2 #13401

Merged
merged 3 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/HLE/proAdhoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bool isOriPort = false;
bool isLocalServer = false;
SockAddrIN4 g_localhostIP;
sockaddr LocalIP;
int defaultWlanChannel = PSP_SYSTEMPARAM_ADHOC_CHANNEL_1; // Don't put 0(Auto) here, it needed to be a valid/actual channel number
int defaultWlanChannel = PSP_SYSTEMPARAM_ADHOC_CHANNEL_11; // Don't put 0(Auto) here, it needed to be a valid/actual channel number

bool isMacMatch(const SceNetEtherAddr* addr1, const SceNetEtherAddr* addr2) {
// Ignoring the 1st byte since there are games (ie. Gran Turismo) who tamper with the 1st byte of OUI to change the unicast/multicast bit
Expand Down
2 changes: 1 addition & 1 deletion Core/HLE/sceNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ 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) {
WARN_LOG(SCENET, "UNTESTED sceNetGetMallocStat(%x)", statPtr);
DEBUG_LOG(SCENET, "UNTESTED sceNetGetMallocStat(%x)", statPtr);
if(Memory::IsValidAddress(statPtr))
Memory::WriteStruct(statPtr, &netMallocStat);
else
Expand Down
9 changes: 9 additions & 0 deletions Core/HLE/sceUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,15 @@ static u32 sceUtilityGetSystemParamInt(u32 id, u32 destaddr)
switch (id) {
case PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL:
param = g_Config.iWlanAdhocChannel;
if (param == PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC) {
// FIXME: Actually.. it's always returning 0x800ADF4 regardless using Auto channel or Not, and regardless the connection state either,
// Not sure whether this error code only returned after Adhocctl Initialized (ie. netAdhocctlInited) or also before initialized.
// FIXME: Outputted channel (might be unchanged?) either 0 when not connected to a group yet (ie. adhocctlState == ADHOCCTL_STATE_DISCONNECTED),
// or -1 (0xFFFFFFFF) when a scan is in progress (ie. adhocctlState == ADHOCCTL_STATE_SCANNING),
// or 0x60 early when in connected state (ie. adhocctlState == ADHOCCTL_STATE_CONNECTED) right after Creating a group, regardless the channel settings.
Memory::Write_U32(param, destaddr);
return 0x800ADF4;
}
break;
case PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE:
param = g_Config.bWlanPowerSave?PSP_SYSTEMPARAM_WLAN_POWERSAVE_ON:PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF;
Expand Down