Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

AtlasFPGA/gameboy

 
 

Repository files navigation

Gameboy DeMiSTified

22/09/21 DECA port DeMiSTified by somhic from original MiST gameboy https://github.com/mist-devel/gameboy.

Special thanks to Alastair M. Robinson creator of DeMiSTify for helping me. I've also added some of his solutions from https://github.com/robinsonb5/gameboy like phase shift at SDRAM_CLK, and content from firmware/config.h and overrides.c.

Read this guide if you want to know how I DeMiSTified this core.

Original module sound errors and signed/unsigned troubles have been arranged thanks to @rampa069.

Features:

  • HDMI video output
  • VGA 444 video output is available through GPIO (see pinout below).
  • Line out (3.5 jack green connector) and HDMI audio output
  • PWM audio is available through GPIO (see pinout below)
  • Joystick available through GPIO (see pinout below). Joystick power pin must be 2.5 V
    • DANGER: Connecting power pin above 2.6 V may damage the FPGA
    • This core is prepared for Megadrive 6 button gamepads as it outputs a permanent high level on pin 7 of DB9

Additional hardware required:

  • SDRAM module. Tested with 32 MB SDRAM board for MiSTer (extra slim) XS_2.2 (see connections)
  • PS/2 Keyboard connected to GPIO (see pinout below)
Versions:

v0.1 VGA version only. I2S audio line out working

v0.2 SDRAM_CLK phase shift -1.5 ns

v0.3 HDMI video&audio 640x576@60Hz

v0.4 Added Demistified versions of Neptuno and Unamiga reloaded

v0.5 Updated Demistify. Added Joystick pinout

v0.6 Changes in Mist core to adapt demistify to both Deca and new board Atlas_cyc

Instructions to compile the project for a specific board:

(Note that sof/svf files are already included in /deca/output_files/)

git clone https://github.com/DECAfpga/gameboy
cd gameboy
#Do a first make (will finish in error) but it will download missing submodules 
make
#Checkout to the DeMiSTify branch with the latest updates
cd DeMiSTify
git checkout somhic
#Create file site.mk in DeMiSTify folder 
cp site.template site.mk
#Edit site.mk and add your own PATHs to Quartus (Q19)
gedit site.mk
#Go back to root folder and do a make with board target (deca, neptuno, uareloaded, atlas_cyc). If not specified it will compile for all targets.
cd ..
make BOARD=deca
#when asked just accept default settings with Enter key

After that you can:

  • Flash bitstream directly from command line
  • Load project in Quartus from /deca/gameboy_deca.qpf

Pinout connections:

pinout_deca

Mouse is not required to use this core

For 444 video DAC use all VGA pins. For 333 video DAC connect MSB from addon to MSB of location assignment (e.g. connect pin VGAR2 from Waveshare addon to VGA_R[3] Deca pin).

Others:

  • Button KEY0 is a reset button

STATUS

  • Working fine

  • HDMI video outputs special resolution so will not work on all monitors.

OSD Controls

  • F12 show/hide OSD
  • The reset button KEY0 resets the controller (so re-initialises the SD card if it's been changed, reloads any autoboot ROM.) The OSD Reset menu item resets the core itself.

Follows original readme.md content:

Source code for Gameboy for MIST

This is source code of a gameboy implementation for the MIST.

It's based on the t80 CPU core. A minor fix was needed for the "LD ($FF00+C)" instruction.

The audio implementation has been taken from the PACE framework. The original file is available in the pacedev svn.

Binaries are available at https://github.com/mist-devel/mist-binaries/tree/master/cores/gameboy.

About

Nintendo Gameboy core - DeMiSTified for Atlas CYC1000 & others. See README.md in Atlas_cyc folder

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Assembly 67.5%
  • VHDL 19.8%
  • Verilog 11.0%
  • SystemVerilog 1.0%
  • Shell 0.4%
  • C 0.1%
  • Other 0.2%