Skip to content

raphaklaus/gameboy-cpu

Repository files navigation

Game Boy CPU Emulator

Motivation

Understand how CPU's works in low level but keeping the implementation at the highest level possible.

The idea is scrapping the CPU manuals to retrieve most data possible and make the CPU implementation less manual.

This is a WIP project, you can take a look at the output.json inside src/scrapper to have an idea how the specifications is been built.

All the opcodes are separated by groups of operations. Like ld, call and bit since there is no need to have repeated blocks of code, I just tweak each opcode with the informations from output.json mentioned earlier.

Internals

CPU

Flags:

  • Z (zero)
  • N (Subtract)
  • H (Half Carry)
  • C (Carry)

Registers 8-bit:

  • A
  • B
  • C
  • D
  • E
  • H
  • L

Registers 16-bit:

  • AF (Accumulator and Flags)
  • BC
  • DE
  • HL
  • SP (Stack Pointer)
  • PC (Program Counter)

Interrupts:

  • HBlank
  • VBlank
  • IO
  • More TBD

Memory

32 Kb built-in initially.

References

http:https://zenol.fr/gb-doc/gameboy-opcodes.html http:https://www.devrs.com/gb/files/opcodes.html https://rednex.github.io/rgbds/gbz80.7.html

About

[WIP] High level Nintendo Game Boy CPU emulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published