Emulator Issues #11528
openDebugger displays wrong bitmask
0%
Description
I've run into an instruction (rlwimi r6, r7, 16, 6, 15) that displays the wrong bitmask, debugger shows it as 0x000003FF when it should be 0x03FF0000 (bits 6-15), I've tracked it down to this line, with HelperRotateMask. I'm not sure if it's the disassembler or the interpreter too but it's worth double checking, rlwinm/rlwimi is a pain. Instruction opcode is 0x50E6819E, used in every GameCube game in MEMIntrruptHandler+0x2C
https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Common/GekkoDisassembler.cpp#L615
Files
Updated by taolas almost 6 years ago
12345678 rl 16 -> 56781234 wimi 6, 15 -> 06780000 (678 = 3FF).
Therefore unscrambled: a mask 3FF is applied to 678 = 000003FF. It's correct, as it takes the rotation into account. You just did the mask. Using the rotation and mask is good because you can look at the original hex and immediately know what's being masked.
Updated by nwplayer123 almost 6 years ago
- File Screenshot_76.png Screenshot_76.png added
Should still be 0x03FF0000, upper halfword is 0x4022, lower halfword is 0x4024, that's how it gets this address, insert 10 bits at bit 6(to 15)
https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/HW/MemoryInterface.cpp#L115
Updated by taolas almost 6 years ago
Insert what 10 bits? Isn't the helper consistently showing the what and not the where to?
What would you expect rlwimi r6, r7, 20, 6, 15 to show, the same 0x03FF0000?
I could be wrong here, but it seems to be consistent with what it's showing.
Updated by nwplayer123 almost 6 years ago
oh, yeah, I guess that's what I'm thinking of. I'm expecting the where to and not the what. insrwi is just the simplified opcode for that rlwimi, insert right word immediate. I'm expecting it to be 0x03FF0000 cuz it overwrites those bits in r6 vs what it takes from r7.