halken
halken copied to clipboard
A Game Boy emulator written in Go
halken
Video games are meant to be just one thing. Fun. Fun for everyone.
Satoru Iwata
Halken is a Game Boy emulator written in Go being developed during my time at the Recurse Center. The name is one used by HAL Laboratories for a time. HAL was the first company where Satoru Iwata was a video game programmer.
I intend to have lots of comments as well as a document regarding the process. Once I am happy with 32KB games generally working I'll be cleaning the code and writing documentation for others who want to tackle the same project.
Known working games
Usage: halken /path/to/rom
- Tetris
- Dr. Mario
- Flipull
- World Bowling
- Minesweeper
- Motorcross Maniacs
- Hyper Lode Runner
- Battlecity
Known bugs
- LCD STAT interrupt is only partially correct - need to make sure all cases are covered
- Breaks certain games like Game of Harmony, which gets weird graphics due to it not firing when it should
- Sprite color palettes besides default are unimplemented
- 8x16 sprites aren't drawn properly, get cut off
TODO
- ~Implement CPU opcodes~
- ~Non-CB opcodes implemented~
- ~Write dispatch loop~
- Use blargg's test output to fix instructions
- ~01 - special~
- 02 - interrupts
- ~03 - op sp,hl~
- ~04 - op r,imm~
- ~05 - op rp~
- ~06 - ld r,r~
- ~07 - jr,jp,call,ret,rst~
- ~08 - misc instrs~
- ~09 - op r,r~
- ~10 - bit ops~
- ~11 - op a,(hl)~
- ~Implement memory~
- ~Test GB bootstrap ROM~
- ~Draw tiles~
- ~Draw background~
- ~Graphics loop~
- Interrupts
- ~VBlank~
- ~LCD~
- ~Timer~
- ~Serial~
- ~Joypad~
- ~Timer~
- ~Refactor (direct memory access vs. abstractions), lower LOC, comment~
- Document process for learners