comparison 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
comparison
equal deleted inserted replaced
92:1ff2c546f5ad 93:4c60ebca1a9d
128 ;;;;;;;;;;; 128 ;;;;;;;;;;;
129 129
130 130
131 ;;;;;;;;;;;;;;; CPU data 131 ;;;;;;;;;;;;;;; CPU data
132 132
133
134
135 (defn cpu-data [size arr-fn] 133 (defn cpu-data [size arr-fn]
136 (let [store (int-array size)] 134 (let [store (int-array size)]
137 (fn [state] (set-state! state) (arr-fn store) store))) 135 (fn [state] (set-state! state) (arr-fn store) store)))
138 136
137 (def memory
138 (cpu-date Gb/GB_MEMORY #(Gb/getMemory %)))
139
139 (def ram 140 (def ram
140 (cpu-data (Gb/getRAMSize) #(Gb/getRAM %))) 141 (cpu-data Gb/RAM_SIZE #(Gb/getRAM %)))
141 142
142 (def rom 143 (def rom
143 (cpu-data (Gb/getROMSize) #(Gb/getROM %))) 144 (cpu-data Gb/ROM_SIZE #(Gb/getROM %)))
144 145
145 (def working-ram 146 (def working-ram
146 (cpu-data Gb/WRAM_SIZE #(Gb/getWRAM %))) 147 (cpu-data Gb/WRAM_SIZE #(Gb/getWRAM %)))
147 148
148 (def video-ram 149 (def video-ram