Language…
8 users online: blgmadresh0000, crocodileman94, Drakel, Johnson, lancejameslim, OEO6, pnaha, RichardDS90 - Guests: 1,286 - Bots: 90
Users: 70,537 (2,468 active)
Latest user: Unikirin753

UberASM Retry System (+ Multiple Checkpoints) v0.8.1

PatchUberASM

Originally posted by Anas
Also, as for the main entrance checkpoint thingy, what I meant is that it would useful if you make a custom no-Yoshi intro with this block and the next level after the intro already uses a checkpoint but for some reason you don’t want to use the extra checkpoint option.

Ah ok I see, I forgot that the custom checkpoints are optional, but still I think since you can just do that with them, you should enable them and use a secondary entrance as the checkpoint for after the intro. The only downsides to enabling the custom checkpoints is a bit more RAM usage (but you can also reduce the max amount of them to 1 or just lower than the default 8 to minimize that) and that they take up a few custom object slots (but there's still plenty that can be used with Objecttool).

Originally posted by Anas

Finally, as for the intro level bug, at least that’s how I remember it when I last tested it, and I already worked around the glitched lives counter issue by putting a 1-up in the player’s position.

Mh ok, so it sounds like it was an issue with getting a game over in the intro, which I can understand would cause that. As I said, you can disable life loss for each sublevel from tables.asm, so you could just do that for the intro sublevel. A 1-up works too I guess. I can look into trying to fix that anyway but idk if it's feasible
Actually, I just quickly tested out the retry with the intro level and luckily there's no problem from my side! Guess I misremembered; I think it was the title screen, which wouldn't make sense to apply retry for.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Update v0.5.2:
  • Now changing the X/Y position for the prompt text (from the settings or by writing to the respective RAM addresses) only works if the black box is disabled, since otherwise it looks broken. Thanks to  AmperSam for the suggestion.
  • Added an "api" file containing useful routines that can be called by external UberASM files (sadly not from other library files if using standard UberASMTool). For now it only has two, one to reset the current level's checkpoint, and one to reset all checkpoints, but more can be added in the future. For information on how to use them see docs/api.html.
  • Fixed Retry prompt remaining glitched on screen in case Mario revives after death (for example, Yoshi revive glitch). Thanks to  YouFailMe and Mega for pointing it out.
  • Added !draw_all_dc_collected option to make all DCs collected be drawn or not to Retry's sprite status bar. Thanks to Anas for the suggestion.
  • Now enabling the sprite status bar on the title screen will work properly instead of showing glitched tiles. Note that it is still disabled by default in sprite_status_bar_tables.asm: values are $0000 for level C7, changing those according to the guide in the file will enable it.
    NOTE: this requires inserting the new retry_gm06.asm gamemode file in GM 06 (see updated how_to_insert.txt guide).
  • Added fix for dying on the title screen with the !title_death_behavior option, with which you can choose if to reload the title screen immediately or only after the death animation has played out. You can also keep the original game's glitched behavior if you need to.
    NOTE: this requires inserting the new retry_gm07.asm gamemode file in GM 07 (see updated how_to_insert.txt guide).
Is it possible to play the full death animation duration before reloading on a specific sublevel while using instant retry with no prompt + no death animation as the default setting? I want to use the Revival Block for a level while using this retry system (unless there is a better way to do this). Also understandable if it is too out of the way to address as it is a bit of a niche scenario.
Originally posted by PangaeaPanga
Is it possible to play the full death animation duration before reloading on a specific sublevel while using instant retry with no prompt + no death animation as the default setting? I want to use the Revival Block for a level while using this retry system (unless there is a better way to do this). Also understandable if it is too out of the way to address as it is a bit of a niche scenario.

Hey, it is not possible with just tinkering with the settings/tables, I might add a ram address or something to achieve that in the future, but for now you can try with a hacky solution that I tested and it seems to work:
  • Set the value for the "checkpoint_effect" table in "tables.asm" to $4x for the sublevels (so it plays the vanilla death animation), with x being the setting you want for the checkpoints in the sublevel
  • In "level_end_frame.asm", find the label for the sublevel you want and use this code for it:
    Code
    levelXXX:
        ; Skip if not dying
        lda $71 : cmp #$09 : bne .return
        
        ; Don't play death song and play death sfx (only once)
        lda !ram_is_dying : bne +
        stz $1DFB|!addr
        lda.b #!death_sfx : sta !death_sfx_addr
    +   
        ; If about to exit the level, reload the level
        ; without reloading the music (if it didn't change)
        lda $1496|!addr : cmp #$02 : bcs .return
        lda !ram_music_backup : sta $0DDA|!addr
        jsl in_level_main_dying_respawn
    .return:
        rts

    (with XXX your sublevel number of course). This takes care of the death music/sfx and reloads the level when needed.
    If you need this for more sublevels you can just do:
    Code
    levelYYY:
        jmp levelXXX

    (YYY the second sublevel, XXX the first) for all other sublevels, to avoid duplicating code.
Be warned that the latest version added a compilation error that happens when setting !fast_prompt = 0 in the settings. If you need to use that with the latest release, you can grab the code from here, in which the error was fixed. It will be later added in the next official release.
Hello again! I just realized something that might sound niche but might be actually be helpful in some situations: the ability to remap the retry prompt’s graphics on a per-level basis, either with a level table or a separate UberASM level code. Obviously the global option should still be there, but still, if one plans to use a sprite with a certain tile that’s already overwritten by the prompt’s graphics but they don’t want to remap that single tile just for that, they could instead remap the prompt’s graphics itself specifically for that level. If this is too complicated to implement, no problem, just a useful suggestion.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Originally posted by Anas
Hello again! I just realized something that might sound niche but might be actually be helpful in some situations: the ability to remap the retry prompt’s graphics on a per-level basis, either with a level table or a separate UberASM level code. Obviously the global option should still be there, but still, if one plans to use a sprite with a certain tile that’s already overwritten by the prompt’s graphics but they don’t want to remap that single tile just for that, they could instead remap the prompt’s graphics itself specifically for that level. If this is too complicated to implement, no problem, just a useful suggestion.

Yeah that would be way too much work, it sounds easier to just remap the specific sprites in the levels that need it, even if a bit annoying. But I'm adding a new option in the next version to kill score sprites on death, so their graphics can be used for the prompt and save on gfx space, inspired by  AmperSam's RHR baserom, so that may help you avoid remapping sprites and stuff.
Interesting! Will look forward to it. Nice idea with the score sprites!
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Is it just me or does changing the settings for '!no_exit_option' and '!no_prompt_box' no longer work after applying retry to the ROM for the first time with whatever the settings were beforehand? I just noticed. Also, how come when turning on the prompt box, a blank sprite tile is required? The whole prompt itself is black, thus leading to minor waste. Am I missing something?
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Originally posted by Anas
Is it just me or does changing the settings for '!no_exit_option' and '!no_prompt_box' no longer work after applying retry to the ROM for the first time with whatever the settings were beforehand? I just noticed.

Those settings are updated when loading the title screen, so maybe you're reloading a save state or something and skip that?

Originally posted by Anas
Also, how come when turning on the prompt box, a blank sprite tile is required? The whole prompt itself is black, thus leading to minor waste. Am I missing something?

It's not entirely black, it has two holes to make space for the prompt sprite tiles which otherwise would get covered (you can see that if you disable sprites in the emulator). The empty tile is used to cover the space between the cursor and the word, and for the other word to cover the space where the cursor should be.
Wait, those two settings reload when loading title screen? Ahhh, I was loading from a savestate directly to the overworld, so that must be it. Also, I just checked the prompt box on Snes9x, and it seems that the black tile masks all the sprite tiles for the prompt. Is that what you mean?
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Originally posted by Anas
Wait, those two settings reload when loading title screen? Ahhh, I was loading from a savestate directly to the overworld, so that must be it. Also, I just checked the prompt box on Snes9x, and it seems that the black tile masks all the sprite tiles for the prompt. Is that what you mean?

No, I mean that the prompt has empty spots to not cover the prompt tiles, so you need some black sprite tiles to cover a couple spots.
Ahh, I see now. I'm guessing it would be super complicated to get rid of the spaces for the blank tiles within the windowing itself, but that's OK! Was just curious why it's like that.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Originally posted by Kevin
Originally posted by PangaeaPanga
Is it possible to play the full death animation duration before reloading on a specific sublevel while using instant retry with no prompt + no death animation as the default setting? I want to use the Revival Block for a level while using this retry system (unless there is a better way to do this). Also understandable if it is too out of the way to address as it is a bit of a niche scenario.

Hey, it is not possible with just tinkering with the settings/tables, I might add a ram address or something to achieve that in the future, but for now you can try with a hacky solution that I tested and it seems to work:
  • Set the value for the "checkpoint_effect" table in "tables.asm" to $4x for the sublevels (so it plays the vanilla death animation), with x being the setting you want for the checkpoints in the sublevel
  • In "level_end_frame.asm", find the label for the sublevel you want and use this code for it:
    Code
    levelXXX:
        ; Skip if not dying
        lda $71 : cmp #$09 : bne .return
        
        ; Don't play death song and play death sfx (only once)
        lda !ram_is_dying : bne +
        stz $1DFB|!addr
        lda.b #!death_sfx : sta !death_sfx_addr
    +   
        ; If about to exit the level, reload the level
        ; without reloading the music (if it didn't change)
        lda $1496|!addr : cmp #$02 : bcs .return
        lda !ram_music_backup : sta $0DDA|!addr
        jsl in_level_main_dying_respawn
    .return:
        rts

    (with XXX your sublevel number of course). This takes care of the death music/sfx and reloads the level when needed.
    If you need this for more sublevels you can just do:
    Code
    levelYYY:
        jmp levelXXX

    (YYY the second sublevel, XXX the first) for all other sublevels, to avoid duplicating code.


Thank you so much! Also amazing work on this retry system, really appreciated (especially for Kaizo hacks).
Y'know what actually, about the main entrance checkpoint thingy, how can I modify the checkpoint option 2 (affects main/secondary/midway entrances) so that secondary entrances are not affected? I am assuming you are checking the three entrance types separately, so perhaps a check needs to be removed for the secondary entrances?
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Dunno if it's me, but I think I found an obscure bug with the bonus game. Basically, if you collect any dragon coins in the level and then proceed to the bonus game, the dragon coin count and display will carry over, which is very strange. I don't even have anything which changes item memory or dragon coin behavior at all. Only these score-related hex edits:

Code
org $00F37F
db $12 ; consecutive score from getting first dragon coin

org $00F381
db $16 ; ending consecutive score from getting fourth dragon coin

org $00F385
db $0E ; score from getting last dragon coin

org $00F35E : db $00 ; make dragon coins give zero regular coins


Now luckily, I can deal with it very easily by adding this simple code in the bonus game levels:

Code
init:
STZ $1420|!addr
STZ $1422|!addr
RTL


But it's so bizarre, I had to report this here! Perhaps something related to how retry clears dragon coins on death?
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

I'm having a little trouble getting this set up, mostly due to lack of knowledge on rom hacking.specifically this portion of the instruction txt:
" - Copy the "asm/retry_config" folder inside UberASM Tool's top folder (so it should be at the same level as "level", "gamemode", etc.). "

i'm not quite sure exactly what that means and i've tried a few things, but nothing has worked. when i run UberASM it says "Could not parse list file! Error: line 108 - file does not exist. "

any help would be greatly appreciated
Originally posted by slimesoup
I'm having a little trouble getting this set up, mostly due to lack of knowledge on rom hacking.specifically this portion of the instruction txt:
" - Copy the "asm/retry_config" folder inside UberASM Tool's top folder (so it should be at the same level as "level", "gamemode", etc.). "

i'm not quite sure exactly what that means and i've tried a few things, but nothing has worked. when i run UberASM it says "Could not parse list file! Error: line 108 - file does not exist. "

any help would be greatly appreciated


Basically, wherever 'UberASMTool.exe' is, you have to put that folder in the same place as that.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

I just tried inserting this on a ROM with the following things applied, and the game freezes on a black screen after the Nintendo Presents.
So there must be one or more things that are incompatible with this UberASM:


PatchUberASM