New to using EPROMs with NES, NROM game on CNROM board?

A place that you can discuss reproduction of classic titles or "licensed-for-reproduction" homebrew for personal use.

Moderators: B00daW, Moderators

Forum rules
1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.
Post Reply
RetroHacker
Posts: 11
Joined: Sat Jan 17, 2009 8:57 pm

New to using EPROMs with NES, NROM game on CNROM board?

Post by RetroHacker » Sat Jan 17, 2009 9:30 pm

I've never made an EPROM cartridge for the NES before, but I've done it many times for simpler systems, such as the Atari 2600 and the Gameboy. I'm very familiar with Atari bankswitching, and I have done some reading on the NES and the various mappers that were used, and I think I have a pretty good handle on how it all works. Or at least, I thought I did. I tried to make a simple EPROM cart tonight. I took a crummy game ("Star Voyager" by Acclaim), and desoldered the ROMs, and installed sockets. I cut a hole in the cartridge housing, and removed the metal bar from an NES.

Star Voyager is a CNROM game, and it has a 32k PRG ROM, and a 32K CHR ROM, addressed as four 8k chunks by the 74161 in the cartridge. I wanted to use an NROM game though, Super Mario Bros (or a romhack thereof). Super Mario Bros. has a 32k PRG ROM, and 8k of CHR ROM, and uses no bankswitching. My "assumption", is that since the game code doesn't try to bankswitch, then the cart shouldn't switch CHR banks at all. And, even if it does, I'll just replace the CHR ROM with a 27256 with the same 8k of data burned into all four banks, so any switching will be a moot point. Both games have vertical mirroring.

I split the .nes file for Super Mario Bros. into it's component parts using readnes, a simple little C program I found online. That generated the .prg and .chr files. I used cat to create a new file with four copies of the CHR file. I took the two 32k files I had created and burned them to two 27256's, and fitted them in my ugly EPROM cartridge. Plugging it into the Nintendo rewarded me with a (slightly garbled) Super Mario Bros. screen.

So... playing the game, this is where things get interesting. It's like the graphic data is screwed up, or at least, the order it reads it in. It's hard to explain, but the left half of the screen contains a copy of the data that should be off the screen to the right. The right half of the screen contains the correct data. Sprites such as enemies and Mario will appear in their correct places all the time, but the background, blocks and coins are affected. For example, when walking past a piranah plant in a pipe, it looks normal until it gets to the middle of the screen - the pipe disappears and gets replaced with whatever data should be coming a screen away, and the piranah plant is still there.

I took a few pictures with the intent to post one, but I don't see a function in this forum to post an attachment. I'll have to load it on PhotoBucket or somesuch later.

Now, I understand that this is caused by me using the wrong type of game with the wrong board, but at the same time, I don't understand _why_ it happened. As far as I can tell, bank switching the CHR data should be moot if all four banks of CHR ROM contain exactly the same data. And how could the left half of the screen possibly be showing data that shouldn't be displayed yet? It doesn't make sense. As far as I know everything is installed in the cart correctly, the documents I found on the nesdevwiki and elsewhere both indicate that no modifications are necessary to use an EPROM, so it's not like a couple address lines are swapped. The pinouts of the Nintendo ROMS and 27256's appear the same. All I did was desolder them and install sockets.

I'm really intrigued as to why this happened, and what is going on here. Any help would be appreciated.

Oh, and yes, with the graphics screwed up like this, the game is quite hard to play. I did play all the way to 5-2 (no warping), but then died from falling in holes I couldn't see and hadn't remembered...

-Ian

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

Re: New to using EPROMs with NES, NROM game on CNROM board?

Post by tepples » Sat Jan 17, 2009 9:37 pm

RetroHacker wrote:Both games have vertical mirroring.

I split the .nes file for Super Mario Bros. into it's component parts using readnes, a simple little C program I found online. That generated the .prg and .chr files. I used cat to create a new file with four copies of the CHR file. I took the two 32k files I had created and burned them to two 27256's, and fitted them in my ugly EPROM cartridge. Plugging it into the Nintendo rewarded me with a (slightly garbled) Super Mario Bros. screen.

So... playing the game, this is where things get interesting. It's like the graphic data is screwed up, or at least, the order it reads it in. It's hard to explain, but the left half of the screen contains a copy of the data that should be off the screen to the right.
That sounds like a mirroring problem. Perhaps you were confused by Nintendo's opposite nomenclature for nametable mirroring. "V" on Nintendo discrete boards (NROM, C*ROM, U*ROM) means vertical arrangement of nametables, which implies horizontal mirroring. Likewise, "H" means that the nametables are arranged horizontally and mirrored vertically. If you toggle the mirroring in your rom of SMB1 and run it in an emulator, do you get the same misbehavior?

RetroHacker
Posts: 11
Joined: Sat Jan 17, 2009 8:57 pm

Post by RetroHacker » Sat Jan 17, 2009 9:47 pm

That sounds like a mirroring problem. Perhaps you were confused by Nintendo's opposite nomenclature for nametable mirroring. "V" on Nintendo discrete boards (NROM, C*ROM, U*ROM) means vertical arrangement of nametables, which implies horizontal mirroring. Likewise, "H" means that the nametables are arranged horizontally and mirrored vertically. If you toggle the mirroring in your rom of SMB1 and run it in an emulator, do you get the same misbehavior?
*head* *hit* *keyboard*

I just tried it - I removed the solder from the "V" on the board, and soldered a blob on the "H".. and it worked perfectly.

Man. I had no idea. I didn't even _think_ to look up my doner game in my list-o-mappers. Sure enough, it's Horizontal. I just saw that "V" soldered on the board and immediately assumed it was Vertical. And Super Mario Bros. is definitely "V"...

Thanks for the help! Now I know another thing to check! And, amazingly enough, I was right - I _can_ run NROM games on a CNROM board!

Thanks again!

-Ian

Post Reply