One of the problem is that EPM3064 has 30 I/O pins (XC9572 has 34). But MMC2 needs
PRG_A[16..13] + CHR_A[16..12] + CPU_A[14..12] + CPU D[4..0] + nROMSEL + RnW + PRG_CE + PPU_A[13..0] + PPU_nRD + CIRAM_A10 = 4 + 5 + 3 + 5 + 1 + 1 + 1 + 14 + 1 + 1 = 36
* for M2, despite being connected to original chip, I don't see any use
* luckily, MMC2 does not have any power-up known state so no external reset need to be wired
I looked at the binary of PPU addresses that need to be hijacked by MMC2 for tile switching:
Code: Select all
| 1111 | 32109876543210 | xxxx xyyy 0FD8 | 00111111011000 0FE8 | 00111111101000 | 1FD8 | 01111111011000 .. | 1FDF | 01111111011111 | 1FE8 | 01111111101000 .. | 1FEF | 01111111101111
* PPU A12/11/10 have to be wired for mirroring or knowing the CHR bank, but..
* from PPU_A9/8/7/6/3 I just need to know if they are all ones, so I need only AND of them
* from PPU_A2/1/0 i just need to know if they are all zeros, so I need only OR of them
so it gives 36 - 5 +1 - 3 + 1 = 30 (just barely enough!)
I could also add the PPU_!A13 to AND product (instead of wiring PPU_A13) but on many cheap famiclones, PPU_!A13 and CIRAM_!CS are not wired to the connector at all.
And I used diodes for all that logic!
I wired R/!W to PRG-!WE, !ROMSEL to PRG-!CS, and PRG-!CE to PRG-!OE because I wanted to be able to reflash it using kazzo in future.
I burned EPROMS, soldered everything and... Unfortunatelly the cartridge did not booted at all (sometimes few chords of music from Punch Out were played but it did not go even to the title screen).
So I quattro checked all connections, VHDL code, even dumped the PRG/CHR using kazzo, everything seemed to be correct, but it was not working in console. Then I rewired PRG-!WE to VCC and it worked! Looks like mapper bankswitch writes messes internal state of the 29EE010 EPROM.