golangemusIgnacio Sánchez Ginés
@drhelius
Emulator = legalROM = ilegal
InterpreterLD A,(HL)SUB 1JR C,CONTINUECP BJR NZ,LOOP
Decode
Read
Exec
Binary Translation
TargetMachineCode
LD A,(HL)SUB 1JR C,CONTINUECP BJR NZ,LOOP
Dynamic Recompilation
Trans
Read
Exec
LD A,(HL)SUB 1JR C,CONTINUECP BJR NZ,LOOP
TargetMachineCode
CPU6502 Z80
Game Boy *Master SystemGame Gear
MSXZX Spectrum
NESAtari 2600Commodore 64
Apple 2Super NES 65816
8DC4F3CD293D2144FF3E92BE20FDCD0C........
parameter
opcode opcodeopcode
parameter
Main Loopwhile true {
updateCPU() updateVideo() updateInput() updateAudio()
}
updateCPU() { opcode = fetchOpcode()runOpcode(opcode)
}
Flags
0 0H C 0 0Z N1 05 4 3 27 6
16 KB ROM Bank 016 KB switchable ROM bank
8 KB Video RAM
8 KB switchable RAM bank8 KB internal RAM
Mirror 8 KB internal RAMSprite Memory (OAM)
EmptyIO PortsEmpty
Internal RAM
Interrupt Register
cartridge
FF4CFF80
FEA0
FF00
FFFF
FE00E000
C000A000
80004000
0000
cartridge
16 KB ROM Bank 0
16 KB switchable ROM bank
8000
4000
0000
Workshop
go get -u github.com/drhelius/demo-emulator
cd $GOPATH/src/github.com/drhelius
go run main.go -rom workshop.rom