Skip to content

Commit

Permalink
Add illegal instructions as functional nop's
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfierke committed Jan 16, 2024
1 parent e72629a commit b1c1345
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,9 @@ func (cpu *CPU) Execute(mmu *mem.MMU, inst *isa.Instruction) (nextPC uint16, cyc
switch opcode.Addr {
case 0x00:
// NOP
case 0xDB, 0xEC, 0xED:
// ILLEGAL instructions
// These don't do anything, but aren't really the same as a NOP
case 0x01:
// LD BC, n16
cpu.load16(cpu.Reg.BC, cpu.readNext16(mmu))
Expand Down

0 comments on commit b1c1345

Please sign in to comment.