diff --git a/src/NDS.h b/src/NDS.h index 9e3ed342..8f408a03 100644 --- a/src/NDS.h +++ b/src/NDS.h @@ -52,8 +52,6 @@ enum Event_DSi_CamTransfer, Event_DSi_DSP, - Event_WifiLegacy, - Event_MAX }; diff --git a/src/Wifi.cpp b/src/Wifi.cpp index b27d7c77..f7d8c310 100644 --- a/src/Wifi.cpp +++ b/src/Wifi.cpp @@ -504,6 +504,11 @@ void CancelEvent(u32 id) SchedListMask &= ~(1<R[15]); IOPORT(0x034) = 0x0002; @@ -2010,7 +2028,8 @@ void Write(u32 addr, u16 val) if (IOPORT(W_PowerUnk) & 0x0002) { - USUntilPowerOn = -2048; + //USUntilPowerOn = -2048; + ScheduleEvent(Event_RFWakeup, false, 2048, RFWakeup, 0); IOPORT(W_PowerState) |= 0x100; } } @@ -2103,7 +2122,8 @@ void Write(u32 addr, u16 val) { //printf("power on\n"); IOPORT(W_PowerState) |= 0x100; - USUntilPowerOn = -2048; + //USUntilPowerOn = -2048; + ScheduleEvent(Event_RFWakeup, false, 2048, RFWakeup, 0); ForcePowerOn = false; } } @@ -2125,14 +2145,16 @@ void Write(u32 addr, u16 val) { //printf("power on\n"); IOPORT(W_PowerState) |= 0x100; - USUntilPowerOn = -2048; + //USUntilPowerOn = -2048; + ScheduleEvent(Event_RFWakeup, false, 2048, RFWakeup, 0); ForcePowerOn = false; } if (val == 0x8000) { //printf("force power on\n"); IOPORT(W_PowerState) |= 0x100; - USUntilPowerOn = -2048; + //USUntilPowerOn = -2048; + ScheduleEvent(Event_RFWakeup, false, 2048, RFWakeup, 0); ForcePowerOn = true; } break; diff --git a/src/Wifi.h b/src/Wifi.h index dee525cb..28022ec0 100644 --- a/src/Wifi.h +++ b/src/Wifi.h @@ -156,7 +156,7 @@ enum Event_RXCheck = 0, Event_IRQ15, Event_MSTimer, - Event_PowerOn, + Event_RFWakeup, Event_MPClientSync, Event_TRX, Event_RF,