- 512k Flash PRG ROM
- 512k Flash CHR ROM
- 32k W-RAM
- John's Missing Pulse Detector + 74LS168 counter to select games with reset button
Here are the games I am trying to use:
- Crisis Force (VRC4e)
- Gradius II (VRC4b)
- Bio Miracle (VRC4b)
- Ganbare Goemon 2 (VRC2b)
Anyway. I did some footwork ahead of time and hacked each of these games into VRC4e. I did this using fceux and setting breakpoints on writes to all VRC4 registers, then changed the address written to for all of these. Once I got the cartridge built, I loaded these hacked games onto my ROMs, and had some varying degrees of success.
- Bio Miracle - Perfect.
- Crisis Force - Worked, but had some minor graphical glitches, playable
- Gradius II - Worked perfectly occasionally if I cycled through the games quickly (i.e. tap reset quickly) and landed on it, otherwise crash.
- Ganbare Goemon 2 - same as Gradius II.
I have a Game Genie modified for use with Famicom. Cleverly, I hooked the Tiny Tunes cart through the Game Genie and I was able to power up, press reset the correct number of times, and then press Start. This created a pseudo cold-start condition into each game. Ganbare Goemon 2 never worked this way. Gradius II starts with incorrect CHR data (i.e. incorrect CHR page selected or something), then you press start and everything clears up and looks normal, lets you select your weapon options, and as soon as the game starts, you die immediately. Then the level starts over and you die again, and again a 3rd time for game over. Everything else works. This feels like one of those Konami pirate gotchas kicking in or something. The other 2 games did work fine from the Game Genie cold start.
Leftovers in RAM got me thinking more about W-RAM. I am only supposed to have 2k W-RAM and I had hooked up the full 32k using additional PRG address lines from the PRG-ROM. 32k in fact would map RAM over top of some of the VRC4 control registers if you kept counting up 32k from $6000! I am thinking that would be a bad thing.
Also, I had connected my RAM chip's R/W pin directly to the VRC4 chip instead of using the diode/82pF/1kohm noise filter as populated in carts that came with W-RAM. (I found this looking at pictures in NesCartDB) I added this filter and undid my extra address lines (connected my 4 MSB address lines to GND on the RAM chip). This FIXED the graphical issues in Crisis Force. Not quite sure what was technically happening but that fixed it. No other effect noticed in any other game.
Next I was reading more in the NesDev wiki article on VRC2/VRC4 and I found this, specific to Ganbare Goemon 2:
I ran Ganbare Goemon 2 in fceux and set it to break on reads from $6000 and $6100. It STAs to those registers and immediately LDAs them back, so I just NOPped out the LDAs. That FIXED Ganbare Goemon 2. That game always works now in the Tiny Tunes cartridge, no tapping of reset required, cold boot via Game Genie OK. However, I do not understand this one. If I had W-RAM available in the range $6000-$6FFF, why wouldn't it have stored the write to $6000 in the RAM chip and read it back?? And why did it sometimes run if I quickly cycled through games and landed on Ganbare Goemon 2? Hmm...Several games, including Contra (J) and Ganbare Goemon 2 (J), rely on the two Data pins being connected to each other, and so expect to be able to read the written value back. In these cases, the LSB agrees with the last value written and the upper seven bits are open bus, e.g. both LDA $6100 and LDA $6000 will return $60|latch. Returning neither open bus nor 0x00 will work, and these games will lock almost immediately after execution begins. Fortunately, no games ever rely on any other behavior.
And that leads me to where I am now tonight. All games work, except Gradius II is behaving just like Ganbare Goemon used to behave. I have to hit reset a lot and land on Gradius II for it to work. Gradius II does read and write to $6000+, but it is expecting to find W-RAM there.
Does anyone have any ideas why this tapping reset thing works for Gradius II and why I can not cold start that game on my VRC4e board? My RAM chip clearly works in Crisis Force and Gradius II, or else I could not imagine those games would be able to run at all without it functioning correctly. So I don't really suspect the RAM chip I guess. I do not know what to try next.