Mercurial > vba-clojure
diff clojure/com/aurellem/gb_driver.clj @ 96:cb487c4ce5c0
added write-memory!, which allows me to write any value to the
gameboy's memory-mapped rom or ram.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 11 Mar 2012 23:27:19 -0500 |
parents | b74a578d0c88 |
children | 9fad96094950 |
line wrap: on
line diff
1.1 --- a/clojure/com/aurellem/gb_driver.clj Sun Mar 11 23:10:44 2012 -0500 1.2 +++ b/clojure/com/aurellem/gb_driver.clj Sun Mar 11 23:27:19 2012 -0500 1.3 @@ -155,6 +155,13 @@ 1.4 (def registers 1.5 (cpu-data Gb/NUM_REGISTERS #(Gb/getRegisters %))) 1.6 1.7 + 1.8 +(defn write-memory! [new-memory] 1.9 + (let [store (int-array new-memory)] 1.10 + (assert (= Gb/GB_MEMORY) (count new-memory)) 1.11 + (Gb/writeMemory new-memory))) 1.12 + 1.13 + 1.14 ;; TODO add register names 1.15 1.16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;