aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2023-07-14 11:39:58 +0200
committerArisotura <thetotalworm@gmail.com>2023-07-14 11:39:58 +0200
commita2033a62fdff0ec8899bcf05bc98fc7fe132c850 (patch)
tree25ae39b87dcea040c6c46f6634cf15fdac492e98 /src
parentf432e559d41017f668009f438cec6d9be1dcab44 (diff)
wifi: only allow setting TXSLOT_CMD bit15 if CMDCOUNT is nonzero, as per GBAtek
Diffstat (limited to 'src')
-rw-r--r--src/Wifi.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Wifi.cpp b/src/Wifi.cpp
index e2a7271..0abc0cc 100644
--- a/src/Wifi.cpp
+++ b/src/Wifi.cpp
@@ -2214,13 +2214,15 @@ void Write(u32 addr, u16 val)
val &= 0x0FFF;
break;
+ case W_TXSlotCmd:
+ if (CmdCounter == 0)
+ val = (val & 0x7FFF) | (IOPORT(W_TXSlotCmd) & 0x8000);
+ // fall-through
case W_TXSlotLoc1:
case W_TXSlotLoc2:
case W_TXSlotLoc3:
- case W_TXSlotCmd:
// checkme: is it possible to cancel a queued transfer that hasn't started yet
// by clearing bit15 here?
- // TODO: "W_TXBUF_CMD.Bit15 can be set ONLY while W_CMD_COUNT is non-zero."
IOPORT(addr&0xFFF) = val;
FireTX();
return;