SMB - Write to $6000 as RAM?

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

SMB - Write to $6000 as RAM?

Post by mikaelmoizt »

Hello again! My question is about Super Mario Bros [JU] but any version might work just as well.

This might be a stupid question, but I can´t seem to find any good answer anywhere. :oops:

So, I discovered that memory located @ $6000 acts like (somewhat static) RAM when writing anything there.
I hex edited a small sub routine @ $6000-$6004, and it works just fine to jump there and execute code.

Am I missing something here? Is this possible in emulator only? Or did I just magically find tons of free RAM to use for hacking purposes?
I´ve got %01100011 problems but the BITs aint one.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: SMB - Write to $6000 as RAM?

Post by lidnariq »

A lot of emulators pretend that every NES game ever had RAM made available from $6000-$7FFF.

This is not particularly true; only 268 of the 1382 games that NesCartDB knows of provided RAM (battery-backed or otherwise) there.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: SMB - Write to $6000 as RAM?

Post by tokumaru »

The old iNES header format specified whether RAM at $6000-$7FFF was battery-backed, but it didn't specify whether it was present, so many emulators map RAM there just in case. IIRC, with iNES 2.0 you can specify how much WRAM a game uses, and 0 bytes is an option. In an actual cart, you obviously need a RAM chip and some logic to map it to $6000-$7FFF. Putting your SMB1 hack that uses RAM at $6000-$7FFF into an actual SMB1 NROM cart will not work unless you mod the cart with the extra RAM chip and the logic chips to map it.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: SMB - Write to $6000 as RAM?

Post by tepples »

Vs. Super Mario Bros. needs RAM there, possibly for copying extra level data out of CHR ROM. (You'll need to patch it with 2C03 compatibility and DIP switch hacks before it'll run correctly on an NES though.) So does Family BASIC, which is the canonical example of an NROM + RAM board. You'll need a 6264 and a 74HC20, as described here.
mikaelmoizt
Posts: 120
Joined: Sat Apr 12, 2014 12:11 pm
Location: Gothenburg, Sweden

Re: SMB - Write to $6000 as RAM?

Post by mikaelmoizt »

Oh. So this works much like I expected it to. Thank you all for your replies! It clarified a lot to me.

I might consider using the memory for hacks anyway if I ever need to expand upon the few free bytes of RAM from the original.
I´ve got %01100011 problems but the BITs aint one.
Post Reply