Editing Talk:PS2 Emulation
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1,484: | Line 1,484: | ||
Also easier example (without using negative addressing because this is additional emu quirk..). ld r2, 0x3008(r0). This opcode will load double word from 0x3008 address no matter what we currently have in r0, because RA is 0 which is badly interpreted as r0 base. | Also easier example (without using negative addressing because this is additional emu quirk..). ld r2, 0x3008(r0). This opcode will load double word from 0x3008 address no matter what we currently have in r0, because RA is 0 which is badly interpreted as r0 base. | ||
This is because of PowerPC quirk that i (and apparently IDA | This is because of PowerPC quirk that i (and apparently IDA) wasn't aware. From IBM manual: | ||
ld RT, Disp(RA) | ld RT, Disp(RA) | ||
Line 1,498: | Line 1,498: | ||
Tl;dr is that if RA is 0 (which disassemblers show as r0), then Disp is real load/store address. This is used many times in emu itself to access negative addresses (0xFFFFFFFFxxxxxxxx), and is used in all netemu cmd 0x01 hooks. | Tl;dr is that if RA is 0 (which disassemblers show as r0), then Disp is real load/store address. This is used many times in emu itself to access negative addresses (0xFFFFFFFFxxxxxxxx), and is used in all netemu cmd 0x01 hooks. | ||
While this is more PPC itself than emu stuff, i feel is important to mention this here. | While this is more PPC itself than emu stuff, i feel is important to mention this here. | ||
Now if we remember that emu have mapped "negative address", | Now if we remember that emu have mapped "negative address", functions like below starting to make sense. | ||
std r4, | sub_186A40: # CODE XREF: VIF0_big_jumptable_3026C+FCC↑p | ||
std r0, -0x6BF0(r0) # store r0 on 0xFFFFFFFFFFFF9410, no matter what r0 actually is at the moment. | |||
std r4, -0x6BD0(r0) # store r4 on 0xFFFFFFFFFFFF9430, no matter what r0 actually is at the moment. | |||
std r5, -0x6BC8(r0) | |||
std r6, -0x6BC0(r0) | |||
std r7, -0x6BB8(r0) | |||
std r8, -0x6BB0(r0) | |||
std r9, -0x6BA8(r0) | |||
std r10, -0x6BA0(r0) | |||
std r11, -0x6B98(r0) | |||
std r12, -0x6B90(r0) | |||
mflr r4 | |||
std r1, -0x6BE8(r0) | |||
std r2, -0x6BE0(r0) | |||
std r3, -0x6BD8(r0) | |||
std r4, -0x7F80(r0) | |||
bl .VU0_cmd_0x12_fl_overflow_related | |||
ld r4, -0x7F80(r0) | |||
ld r1, -0x6BE8(r0) | |||
ld r2, -0x6BE0(r0) | |||
ld r3, -0x6BD8(r0) | |||
mtlr r4 | |||
ld r0, -0x6BF0(r0) # load to r0 from address 0xFFFFFFFFFFFF9410, no matter what r0 actually is at the moment. | ld r0, -0x6BF0(r0) # load to r0 from address 0xFFFFFFFFFFFF9410, no matter what r0 actually is at the moment. | ||
ld r4, | ld r4, -0x6BD0(r0) # load to r4 from address 0xFFFFFFFFFFFF9430, no matter what r0 actually is at the moment. | ||
ld r5, -0x6BC8(r0) | |||
ld r6, -0x6BC0(r0) | |||
ld r7, -0x6BB8(r0) | |||
ld r8, -0x6BB0(r0) | |||
ld r9, -0x6BA8(r0) | |||
ld r10, -0x6BA0(r0) | |||
ld r11, -0x6B98(r0) | |||
ld r12, -0x6B90(r0) | |||
blr | |||
== Communication with Graphics Synthesizer in ps2_gxemu == | == Communication with Graphics Synthesizer in ps2_gxemu == |