wifi: implement increment for txheader[4]

This commit is contained in:
StapleButter 2018-01-04 00:10:35 +01:00
parent d50e7e4686
commit 981661a36d
2 changed files with 16 additions and 4 deletions

View File

@ -945,7 +945,8 @@ u8 ARM9Read8(u32 addr)
case 0x08000000: case 0x08000000:
case 0x09000000: case 0x09000000:
printf("GBA read8 %08X\n", addr); //return *(u8*)&NDSCart::CartROM[addr & (NDSCart::CartROMSize-1)];
//printf("GBA read8 %08X\n", addr);
return 0xFF; return 0xFF;
} }
@ -993,7 +994,8 @@ u16 ARM9Read16(u32 addr)
case 0x08000000: case 0x08000000:
case 0x09000000: case 0x09000000:
printf("GBA read16 %08X\n", addr); //return *(u16*)&NDSCart::CartROM[addr & (NDSCart::CartROMSize-1)];
//printf("GBA read16 %08X\n", addr);
return 0xFFFF; return 0xFFFF;
} }
@ -1041,7 +1043,8 @@ u32 ARM9Read32(u32 addr)
case 0x08000000: case 0x08000000:
case 0x09000000: case 0x09000000:
printf("GBA read32 %08X\n", addr); //return *(u32*)&NDSCart::CartROM[addr & (NDSCart::CartROMSize-1)];
//printf("GBA read32 %08X\n", addr);
return 0xFFFFFFFF; return 0xFFFFFFFF;
} }

View File

@ -303,6 +303,13 @@ int PreambleLen(int rate)
return 192; 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) void StartTX_LocN(int nslot, int loc)
{ {
TXSlot* slot = &TXSlots[nslot]; TXSlot* slot = &TXSlots[nslot];
@ -415,7 +422,8 @@ void SendMPReply(u16 clienttime, u16 clientmask)
if (IOPORT(W_TXSlotReply2) & 0x8000) if (IOPORT(W_TXSlotReply2) & 0x8000)
{ {
slot->Addr = (IOPORT(W_TXSlotReply2) & 0x0FFF) << 1; slot->Addr = (IOPORT(W_TXSlotReply2) & 0x0FFF) << 1;
*(u16*)&RAM[slot->Addr + 0x4] = 0x0001; //*(u16*)&RAM[slot->Addr + 0x4] = 0x0001;
IncrementTXCount(slot);
} }
u16 clientnum = 0; u16 clientnum = 0;
@ -719,6 +727,7 @@ bool ProcessTX(TXSlot* slot, int num)
// seems this is set to indicate which clients failed to reply // seems this is set to indicate which clients failed to reply
*(u16*)&RAM[slot->Addr + 0x2] = 0; *(u16*)&RAM[slot->Addr + 0x2] = 0;
IncrementTXCount(slot);
SetIRQ(12); SetIRQ(12);
IOPORT(W_TXSeqNo) = (IOPORT(W_TXSeqNo) + 1) & 0x0FFF; IOPORT(W_TXSeqNo) = (IOPORT(W_TXSeqNo) + 1) & 0x0FFF;