view clojure/com/aurellem/gb_driver.clj @ 64:02bca9640f3f

refactor clojure level
author Robert McIntyre <rlm@mit.edu>
date Wed, 07 Mar 2012 20:47:25 -0600
parents c44cf1f5954c
children 60c768964937
line wrap: on
line source
1 (ns com.aurellem.gb-driver
2 (:import com.aurellem.gb.Gb)
3 (:import (java.nio IntBuffer ByteOrder)))
5 (defn vba-init []
6 (Gb/loadVBA)
7 (future
8 (Gb/startEmulator "/home/r/proj/pokemon-escape/roms/yellow.gbc")))
10 (defn cpu-data [size arr-fn]
11 (let [store (int-array size)]
12 (fn []
13 (arr-fn store)
14 store)))
16 (def ram
17 (cpu-data (Gb/getRAMSize) #(Gb/getRAM %)))
19 (def rom
20 (cpu-data (Gb/getROMSize) #(Gb/getROM %)))
22 (def working-ram
23 (cpu-data Gb/WRAM_SIZE #(Gb/getWRAM %)))
25 (def video-ram
26 (cpu-data Gb/VRAM_SIZE #(Gb/getVRAM %)))
28 (def registers
29 (cpu-data Gb/NUM_REGISTERS #(Gb/getRegisters %)))