From 77f74a831f0616f37f27c4675d259a7471a85d55 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 13 Mar 2017 12:55:15 -0700 Subject: [PATCH] DS Wi-Fi: Partially implement W_POWERFORCE --- src/ds/wifi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ds/wifi.c b/src/ds/wifi.c index 418c5a826..c6ff037b5 100644 --- a/src/ds/wifi.c +++ b/src/ds/wifi.c @@ -27,6 +27,20 @@ static uint8_t DSWifiReadBB(struct DS* ds, uint8_t address) { static void DSWifiWriteReg(struct DS* ds, uint32_t address, uint16_t value) { switch (address) { + case 0x040: + value &= 0x8001; + if (value & 0x8000) { + uint16_t state = ds->wifi.io[0x03C >> 1]; + if (value & 0x1) { + state |= 0x200; + state &= ~0x100; + } else { + mLOG(DS_WIFI, STUB, "Stub Wi-Fi I/O register write: %06X:%04X", address, value); + state &= ~0x200; + } + ds->wifi.io[0x03C >> 1] = state; + } + break; case 0x158: if (value & 0x1000) { DSWifiWriteBB(ds, value & 0xFF, ds->wifi.io[0x15A >> 1]); @@ -46,6 +60,7 @@ static void DSWifiWriteReg(struct DS* ds, uint32_t address, uint16_t value) { static uint16_t DSWifiReadReg(struct DS* ds, uint32_t address) { switch (address) { + case 0x040: case 0x15C: break; default: