kgsws / gameboy_lcd

Gameboy LCD code used in my video.
GNU General Public License v3.0
37 stars 5 forks source link

Gameboy LCD stuff

This repository contains applications used in my Gameboy LCD video.

Pin naming

LCD pin naming used in this repository matches the Gameboy CPU pinout.

ESP32

Every application has to be compiled using cmake method:

mkdir build
cd build
cmake ..
make

List of applications:

Use the file wifi_info.h for network configuration.

PC

Simple makefile.

List of applications:

RPi

Every example here generates modified control signals. That is 2 MHz pixel clock version.

Important RPi stuff

The code fills framebuffer with generated video waveforms. It expects RGB DPI mode to be active. However, you can't just run any application, as there is no FPGA involved. If you use something that uses framebuffer the standard way, it will generate garbage signals for LCDs. This might even damage them. Every application has to be modified to generate correct signals.

Pin mapping

This is a default configuration and i relies on BGRA framebuffer setting. If you happen to use RGBA just swap RED with BLUE. LCD Data are always on two consecutive pins. In single-screen code only first to bits of GREEN channel are used.

config.txt

Use FKMS mode! Example code requires framebuffer to exist. Use legacy version of raspberry Pi OS.

Add this at the end of the file:

dtoverlay=dpi24
dpi_output_format=0x76017
dpi_timings=408 0 0 6 0 307 0 0 1 0 0 0 0 60 0 3840000 1
dpi_group=2
dpi_mode=87
framebuffer_width=408
framebuffer_height=307
enable_dpi_lcd=1
display_default_lcd=1

cmdline.txt

Add this to the first line fbcon=map:2. Remember, this file should contain only one line.

This is important as it disables text cosole. Text console would mess up generated signals.