Mercurial > vba-clojure
diff clojure/com/aurellem/exp/item_bridge.clj @ 212:8523faa122b0
fixed compilaition error in dylan's code
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 23 Mar 2012 18:06:37 -0500 |
parents | 426fce7e609d |
children | 49a709c555f2 |
line wrap: on
line diff
1.1 --- a/clojure/com/aurellem/exp/item_bridge.clj Fri Mar 23 05:58:41 2012 -0500 1.2 +++ b/clojure/com/aurellem/exp/item_bridge.clj Fri Mar 23 18:06:37 2012 -0500 1.3 @@ -119,15 +119,11 @@ 1.4 (defn mid-game-corrupt [] 1.5 (read-state "corrupt-mid-game")) 1.6 1.7 -(defn prepare-memory 1.8 - ([^SaveState state] 1.9 - (-> state 1.10 - (set-memory-range 0xD31D (loop-program)) 1.11 - (set-memory-range 0xD336 [0x1D 0xD3]))) 1.12 - ([] (prepare-memory @current-state))) 1.13 + 1.14 1.15 1.16 1.17 + 1.18 (defn test-memory-fun [n] 1.19 (capture-program-counter 1.20 (set-memory-range 1.21 @@ -141,3 +137,29 @@ 1.22 ;;(def bad (test-memory-fun 18000)) 1.23 1.24 1.25 + 1.26 +(defn menu-open-state [] 1.27 + (read-state "menu-open")) 1.28 + 1.29 +(defn prepare-memory 1.30 + ([^SaveState state] 1.31 + (-> state 1.32 + (set-memory-range 0xD31D (loop-program)) 1.33 + (set-memory-range 0xD36D [0x1D 0xD3]))) 1.34 + ([] (prepare-memory @current-state))) 1.35 + 1.36 + 1.37 +(defn succesful-PC-capture 1.38 + "This function demonstrates successful PC capturing by 1.39 + setting 0xD36D to the value of the start location of 1.40 + a specially prepared program. 1.41 + 1.42 + You must run the function and then exit the open menu 1.43 + to see the effect." 1.44 + [] 1.45 + (dorun 1.46 + (map #(println (Integer/toHexString %)) 1.47 + (capture-program-counter 1.48 + (prepare-memory (menu-open-state)) 1.49 + 9000000)))) 1.50 + 1.51 \ No newline at end of file