MMC1 question about rendering

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
DarkMoe
Posts: 70
Joined: Sat Jun 27, 2015 1:09 pm

MMC1 question about rendering

Post by DarkMoe »

Hi ! me again,

So I'm trying to implement that official_only.nes test, that uses MMC1.

I managed to get the bankmapping working with the 5 bits shift register and it looks like it works ok.

What I don't understand at all, is how this impacts my rendering functions. According to the header, it has 16 banks of PRGROM of 16 kb each, which is the full rom, and no data for chrRom. So this means that the graphics are not hardcoded into the rom like other games ?

How am I supposed to change my logic to draw the letters for this test ?

I managed to implement all that t and v internal registers to get accurate scrolling, but this is something different.

Sorry for these basic questions, and thanks as always.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: MMC1 question about rendering

Post by rainwarrior »

If the header says there are no CHR banks, then it is CHR-RAM instead of CHR-ROM: iNES format reference

Maybe this wiki article could help explain: CHR ROM vs. CHR RAM

Basically CHR-RAM just means you can write to it (via $2007) just like you would the nametables, except PPU range $0000-$1FFF is mapped to the CHR-RAM. (There are other obscure mappings, but this is the normal configuration for CHR-RAM.)
Rahsennor
Posts: 479
Joined: Thu Aug 20, 2015 3:09 am

Re: MMC1 question about rendering

Post by Rahsennor »

This is technically offtopic, but blargg's CPU tests are also available in NROM form. They can be found in the rom_singles folder of instr_test-v5.zip.

The NROM versions test both official and unoffical opcodes, but check the official opcodes first, so if you ignore tests that fail unofficial opcodes, you'll still cover all the official ones.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: MMC1 question about rendering

Post by tokumaru »

I just want to point out that CHR-RAM is not an obscure thing, it's actually very common, a great number of NES games use that instead of CHR-ROM. This is actually what most other consoles and computers use too... Master System, Game Boy, Genesis, SNES... none of those have the option to use patterns directly from ROM, it's always RAM.

The NES is a rare exception, since Nintendo decided to put the pattern memory inside the cartridge instead of inside the console, probably to reduce costs, and this allowed developers to choose between ROM or RAM for each game.
User avatar
Dwedit
Posts: 4922
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: MMC1 question about rendering

Post by Dwedit »

I looked at bootgod's list and determined that around 25% of all games used CHR-RAM.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: MMC1 question about rendering

Post by rainwarrior »

Dwedit wrote:I looked at bootgod's list and determined that around 25% of all games used CHR-RAM.
There's a stats page with exactly that information on it: http://bootgod.dyndns.org:7777/stats.php?page=3
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: MMC1 question about rendering

Post by tokumaru »

rainwarrior wrote:There's a stats page with exactly that information on it: http://bootgod.dyndns.org:7777/stats.php?page=3
Cool!

OK, CHR-RAM is slightly less common than I imagined, but it's still pretty common. :wink:
DarkMoe
Posts: 70
Joined: Sat Jun 27, 2015 1:09 pm

Re: MMC1 question about rendering

Post by DarkMoe »

Thanks ! I just discovered my video rendering is not as good as I thought.

I will try those nrom alternatives.

Yeah I know about video ram, I have a fairly advanced GB/GBC emulator, but well .. I was confused with the NES.

Thanks everyone !
Post Reply