Using the NES's PPU RAM as CHR RAM?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
Dwedit
Posts: 4309
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Using the NES's PPU RAM as CHR RAM?

Post by Dwedit » Sun May 10, 2009 4:02 am

Is it theoretically possible to make a cartridge with a mapper that would use 1K of the NES's PPU RAM as CHR RAM, and have the other 1K as a single screen mirrored nametable?
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Sun May 10, 2009 7:43 am

Yep, connect: VRAM_CE to GND and VRAM_A10 to PPU_A13.

User avatar
Dwedit
Posts: 4309
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Sun May 10, 2009 6:16 pm

Great, assign it a mapper number and let the competitions begin :)
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

tepples
Posts: 21982
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Sun May 10, 2009 6:34 pm

How would the PRG switching work? Or are you talking 32 KiB max PRG?

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Sun May 10, 2009 6:58 pm

What's wrong with ANROM (as long as you don't use more than 1KiB of CHR-RAM or switch name tables)?

tepples
Posts: 21982
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Sun May 10, 2009 7:05 pm

A mapper that grounds VRAM_CE mirrors the 64 tiles eight times in the pattern tables. A*ROM doesn't.

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Sun May 10, 2009 7:10 pm

But that doesn't mean you can't make a "PRG-only board" compatible game. Can't people be trusted to not use more than 64 tiles? It should be easy to verify.

tepples
Posts: 21982
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Sun May 10, 2009 7:46 pm

kyuusaku wrote:Can't people be trusted to not use more than 64 tiles?
Until your code depends on tile $27 showing the same as tile $67.

User avatar
tokumaru
Posts: 11703
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru » Sun May 10, 2009 7:52 pm

tepples wrote:Until your code depends on tile $27 showing the same as tile $67.
Then do the same as we already do to represent games that have less than 16KB of PRG-ROM in iNES form: replicate the data. Use the same 1KB of CHR 8 times. <-- THIS DOESN'T MAKE SENSE, AS WE'RE TALKING ABOUT RAM, NOT ROM. SO YEAH, WE MIGHT NEED A NEW MAPPER NUMBER...
Last edited by tokumaru on Sun May 10, 2009 8:50 pm, edited 1 time in total.

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Sun May 10, 2009 7:59 pm

Except of course when your game animates tiles, and expects the mirrors to be updated as well each frame for whatever reason :roll:

User avatar
tokumaru
Posts: 11703
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru » Sun May 10, 2009 8:49 pm

Don't mind my stupidity. I forgot we were talking about RAM, not ROM. I'm sleepy...

User avatar
kyuusaku
Posts: 1665
Joined: Mon Sep 27, 2004 2:13 pm

Post by kyuusaku » Sun May 10, 2009 8:53 pm

Don't mind my comment, it was sarcasm ;)

lidnariq
Posts: 9411
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Post by lidnariq » Mon May 11, 2009 4:07 pm

Why only 1 screen mirroring? Why not map the 2kB over the PPU's entire address space so that you can trade off CHR-RAM and nametable RAM ?

P.S. There's a little ~game called Escape From Pong which is a 1kB PRG-ROM and CHR-RAM -- it currently pretends to be a 16kB NROM game with CHR-RAM, but this is technically invalid.

tepples
Posts: 21982
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Mon May 11, 2009 7:15 pm

lidnariq wrote:Why only 1 screen mirroring? Why not map the 2kB over the PPU's entire address space so that you can trade off CHR-RAM and nametable RAM ?
Because you can't tell the NES to just skip parts of a nametable without using heavy sprite 0 or palette wizardry.
P.S. There's a little ~game called Escape From Pong which is a 1kB PRG-ROM and CHR-RAM -- it currently pretends to be a 16kB NROM game with CHR-RAM, but this is technically invalid.
It's not invalid if you treat mapper 0 with CHR RAM as an undersize BNROM, just like ordinary NROM is an undersize CNROM, and CNROM is an undersize GNROM.

User avatar
tokumaru
Posts: 11703
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru » Tue May 12, 2009 10:09 am

tepples wrote:
lidnariq wrote:Why only 1 screen mirroring? Why not map the 2kB over the PPU's entire address space so that you can trade off CHR-RAM and nametable RAM ?
Because you can't tell the NES to just skip parts of a nametable without using heavy sprite 0 or palette wizardry.
I imagine that scrolling would be a big pain.
It's not invalid if you treat mapper 0 with CHR RAM as an undersize BNROM, just like ordinary NROM is an undersize CNROM, and CNROM is an undersize GNROM.
I always thought that it'd make more sense to treat mapper 0 with CHR-RAM as an undersize UNROM. I believe Nestopia said my ROM was corrupted when I tried that though, it wouldn't take less than 128KB or PRG-ROM.

Locked