comparison clojure/com/aurellem/exp/item_bridge.clj @ 235:5becef6312b9

working on item-injection; fixed off-by-one error in print-pokedex.
author Robert McIntyre <rlm@mit.edu>
date Sat, 24 Mar 2012 20:05:47 -0500
parents 49a709c555f2
children e23ab90fcc86
comparison
equal deleted inserted replaced
233:49a709c555f2 235:5becef6312b9
77 (set-memory-range 0xD31D (loop-program)) 77 (set-memory-range 0xD31D (loop-program))
78 (set-memory-range 78 (set-memory-range
79 map-function-address-start 79 map-function-address-start
80 [0xD3 0x1D])))) 80 [0xD3 0x1D]))))
81 81
82
83
84
85 (defn-memo corrupt-moves [] 82 (defn-memo corrupt-moves []
86 (concat 83 (concat
87 (first 84 (first
88 (->> 85 (->>
89 [[] (mid-game)] 86 [[] (mid-game)]
102 (first (title))) 99 (first (title)))
103 (advance [] [:start]) 100 (advance [] [:start])
104 (advance [] [:a]) 101 (advance [] [:a])
105 (advance [:a] [:a :start]))) 102 (advance [:a] [:a :start])))
106 [[]])) 103 [[]]))
107
108
109 104
110 (defn corrupt 105 (defn corrupt
111 "enter the codes to destroy the 106 "enter the codes to destroy the
112 pokemon list using save corruption" 107 pokemon list using save corruption"
113 ([^SaveState state] 108 ([^SaveState state]
117 ([] (corrupt @current-state))) 112 ([] (corrupt @current-state)))
118 113
119 (defn mid-game-corrupt [] 114 (defn mid-game-corrupt []
120 (read-state "corrupt-mid-game")) 115 (read-state "corrupt-mid-game"))
121 116
122 117 (defn gen-start-game-corrupt []
123 118 (->> (finish-title)
124 119 (advance [:b] [:a :b :start])
125 120 (play-moves (corrupt-moves))))
121
122 (defn start-game-corrupt []
123 (read-state "corrupt-start-game"))
126 124
127 (defn test-memory-fun [n] 125 (defn test-memory-fun [n]
128 (capture-program-counter 126 (capture-program-counter
129 (set-memory-range 127 (set-memory-range
130 (tick (mid-game)) 128 (tick (mid-game))
196 insertion-address 194 insertion-address
197 (trampoline-assembly (menu-open-state))) 195 (trampoline-assembly (menu-open-state)))
198 (set-memory-range 196 (set-memory-range
199 memory-function-address-start 197 memory-function-address-start
200 insertion-address-bits)))) 198 insertion-address-bits))))
199
200
201
202 ;;map-functions
203
204 ;; Room, Upstairs 0xBO 0x40
205 ;; Room, Downstairs 0x02 0x41
206 ;; Pallet Town 0xFA 0x4D
207 ;; Rival's House 0x3B 0x5C
208 ;; Oak's Lab 0x92 0x43
209 ;; Route 1 0x58 0x43
210 ;; Viridian City 0x2A 0x50
211 ;; Viridian PkmnCenter 0x5D 0x42
212 ;; Viridian Mart 0x7A 0x4C
213 ;; Viridian House #1 0x79 0x4D
214 ;; Viridian House #2 0xD3 0x4D
215 ;; Route 22 0xB3 0x4E
216 ;; League Front Gate 0x8D 0x5F