
Gameboy MBC5 Cart + FRAM DUAL 2MB
sillyhatday/GAMEBOY-MBC5-DUAL-4_8MB
A working 8MB flash cart. You can also use this to to make a 4MB cart out of cheaper 2MB chips.

A CPLD implementation of the MBC5 mapper
Gameboy CPLD Cart + FRAM is an open-source printed circuit board by sillyhatday, from the sillyhatday/GAMEBOY-CPLD-FRAM-2MB repository on GitHub, published under the CC-BY-SA-4.0 licence. It is a 2-layer board of 51 × 61 mm with 23 parts on 64 nets, routed with 1,260 tracks and 135 vias.
It is built around the 74LVC1G332GV and FM1808B-PG. Its parts include 6 capacitors, 5 ICs, 1 resistor and 1 connector. It belongs with the retro computing and games and fPGA and programmable logic boards and the FPGA and CPLD boards of this library.
[!WARNING] Current circuit board revision does not include support for the MAX7000 or ATF150x CPLD without bodges.
This is my take of a CPLD based flash cart for the Gameboy.
The whole project is based from Alex's project from years back. Without that project, I would never have picked this up and spend my time figuring out how to work with CPLDs. I am not a programmer and do not claim to be. Picking up Alex's code I can see how things work with my previous knowledge of how carts operate.
The newest update has been done with the help of AI. I just wanted to get this thing done so it is off my active project list. Even though AI has helped, I have learned a little bit more about how CPLDs work because of it. In the future I'd like to use the knowledge to do another project.
Some reasons to build this project are:
+ No need for sourcing a donor cartridge
+ Multi MBC compatibility
+ Cheaper to build vs a donor cart (initially not, more made, more saved)[!IMPORTANT] This project is designed with MBC5 functionality as the main priority. Compatibility with MBC1 is added on top, therefore, compatibility is not guaranteed. Super Mario Land 2 & Zelda: Link's Awakening work here, where they have issues running on a normal MBC5 chip. However, Donkey Kong Land does not work. Maybe one day I can create an MBC1 CPLD mapper.
[!NOTE] For updates, see towards the end of the readme
- Get a cartridge that works well enough
- Make the Altera 3032A & 3064A both work
- Fix SRAM problems with MAX7000 and edge case MAX3000
- Fix this readme after half updating and rage quitting. Remove V2.0 PCB pics.
- Write draft of instructions for programming Atmel chips- Do some power tests of carts I have built so far.- Test flashing Atmel chips in circuit
- Design some hardware to flash Atmel chips in circuit
- Update PCB to include solder jumper for different CPLD families.
- Some issues with SRAM in FlashGBX with Atmel 1502A. Check hardware over & adjust SVF export settings.
- Move FRAM chip select glue logic into software.* The full components parts list and cart PCB
* (Optional) JTAG adaptor PCB
* Altera USB Blaster or FT232 for JTAG (cheap clones work)
* Windows PC with Quartus II Programmer, Quartus II Web Edition or OpenOCD
* GBxCart and related software
* Modified Gameboy cart shell or (optional) 3D printed Game Gear cart adaptor
* Equipment to solder tiny SMD components
* Skills to solder tiny SMD components reliably[!TIP] Information on chosing a CPLD
ALTERA PROGRAMMING GUIDE
ATMEL PROGRAMMING GUIDE
CPLD POWER USAGE
Prices vary, these are typical.
| Model | Cost x1 | Vendor |
|---|---|---|
| 3032A: | €1.16 | Aliexpress |
| 3064A: | €1.60 | Aliexpress |
| 7032S: | €1.85 | Aliexpress |
| 1504A: | €1.97 | Mouser |
Depending on the model, the AP2127K-3.3TRG1 may not be needed.
| Model | AP2127K | Jumper |
|---|---|---|
| 3032A | YES | NO |
| 3064A | YES | NO |
| 7032S | NO | YES |
| 1502A | NO | YES |
[!IMPORTANT] When ordering cartridge PCBs, make sure to choose 0.8mm thickness and gold plating.
Altera MAX3000 & MAX7000 CPLDs are obselete and only found on Aliexpress. I suggest the 3032A. (MAX7000 is a relic at this point).
If ordering MAX7000, get the S version, otherwise throw your money in a fire. Eg, EPM7032S
Atmel ATF150x parts can be bought new from reputable sellers. However they are trickier to program for the average person.
Order FRAM from Aliexpress & eBay at your own risk, they are known to be extremely unreliable.
| Part No. | Package | Qty |
|---|---|---|
| 29F016 | TSOP48 | 1 |
| FM1808 | SOIC28 | 1 |
| CPLD* | TQFP44 | 1 |
| 74LVC1G332 | TSOP6 | 1 |
| AP2127K-3.3TRG1** | SOT23-5 | 1 |
| Cap 100nF | 0603 | 4 |
| Cap 1uF | 0603 | 2 |
| Res 10K | 0603 | 1 |
*EPM3064A, EPM3032A, EPM7064S, EPM7032S, ATF1504A or ATF1502A **See CPLD info
| Part No. | Qty |
|---|---|
| DS Lite Cart Conn | 1 |
| USB C USB4125 | 1 |
| Pin Headers | 2x5-P2.54mm |
| GG Adaptor or Shell | 1 |
| USB Blaster | 1 |
[!TIP] Link to Game Gear Adaptor
Different CPLD
Original Prototype
I've picked this back up again when I found a PCB laying about. I had to wonder if AI was good enough now to help improve things. It is fortunately.
The previous update I was naive to think programming in C++ was anything like Verilog. I mean it is, but the device being programmed works so differently to other CPU based systems.
The issue that has been plaguing the 7032S & 1504A, is the save RAM functionality. Games would not save, or correctly use the cartridge as work RAM. This was on the Gameboy and cart readers. I tested this over a few carts and the first one kinda worked. It was flaky but saving, yet only on the GB and not the cart reader. There worst problem is that this problem crept into some of the 3032A and 3064A carts also.
This code refactor seems to have fixed all these problems, not only the MAX3000 but the MAX7000 also. As of now, the ATF1504 is untested. I am hopeful that it will work also. Programming those is more complex and I've since forgotten how to do it.
The smaller EPM3032A, EPM7032S & ATF1502 with 32 macro cells are now more than big enough to fit the program, no longer is it so tight. This is thanks to removing the 128KB RAM functionality, reducing the amount of registers required to address that has gained a lot of space. Additional code can be added for more functionality such as moving the FRAM gate logic into the CPLD and making it user programmable with a solder bridge on the PCB.
This is all very nice as the smaller chips tend to use less power than the larger counterparts, even though they use the same quantity of macro cells. I'll add more detailed information on the changes in its own readme.
When the Atmel part is confirmed working, I'll update the rest of the readme to walk though programming those. Ideally the PCB could use a revision to add the FRAM mode jumper and a jumper to bypass the 3.3v regulator when using the MAX7000 and ATF15xx chips. Again, I'll get to that when testing is complete.
| Version | Status | Notes |
|---|---|---|
| V1.0.0 | Initial | Original code from Alex's blog |
| V1.0.1 | Fix | Removed internal FRAM chip select logic to lower cartridge power consumption 1 to 3% |
| V2.0.0 | Fix | Changed project compiler settings to lower cartridge power consumption 36 to 41% |
| V3.0.0 | Current | AI helper to teach me and structure code better. Use of macro cells more efficient. Logic split into smaller sections. More reliable, cleaner code, better output waveforms (I need to confirm that). |
🔧 Driver Install: https://www.terasic.com.tw/wiki/Intel_USB_Blaster_Driver_Installation_Instructions
⬇️ Driver Download: https://github.com/sudhamshu091/USB-Blaster-Driver-for-DE10-lite
🖨️ Game gear Adaptor: https://www.thingiverse.com/thing:5830799
⏬ Alt Link Quartus: https://archive.org/details/quartus-iiprogrammer-and-signal-tap-ii-13.1.0.162.7z
🛍️ Inside Gadgets Shop: https://shop.insidegadgets.com
📎 Inside Gadgets GitHub: https://github.com/insidegadgets
📷 Inside Gadgets Insta: https://www.instagram.com/inside.gadgets
🖇️ Bytendo Mods GitHub: https://github.com/bytendomods
🐭 Bucket Mouse: https://github.com/Bucket-Mouse
🛒 Natalie Shop: https://nataliethenerd.com/
🤓 Natalie GitHub: https://github.com/natalie-lang/natalie
Thanks to Xukkorz, Drew, Jamo, Alex, Deceptive Thinker, Natalie the Nerd & anyone else who I may have forgotten.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You are able to copy and redistribute the material in any medium or format, as well as remix, transform, or build upon the material for any purpose (even commercial) - but you must give appropriate credit, provide a link to the license, and indicate if any changes were made.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 100nF | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C1, C2, C4, C6 |
| 2 | 1uF | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C3, C5 |
| 1 | 10K | Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder | R1 |
| 1 | 29F016 | Package_SO:TSOP-I-48_18.4x12mm_P0.5mm | U3 |
| 1 | 3032A | Package_QFP:TQFP-44_10x10mm_P0.8mm | U2 |
| 1 | 3v/5v | Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm | JP1 |
| 1 | 5V | TestPoint:TestPoint_Pad_D1.0mm | TP1 |
| 1 | 74LVC1G332 | Package_SO:TSOP-6_1.65x3.05mm_P0.95mm | U5 |
| 1 | AP2127K | Package_TO_SOT_SMD:SOT-23-5 | U4 |
| 1 | Altera/Atmel | Jumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mm | JP2 |
| 1 | CartBus | GAMEBOY:GameBoy_GamePak_DMG-09_P1.50mm_Edge | U?1 |
| 1 | Conn_01x06 | GAMEBOY:JTAG Cart Edge Connector | J1 |
| 1 | FM1808 | Package_SO:SOIC-28W_7.5x17.9mm_P1.27mm | U1 |
| 1 | GND | TestPoint:TestPoint_Pad_D1.0mm | TP3 |
| 1 | TCK | TestPoint:TestPoint_Pad_D1.0mm | TP7 |
| 1 | TDI | TestPoint:TestPoint_Pad_D1.0mm | TP4 |
| 1 | TDO | TestPoint:TestPoint_Pad_D1.0mm | TP5 |
| 1 | TMS | TestPoint:TestPoint_Pad_D1.0mm | TP6 |
| 1 | VCC | TestPoint:TestPoint_Pad_D1.0mm | TP2 |

sillyhatday/GAMEBOY-MBC5-DUAL-4_8MB
A working 8MB flash cart. You can also use this to to make a 4MB cart out of cheaper 2MB chips.

sillyhatday/GAMEBOY-MBC5-QUAD-8MB
8MB Gameboy cart using only 2MB flash chips

crankery/crank68
One day I thought to myself I want to build a computer with the simplest 8 bit CPU I can think of". That CPU is the Motorola M6800 and this is the computer.

MouseBiteLabs/Super-Game-Boy-Plus
A replacement circuit board for improving the Super Game Boy, or for creating a standalone Game Boy game for the SNES.

abd-alaj/BLDC-motor-custom-inverter
Matlab, Simulink, Hardware and C-code for a custom inverter project.



It measures 51 × 61 mm and has 2 copper layers, 1.6 mm thick.
23 parts, built around the 74LVC1G332GV and FM1808B-PG. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the sillyhatday/GAMEBOY-CPLD-FRAM-2MB repository on GitHub, at the commit this page was made from: the board is KICAD/Gameboy CPLD Cart + FRAM.kicad_pcb and its schematic KICAD/Gameboy CPLD Cart + FRAM.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the CC-BY-SA-4.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).