diff clojure/com/aurellem/gb_driver.clj @ 93:4c60ebca1a9d

added function to get all the GB's memory.
author Robert McIntyre <rlm@mit.edu>
date Sun, 11 Mar 2012 20:16:09 -0500
parents 65c2854c5875
children 612393a0d3a0
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb_driver.clj	Sun Mar 11 19:07:31 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb_driver.clj	Sun Mar 11 20:16:09 2012 -0500
     1.3 @@ -130,17 +130,18 @@
     1.4  
     1.5  ;;;;;;;;;;;;;;; CPU data
     1.6  
     1.7 -
     1.8 -
     1.9  (defn cpu-data [size arr-fn]
    1.10    (let [store (int-array size)]
    1.11      (fn [state] (set-state! state) (arr-fn store) store)))
    1.12  
    1.13 +(def memory
    1.14 +  (cpu-date Gb/GB_MEMORY #(Gb/getMemory %)))
    1.15 +
    1.16  (def ram
    1.17 -  (cpu-data (Gb/getRAMSize) #(Gb/getRAM %)))
    1.18 +  (cpu-data Gb/RAM_SIZE #(Gb/getRAM %)))
    1.19  
    1.20  (def rom 
    1.21 -  (cpu-data (Gb/getROMSize) #(Gb/getROM %)))
    1.22 +  (cpu-data Gb/ROM_SIZE #(Gb/getROM %)))
    1.23  
    1.24  (def working-ram 
    1.25    (cpu-data Gb/WRAM_SIZE #(Gb/getWRAM %)))