Home

Awesome

alt text

papiGB

Game Boy Classic fully functional FPGA implementation from scratch

###Requirements

sudo apt-get install iverilog gtkwave

##Compiling code cd sim/

make compile

##Running a simulation

cd sim/

make run

Once the simulation completes, the following ASCII files are generated under the sim/ folder:

Simulations will not automatically generate a VCD dump file. To generate a VCD dump do:

make DUMPTYPE=vcd

##Simulation Options To control additional simulation options, use the SIMFLAGS flag. Valid values are:

The following command will stop the simulation after the first frame, will generate GPU log, but will not generate CPU log.

make SIMFLAGS="-DSTOP_AFTER_FIRST_FRAME -DENABLE_GPU_LOG"

The following command will simulate RTL using a cartrigde file:

make SIMFLAGS=" -DCARTRIGDE_DUMP_PATH='\"resources/tetris.dump\"'"

The following command will disable the CPU and load VMEM data from a dump file:

make SIMFLAGS="-DDISABLE_CPU -DVMEM_DUMP_PATH='\"resources/tetris_vmem_8000_9fff.dump\"' -DENABLE_GPU_LOG -DSTOP_AFTER_FIRST_FRAME"

##Looking at simulation results

cd sim/

make view

##Cleaning up simulation files. This also erases the vcd and the log files!

make clean

##Installing a game boy assembly

RGBDS is a great gameboy assembly (https://www.anjbe.name/rgbds/)

To install it do:

git clone https://github.com/bentley/rgbds/

cd rgbds

sudo apt-get install bison flex

make

sudo make install

To compile an assebly program called test_INCr_b.asm do:

rgbasm -o test_INCr_b.obj test_INCr_b.asm

rgblink -m test_INCr_b.map -n test_INCr_b.sym -o test_INCr_b.gb test_INCr_b.obj

The use hexdump to get the ASCII hex dump to load into the RTL simulation:

hexdump -v test_INCr_b.gb > test_INCr_b.hex