# Troubleshooting

#### Q: I applied a FG gradient code, and it appears above the Retry prompt as well!

A: You need to make a slight edit to the HDMA code. You should see something like this:

    LDA #$17
    STA $212C
    LDA #$00
    STA $212E

Change that to:

    LDA #$17
    STA $212C
    LDA #$17	;<- change here
    STA $212E

#### Q: I'm making the music in a level fade out using the following code (with AddmusicK) but the music doesn't reload when dying!

    LDA #$FF
    STA $1DFB|!addr

A: You want to also store `#$FF` to `$0DDA`, like this:

    LDA #$FF
    STA $1DFB|!addr
    STA $0DDA|!addr	;<- change here

#### Q: When dying after getting the goal post or beating a boss, the music doesn't restart when respawning!

A: One common cause for this is a bug with AddmusicK that happens when you change certain songs to `#$00` in the asm/tweaks.asm (or asm/UserDefines.asm) file, specifically: `!Miss`, `!BossClear`, `!StageClear`, `!Keyhole` or `!IrisOut` (maybe also `!SwitchPalace`, `!RescueEgg` and `!StaffRoll`). This can cause issues like the one mentioned here or the P-Switch/Star timers acting weirdly when activated

To fix this, open AMK's asm/SNES/patch.asm file and remove all instances of codes like this:

    CMP !SongThatYouChangedTo0
    BEQ Something

For example, if you changed `!IrisOut` to `#$00`, then you'd remove these codes (you can CTRL+F `!IrisOut` to find all instances in the file):

    CMP !IrisOut
    BEQ ++

    CMP !IrisOut
    BEQ LevelEndMusicChange

    CMP !IrisOut
    BEQ Okay

Run AddmusicK after applying the changes and the issue should be fixed. If it still happens but you didn't change the tweaks/UserDefines file, then DM me the issue.

#### Q: I'm using the "Single Screen" UberASM code, and sprites keep moving while Mario is dead!

A: To fix, add this code at the very start of the Single Screen's main code:

        LDA $71
        CMP #$09
        BNE +
        RTL
    +

#### Q: When I enter a level from the overworld, it brings me to the bonus game!

A: After inserting Retry for the first time, don't load a save state that you made before inserting it and make sure to start from a new save file.

#### Q: I use a custom midway block/sprite, but it doesn't seem to work!

By default Retry only works with the vanilla midway tile, but it's fairly straightforward to make it work with your own blocks/sprites. Retry has a specific RAM address that can be used to set the midway in the current level (according to the `checkpoint` setting in retry_config/settings_local.asm). The address is `!ram_set_checkpoint` to have it always available in sprites/blocks, you can copy the contents of "ram.asm" into PIXI's asm/sa1def.asm, GPS's defines.asm and UberASM Tool's other/macro_library.asm.

The system works as follows: if you set the low byte (`!ram_set_checkpoint`) to `#$00`, it will trigger the current level's midway. If the checkpoint table for this sublevel is 0, it means it will give you the midway for the main level. While if it's 2 or 3, it will give you the midway for the current sublevel.

You can also set a completely custom entrance for the checkpoint, similarly to how Retry's custom midway objects work. To do this, you need to set the entire 16 bit address (`!ram_set_checkpoint` and `!ram_set_checkpoint+1`) to the entrance value you want to use. This value follows the format of $7E19B8 and $7E19D8 (where $7E19B8 should go in the first byte of the address, $7E19D8 in the second). For more info, check those addresses in SMWCentral's RAM Map. In practice, your midway block sprite should have a piece of code like this, to set the vanilla midway:

    LDA #$01
    STA $13CE

To add multiple midway support, you'd just need to add this after it:

    LDA #$00
    STA !ram_set_checkpoint

To make the midway take you to an arbitrary entrance, you need to set a different value depending on what entrance it is. For example, to make it use secondary exit number $0169, you'd use this code:

    REP #$20
    LDA #$0169	; Secondary exit number.
    ORA #$0200	; Set the "secondary exit" bit in the high byte (like $7E19D8).
    STA !ram_set_checkpoint
    SEP #$20

Additionally, you can also reset the current level's checkpoint by setting !ram_set_checkpoint to #$80. This will respawn Mario in the current level's main entrance when dying.

- if !save_on_checkpoint = 1, using this method will also make the game save.
- if using the "Individual Dragon Coins Save" patch, using this method will also make the current Dragon Coins save (when !Midpoint = 1 in that patch).
- this address is only checked while in a level, but you can also set it in other situations (in this case, the checkpoint will be registered the first time a level is entered).

#### Q: I patched the 32x32 Player Tilemap patch / lx5's Custom Powerups / lx5's Dynamic Spriteset System (DSS) / DKCR Status Bar (or other sprite status bars) and I get glitched graphics when dying! What do I do?

A: Those patches have a high chance of using the same spots in SP1 for their dynamic tiles as the Retry prompt. To fix it, open retry_config/settings_global.asm and towards the bottom you'll see a bunch of `!tile_...` defines. You need to edit some of those to other free spots in SP1 that aren't used by other patches.

#### Q: I'm using !prompt_freeze = 0 to make sprites move while Mario is dead, but it also causes autoscrollers to keep going. How do I stop them?

A: vanilla autoscrollers should already stop when dying with this options turned on, while custom autoscrollers need to be handled on a case-by-case basis by adding a check for Mario's state. This is usually simple to fix by adding a code like this at the beginning of your custom autoscroller's main code:

        LDA $71
        CMP #$09
        BNE .run
        RTL
    .run:

(if your autoscroller code is in a routine that ends with RTS, use RTS instead of RTL before `.run`).

Return to main page