This patch rewrites the game's save file handling by using DMA for saving and loading, leading to the most efficient handling. As a bonus, it also frees up the 141 bytes of RAM at $7E:1F49.
NOTE: You must apply this patch after you use Lunar Magic to modify any of the level's level flags on the overworld -- LM doesn't take into account the fact that $1F49 is never being used anymore.
Read the readme for information on including an address to be saved to SRAM/BWRAM.
This version now allows addresses to have default values.
The BWRAM is included because due to the nature of the sa-1 rom, SRAM doesn't exist, so use that instead of SRAM on a sa-1 rom, not SRAM.
SRAM Plus Tested with:
- Asar 1.91
- Lunar Magic 3.11 and 3.50 (for the modified LM hijack #2)
- Mesen 2
I removed the @ from the sram_table.asm file to avoid issues with Asar 2.0 in the future.
BWRAM Plus Tested with:
- Asar 1.91
- SA-1 v1.40
- Lunar Magic 3.50
- Mesen 2
---
Both fixes are satisfactory; in the former, by confirming the RTL placed is consistent in both spots, and in the latter, by verifying the initial level flags are set correctly by the new call to the routine at $009F06 -- even if, as the changelog implies, is a bit redundant for now. (for clarification: this was done in advance of another patch which is coming).
Two very minor things I think would be cool to see in a future version:
1.- The routine call at $009F06 is only called once in the vanilla game, at $009CB5. By some really specific optimization (the branch at $009CC8 is useless) and slightly remapping the jumps to $009CBE, you could save some bytes and cycles by changing the JSR to a JSL, therefore avoiding a JSL<->RTS bridge.
2.- Altough the description and readme makes this abundantly clear, SRAM Plus is for non-SA1 and BWRAM Plus for SA-1 ROMs, and I think an assertion to verify this could be added. I decided against adding it, for now, mostly because again, if you don't read the readme and patch the wrong thing you should have paid more attention, but it's something to keep in mind for the future.
tried it with the individual dragon coin save and RHR baserom... followed instructions of both and used SA-1... game hangs on a black screen after nintendo presents...
i have never ever have gotten this to work honestly.
Found an issue. Managed to apply the saving of lives etc. When running out of lives, however, I can move Mario around while he has a halo on his head and 0 lives. Felt like it was worth reporting.
I'm in the same situation, although you probably applied the patch created by Tattletale.
I will try to find a solution.
If you're a beginner like me, you're having trouble using this patch. Because of this I will leave the code of the RAM addresses, which I used in my hack!
7. (SRAM Plus only)
If you apply SRAM Plus for the first time to a ROM where this version of retry is already installed, the load/save functions will not work properly.
(e.g. "Erase Data" menu in the title screen will crash the game.)
To fix it, apply the retry patch once again. After doing this, applying patches in any order will be okay.
Whenever I apply this, my game crashes when I erase a save file in game. Anyone knows what the problem could be? My table is still empty.
I'm having this same exact issue. Using this with a death counter patch, and the counter works perfectly except it crashes when i go to erase a save file.
This patch has an issue with the lives count, it ends the game prematurely with 1 life left resulting in a halo mario on the overworld. As long as you keep at least 2 lives, it appears to work ok.
Final comment here: This patch is just very broken, corrupting stuff on various places. I recommend against using it, even if you finally manage to find out how it works.
Found another issue: When beating the Donut Secret Ghost House, the black save prompt started glitching out heavily. Merely visual, no gameplay affected. Went away once I pressed save and continue.
Found an issue. Managed to apply the saving of lives etc. When running out of lives, however, I can move Mario around while he has a halo on his head and 0 lives. Felt like it was worth reporting.
ASM patches aren't rocket science, you literally just open Asar, insert the name of the ROM and the name of the patch. They can also be easily editable by advanced users by just opening them in a text editor like Notepad++ or VS Code or Sublime Text. IPS patches are opaque and require inserting and editing in like, hex editors. It's cumbersome for advanced users and restrains the info within said patches from being shared. Just because it's easy to use doesn't always mean it's good.
No, but it's not the ease of use that makes it bad. Besides, do I prefer editing specific data in a hex editor over having some weird table in which you have to write god knows what (no readme)? Yeah, any day. Hex editing is pretty universal. This requires certain instructions which aren't given.
But in the end, I see the use for asm files in general. Thanks for reminding me
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
But not enough knowlegde to begin to understand why that's a terrible practice.
That's a completely subjective matter. I already named ease of use as a pro regarding IPS patches. It's no wonder they're widespread. Ease of use is by no means terrible.
They're terrible because they're usable only on specific ROMs (headered/unheadered, Japanese/US etc), they're static compiled data, so you can't, for example choose which freeram the patch you're inserting uses or the patch can't check if other patches have been inserted into the ROM that would have incompatibilities with the base version, IPS patches can't search for freespace in the ROM unlike asar patches and the user can't even change the freespace area used, which makes it even worse than xkas patches (and has a possibility of overwriting data already used for something else).
Also IPS patches obfuscate code and can't be easily modified unless you grab a hex editor for finding the differences after patching and a disassembler to recreate the patch.
And finally, IPS may be "easier to apply", but that's just comparing using a program which opens 2 dialogs for selecting files and 1 for saving versus a program where you have to type names of 2 files or drag the files into it and press enter.
Yeah, in the end it's very easy to apply most ASM patches, but then there's this one (which fair enough, seems to be an exception). No readme, no indication on what to do or what this patch is useful for in-game. This is where an ips/BPS patch saying "save Dragon Coins/Lives/Power ups would come in real handy for people who want just that. Now you got these seperate puzzle pieces that you need to stitch together in order to make proper use of SRAM plus.
But yes, by now it's clear my issue is more with this patch, rather than the .asm format in general.
ASM patches aren't rocket science, you literally just open Asar, insert the name of the ROM and the name of the patch. They can also be easily editable by advanced users by just opening them in a text editor like Notepad++ or VS Code or Sublime Text. IPS patches are opaque and require inserting and editing in like, hex editors. It's cumbersome for advanced users and restrains the info within said patches from being shared. Just because it's easy to use doesn't always mean it's good.
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
But not enough knowlegde to begin to understand why that's a terrible practice.
That's a completely subjective matter. I already named ease of use as a pro regarding IPS patches. It's no wonder they're widespread. Ease of use is by no means terrible.
They're terrible because they're usable only on specific ROMs (headered/unheadered, Japanese/US etc), they're static compiled data, so you can't, for example choose which freeram the patch you're inserting uses or the patch can't check if other patches have been inserted into the ROM that would have incompatibilities with the base version, IPS patches can't search for freespace in the ROM unlike asar patches and the user can't even change the freespace area used, which makes it even worse than xkas patches (and has a possibility of overwriting data already used for something else).
Also IPS patches obfuscate code and can't be easily modified unless you grab a hex editor for finding the differences after patching and a disassembler to recreate the patch.
And finally, IPS may be "easier to apply", but that's just comparing using a program which opens 2 dialogs for selecting files and 1 for saving versus a program where you have to type names of 2 files or drag the files into it and press enter.
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
But not enough knowlegde to begin to understand why that's a terrible practice.
That's a completely subjective matter. I already named ease of use as a pro regarding IPS patches. It's no wonder they're widespread. Ease of use is by no means terrible.
My goodness! Every single game uses simple IPS/BPS patches for stuff like this, but for some reason, the game with the biggest hacking community in the world needs cumbersome .asm patches, which are hard for newcomers to decipher and oftentimes (given the comments on many of these patch download pages) riddled with issues.
Why do people need to get through this list of issues before they can save their lives/Dragon Coins with the game? Super Mario Bros. 3 has a hack that incorporates SMB1, SMB2, SMB2US and full save features to all, with a single .ips file.
I think that maybe you should not comment on matters that you have little comprehension of my friend.
EDIT: The NES which is the console that ran the SMB1, SMB2, SMB2US and SMB3 cartridges, are EXTREMELY different than its successor the SNES and the have completely different hardware/software capability's and as newer systems go the SNES is considerably more complex than the NES both in its architecture and engineering.
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
Originally posted by description of SRAM and BW-Ram Plus v1.3
NOTE: You must apply this patch after you use Lunar Magic to modify any of the level's level flags on the overworld -- LM doesn't take into account the fact that $1F49 is never being used anymore.
So I assemble the patch again after I modify any level flags? Or after I assemble the patch I should not modify level flags anymore?
My goodness! Every single game uses simple IPS/BPS patches for stuff like this, but for some reason, the game with the biggest hacking community in the world needs cumbersome .asm patches, which are hard for newcomers to decipher and oftentimes (given the comments on many of these patch download pages) riddled with issues.
Why do people need to get through this list of issues before they can save their lives/Dragon Coins with the game? Super Mario Bros. 3 has a hack that incorporates SMB1, SMB2, SMB2US and full save features to all, with a single .ips file.
I think that maybe you should not comment on matters that you have little comprehension of my friend.
EDIT: The NES which is the console that ran the SMB1, SMB2, SMB2US and SMB3 cartridges, are EXTREMELY different than its successor the SNES and the have completely different hardware/software capability's and as newer systems go the SNES is considerably more complex than the NES both in its architecture and engineering.
My goodness! Every single game uses simple IPS/BPS patches for stuff like this, but for some reason, the game with the biggest hacking community in the world needs cumbersome .asm patches, which are hard for newcomers to decipher and oftentimes (given the comments on many of these patch download pages) riddled with issues.
Why do people need to get through this list of issues before they can save their lives/Dragon Coins with the game? Super Mario Bros. 3 has a hack that incorporates SMB1, SMB2, SMB2US and full save features to all, with a single .ips file.
If you're a beginner like me, you're having trouble using this patch. Because of this I will leave the code of the RAM addresses, which I used in my hack!
Code
sram_table: dl $7E1EA2 : dw $008D ;Default Code
dl $7E0019 : dw $0001 ;Mario's Powerup
dl $7E0DB9 : dw $0001 ;Luigi's Powerup
dl $7E0DC2 : dw $0001 ;Mario's Item Box
dl $7E0DBD : dw $0001 ;Luigi's Item Box
dl $7E0DBE : dw $0001 ;Mario's Lives
dl $7E0DB5 : dw $0001 ;Luigi's Lives
dl $7E13C7 : dw $0001 ;Mario's Yoshi Color
dl $7E0DBB : dw $0001 ;Luigi's Yoshi Color
dl $7E0DBF : dw $0001 ;Mario's Coins
dl $7E0DB7 : dw $0001 ;Luigi's Coins
dl $7E0F34 : dw $0003 ;Mario's Score
dl $7E0F37 : dw $0003 ;Luigi's Score
dl $7E0F48 : dw $0001 ;Mario's Bonus
dl $7E0F49 : dw $0001 ;Luigi's Bonus
dl $7E0DC1 : dw $0001 ;Yoshi Overworld
dl $7E1F2F : dw $000C ;Yoshi Coin Collected
.end
sram_defaults: db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00
To use, add the code in the sram_table.asm file, in the corresponding location. This code has multiple RAM addresses, while using the code your game will be able to save powerup, item box, yoshi, yoshi coin, coin, score, and bonus score. If you want to remove some code, just delete the line of code and the number of bytes corresponding to the deleted code.
Remember that for the patch to work you need to apply the patch posted by Tattletale and that the default code line should never be deleted.
For those wanting to save powerups, coins, lives, yoshi and stuff like that:
First things first, those values are getting saved and loaded properly, issue is, the game hard-resets these values after load save - happens at $009E1C. I didn't add a patch to ignore that inside this pack because it's not in this pack's responsibility to do that.
Here's a patch that ignores the hard-reset:
Made by Ladida.
Issue is though, when you do that, the game also lets you bring the showoff level yoshi to the intro level and then to the OW. So make sure to initialize and save this RAM 7E0DC1, like this:
for normal ROMs:
Code
sram_table:
dl $7E0DC1 : dw $0001
sram_defaults:
db $00
for sa-1:
Code
bw_ram_table:
dl $400DC1 : dw $0001
bw_ram_defaults:
db $00
Also make sure to initialize / save whatever else you are using.
EDIT 2019/01/13:
If you also want to save stars and score, change that patch to:
sooo ive read the coments and am a bit confused, i havent rly edited much of the overworld, will the mario is now stuck on the map glitch happen if i have saved the overwolrd before the patch but then decide to add something new so i edit the overworld then save? or will it just happen if the overworld has not been edited before the patch
i want to know if i have to make the enitire overworld map before the patch or if i can just edit something now aply the patch and then later edit the overworld some more
does this patch have the potential for incompatibilities?
A couple patches, specifically these which mess with the saving routine or use specific parts of freespace in bank 0 are this (e.g. no overworld or one player, one savefile).
Quoting myself from a previous version of the patch.
Quote
Just pointing out some really useful info.
SRAM Plus, as mentioned in the description, frees $1F49 which is STILL used by LM, that also means you should reapply this patch AFTER you modify and save your overworld because your ROM will NOT be listening the initial level flags and that will cause you problems.
BW-RAM plus does NOT have this problem because it never touches $1F49.
Found a "bug". The game runs the init (clear) routine during the intro screen, so if you've got the level set to 00 (no intro), the values don't get initialized.
Edit: Likewise, if you change the intro level value, be sure to also change the CMP value in the clear routine.
SRAM Plus, as mentioned in the description, frees $1F49 which is STILL used by LM, that also means you should reapply this patch AFTER you modify and save your overworld because your ROM will NOT be listening the initial level flags and that will cause you problems.
BW-RAM plus does NOT have this problem because it never touches $1F49.
This zip file, contain two versions of the SRAM patch, one for the SA-1, which moves data to BW-RAM as intended and the original that will do as intended as well.
Comments (40)
Tested with:
- Asar 1.91
- Lunar Magic 3.11 and 3.50 (for the modified LM hijack #2)
- Mesen 2
I removed the @ from the sram_table.asm file to avoid issues with Asar 2.0 in the future.
BWRAM Plus
Tested with:
- Asar 1.91
- SA-1 v1.40
- Lunar Magic 3.50
- Mesen 2
---
Both fixes are satisfactory; in the former, by confirming the RTL placed is consistent in both spots, and in the latter, by verifying the initial level flags are set correctly by the new call to the routine at $009F06 -- even if, as the changelog implies, is a bit redundant for now. (for clarification: this was done in advance of another patch which is coming).
Two very minor things I think would be cool to see in a future version:
1.- The routine call at $009F06 is only called once in the vanilla game, at $009CB5. By some really specific optimization (the branch at $009CC8 is useless) and slightly remapping the jumps to $009CBE, you could save some bytes and cycles by changing the JSR to a JSL, therefore avoiding a JSL<->RTS bridge.
2.- Altough the description and readme makes this abundantly clear, SRAM Plus is for non-SA1 and BWRAM Plus for SA-1 ROMs, and I think an assertion to verify this could be added. I decided against adding it, for now, mostly because again, if you don't read the readme and patch the wrong thing you should have paid more attention, but it's something to keep in mind for the future.
i have never ever have gotten this to work honestly.
I'm in the same situation, although you probably applied the patch created by Tattletale.
I will try to find a solution.
For bwram, change it like this.
If you apply SRAM Plus for the first time to a ROM where this version of retry is already installed, the load/save functions will not work properly.
(e.g. "Erase Data" menu in the title screen will crash the game.)
To fix it, apply the retry patch once again. After doing this, applying patches in any order will be okay.
No, but it's not the ease of use that makes it bad. Besides, do I prefer editing specific data in a hex editor over having some weird table in which you have to write god knows what (no readme)? Yeah, any day. Hex editing is pretty universal. This requires certain instructions which aren't given.
But in the end, I see the use for asm files in general. Thanks for reminding me
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
But not enough knowlegde to begin to understand why that's a terrible practice.
That's a completely subjective matter. I already named ease of use as a pro regarding IPS patches. It's no wonder they're widespread. Ease of use is by no means terrible.
They're terrible because they're usable only on specific ROMs (headered/unheadered, Japanese/US etc), they're static compiled data, so you can't, for example choose which freeram the patch you're inserting uses or the patch can't check if other patches have been inserted into the ROM that would have incompatibilities with the base version, IPS patches can't search for freespace in the ROM unlike asar patches and the user can't even change the freespace area used, which makes it even worse than xkas patches (and has a possibility of overwriting data already used for something else).
Also IPS patches obfuscate code and can't be easily modified unless you grab a hex editor for finding the differences after patching and a disassembler to recreate the patch.
And finally, IPS may be "easier to apply", but that's just comparing using a program which opens 2 dialogs for selecting files and 1 for saving versus a program where you have to type names of 2 files or drag the files into it and press enter.
Yeah, in the end it's very easy to apply most ASM patches, but then there's this one (which fair enough, seems to be an exception). No readme, no indication on what to do or what this patch is useful for in-game. This is where an ips/BPS patch saying "save Dragon Coins/Lives/Power ups would come in real handy for people who want just that. Now you got these seperate puzzle pieces that you need to stitch together in order to make proper use of SRAM plus.
But yes, by now it's clear my issue is more with this patch, rather than the .asm format in general.
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
But not enough knowlegde to begin to understand why that's a terrible practice.
That's a completely subjective matter. I already named ease of use as a pro regarding IPS patches. It's no wonder they're widespread. Ease of use is by no means terrible.
They're terrible because they're usable only on specific ROMs (headered/unheadered, Japanese/US etc), they're static compiled data, so you can't, for example choose which freeram the patch you're inserting uses or the patch can't check if other patches have been inserted into the ROM that would have incompatibilities with the base version, IPS patches can't search for freespace in the ROM unlike asar patches and the user can't even change the freespace area used, which makes it even worse than xkas patches (and has a possibility of overwriting data already used for something else).
Also IPS patches obfuscate code and can't be easily modified unless you grab a hex editor for finding the differences after patching and a disassembler to recreate the patch.
And finally, IPS may be "easier to apply", but that's just comparing using a program which opens 2 dialogs for selecting files and 1 for saving versus a program where you have to type names of 2 files or drag the files into it and press enter.
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
But not enough knowlegde to begin to understand why that's a terrible practice.
That's a completely subjective matter. I already named ease of use as a pro regarding IPS patches. It's no wonder they're widespread. Ease of use is by no means terrible.
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
But not enough knowlegde to begin to understand why that's a terrible practice.
Why do people need to get through this list of issues before they can save their lives/Dragon Coins with the game? Super Mario Bros. 3 has a hack that incorporates SMB1, SMB2, SMB2US and full save features to all, with a single .ips file.
I think that maybe you should not comment on matters that you have little comprehension of my friend.
EDIT: The NES which is the console that ran the SMB1, SMB2, SMB2US and SMB3 cartridges, are EXTREMELY different than its successor the SNES and the have completely different hardware/software capability's and as newer systems go the SNES is considerably more complex than the NES both in its architecture and engineering.
Enough comprehension to understand edits to a ROM can be compiled into an IPS patch.
So I assemble the patch again after I modify any level flags? Or after I assemble the patch I should not modify level flags anymore?
Why do people need to get through this list of issues before they can save their lives/Dragon Coins with the game? Super Mario Bros. 3 has a hack that incorporates SMB1, SMB2, SMB2US and full save features to all, with a single .ips file.
I think that maybe you should not comment on matters that you have little comprehension of my friend.
EDIT: The NES which is the console that ran the SMB1, SMB2, SMB2US and SMB3 cartridges, are EXTREMELY different than its successor the SNES and the have completely different hardware/software capability's and as newer systems go the SNES is considerably more complex than the NES both in its architecture and engineering.
Why do people need to get through this list of issues before they can save their lives/Dragon Coins with the game? Super Mario Bros. 3 has a hack that incorporates SMB1, SMB2, SMB2US and full save features to all, with a single .ips file.
To use, add the code in the sram_table.asm file, in the corresponding location. This code has multiple RAM addresses, while using the code your game will be able to save powerup, item box, yoshi, yoshi coin, coin, score, and bonus score. If you want to remove some code, just delete the line of code and the number of bytes corresponding to the deleted code.
Remember that for the patch to work you need to apply the patch posted by Tattletale and that the default code line should never be deleted.
First things first, those values are getting saved and loaded properly, issue is, the game hard-resets these values after load save - happens at $009E1C. I didn't add a patch to ignore that inside this pack because it's not in this pack's responsibility to do that.
Here's a patch that ignores the hard-reset:
Made by Ladida.
Issue is though, when you do that, the game also lets you bring the showoff level yoshi to the intro level and then to the OW. So make sure to initialize and save this RAM 7E0DC1, like this:
for normal ROMs:
for sa-1:
Also make sure to initialize / save whatever else you are using.
EDIT 2019/01/13:
If you also want to save stars and score, change that patch to:
Also remember to initialize the values properly (mario score, luigi score, mario bonus star and luigi bonus star).
i want to know if i have to make the enitire overworld map before the patch or if i can just edit something now aply the patch and then later edit the overworld some more
Edited the overworld, now im stuck.
Will disable the player from moving on the map.
A couple patches, specifically these which mess with the saving routine or use specific parts of freespace in bank 0 are this (e.g. no overworld or one player, one savefile).
SRAM Plus, as mentioned in the description, frees $1F49 which is STILL used by LM, that also means you should reapply this patch AFTER you modify and save your overworld because your ROM will NOT be listening the initial level flags and that will cause you problems.
BW-RAM plus does NOT have this problem because it never touches $1F49.
Edit: Likewise, if you change the intro level value, be sure to also change the CMP value in the clear routine.
If you are using a previous version, please redownload.
SRAM Plus, as mentioned in the description, frees $1F49 which is STILL used by LM, that also means you should reapply this patch AFTER you modify and save your overworld because your ROM will NOT be listening the initial level flags and that will cause you problems.
BW-RAM plus does NOT have this problem because it never touches $1F49.