halken

command module
v0.0.0-...-82db094 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2018 License: Unlicense Imports: 9 Imported by: 0

README

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

  1. Tetris
  2. Dr. Mario
  3. Flipull
  4. World Bowling
  5. Minesweeper
  6. Motorcross Maniacs
  7. Hyper Lode Runner
  8. 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

  1. 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)
  2. Implement memory
  3. Test GB bootstrap ROM
  4. Draw tiles
  5. Draw background
  6. Graphics loop
  7. Interrupts
    • VBlank
    • LCD
    • Timer
    • Serial
    • Joypad
  8. Timer
  9. Refactor (direct memory access vs. abstractions), lower LOC, comment
  10. Document process for learners

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cpu emulates the Sharp LR35902 executors contains implementations of assembly instructions registers contains register information and methods instructions contains all CPU instructions
Package cpu emulates the Sharp LR35902 executors contains implementations of assembly instructions registers contains register information and methods instructions contains all CPU instructions
Package io handles reading keyboard inputs and returning them when requested by the CPU Input detection is provided by ebiten and ReadInput is called every frame
Package io handles reading keyboard inputs and returning them when requested by the CPU Input detection is provided by ebiten and ReadInput is called every frame
Package lcd models all functionality related to the Game Boy's video output
Package lcd models all functionality related to the Game Boy's video output
Package mmu contains the GBMMU struct which represents the Game Boy's memory and contains methods related to modifying memory TODO The WriteData and ReadData methods are pretty lean because I am modeling memory as a flat array of bytes.
Package mmu contains the GBMMU struct which represents the Game Boy's memory and contains methods related to modifying memory TODO The WriteData and ReadData methods are pretty lean because I am modeling memory as a flat array of bytes.
Package timer contains functions to modify the GB's timer registers The timer is required to handle things like how quick tetromino should drop, and can provide pseudo-random numbers Realized timer implementation was necessary when Tetris would play correctly, but only would get square tetromino.
Package timer contains functions to modify the GB's timer registers The timer is required to handle things like how quick tetromino should drop, and can provide pseudo-random numbers Realized timer implementation was necessary when Tetris would play correctly, but only would get square tetromino.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL