Skip to content

retcode/tinyred

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

tinyred

A tiny Game Boy emulator in C, targeted at Pokemon Red.

Features

  • boots and plays Pokemon Red
  • SDL windowed output
  • readable main source

Build

make run

47-line source:

make run-min

Files

  • tinyred.c - readable, commented version
  • tinyred_min.c - 47-line code-golf version

How It Works

  • starts after the boot ROM with normal DMG register values
  • emulates the LR35902 CPU with compact opcode patterns
  • maps ROM, VRAM, WRAM, OAM, IO, HRAM, and interrupts through one bus
  • implements just enough MBC3 banking for Pokemon Red
  • draws the Game Boy background, window, and sprites scanline by scanline
  • advances DIV, TIMA, LCD modes, VBlank, STAT, and joypad polling once per frame

Controls

  • w/a/s/d or arrows - d-pad
  • j / x - A
  • k / z - B
  • space - Select
  • enter - Start
  • q / Esc - quit

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors