Some notes on how zoning out works in Ocarina of Time
At 8011B934 (8011A5D0 + 0x1364) there is a signed 32bit variable that denotes the type of zone out that occurred. Here are a few values I've found so far:
-3 | Warp Song | Resets Temp Flags. Uses Respawn type 2's entrance index for loading the next entrance |
-2 | ? | Preserves Temp Flags. Set when entering a loading zone in tower collapse/playing the sun's song/game over and continuing |
-1 | ? | Preserves Temp Flags. Warps you back to your last entrance index |
0 | Standard Exit | Resets Temp Flags |
1 | Standard Out of Bounds | Reverts to last checkpoint. Preserves Temp Flags. This is the zoneout that occurs with tower collapse void warp |
2 | Grotto Return | Temp Flags reset |
3 | Return to Farore's Wind | Temp Flags restored from Farore's Wind data |
Values greater than 0 are interesting because they each have their own set of return coordinates when the game reloads.
I now have an educated on how void warp works in tower collapse as well. Void warp works by "touching" an exit on the same frame as you "void out" by falling 300 or 400 units (forget which). What i think happens next is that the game processes the routine for touching the exit first, which causes the next entrance index variable to be changed, and zoneout type to be set to -2. Then, when the void out is processed, the zoneout type is changed to 1, overriding the normal coordinates for the entrance. One small gap in this theory is that I don't know why the entrance index doesn't change as well.
Edit: someone messed around with zone outs and it helped me re-discover a thing Acryte found. Basically, when you play a warp song, it overwrites zoneout 2's entrance index, rather than writing directly into the next entrance index variable. This means that if you were to play a warp song and wrong warp into a grotto, leaving it would put you somewhere in the scene you'd warp to. You would have to set things up first by entering a grotto though because by default Link's spawn parameter will be set to 0, causing him to be completely invisible and uncontrollable.