Emulator Issues #11528
Debugger displays wrong bitmask
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
#1 Updated by taolas about 1 month 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.
#2 Updated by nwplayer123 about 1 month ago
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)
#4 Updated by nwplayer123 about 1 month 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.