Upgrade to Pro — share decks privately, control downloads, hide ads and more …

8-bit Emulator Programming with Go

8-bit Emulator Programming with Go

Introduction to emulator programming including source code of a Game Boy emulator written in Go: https://github.com/drhelius/demo-emulator

This was presented at Codemotion 2016 (Madrid, Spain): https://2016.codemotion.es

Ignacio Sanchez Gines

November 19, 2016
Tweet

Other Decks in Programming

Transcript

  1. Dynamic Recompilation Trans Read Exec LD A,(HL) SUB 1 JR

    C,CONTINUE CP B JR NZ,LOOP Target Machine Code
  2. CPU 6502 Z80 Game Boy * Master System Game Gear

    MSX ZX Spectrum NES Atari 2600 Commodore 64 Apple 2 Super NES 65816
  3. CPU H L B C D E SP PC A

    F 16 bit 8 bit
  4. Flags 0 0 H C 0 0 Z N 1

    0 5 4 3 2 7 6
  5. 16 KB ROM Bank 0 16 KB switchable ROM bank

    8 KB Video RAM 8 KB switchable RAM bank 8 KB internal RAM Mirror 8 KB internal RAM Sprite Memory (OAM) Empty IO Ports Empty Internal RAM Interrupt Register cartridge FF4C FF80 FEA0 FF00 FFFF FE00 E000 C000 A000 8000 4000 0000 cartridge
  6. Bank 0 Bank 1 Bank 2 Bank 3 Bank 4

    ... fixed 00000 04000 08000 0C000 10000 14000 switchable Bank 4