• Stars
    star
    1,256
  • Rank 37,419 (Top 0.8 %)
  • Language
    C++
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A gameboy emulator that only plays Pokemon Blue, in ~50 lines of c++.

pokegb

A gameboy emulator that only plays Pokemon Blue, in ~50 lines of c++.

See the technical write-up.

Features

Plays Pokemon Blue (and Red).

Building

Only builds on Linux and macOS AFAIK.

$ make

On macOS, you'll need to create a save file too (just the first time):

$ make rom.sav

Running

Get a Pokemon Blue (or Pokemon Red) ROM file. The files that are known to work have the following sha1s:

Name sha1
Pokemon - Blue Version (USA, Europe) (SGB Enhanced).gb d7037c83e1ae5b39bde3c30787637ba1d4c48ce2
Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb ea9bcae617fdf159b045185467ae58b2e4a48b9a

Others might work too, but these are the ones that I've tried.

Rename the file to rom.gb and put it in the current directory. Then run:

$ ./pokegb

The save file is written to rom.sav.

Keys:

Action Key
DPAD-UP
DPAD-DOWN
DPAD-LEFT
DPAD-RIGHT
B Z
A X
START Enter
SELECT Tab

Updating keys

Look for line 24 the source. The following table shows which numbers map to which keyboard keys:

number default key gameboy button
27 X A Button
29 Z B Button
43 Tab Select Button
40 Return Start Button
79 Arrow Right DPAD Right
80 Arrow Left DPAD Left
81 Arrow Down DPAD Down
82 Arrow Up DPAD Up

Replace the numbers on this line with one from the SDL scancode list.

More Repositories

1

smolnes

NES emulator in <5000 bytes of C
C
520
star
2

binjgb

Gameboy emulator implemented in C, that also runs in the browser
C
483
star
3

raw-wasm

Raw WebAssembly demos
WebAssembly
387
star
4

wasm-clang

Running Clang/LLD in WebAssembly Demo
JavaScript
191
star
5

love-nacl

Port of LÖVE to Native Client
C
43
star
6

wasm-e2e

Temporary scaffolding for running WebAssembly end-to-end, from C++ to browsers.
Python
23
star
7

porklike.gb

Gameboy Port of LazyDevs' Porklike
C
22
star
8

doomfirewasm

Doom fire effect, implemented in WebAssembly
HTML
20
star
9

smoothnacl

SmoothLife ported to NaCl
C++
18
star
10

lupica

Very WIP Casio Loopy emulator
C
12
star
11

nacl-nxengine

A port of nxengine to Native Client
C
9
star
12

raytrace-wasm

Mini raytracer in hand-written wasm
WebAssembly
8
star
13

metaball-wasm

WebAssembly metaball effect
WebAssembly
6
star
14

binji.github.io

HTML
5
star
15

binjnes

NES emulator implemented in C, that also runs in the browser
SourcePawn
4
star
16

pnacl.c

PNaCl reader/parser/interpreter in C
C
4
star
17

naclbind.js

JavaScript -> Native Client binding library
JavaScript
4
star
18

pnacl.js

JavaScript
3
star
19

spec.js

JavaScript implementation of the WebAssembly spec
JavaScript
3
star
20

nacl-sdk-gn-experiment

Experimenting with using GN to build the NaCl SDK
Shell
2
star
21

drod-nacl

Port of DROD: Gunthro and the Epic Blunder to NaCl
C++
2
star
22

pexe.py

Python
2
star
23

naclports

clone of https://chromium.googlesource.com/external/naclports.git
C
2
star
24

gabby

experimental clock-edge-ticked gb emulator
C++
2
star
25

gapi-nacl

Google Client APIs for Native Client
Python
2
star
26

pajama

JavaScript
2
star
27

virgil-chip8

chip8 simulator in virgil
Shell
2
star
28

bitmix

Mixing 4-/8-/16-bit values using only multiply/and/shift
JavaScript
2
star
29

mooneye-gb-tests

Cloned and filtered the tests directory from https://github.com/Gekkio/mooneye-gb
Assembly
1
star
30

wasmsummit2021-talk

Slides for my WebAssembly Summit 2021 Talk
JavaScript
1
star
31

sexpr-wasm

sexpression -> wasm
1
star
32

vimrc

Vim Script
1
star
33

ninja-wrap

Simple Python wrapper for ninja
Python
1
star
34

simfun

C++
1
star
35

drod

Mirror of Deadly Rooms of Death, (from http://drod.cvs.sourceforge.net/viewvc/drod/Caravel/?view=tar)
C++
1
star
36

fullstackfest-talk

Slides to the talk I gave at FullStackFest 2016
JavaScript
1
star
37

lucius

Clone of old lucius.vim colorscheme.
Vim Script
1
star
38

gotosthlm-talk

Slides to the talk I gave at GOTO Stockholm 2017
JavaScript
1
star
39

wasi-sdk-bin

C++
1
star