Banner
Views: 738,241,527
Time:
7 users online: BabaYegha, dogemaster500, Gamma V, Kusrry, o Shiny Ninetales, somekaizoguy678, westslasher2 - Guests: 28 - Bots: 84Users: 38,853 (1,927 active)
Latest: Sillymel
Tip: Press F2 on the level editor to see sub-screen boundaries. This will help you avoid glitching Dragon Coins by putting them on the sub-screen boundaries.Not logged in.
Details for SRAM and BW-RAM Plus v1.3
SMW Patches - SRAM and BW-RAM Plus v1.3
File Name: SRAM and BW-RAM Plus v1.3
Added:
Version History: View
Authors: LX5, MarioE, Tattletale
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: 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.


Update: Fixed for compatibility with Lunar Magic v2.53.

changelog:

v1.3
--------------------
LX5's bwram_plus:
Fixed a bug init would happen after intro level's load, leading to weird issues with initialized RAMs. Example: if you remove the code that takes care of initializing manually the life counter and try to do that with bwram's default values, you will see your life counter suddenly jump from 1 to the right value. And many other issues of the same variation.
I also brought the load routine to the same hijack, so now the game chooses whether to init or load, instead of trying to do both. In v1.2, I had added a lock so that wouldn't happen, I removed it in this version. Both routines are running at the same hijack sram_plus uses now.

v1.2
--------------------
MarioE's sram_plus:
Fixed a bug it would restore a piece of code from the original game on top of a LM hijack (message sprite fix (shift+f8)) that would send you to the wrong OW submap.

v1.1
--------------------
LX5's bwram_plus:
Fixed a bug the patch would load a save even if there was no save to be loaded (values would be loaded with FF or whatever else was in the tables).
Fixed a bug the patch would write garbage to address+1, according to the tables, so dl $4013C7 : dw $0001 would write to 4013C7 and 4013C8.
Tags: bw-ram, dma, sa-1, save, sram
Download: Download - 93.28 KiB
232 downloads
Graeak
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.
Posted by: Graeak - | Link
Tattletale
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.
Code
!dp = $0000
!addr = $0000
!sa1 = 0
!gsu = 0
!bank = $800000

if read1($00FFD6) == $15
	sfxrom
	!dp = $6000
	!addr = !dp
	!gsu = 1
	!bank = $000000
elseif read1($00FFD5) == $23
	sa1rom
	!dp = $3000
	!addr = $6000
	!sa1 = 1
	!bank = $000000
endif

org $009E1C|!bank
	STZ.w $13C9|!addr
	REP #$20
	BRA +
org $009E4B|!bank
+


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:

Code
!dp = $0000
!addr = $0000
!sa1 = 0
!gsu = 0
!bank = $800000

if read1($00FFD6) == $15
	sfxrom
	!dp = $6000
	!addr = !dp
	!gsu = 1
	!bank = $000000
elseif read1($00FFD5) == $23
	sa1rom
	!dp = $3000
	!addr = $6000
	!sa1 = 1
	!bank = $000000
endif

org $009E1C|!bank
	STZ.w $13C9|!addr
	BRA +
org $009E54|!bank
+


Also remember to initialize the values properly (mario score, luigi score, mario bonus star and luigi bonus star).
Posted by: Tattletale - | Link

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 29

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented