Mercurial > vba-clojure
view clojure/com/aurellem/gb_driver.clj @ 70:ff6f1acae59e
removed zero frame confusion
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 08 Mar 2012 02:25:20 -0600 |
parents | 8cb500493ec2 |
children | 39928bf4622d |
line wrap: on
line source
1 (ns com.aurellem.gb-driver2 (:import com.aurellem.gb.Gb)3 (:import java.io.File)4 (:import (java.nio IntBuffer ByteOrder)))6 (Gb/loadVBA)8 (def yellow-rom-image9 (File. "/home/r/proj/pokemon-escape/roms/yellow.gbc"))11 (def yellow-save-file12 (File. "/home/r/proj/pokemon-escape/roms/yellow.sav"))14 (defn vba-init []15 (.delete yellow-save-file)16 (Gb/startEmulator (.getCanonicalPath yellow-rom-image)))18 (defn cpu-data [size arr-fn]19 (let [store (int-array size)]20 (fn []21 (arr-fn store)22 store)))24 (def ram25 (cpu-data (Gb/getRAMSize) #(Gb/getRAM %)))27 (def rom28 (cpu-data (Gb/getROMSize) #(Gb/getROM %)))30 (def working-ram31 (cpu-data Gb/WRAM_SIZE #(Gb/getWRAM %)))33 (def video-ram34 (cpu-data Gb/VRAM_SIZE #(Gb/getVRAM %)))36 (def registers37 (cpu-data Gb/NUM_REGISTERS #(Gb/getRegisters %)))39 (defn step40 ([] (Gb/step))41 ([mask] (Gb/step mask)))43 (defn shutdown [] (Gb/shutdown))