Advertisement
mzxrules

Pause Trick

May 2nd, 2016
1,472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1. Q: can anyone tell me why pausing in gohmas room as adult makes ganondoor work? i know that its corrupting the cutscene pointer but how does it work
  2.  
  3. A: it's not corrupting the cutscene pointer.
  4.  
  5. When you watch a cutscene (well, a specific subset of them, but a huge amount none the less), the cutscene pointer is set to point at where the cutscene is located in ram. The cutscene pointer is never nulled out when a cutscene terminates (a glitch of it's own that was fixed in Majora's Mask), so the stored address ends up persisting forever until a new cutscene plays or the game is shut off.
  6.  
  7. So what's happening is that the pointer itself isn't being "corrupted", the data making up the cutscene is being "corrupted", because the file that the cutscene was stored in was deallocated from memory, allowing new data to be stored in it's place.
  8.  
  9. As for the pause trick specifically: The cutscenes we watch before a wrong warp are typically stored in "scene" files. Scene files contain the bulk of the data used to make up a loaded area (like Kokiri Forest). Because the scene file is one of the first files allocated to the "gameplay" game state's reserved heap when the game loads/re-loads an area, scene files end up having a fixed end address in ram (since things are allocated from a high address to low address on the game state heap).
  10.  
  11. Thus the size of the destination scene file becomes somewhat important. The end address of a scene file in ram is 80384980 for I think all versions except the Debug Rom. When you do Ganondoor as a child in any%, the "Inside of the Deku Tree" cutscene sets the cutscene pointer to an address of roughly 80384xxx, while the Tower Collapse scene file has a start address of 8037xxxx or so.
  12.  
  13. That means that the Tower Collapse scene file data overwrites the "Inside the Deku Tree" cutscene completely. The only reason the game doesn't crash here is because the game "ignores" cutscenes with negative commands or frames, and we just so happen to hit the right data to hit this condition.
  14.  
  15. With the pause trick, your last cutscene is usually the Title Screen cs. In this situation, the cutscene pointer stores an address of 8036xxxx, which is a lower address than the start address of most scene files. Without it, you end up playing the Title Cutscene, which results in an oobs loop as the cutscene's data positions Link incredibly far out of bounds.
  16.  
  17. Now for why the pause trick works:
  18.  
  19. After the game allocates the space for the scene file, the game then allocates a fixed 0xFA000 bytes reserved for graphical data, positioning this space immediately before the scene file. Thus, the start address of this space directly depends on the size of the scene file. I like to call this space "object space", because during gameplay this is the space that object files (which contain pre-computed gbi data/textures/animations) are allocated. This is also where various textures used by the pause screen are loaded to when the game is paused (overwriting the object files).
  20.  
  21. Since the space is fixed length, the entire 0xFA000 bytes isn't overwritten with data, and since files are inserted into "object space" starting from low address to high, data at the high end (like the Title Screen cutscene data) won't be overwritten.
  22.  
  23. This is why pausing in only specific areas works: the start address of the "object space" is directly dependent on scene size. If you pause in scenes that are smaller, the start address for the object space is closer to the end of ram, which is enough to push it to where pausing the game will store a file that will overwrite data at the 8036xxxx address that our Title Screen cutscene was located at.
  24.  
  25. As for why the pause trick in Gohma's Room is adult only:
  26.  
  27. Child and Adult Link use two separate object files to store data. The object file for Adult Link is significantly bigger (0xA880 bytes), allowing the pause screen files to overwrite more data in ram.
  28.  
  29. oh also, the pause trick is language dependent sometimes. The backup strat of pausing in Link's House to fix the Ganondoor wrong warp is language dependent on a few versions because the data that overwrites the "Title Cutscene" is a texture that contains text.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement