- Joined
- Mar 17, 2016
- Messages
- 90
- Likes
- 67
Background
With the amazing TinyTendo project by RedHerring32, the NES took on a GB-sized form factor, with cartridges around the size of a GB game. Of course, when shrinking a cartridge, you might not be able to use the original ROMs due to size constraints. Luckily modern flash alternatives work just as well. However, one item that isn't able to be replaced with off-the-shelf components are the "mapper" chips. The NES CPU can only see 32 KB of ROM at any given time, and there are similar constraints on the "CHR" (Character) PPU ROM as well. Due to this limitation, either your code and graphics need to fit into the limited space available, or through some clever solution, you need to be able to switch out which part of the ROM can be seen by the NES CPU or PPU at some point. Mapper chips serve this purpose; they allow a larger ROM to be switched out in "banks"; small windows into the ROM that can have their contents switched out with different ones, elsewhere in the ROMs, when a developer wants it. The developers of the mapper chips were clever, and realized they could use the fact that ROMs are read only, and issue a write command. For ROMs (Read Only Memories), this will achieve nothing. However, mapper chips sit on the same address and data busses as the ROM, and can intercept these writes to allow useful functionality, such as bank switching. The most popular mapper by far is the MMC3.
The Problem
Given these chips can't really be bought, they must be harvested from an existing official game cartridge. Reproduction makers, as well as TinyTendo cartridge makers need to track down existing games with the chip in order to make what they want. While this is probably fine, it is a bit tedious and time consuming, and also takes regular cartridges out of commission. There do exist "pirate" MMC3 chips, however the compatibility leaves a lot to be desired, to my understanding. Also these chips are not well documented, in terms of accuracy.
The Solution
This project attempts to alleviate these issues by creating an accurate, open source implementation of the MMC3, using parts that can be purchased today, and also perhaps assembled via a PCBA service.
Goals
- Accurate behavior
- Open Source
- Uses modern parts that can still be purchased today
- Able to be fitted directly in place of an MMC3 chip, so no board changes need to be made for Reproduction and TinyTendo folks
- Supporting all variants of the MMC3 chip behavior (there are only 2 known at time of writing)
With all that out of the way, lets get down to business. The first order of business was specing out a part. We're going to want an FPGA or CPLD for this, most likely, and if we want something able to be soldered into the same spot, either we need ones that somehow match the exact pinout of the MMC3, or we need to mount it onto a PCB that can solder in place of the original MMC3. Unfortunately, due to the situation in my home country, I'm ruling out using services like JLCPCB or PCBWAY. This puts extra contraints on my parts, since we need to be able to deal with the constraints of PCB manufacturers that aren't quite as capable. After searching around for several hours, I finally settled on a chip that left me some room on the board, and met most of the rest of the requirements.
Speaking of requirements, lets take a look:
- Enough Logic Elements to hold my design (this is TBD as I create the design, so hopefully what I have currently is enough)
- Enough IO (we need about 38 total IO pins for this design)
- Small enough that it can fit within the space of the original MMC3 IC.
- Ideally 5v tolerance, though this isn't required.
- Able to be routed with less capable PCB fabs.
At the moment, I've landed on the Altera MAX V CPLDs, particularly the MBGA100 variants (particularly, either 5M160Z or 5M240Z, depending on how large the design is)
These balance the requirements fairly well, though not perfectly. They aren't 5v tolerant, and have the potential to have too few Logic Elements, though I think that one of the two parts will be fine to handle it, and perhaps external level shifters will be needed.
In the process of picking the part out, I also had to make sure I was able to route it, so I did try several test routes along the way to see how things would hold up when keeping the manufacturer capabilities in mind. This led to the routing for the board to sorta just happen in the process of checking everything, aside from some small details.
This layout isn't 100% done, and still needs some work, but the broad strokes are there. I did have to make a few compromises to deal with the limited manufacturing tolerances, but as far as I can tell, this should be sufficient. Some ball pads were removed and worse case scenario, those same balls will need to be manually removed from the chip, when soldering it, but via tenting should ideally just take care of it. There's still some work to be done, like level translation, the core voltage regulation and decoupling, but I believe this shows the design is doable.
In addition to the replacement module, I've also routed up a testing platform. This should help me ensure accuracy to the original implementation. This board is still also a work in progress, also just missing a few caps, voltage regulation, and I need to decide how I'm doing power in to the board.
This board should allow me to test the implementation of my chip against a real one, side by side, and check for discrepancies.
Finally, this is my first competition entry, so please do let me know if there's anything I'm missing. Thanks for reading, and good luck to all the other contestants!
With the amazing TinyTendo project by RedHerring32, the NES took on a GB-sized form factor, with cartridges around the size of a GB game. Of course, when shrinking a cartridge, you might not be able to use the original ROMs due to size constraints. Luckily modern flash alternatives work just as well. However, one item that isn't able to be replaced with off-the-shelf components are the "mapper" chips. The NES CPU can only see 32 KB of ROM at any given time, and there are similar constraints on the "CHR" (Character) PPU ROM as well. Due to this limitation, either your code and graphics need to fit into the limited space available, or through some clever solution, you need to be able to switch out which part of the ROM can be seen by the NES CPU or PPU at some point. Mapper chips serve this purpose; they allow a larger ROM to be switched out in "banks"; small windows into the ROM that can have their contents switched out with different ones, elsewhere in the ROMs, when a developer wants it. The developers of the mapper chips were clever, and realized they could use the fact that ROMs are read only, and issue a write command. For ROMs (Read Only Memories), this will achieve nothing. However, mapper chips sit on the same address and data busses as the ROM, and can intercept these writes to allow useful functionality, such as bank switching. The most popular mapper by far is the MMC3.
The Problem
Given these chips can't really be bought, they must be harvested from an existing official game cartridge. Reproduction makers, as well as TinyTendo cartridge makers need to track down existing games with the chip in order to make what they want. While this is probably fine, it is a bit tedious and time consuming, and also takes regular cartridges out of commission. There do exist "pirate" MMC3 chips, however the compatibility leaves a lot to be desired, to my understanding. Also these chips are not well documented, in terms of accuracy.
The Solution
This project attempts to alleviate these issues by creating an accurate, open source implementation of the MMC3, using parts that can be purchased today, and also perhaps assembled via a PCBA service.
Goals
- Accurate behavior
- Open Source
- Uses modern parts that can still be purchased today
- Able to be fitted directly in place of an MMC3 chip, so no board changes need to be made for Reproduction and TinyTendo folks
- Supporting all variants of the MMC3 chip behavior (there are only 2 known at time of writing)
With all that out of the way, lets get down to business. The first order of business was specing out a part. We're going to want an FPGA or CPLD for this, most likely, and if we want something able to be soldered into the same spot, either we need ones that somehow match the exact pinout of the MMC3, or we need to mount it onto a PCB that can solder in place of the original MMC3. Unfortunately, due to the situation in my home country, I'm ruling out using services like JLCPCB or PCBWAY. This puts extra contraints on my parts, since we need to be able to deal with the constraints of PCB manufacturers that aren't quite as capable. After searching around for several hours, I finally settled on a chip that left me some room on the board, and met most of the rest of the requirements.
Speaking of requirements, lets take a look:
- Enough Logic Elements to hold my design (this is TBD as I create the design, so hopefully what I have currently is enough)
- Enough IO (we need about 38 total IO pins for this design)
- Small enough that it can fit within the space of the original MMC3 IC.
- Ideally 5v tolerance, though this isn't required.
- Able to be routed with less capable PCB fabs.
At the moment, I've landed on the Altera MAX V CPLDs, particularly the MBGA100 variants (particularly, either 5M160Z or 5M240Z, depending on how large the design is)
These balance the requirements fairly well, though not perfectly. They aren't 5v tolerant, and have the potential to have too few Logic Elements, though I think that one of the two parts will be fine to handle it, and perhaps external level shifters will be needed.
In the process of picking the part out, I also had to make sure I was able to route it, so I did try several test routes along the way to see how things would hold up when keeping the manufacturer capabilities in mind. This led to the routing for the board to sorta just happen in the process of checking everything, aside from some small details.
This layout isn't 100% done, and still needs some work, but the broad strokes are there. I did have to make a few compromises to deal with the limited manufacturing tolerances, but as far as I can tell, this should be sufficient. Some ball pads were removed and worse case scenario, those same balls will need to be manually removed from the chip, when soldering it, but via tenting should ideally just take care of it. There's still some work to be done, like level translation, the core voltage regulation and decoupling, but I believe this shows the design is doable.
In addition to the replacement module, I've also routed up a testing platform. This should help me ensure accuracy to the original implementation. This board is still also a work in progress, also just missing a few caps, voltage regulation, and I need to decide how I'm doing power in to the board.
This board should allow me to test the implementation of my chip against a real one, side by side, and check for discrepancies.
Finally, this is my first competition entry, so please do let me know if there's anything I'm missing. Thanks for reading, and good luck to all the other contestants!