From 20f2660faf7cbf1db8ff2fa1a1c35b13bb394645 Mon Sep 17 00:00:00 2001 From: Jairinho Date: Tue, 1 Mar 2022 21:11:29 -0300 Subject: [PATCH] little change on the "LD Vx, [I]" instruction --- chip8/instructions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chip8/instructions.go b/chip8/instructions.go index 3c24377..32677a8 100644 --- a/chip8/instructions.go +++ b/chip8/instructions.go @@ -317,5 +317,5 @@ func (emulator *Emulator) StoreRegisters(x uint8) { // // The interpreter reads values from memory starting at location I into registers V0 through Vx. func (emulator *Emulator) ReadRegisters(x uint8) { - copy(emulator.V[0:], emulator.Memory[emulator.I:emulator.I+uint16(x)+1]) + copy(emulator.V[:x+1], emulator.Memory[emulator.I:]) }