Skip to content

refactor ghost handling by removing hardcoded Mario graph node offsets - #73

Merged
FramePerfection merged 1 commit into
Developmentfrom
fix/ghost-hardcoded-mario-graph-node
Sep 25, 2026
Merged

FramePerfection merged 1 commit into
Developmentfrom
fix/ghost-hardcoded-mario-graph-node

Conversation

@hugou74130

Copy link
Copy Markdown
Collaborator

Fixes #72

Since c50ef50, the ghost loop sets each Mario ghost's sharedChild to a hardcoded 0x800F0860 every frame. That address is Mario's graph node only on US, so on JP and on some romhacks the game freezes as soon as a ghost is spawned.

The loop now reads the graph node from gMarioObject (lw t1, 0x14 (RegMarioObject) + nop). The routine keeps the same size, so no other offsets change.

  • Updated ghost_loop.asm, GhostHackUS.hck and GhostHackJP.hck
  • The .hck bytes match the armips output

Tested on JP (no freeze anymore, ghost uses 0x800ED9E0) and US (unchanged).

@FramePerfection FramePerfection left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea how I ended up scuffing that address, I can't remember coding that in but the evidence is there 🙈

Thanks for the fix, I'll release this right away!

@FramePerfection
FramePerfection merged commit 82d2cfd into Development Sep 25, 2026
1 check passed
@FramePerfection
FramePerfection deleted the fix/ghost-hardcoded-mario-graph-node branch September 25, 2026 18:38
@FramePerfection FramePerfection mentioned this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ghost hack freezes the game on JP and on some romhacks (hardcoded Mario graph node)

2 participants