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

Tell if game uses wram or not?

Tell if game uses wram or not?
by on (#154447)
How can you tell if a game needs WRAM? Say how can I tell if I need a TSROM or a TLROM board?
Re: Tell if game uses wram or not?
by on (#154448)
If it's in NES 2.0 format, you can check the WRAM size fields in the header.

If it's in original iNES format, the easiest thing is to run it in a debugging emulator (Nintendulator; FCEUX for Windows) and set a watch on reads and writes to CPU $6000-$7FFF. If it never writes there, it doesn't use WRAM.
Re: Tell if game uses wram or not?
by on (#154449)
For commercial games, you can check Bootgod's database and look at the actual PCBs, instead of relying on ROMs and emulators.

If it's a homebrew, you'll have to proceed as tepples suggested, or ask the author directly.
Re: Tell if game uses wram or not?
by on (#154453)
It's highly unlikely your ROM is in NES 2 format at this point. :P Maybe in a few years the situation could change, though?

If you're looking for bootgod's database, here's a link: http://bootgod.dyndns.org:7777/

If you're looking for a guide to using an NES debugger, there's documentation for FCEUX's debugger here: http://www.fceux.com/web/help/fceux.html?Debugger.html
Re: Tell if game uses wram or not?
by on (#154459)
tepples wrote:
If it's in NES 2.0 format, you can check the WRAM size fields in the header.

If it's in original iNES format, the easiest thing is to run it in a debugging emulator (Nintendulator; FCEUX for Windows) and set a watch on reads and writes to CPU $6000-$7FFF. If it never writes there, it doesn't use WRAM.



That is beyond my knowledge. Lol. I have FCEUX and opened up the debug area, but yeah, no idea what I am doing.
Re: Tell if game uses wram or not?
by on (#154460)
Ok, I found the actual "RAM Watch", I assume that is what you are talking about? I set it to $6000-$7FFF for address, leave Data Type Signed? and Data Size 1? I noticed on Mario 3 that the number in the "value" field go crazy. I know that game uses the wram. So I tried it on Super Contra 7. That number stays at 2 for me. So I assume that does not use wram? Can you verify that by chance? Just want to make sure I am doing it correctly. Thanks for the help!
Re: Tell if game uses wram or not?
by on (#154461)
RAM watch is not really sufficient. It can only look at a few bytes. WRAM covers a wide range. The best tool for discovering this is breakpoints in the debugger.

1. Click the "Add" button in the breakpoints panel.
2. Put "6000" and "7FFF" in the address boxes.
3. Check "read" and "write".
4. Select "CPU mem".
5. Click OK.
6. Reset the game and begin playing.

If the game halts and goes to the debugger, you've hit your breakpoint, which means the game is trying to write to or read from the WRAM region. Usually this will happen very early, possibly even directly after reset.

If this never happens, the game was not using the WRAM area.
Re: Tell if game uses wram or not?
by on (#154463)
rainwarrior wrote:
RAM watch is not really sufficient. It can only look at a few bytes. WRAM covers a wide range. The best tool for discovering this is breakpoints in the debugger.

1. Click the "Add" button in the breakpoints panel.
2. Put "6000" and "7FFF" in the address boxes.
3. Check "read" and "write".
4. Select "CPU mem".
5. Click OK.
6. Reset the game and begin playing.

If the game halts and goes to the debugger, you've hit your breakpoint, which means the game is trying to write to or read from the WRAM region. Usually this will happen very early, possibly even directly after reset.

If this never happens, the game was not using the WRAM area.


Okie great. I tried on Mario 2 and Mario 3. It never went to the debugger screen, but it did lock the game up. On the contra 7 it did not.
Re: Tell if game uses wram or not?
by on (#154468)
I'd recommend keeping the debugger window open while you run the game. (If you have a small monitor, run the game at 1x zoom.) You can click "Run" at the top center of the debugger window to advance past each time the breakpoint is triggered. If WRAM is being written in a loop, such as if several bytes are being filled one after another, the progress of the loop can be inferred from the A, X, and Y register fields, but interpreting what's going on may need a bit of 6502 knowledge.

Some games might make a few stray writes, especially if they used WRAM during development and cut out reliance on it before production, but by mistake didn't completely cut out the code that set up WRAM. There are stray reads in Low G Man, for instance. To rule out a stray write, try this:

  1. Breakpoints are listed at the top right corner of the debugger window. Disable the watch on $6000-$7FFF by double-clicking it, which should cause its enabled indicator to disappear.
  2. In the top center of the debugger window, click Run to continue the game.
  3. During gameplay, reenable the watch on $6000-$7FFF by double-clicking it. If it stops again, the game probably actually uses WRAM.

You're correct that Super Mario Bros. 2 and Super Mario Bros. 3 rely on WRAM.
Re: Tell if game uses wram or not?
by on (#154503)
Tormenter wrote:
It never went to the debugger screen, but it did lock the game up.

If you close the debugger it will just pause. (The pause key will resume, too, but it's likely to hit the same breakpoint many times in a row if you don't turn it off in the debugger.)

tepples wrote:
Some games might make a few stray writes / stray reads...

Are stray read/writes a significant number of cases, or is Low G Man the only one you know of?

The other thing that can identify a game that requires WRAM is if it's battery backed. That information is found in byte 6 of the header, but it's probably really obvious if a game has a save system just by playing it.
Re: Tell if game uses wram or not?
by on (#154506)
rainwarrior wrote:
tepples wrote:
Some games might make a few stray writes / stray reads...

Are stray read/writes a significant number of cases, or is Low G Man the only one you know of?

The latter, but I was trying to cover all bases.
Re: Tell if game uses wram or not?
by on (#154509)
One more caveat: If the game uses a mapper that can map PRG-ROM at $6000..7FFF, such as FME-7 (I'm not aware of others), it may read from that area even though it has no WRAM. Example: Gimmick!