diff clojure/com/aurellem/gb/gb_driver.clj @ 522:5596cd4a3fc6

added RAM display.
author Robert McIntyre <rlm@mit.edu>
date Sat, 23 Jun 2012 19:12:26 -0500
parents a6d060a64246
children d00096b6bf17
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/gb_driver.clj	Sat Jun 23 17:45:38 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/gb_driver.clj	Sat Jun 23 19:12:26 2012 -0500
     1.3 @@ -154,6 +154,13 @@
     1.4       (set-state! state)
     1.5       (dorun (map (fn [move] (step @current-state move)) moves))
     1.6       [(concat prev moves) @current-state]))
     1.7 +
     1.8 +(defn accurate-memory
     1.9 +  ([^SaveState state address]
    1.10 +     (set-state! state)
    1.11 +     (Gb/readMemory address))
    1.12 +  ([address]
    1.13 +     (accurate-memory @current-state address)))
    1.14    
    1.15  ;;;;;;;;;;;
    1.16  
    1.17 @@ -166,9 +173,6 @@
    1.18    ([^File target]
    1.19       (write-png! @current-state target)))
    1.20  
    1.21 -
    1.22 -
    1.23 -
    1.24  ;;;;;;;;;;;;;;; CPU data
    1.25  
    1.26  (defn cpu-data [size arr-fn]
    1.27 @@ -294,6 +298,4 @@
    1.28  (defn rgb->gb-rb [[r g b :as color]]
    1.29    (let [store (int-array 3)]
    1.30      (Gb/translateRGB (int-array color) store)
    1.31 -    (vec store)))
    1.32 -
    1.33 -
    1.34 +    (vec store)))
    1.35 \ No newline at end of file