diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ARMInterpreter_ALU.cpp | 4 | ||||
-rw-r--r-- | src/NDS.cpp | 9 | ||||
-rw-r--r-- | src/Wifi.cpp | 11 |
3 files changed, 18 insertions, 6 deletions
diff --git a/src/ARMInterpreter_ALU.cpp b/src/ARMInterpreter_ALU.cpp index 7ff8255..4f76b8b 100644 --- a/src/ARMInterpreter_ALU.cpp +++ b/src/ARMInterpreter_ALU.cpp @@ -895,7 +895,7 @@ void A_SMLAWy(ARM* cpu) if (cpu->CurInstr & (1<<6)) rs >>= 16; else rs &= 0xFFFF; - u32 res_mul = ((s32)rm * (s16)rs) >> 16; // CHECKME + u32 res_mul = ((s64)(s32)rm * (s16)rs) >> 16; u32 res = res_mul + rn; cpu->R[(cpu->CurInstr >> 16) & 0xF] = res; @@ -930,7 +930,7 @@ void A_SMULWy(ARM* cpu) if (cpu->CurInstr & (1<<6)) rs >>= 16; else rs &= 0xFFFF; - u32 res = ((s32)rm * (s16)rs) >> 16; // CHECKME + u32 res = ((s64)(s32)rm * (s16)rs) >> 16; cpu->R[(cpu->CurInstr >> 16) & 0xF] = res; } diff --git a/src/NDS.cpp b/src/NDS.cpp index 29231df..8e5700f 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -945,7 +945,8 @@ u8 ARM9Read8(u32 addr) case 0x08000000: case 0x09000000: - printf("GBA read8 %08X\n", addr); + //return *(u8*)&NDSCart::CartROM[addr & (NDSCart::CartROMSize-1)]; + //printf("GBA read8 %08X\n", addr); return 0xFF; } @@ -993,7 +994,8 @@ u16 ARM9Read16(u32 addr) case 0x08000000: case 0x09000000: - printf("GBA read16 %08X\n", addr); + //return *(u16*)&NDSCart::CartROM[addr & (NDSCart::CartROMSize-1)]; + //printf("GBA read16 %08X\n", addr); return 0xFFFF; } @@ -1041,7 +1043,8 @@ u32 ARM9Read32(u32 addr) case 0x08000000: case 0x09000000: - printf("GBA read32 %08X\n", addr); + //return *(u32*)&NDSCart::CartROM[addr & (NDSCart::CartROMSize-1)]; + //printf("GBA read32 %08X\n", addr); return 0xFFFFFFFF; } 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; |