blob: feb89bceefa01e1c941c35551b71a5b08801ecee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package cpu
import cpu.opcodes.*
import ram.Ram
class Cpu {
val registers = Registers()
val ram = Ram()
var standardOpcodes: Map<Int, Operation>
var extendedOpcodes: Map<Int, Operation>
init {
val stdCommandGroup: MutableMap<Int, Operation> = mutableMapOf()
stdCommandGroup.putAll(loads8Bit)
stdCommandGroup.putAll(loads16Bit)
stdCommandGroup.putAll(arithmetic8Bit)
stdCommandGroup.putAll(arithmetic16Bit)
stdCommandGroup.putAll(misc)
stdCommandGroup.putAll(rotates)
standardOpcodes = stdCommandGroup.toMap()
val extCommandGroup: MutableMap<Int, Operation> = mutableMapOf()
extCommandGroup.putAll(miscExtended)
extCommandGroup.putAll(rotatesExtended)
extCommandGroup.putAll(shiftsExtended)
extCommandGroup.putAll(generateExtendedBitOps())
extendedOpcodes = extCommandGroup.toMap()
}
}
|