From d12c7fdd3860ae3a901e0f26627eab5f47af96d4 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Tue, 10 Jul 2018 20:22:45 +0100 Subject: Move SWAP ops into the extended CB prefixed set --- src/main/kotlin/cpu/Cpu.kt | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/main/kotlin/cpu/Cpu.kt') diff --git a/src/main/kotlin/cpu/Cpu.kt b/src/main/kotlin/cpu/Cpu.kt index 3180aeb..ad006d9 100644 --- a/src/main/kotlin/cpu/Cpu.kt +++ b/src/main/kotlin/cpu/Cpu.kt @@ -8,15 +8,22 @@ class Cpu { val registers = Registers() val ram = Ram() - var opcodes: Map + var standardOpcodes: Map + var extendedOpcodes: Map init { - val commandGroups: MutableMap = mutableMapOf() - commandGroups.putAll(loads8Bit) - commandGroups.putAll(loads16Bit) - commandGroups.putAll(arithmetic8Bit) - commandGroups.putAll(arithmetic16Bit) - commandGroups.putAll(misc) - opcodes = commandGroups.toMap() + val stdCommandGroup: MutableMap = mutableMapOf() + stdCommandGroup.putAll(loads8Bit) + stdCommandGroup.putAll(loads16Bit) + stdCommandGroup.putAll(arithmetic8Bit) + stdCommandGroup.putAll(arithmetic16Bit) + stdCommandGroup.putAll(misc) + standardOpcodes = stdCommandGroup.toMap() + + val extCommandGroup: MutableMap = mutableMapOf() + extCommandGroup.putAll(miscExtended) + extendedOpcodes = extCommandGroup.toMap() + + } } \ No newline at end of file -- cgit v1.2.3