diff clojure/com/aurellem/gb_driver.clj @ 94:612393a0d3a0

fixed memory retrieval function to use the simulated gameboy's mapped memory
author Robert McIntyre <rlm@mit.edu>
date Sun, 11 Mar 2012 20:55:21 -0500
parents 4c60ebca1a9d
children b74a578d0c88
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb_driver.clj	Sun Mar 11 20:16:09 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb_driver.clj	Sun Mar 11 20:55:21 2012 -0500
     1.3 @@ -132,10 +132,13 @@
     1.4  
     1.5  (defn cpu-data [size arr-fn]
     1.6    (let [store (int-array size)]
     1.7 -    (fn [state] (set-state! state) (arr-fn store) store)))
     1.8 +    (fn get-data
     1.9 +      ([] (get-data @current-state))
    1.10 +      ([state]
    1.11 +         (set-state! state) (arr-fn store) store))))
    1.12  
    1.13  (def memory
    1.14 -  (cpu-date Gb/GB_MEMORY #(Gb/getMemory %)))
    1.15 +  (cpu-data Gb/GB_MEMORY #(Gb/getMemory %)))
    1.16  
    1.17  (def ram
    1.18    (cpu-data Gb/RAM_SIZE #(Gb/getRAM %)))