I'd like to define a breakpoint in Dolphin before launching a game -- is it possible?
I'm writing a Gecko ASM code to hook on Waverace Blue Storm's VIConfigure function, which sets the video format before its splash screen appears.
My problem is the game appears to be taking a different code path depending on whether Dolphin launches the game for the very first time, vs using the "Emulation > Reset" function.
For some reason my Gecko code only works after I perform an "Emulation > Reset". So I need to step through on the very first launch to see what's happening without using the "Emulation > Reset" function. And the only way I can do that is if I can somehow tell Dolphin what breakpoint I want BEFORE hitting the Play button.
I've noticed when I save my breakpoint in Dolphin it adds "[BreakPoints] 80115afc nb" to the GameINI, but it still requires me to start the game, click "Breakpoints > Load" and then "Emulation > Reset".
Is there something else I can add to the GameINI to get it to actually instantiate the breakpoint automatically on the very first game launch? I've checked the GameINI wiki and couldn't find anything.
Here is the code, it's for patching viWidth inside the GXRenderModeObj passed to VIConfigure:
I've also tried just doing a plain write to the address in r3 where the GXRenderModeObj is stored and that also doesn't work either unless I do "Emulation > Reset". The code for that one is:
Another way I can get it to work is if I set the game to "[Core] ProgressiveScan = True", in which case the "Enable Progressive?" prompt is shown at the game's splash screen, which triggers VIConfigure when "Yes" is selected, and both codes work. But I want this code to work without the user having to do that. Heck, I can't even get that prompt screen to appear on one of my PC's without holding B button even though I've got "[Core] ProgressiveScan = True" so I wouldn't want to rely on it. Codes are for the NTSC-U version.
Thanks
I'm writing a Gecko ASM code to hook on Waverace Blue Storm's VIConfigure function, which sets the video format before its splash screen appears.
My problem is the game appears to be taking a different code path depending on whether Dolphin launches the game for the very first time, vs using the "Emulation > Reset" function.
For some reason my Gecko code only works after I perform an "Emulation > Reset". So I need to step through on the very first launch to see what's happening without using the "Emulation > Reset" function. And the only way I can do that is if I can somehow tell Dolphin what breakpoint I want BEFORE hitting the Play button.
I've noticed when I save my breakpoint in Dolphin it adds "[BreakPoints] 80115afc nb" to the GameINI, but it still requires me to start the game, click "Breakpoints > Load" and then "Emulation > Reset".
Is there something else I can add to the GameINI to get it to actually instantiate the breakpoint automatically on the very first game launch? I've checked the GameINI wiki and couldn't find anything.
Here is the code, it's for patching viWidth inside the GXRenderModeObj passed to VIConfigure:
Code:
C2115afc 00000003 ; insert ASM at 0x80115AFC (VIConfigure's address)
38C00000 60C602C0 ; put 0x000002c0 (viWidth 704) in r6
B0C3000E 7C0802A6 ; put r6's low order bits (0x2c0) at 14 byte offset from addr in r3 (GXRenderModeObj); reinstate overridden 7C0802A6 instruction
60000000 00000000 ; no-op ; return
I've also tried just doing a plain write to the address in r3 where the GXRenderModeObj is stored and that also doesn't work either unless I do "Emulation > Reset". The code for that one is:
Code:
2834142e 00000280 ; if 0x8034142e contains 0x0280
0634142e 00000002 ; write to 0x8034142e the following 2 bytes:
02c00000 00000000 ; 0x02c0
e0000000 80008000 ; end code
Another way I can get it to work is if I set the game to "[Core] ProgressiveScan = True", in which case the "Enable Progressive?" prompt is shown at the game's splash screen, which triggers VIConfigure when "Yes" is selected, and both codes work. But I want this code to work without the user having to do that. Heck, I can't even get that prompt screen to appear on one of my PC's without holding B button even though I've got "[Core] ProgressiveScan = True" so I wouldn't want to rely on it. Codes are for the NTSC-U version.
Thanks