aboutsummaryrefslogtreecommitdiff
path: root/src/Wifi.cpp
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2018-01-04 00:10:35 +0100
committerStapleButter <thetotalworm@gmail.com>2018-01-04 00:10:35 +0100
commit981661a36d691c00f3499d6cf5a3a4db6736a626 (patch)
treec57b59abe29c8037ac4a4da4fe538b5532b2c2c1 /src/Wifi.cpp
parentd50e7e4686c672e80aab50532fa9c25c9bbf226b (diff)
wifi: implement increment for txheader[4]
Diffstat (limited to 'src/Wifi.cpp')
-rw-r--r--src/Wifi.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Wifi.cpp b/src/Wifi.cpp
index 7a9b0a2..ed92ad8 100644
--- a/src/Wifi.cpp
+++ b/src/Wifi.cpp
@@ -303,6 +303,13 @@ int PreambleLen(int rate)
return 192;
}
+void IncrementTXCount(TXSlot* slot)
+{
+ u8 cnt = RAM[slot->Addr + 0x4];
+ if (cnt < 0xFF) cnt++;
+ *(u16*)&RAM[slot->Addr + 0x4] = cnt;
+}
+
void StartTX_LocN(int nslot, int loc)
{
TXSlot* slot = &TXSlots[nslot];
@@ -415,7 +422,8 @@ void SendMPReply(u16 clienttime, u16 clientmask)
if (IOPORT(W_TXSlotReply2) & 0x8000)
{
slot->Addr = (IOPORT(W_TXSlotReply2) & 0x0FFF) << 1;
- *(u16*)&RAM[slot->Addr + 0x4] = 0x0001;
+ //*(u16*)&RAM[slot->Addr + 0x4] = 0x0001;
+ IncrementTXCount(slot);
}
u16 clientnum = 0;
@@ -719,6 +727,7 @@ bool ProcessTX(TXSlot* slot, int num)
// seems this is set to indicate which clients failed to reply
*(u16*)&RAM[slot->Addr + 0x2] = 0;
+ IncrementTXCount(slot);
SetIRQ(12);
IOPORT(W_TXSeqNo) = (IOPORT(W_TXSeqNo) + 1) & 0x0FFF;