This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Using SRAM

Using SRAM
by on (#123846)
I'm working on something and I've ran into a bit of a problem... I need to use RAM $6000. Now, the problem is I'm getting several different results from different emulators so not sure which method I can rely on. Using mapper 0; i figure that emulators see that SRAM isn't currently with this mapper so it denys writes? I'm using it for general timers so I don't want a .sav file produced so the bit for SRAM is disabled in the iNES header.

Thanks.
Re: Using SRAM
by on (#123848)
Which emulators are you using? Do any of them claim to support the NES 2.0 header format?

Mapper 0 is a funny one for SRAM. Most games on that mapper didn't come with any extra memory, but the two that did (Family BASIC and Family BASIC v3) had only 2048 or 4096 bytes, not 8192 bytes.
Re: Using SRAM
by on (#123853)
Mainly FCEUXD SP for debugging and it works great. However with FCEUX it didn't work, then I got the current version and it did work. So far nothing works in nestopia, which if I'm not mistaken is the most accurate of my selection? What exactly to do you recommend here? I want accuracy but at the same time I'd rather it not be purely one emulator specific.
Re: Using SRAM
by on (#123864)
zkip wrote:
What exactly to do you recommend here? I want accuracy but at the same time I'd rather it not be purely one emulator specific.

If you want your code to work on all without setting the SRAM bit in the header, use a mapper such as MMC1.
Re: Using SRAM
by on (#123866)
Is MMC3 "funny" like mapper 0 is? I actually got it (MMC3) working with this, however, I still can't get it to work with Nestopia v1.40. This is actually a ROM hack (hence why I need the use the RAM there) and using MMC1 would complicate the process of distributing an IPS.

Also, back to mapper 0- 2048 or 4096 bytes could work here.. but from a quick look I can't really see anything different from my header in the Family Basic thing. Are they a special case hardcoded in the emulators or something?
Re: Using SRAM
by on (#123869)
In several cases, more than one game shares a mapper, and the games expect different behaviors. For example, the same mapper number represents Uchuusen: Cosmo Carrier and Holy Diver, but the nametable mirroring control differs between the two. So a lot of emulators use some sort of hash (CRC, MD5, SHA-1, etc.) to identify which board to emulate. The trouble with that is that anything other than the exact good dump of Holy Diver gets emulated with Uchuusen behavior, giving incorrect graphics when scrolling. If you want to make a ROM hack of Holy Diver or a homebrew game on the Holy Diver board, too bad.

The long-term solution is the NES 2.0 header, which lets the ROM specify how much RAM is present. It also offers a submapper field, which allows distinguishing behaviors that had been combined into one mapper number. But a lot of emulator authors don't want to catch up even to 2006, or they've moved on from NES emulation and abandoned their work. For that I can only recommend one thing: display a warning message.
Re: Using SRAM
by on (#123877)
PowerPak does not allow mapper 0 ROMs to have SRAM, last time I tried.
Re: Using SRAM
by on (#123895)
oRBIT2002 wrote:
PowerPak does not allow mapper 0 ROMs to have SRAM, last time I tried.

Figures, because PowerPak is 72-pin only, and the only mapper 0 ROMs with SRAM (Family BASIC and Family BASIC v3) are 60-pin only and came bundled with the 15-pin controller (which works only in 60-pin consoles) required to use this ROM.

How many bytes are free for a mapper hack to MMC1?
Re: Using SRAM
by on (#123908)
zkip wrote:
Is MMC3 "funny" like mapper 0 is? I actually got it (MMC3) working with this, however, I still can't get it to work with Nestopia v1.40. This is actually a ROM hack (hence why I need the use the RAM there) and using MMC1 would complicate the process of distributing an IPS.

WRAM should work fine with MMC3, even in homebrew ROMs. Why does MMC1 complicate IPS distribution?
Re: Using SRAM
by on (#123910)
Likewise, many MMC3 games using WRAM work fine in Nestopia. So back to square one, which brings me to this point:

This thread contains virtually no details other than "something doesn't work". There's no code given, no thorough write-up of what's being done/written (coded), what bytes are being changed in the header in question, yadda yadda. If all of that could be provided, it's very likely the extensive knowledge of everyone here could be tapped more resourcefully. This is troubleshooting 101, honestly.
Re: Using SRAM
by on (#123958)
One more thing about MMC3: for WRAM to work in Nestopia, you need to enable WRAM by writing to $A001. Unlike many other emulators, Nestopia implements those bits (and defaults to disabled).