HylianFreddy

Why Fire Medallion as Child can crash

Jun 18th, 2022 (edited)
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. Entering the Fire Temple blue warp as Child Link leads to a crash after receiving the Fire Medallion on the European and Japanese versions of OoT3D, but not in the American version. Here's why.
  2.  
  3. At the end of the Fire Medallion cutscene, the game loads entrance 0x564 to place Link on the warp pad in Death Mountain Crater. This entrance is also used whenever you re-enter the Fire Temple blue warp as Adult Link, whereas re-entering as child goes to the Bolero entrance (0x4F6).
  4.  
  5. This entrance contains scene index 0x61 (DMC), and spawn index 05 (among other data).
  6. The spawn index is used to access the Entrance List inside the scene file, and there is a different List for each scene setup (Scene Command 06).
  7.  
  8. The one for the adult setup has 6 elements:
  9. pos / room
  10. 00 01 <-- from DMT
  11. 01 01 <-- from Goron City
  12. 02 00 <-- from Fire Temple
  13. 03 01 <-- from Fairy Fountain
  14. 04 01 <-- from Bolero
  15. 05 01 <-- from Blue Warp
  16.  
  17. The one for the child setup only has 5 elements, it's missing the blue warp entrance. So entering DMC as child with Spawn Index 05 will read the 2 bytes after the end of the Entrance List. These are:
  18. 40 00 (USA)
  19. 39 00 (EUR)
  20. 5B 00 (JP)
  21. This is the only version difference in the entire scene file (and possibly in all of the scene files), and I honestly can't figure out what this value is supposed to be. I think it's just 2 padding bytes between the Entrance List and the following Start Positions List, but I don't know why the value is not 0.
  22.  
  23. When the game uses these entrances, the room index is fine, but the position index goes out of bounds in the Start Positions List (Scene Command 00).
  24. Position 0x40 ends up having valid data for Link's actor (kind of):
  25. Actor ID = 0000
  26. Pos = 0, 0, 0
  27. Rot = 0, 0x4648, 0
  28. Params = 0x4648
  29.  
  30. I don't think these params are used in the game, but they still work and they act like params 0x6FF, triggering the Farore's Wind spawning animation. So if you have FW set somewhere and then trigger this entrance on USA, you lose the FW point.
  31.  
  32. On the other hand, positions 0x39 and 0x5B give a lot of garbage data, starting with actor ID 0xB8B8 (EUR) or 0xAFFF (JP), which causes the crash when the game tries to use it to assign the player actor the correct Object ID. Accessing the Actor Overlay Table with such a huge index ends up writing the object ID to invalid memory.
  33. The other garbage data don't cause any crashes, so if you hack this actor ID the scene loads correctly. I don't know why the game even reads the actor ID from the scene file in the first place, given that it should always be 0 for the Link actor, but that's what it does.
  34.  
Advertisement
Add Comment
Please, Sign In to add comment