mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -06:00
leave client sync mode when host deauths. makes download play actually work.
This commit is contained in:
18
src/Wifi.cpp
18
src/Wifi.cpp
@ -1156,6 +1156,7 @@ bool CheckRX(bool local)
|
|||||||
//if (framectl==0x0228 && zarp==0x0228) printf("[CLIENT] failed to receive ack\n");
|
//if (framectl==0x0228 && zarp==0x0228) printf("[CLIENT] failed to receive ack\n");
|
||||||
//if (framectl==0x0218 && zarp==0x0218) printf("[CLIENT] failed to receive cmd\n");
|
//if (framectl==0x0218 && zarp==0x0218) printf("[CLIENT] failed to receive cmd\n");
|
||||||
//if (framectl==0x0218) printf("[%016llX] CLIENT: ACK RECEIVED\n", USCounter);
|
//if (framectl==0x0218) printf("[%016llX] CLIENT: ACK RECEIVED\n", USCounter);
|
||||||
|
//if ((framectl&0xFF00)==0) printf("RECEIVED: %04X\n", framectl);
|
||||||
zarp = framectl;
|
zarp = framectl;
|
||||||
|
|
||||||
if (local && (framectl == 0x0118 || framectl == 0x0158))
|
if (local && (framectl == 0x0118 || framectl == 0x0158))
|
||||||
@ -1210,6 +1211,14 @@ zamf = timestamp;
|
|||||||
RXTimestamp = 0;
|
RXTimestamp = 0;
|
||||||
StartRX();
|
StartRX();
|
||||||
}
|
}
|
||||||
|
else if (((framectl & 0x00FF) == 0x00C0) && timestamp && IsMPClient)
|
||||||
|
{
|
||||||
|
IsMPClient = false;
|
||||||
|
NextSync = 0;
|
||||||
|
|
||||||
|
RXTimestamp = 0;
|
||||||
|
StartRX();
|
||||||
|
}
|
||||||
else if (IsMPClient)
|
else if (IsMPClient)
|
||||||
{
|
{
|
||||||
// if we are being a MP client, we need to delay this frame until we reach the
|
// if we are being a MP client, we need to delay this frame until we reach the
|
||||||
@ -1458,7 +1467,7 @@ void USTimer(u32 param)
|
|||||||
|
|
||||||
SetIRQ(0);
|
SetIRQ(0);
|
||||||
SetStatus(1);
|
SetStatus(1);
|
||||||
//printf("%016llX: finished receiving a frame, aid=%04X, client=%04X\n", USTimestamp, IOPORT(W_AIDLow), *(u16*)&RXBuffer[0xC + 26]);
|
//printf("%016llX: finished receiving a frame, aid=%04X, FC=%04X, client=%04X\n", USTimestamp, IOPORT(W_AIDLow), *(u16*)&RXBuffer[0xC], *(u16*)&RXBuffer[0xC + 26]);
|
||||||
WIFI_LOG("wifi: finished receiving packet %04X\n", *(u16*)&RXBuffer[12]);
|
WIFI_LOG("wifi: finished receiving packet %04X\n", *(u16*)&RXBuffer[12]);
|
||||||
|
|
||||||
ComStatus &= ~0x1;
|
ComStatus &= ~0x1;
|
||||||
@ -1733,6 +1742,13 @@ void Write(u32 addr, u16 val)
|
|||||||
printf("wifi: force-setting IF %04X\n", val);
|
printf("wifi: force-setting IF %04X\n", val);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case W_AIDLow:
|
||||||
|
IOPORT(W_AIDLow) = val & 0x000F;
|
||||||
|
return;
|
||||||
|
case W_AIDFull:
|
||||||
|
IOPORT(W_AIDFull) = val & 0x07FF;
|
||||||
|
return;
|
||||||
|
|
||||||
case W_PowerState:
|
case W_PowerState:
|
||||||
//printf("writing power state %x %08x\n", val, NDS::ARM7->R[15]);
|
//printf("writing power state %x %08x\n", val, NDS::ARM7->R[15]);
|
||||||
IOPORT(W_PowerState) |= val & 0x0002;
|
IOPORT(W_PowerState) |= val & 0x0002;
|
||||||
|
@ -439,7 +439,7 @@ int RecvPacket(u8* packet, bool block, u64* timestamp)
|
|||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (!SemWait(InstanceID, block ? 500 : 0))
|
if (!SemWait(InstanceID, block ? 50 : 0))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user