comparison clojure/com/aurellem/exp/item_bridge.clj @ 174:5ce074824fac

made functions more convienent for repl use.
author Robert McIntyre <rlm@mit.edu>
date Wed, 21 Mar 2012 03:38:46 -0500
parents 8665160f0f3d
children 95b2758dd517
comparison
equal deleted inserted replaced
173:8665160f0f3d 174:5ce074824fac
60 (com.aurellem.gb.Gb/tick) 60 (com.aurellem.gb.Gb/tick)
61 (recur (inc i) 61 (recur (inc i)
62 (conj pcs (first (registers)))))))) 62 (conj pcs (first (registers))))))))
63 63
64 (defn loop-program [] 64 (defn loop-program []
65 [0xF3 ;0xD31D ;; disable-interrupts 65 [0x00 ;0xD31D ;; disable-interrupts
66 66
67 0xC3 ;; loop forever 67 0xC3 ;; loop forever
68 0x1D 68 0x1D
69 0xD3]) 69 0xD3])
70 70
71 (def map-function-address-start 0xD36D) 71 (def map-function-address-start 0xD36D)
72 72
73 (defn test-loop [] 73 (defn test-loop []
74 (capture-program-counter 74 (continue!
75 (-> (mid-game) 75 (-> (mid-game)
76 (set-memory-range 0xD31D (loop-program)) 76 (set-memory-range 0xD31D (loop-program))
77 (set-memory-range 77 (set-memory-range
78 map-function-address-start 78 map-function-address-start
79 [0xD3 0x1D]) 79 [0xD3 0x1D]))))
80 (IE! 0)) 80
81 1000)) 81
82 82
83 83
84 (defn-memo corrupt-moves [] 84 (defn-memo corrupt-moves []
85 (concat 85 (concat
86 (first 86 (first