FramePerfection / STROOP

SuperMario64 Technical Run-time Observer and Object Processor
6 stars 2 forks source link

Ghost hack causes crashes on Usamune 1.93 U #4

Open krithalith opened 2 weeks ago

krithalith commented 2 weeks ago

I am using the Usamune 1.93 U ROM, on Mupen 1.1.8-2, and STROOP refactor 0.6.1.

I reset the ROM and loaded an empty save file. After the intro cutscene and text, I activated the ghost hack, made a state, and loaded the state. Everything seems fine. The white flying Mario ghosts appears and circles around me. However, from this point, certain Mario actions / animations will make the game crash.

No problem: idle, walking, turning around, jump, jumpkick, double jump, crouch, crouch slide, breakdance, ...

Crash: backflip, longjump, sideflip, triple jump, dive, ...

Mupen crash log (longjump):

Mupen 64 1.1.8-2 27/08/2024 21:55:13 Address: 0x000000 (closest: mupen64(2).exe 0x000000) Stack overflow (0xc0000005) Video: C:\Users\Derek\Desktop\Mupen64-RR_Repack22\Mupen64-RR Repack\plugin\glN64.dll Audio: C:\Users\Derek\Desktop\Mupen64-RR_Repack22\Mupen64-RR Repack\plugin\a_Jabo_Dsound.dll Input: C:\Users\Derek\Desktop\Mupen64-RR_Repack22\Mupen64-RR Repack\plugin\TASInput.dll RSP: C:\Users\Derek\Desktop\Mupen64-RR_Repack22\Mupen64-RR Repack\plugin\hacktarux-azimer-rsp-hle.dll VCR Task: 0 Emu Launched: 1

FramePerfection commented 2 weeks ago

Thanks for the detailed description.

I'll leave the Usamune link here for myself, as I fear that I'll have to do some assembly debugging here... 😰

FramePerfection commented 2 weeks ago

Okay, so I've tried replicating the crash with a longjump, a triple jump and a backflip, on 0.6.2 (or rather, the current development state, which isn't much different from the latest nightly build), and it worked just fine.
I've found that indeed some changes were made to the ghost hack since 0.6.1 (I wonder who made those, might have been me :suspect: ), so this might work for you as well.

krithalith commented 1 week ago

Ah yep 0.6.2 works without issues with Usamune (U) 1.93. Thanks!

krithalith commented 2 days ago

Ah upon further testing it only seems to work if you don't use any of the actual Usamune features like showing RTA times etc, also if you open the usamune menu it still crashes. I'm guessing the additional HUD elements and the custom menu also use the Gfx pool in ways the vanilla game does not. Speficially I found the following crashes:

If Usamune misc RTA timing is already active and the ghost hack is activated, the game will crash on certain actions like decribed previously.

If Usamune is in pure vanilla (no usamune features active yet), the ghost hack can be activated and seems to work for all actions, but the game will crash when pressing D-down to access the Usamune menu.

I see that in 0.6.2 there is an option to "move" the gfx pool. Is there any chance this could solve the issue?

FramePerfection commented 1 day ago

I see that in 0.6.2 there is an option to "move" the gfx pool. Is there any chance this could solve the issue?

No, that can't be it. The GFX pool just collects valid commands, and so long as Usamune and the ghost hack are producing valid commands (which they do), there is not going to be a conflict there.
Moving the GFX pool is intended only to allow for more ghosts, because each ghost instance produces a considerable amount of commands that, when significantly multiplied, need more space than the original game has accounted for.

It is more likely that activating Usamune feature will cause memory clashes. I will try to figure out the details behind the crashes you've been observing, since I haven't actually attempted to use Usamune myself in regards to the issue (since you had initially described a reproduction scenario that didn't end up causing it, but could have).

Anyways, good to know. I had hoped that this issue had poofed out of existance with 0.6.2, but apparently that is not really the case...