diff --git a/chip8/chip8.go b/chip8/chip8.go index d8e8223..f5fcd2f 100644 --- a/chip8/chip8.go +++ b/chip8/chip8.go @@ -129,7 +129,9 @@ func (emulator *Emulator) Cycle() { case 0xE: switch instruction & 0x00FF { case 0x9E: // SKP Vx + emulator.SkipKeyPressed(x) case 0xA1: // SKNP Vx + emulator.SkipKeyNotPressed(x) } case 0xF: switch instruction & 0x00FF { diff --git a/chip8/instructions.go b/chip8/instructions.go index 500a9fe..269a9d7 100644 --- a/chip8/instructions.go +++ b/chip8/instructions.go @@ -227,3 +227,19 @@ func (emulator *Emulator) Draw(x uint8, y uint8, n uint8) { } } } + +// Skip next instruction if key with the value of Vx is pressed. +// +// Checks the keyboard, and if the key corresponding to the value of Vx +// is currently in the down position, PC is increased by 2. +func (emulator *Emulator) SkipKeyPressed(x uint8) { + // TODO: implement input +} + +// Skip next instruction if key with the value of Vx is not pressed. +// +// Checks the keyboard, and if the key corresponding to the value of Vx +// is currently in the up position, PC is increased by 2. +func (emulator *Emulator) SkipKeyNotPressed(x uint8) { + // TODO: implement input +}