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

Using more than 2 KB RAM? Huh?!?!

Using more than 2 KB RAM? Huh?!?!
by on (#55180)
I have been working on reverse engineering the ROM of the NES game, Gauntlet II (I own a copy of 1 AND 2 btw), and as I was vigorously trying to manipulate level data, I noticed two very curious things that made me thing very hard. The game stores at least one whole copy of the map it is currently using in SRAM (~ $6000 - $63FF), and the rom data for levels is transferred into PPU memory, which starts at $1800 and goes off into wherever it goes (too lazy to check). So, this makes we want to ask: Is this pointing to the fact that SRAM can be used in some sort as RAM? Also, how in the world can parts of PPU memory be used as RAM / ROM space as well? I mean, I have analyzed disassemblies, and I have determined that PPU memory is used like this by strategic writes to 2006 and reads from 2007, but WHY use PPU memory? Is this because the part of level data in ROM is located in a 24 bit range? This is intriguing me, and I am curious if anyone has noticed this in other games, and if it is common. I also would like if anyone can answer my questions.

Final note: this game using the MMC3 mapper. Not sure if that has anything to do with the RAM usage.

Thanks for reading!
Re: Using more than 2 KB RAM? Huh?!?!
by on (#55181)
NesHackR wrote:
Is this pointing to the fact that SRAM can be used in some sort as RAM?

SRAM is like regular RAM, games can use for whatever they want. It just happens to have a battery that will prevent its contents from being erased when not powered by the console, so games will put in it wherever they want to save, but this doesn't mean they'll use it exclusively for saving.

Quote:
Also, how in the world can parts of PPU memory be used as RAM / ROM space as well? I mean, I have analyzed disassemblies, and I have determined that PPU memory is used like this by strategic writes to 2006 and reads from 2007, but WHY use PPU memory?

Back in the 80's memory was very expensive, so if the graphics chip still had room it was cheaper to use that space for extra data than to switch to a larger program chip.

Quote:
This is intriguing me, and I am curious if anyone has noticed this in other games, and if it is common.

It's somewhat common... A very famous game does it: Super Mario Bros. has some garbage tiles at the end of the pattern tables, but that's really the title screen layout. It was probably placed there because there were unused tiles and no more PRG-ROM space for that data. Many CNROM games appear to have used this trick too.

Quote:
this game using the MMC3 mapper. Not sure if that has anything to do with the RAM usage.

I'll admit that I had never seen the "data in CHR-ROM" trick used in a MMC3 game before, but I'm not surprised. About the RAM, like I said, SRAM isn't just for saving, it can be (and almost always, if not always, is) used as extra RAM.

by on (#55186)
Not all games with the 8K of RAM inside the cartridge have battery backup. In fact, most don't.

MC Kids stores a few compressed levels in CHR-ROM.
Re: Using more than 2 KB RAM? Huh?!?!
by on (#55187)
tokumaru wrote:

Quote:
Also, how in the world can parts of PPU memory be used as RAM / ROM space as well? I mean, I have analyzed disassemblies, and I have determined that PPU memory is used like this by strategic writes to 2006 and reads from 2007, but WHY use PPU memory?

Back in the 80's memory was very expensive, so if the graphics chip still had room it was cheaper to use that space for extra data than to switch to a larger program chip.


Sorry for my silly question, but what is a 'room' on a chip?
Re: Using more than 2 KB RAM? Huh?!?!
by on (#55188)
Rid wrote:
Sorry for my silly question, but what is a 'room' on a chip?


Room is free space, or unused bytes. If there were unused tiles, the bytes that would normally be dedicated to them could be used for something else.

by on (#55190)
- It's the lack of a proper word, as you can say "space" with no reference to 3D realm. ^_^;;

by on (#55191)
Zepper wrote:
- It's the lack of a proper word, as you can say "space" with no reference to 3D realm. ^_^;;

"Space."

"The final frontier. These are the voyages of the starship Enterprise."

So that's a 3D realm too, no matter how much televised space opera tries to make it look 2D.

by on (#55193)
I can see the Star Ocean...