little change on the "LD Vx, [I]" instruction

This commit is contained in:
Jairinho 2022-03-01 21:11:29 -03:00
parent a9399f2d17
commit 20f2660faf
No known key found for this signature in database
GPG Key ID: 954589B18A21D5B6

View File

@ -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. // The interpreter reads values from memory starting at location I into registers V0 through Vx.
func (emulator *Emulator) ReadRegisters(x uint8) { 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:])
} }