Retry Extra Settings

The Retry system can be configured to run additional code at specific times when inserted into the routines available in the retry_config/extra.asm file.

On SA-1 ROMs, most of these routines still run on the SNES CPU.

RoutinePurpose
reset: Called when the level is reset by the retry system or when entering from the overworld. Unlike UberASM level init routine, this won't be executed during regular level transitions.
death: This routine will be executed everytime the player dies.
midway: This routine will be called every time the player touches a midway (vanilla or custom midway object).
room_checkpoint: This routine will be called every time the player gets a checkpoint through a room transition. Remember you can check for $13BF and $010B to know in which trans/sub-level you are.
prompt_exit: This routine will be called every time the player selects "exit" on the retry prompt.
save_file: This routine will be called every time the game is saved (before anything gets saved). Remember that you can check for the current save file in $010A. On SA-1 ROMs, this may run on either CPU, depending on what's calling the save routine.
load_file: This routine will be called every time an existing save file is loaded (before anything gets loaded). Remember that you can check for the current save file in $010A.
load_new_file: This routine will be called every time a new save file is loaded (before anything gets reset). Remember that you can check for the current save file in $010A.
game_over: This routine will be called during the game over screen. This is called after the save file data is loaded from SRAM (only the data put before .not_game_over in retry_config/sram_tables.asm) but before all the data is saved again to SRAM. This can be useful if you want to initialize some addresses for the game over and/or have them saved to SRAM.
door_animation: Called when Mario enters a door, every frame during the fade out. This could be useful since the door animation is the only one that can't be intercepted with level ASM or sprite ASM (since it immediately goes to the fading gamemode). If you need some level-specific action here, you can check the sublevel number in $010B (16 bit). If you need to only run the code for 1 frame, you can check for $0DB0 equal to 0.

All these routines are called in 8-bit A/X/Y mode and DBR is already set. Don't worry about overwriting registers, they'll be restored afterwards (except for direct page). All the routines must end with RTS.


Return to main page