aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/ram/Ram.kt
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2018-07-21 19:46:20 +0100
committerJames Barnett <noreply@jamesbarnett.xyz>2018-07-21 19:46:20 +0100
commitc6a953d722b1fdc27a9db6f78f00c52fe43a7222 (patch)
tree6efab06c40d0bd3c26876ca2b40f2f0f20b2def2 /src/main/kotlin/ram/Ram.kt
parent2861f2db6f918c48019c1ac3f91bf6a407452493 (diff)
downloadKGB-c6a953d722b1fdc27a9db6f78f00c52fe43a7222.tar.xz
KGB-c6a953d722b1fdc27a9db6f78f00c52fe43a7222.zip
Add ability to step through CPU execution of boot rom
Diffstat (limited to 'src/main/kotlin/ram/Ram.kt')
-rw-r--r--src/main/kotlin/ram/Ram.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/kotlin/ram/Ram.kt b/src/main/kotlin/ram/Ram.kt
index 93336a7..7614040 100644
--- a/src/main/kotlin/ram/Ram.kt
+++ b/src/main/kotlin/ram/Ram.kt
@@ -13,4 +13,11 @@ class Ram {
ram[address] = data
}
+ fun load(rom: ByteArray) {
+
+ rom.forEachIndexed{i, b ->
+ ram[i] = b.toInt() and 0xFF
+ }
+ }
+
} \ No newline at end of file