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
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