comparison clojure/com/aurellem/gb_driver.clj @ 66:43d4fb2a6fc2

resets now work correctly
author Robert McIntyre <rlm@mit.edu>
date Wed, 07 Mar 2012 23:23:15 -0600
parents 60c768964937
children 8cb500493ec2
comparison
equal deleted inserted replaced
65:60c768964937 66:43d4fb2a6fc2
1 (ns com.aurellem.gb-driver 1 (ns com.aurellem.gb-driver
2 (:import com.aurellem.gb.Gb) 2 (:import com.aurellem.gb.Gb)
3 (:import java.io.File) 3 (:import java.io.File)
4 (:import (java.nio IntBuffer ByteOrder))) 4 (:import (java.nio IntBuffer ByteOrder)))
5 5
6 (Gb/loadVBA)
6 7
7 (def yellow-rom-image 8 (def yellow-rom-image
8 (File. "/home/r/proj/pokemon-escape/roms/yellow.gbc")) 9 (File. "/home/r/proj/pokemon-escape/roms/yellow.gbc"))
9 10
10 (defn vba-init [] 11 (defn vba-init []
11 (Gb/loadVBA)
12 (future 12 (future
13 (Gb/startEmulator (.getCanonicalPath yellow-rom-image)))) 13 (Gb/startEmulator (.getCanonicalPath yellow-rom-image))))
14 14
15 (defn cpu-data [size arr-fn] 15 (defn cpu-data [size arr-fn]
16 (let [store (int-array size)] 16 (let [store (int-array size)]
41 :l 0x0020 41 :l 0x0020
42 :r 0x0010 42 :r 0x0010
43 :u 0x0040 43 :u 0x0040
44 :d 0x0080 44 :d 0x0080
45 45
46 :0 0x0000
47
46 :select 0x0004 48 :select 0x0004
47 :start 0x0008 49 :start 0x0008
48 :restart 0x0800}) 50 :restart 0x0800})
49 51
50 (defn keycode [& keys] 52 (defn keycode [& keys]