comparison clojure/com/aurellem/gb/util.clj @ 176:95b2758dd517

wrote functions to read and write pokemon DV values and status
author Robert McIntyre <rlm@mit.edu>
date Wed, 21 Mar 2012 22:13:43 -0500
parents 5ce074824fac
children fd549c8f42ae
comparison
equal deleted inserted replaced
175:5d9a7a0ca09a 176:95b2758dd517
40 (binary-str (aget (memory state) mem)))) 40 (binary-str (aget (memory state) mem))))
41 state) 41 state)
42 ([mem] 42 ([mem]
43 (view-memory @current-state mem))) 43 (view-memory @current-state mem)))
44 44
45 (defn print-listing [state begin end] 45 (defn print-listing
46 (dorun (map 46 ([^SaveState state begin end]
47 (fn [opcode line] 47 (dorun (map
48 (println (format "0x%04X: 0x%02X" line opcode))) 48 (fn [opcode line]
49 (subvec (vec (memory state)) begin end) 49 (println (format "0x%04X: 0x%02X" line opcode)))
50 (range begin end))) 50 (subvec (vec (memory state)) begin end)
51 state) 51 (range begin end)))
52 state)
53 ([begin end]
54 (print-listing @current-state begin end)))
52 55
53 (defn print-pc 56 (defn print-pc
54 ([^SaveState state] 57 ([^SaveState state]
55 (println (format "PC: 0x%04X" (PC state))) 58 (println (format "PC: 0x%04X" (PC state)))
56 state) 59 state)