Hi,
this is a project I have been working on in my spare time for a while now.
The plan is to build a cart that can run all MBC1-5 games including RTC support and learn something about PCB layout, SMD soldering and FPGA programming. This is not really my first experience in that direction, but the first 'serious' project that puts everything together to do something useful.
The current design includes a MachXO2 FPGA, 16MiB SDRAM, 5V↔3.3V level shifters, RTC+battery, and a MicroSD socket. This is a compromise between fitting everything in the limited space, keeping it solderable by hand, and still including all planned features.
The layout and assembly of the first prototype is done and I am quite happy with the design as I have not (yet) encountered any major bugs.
Partially assembled prototype:
Fully populated and cleaned PCB with connectors for JTAG, I2C, serial and SPI:
And (to my surprise) it actually works: (running a small test from the FPGA embedded memory)
What works:
-GB bus interface with read and write cycles
-Running code from the internal ~8KiB BRAM
-Accessing the RTC
-Low level (block level) SD card interface (some cards still fail initialisation)
-Simple SDRAM controller
After resolving many small and some bigger issues, for example figuring out the quirks of the GB bus cycle, SD card initialisation, or the weird I2C controller in the FPGA,
everything needed to run 32KiB ROM-only/MBC1 games is working. The gameboy boots from the FPGA BRAM, copies 64 sectors (64*512byte) to the SDRAM, switches the lower 32KiB from BRAM to SDRAM and then jumps to the rom at 0x0100:
While this is the bare minimum needed to run small games, there is still quite some missing stuff to make the thing useful:
-MBC emulation
-High level SD card interface (FAT32)
-Savegames
-DMA for fast memory transfers (using the GB cpu, shuffling the Tetris rom byte-by-byte from the card to ram takes ~10s, large games would take minutes...)
-Proper bootloader
-All the important things I completely forgot about
MBC support (without RTC) should be straightforward and would run most games, so that will be next. Stay tuned.
this is a project I have been working on in my spare time for a while now.
The plan is to build a cart that can run all MBC1-5 games including RTC support and learn something about PCB layout, SMD soldering and FPGA programming. This is not really my first experience in that direction, but the first 'serious' project that puts everything together to do something useful.
The current design includes a MachXO2 FPGA, 16MiB SDRAM, 5V↔3.3V level shifters, RTC+battery, and a MicroSD socket. This is a compromise between fitting everything in the limited space, keeping it solderable by hand, and still including all planned features.
The layout and assembly of the first prototype is done and I am quite happy with the design as I have not (yet) encountered any major bugs.
Partially assembled prototype:
Fully populated and cleaned PCB with connectors for JTAG, I2C, serial and SPI:
And (to my surprise) it actually works: (running a small test from the FPGA embedded memory)
What works:
-GB bus interface with read and write cycles
-Running code from the internal ~8KiB BRAM
-Accessing the RTC
-Low level (block level) SD card interface (some cards still fail initialisation)
-Simple SDRAM controller
After resolving many small and some bigger issues, for example figuring out the quirks of the GB bus cycle, SD card initialisation, or the weird I2C controller in the FPGA,
everything needed to run 32KiB ROM-only/MBC1 games is working. The gameboy boots from the FPGA BRAM, copies 64 sectors (64*512byte) to the SDRAM, switches the lower 32KiB from BRAM to SDRAM and then jumps to the rom at 0x0100:
While this is the bare minimum needed to run small games, there is still quite some missing stuff to make the thing useful:
-MBC emulation
-High level SD card interface (FAT32)
-Savegames
-DMA for fast memory transfers (using the GB cpu, shuffling the Tetris rom byte-by-byte from the card to ram takes ~10s, large games would take minutes...)
-Proper bootloader
-All the important things I completely forgot about
MBC support (without RTC) should be straightforward and would run most games, so that will be next. Stay tuned.