mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 07:10:00 -06:00
wifi: little fix related to replies (when the address isn't set, don't try to adjust the TX header)
This commit is contained in:
19
src/Wifi.cpp
19
src/Wifi.cpp
@ -400,9 +400,12 @@ void SendMPReply(u16 clienttime, u16 clientmask)
|
|||||||
IOPORT(W_TXSlotReply1) = 0;
|
IOPORT(W_TXSlotReply1) = 0;
|
||||||
|
|
||||||
// this seems to be set upon IRQ0
|
// this seems to be set upon IRQ0
|
||||||
// TODO: how does it behave if the packet addr is changed before it gets sent?
|
// TODO: how does it behave if the packet addr is changed before it gets sent? (maybe just not possible)
|
||||||
slot->Addr = (IOPORT(W_TXSlotReply2) & 0x0FFF) << 1;
|
if (IOPORT(W_TXSlotReply2) & 0x8000)
|
||||||
*(u16*)&RAM[slot->Addr + 0x4] = 0x0001;
|
{
|
||||||
|
slot->Addr = (IOPORT(W_TXSlotReply2) & 0x0FFF) << 1;
|
||||||
|
*(u16*)&RAM[slot->Addr + 0x4] = 0x0001;
|
||||||
|
}
|
||||||
|
|
||||||
u16 clientnum = 0;
|
u16 clientnum = 0;
|
||||||
for (int i = 1; i < IOPORT(W_AIDLow); i++)
|
for (int i = 1; i < IOPORT(W_AIDLow); i++)
|
||||||
@ -585,8 +588,14 @@ bool ProcessTX(TXSlot* slot, int num)
|
|||||||
*(u64*)&RAM[slot->Addr + 0xC + 24] = USCounter;
|
*(u64*)&RAM[slot->Addr + 0xC + 24] = USCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(u16*)&RAM[slot->Addr + 0xC + 22] = IOPORT(W_TXSeqNo) << 4;
|
//u32 noseqno = 0;
|
||||||
IOPORT(W_TXSeqNo) = (IOPORT(W_TXSeqNo) + 1) & 0x0FFF;
|
//if (num == 1) noseqno = (IOPORT(W_TXSlotCmd) & 0x4000);
|
||||||
|
|
||||||
|
//if (!noseqno)
|
||||||
|
{
|
||||||
|
*(u16*)&RAM[slot->Addr + 0xC + 22] = IOPORT(W_TXSeqNo) << 4;
|
||||||
|
IOPORT(W_TXSeqNo) = (IOPORT(W_TXSeqNo) + 1) & 0x0FFF;
|
||||||
|
}
|
||||||
|
|
||||||
// set TX addr
|
// set TX addr
|
||||||
IOPORT(W_RXTXAddr) = slot->Addr >> 1;
|
IOPORT(W_RXTXAddr) = slot->Addr >> 1;
|
||||||
|
Reference in New Issue
Block a user