Mercurial > vba-clojure
comparison clojure/com/aurellem/exp/item_bridge.clj @ 238:e23ab90fcc86
found appropriate map-function on Route 3
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sun, 25 Mar 2012 00:08:23 -0500 |
parents | 5becef6312b9 |
children | 19fd38fe376e |
comparison
equal
deleted
inserted
replaced
237:ff37bc3004a7 | 238:e23ab90fcc86 |
---|---|
176 | 176 |
177 0xEA | 177 0xEA |
178 0x1D | 178 0x1D |
179 0xD3 ;; set first item to lemonade | 179 0xD3 ;; set first item to lemonade |
180 | 180 |
181 0xC3 ;; return control to the game via absolute junp. | 181 0xC3 ;; return control to the game via absolute jump. |
182 (read-map-function-address state) | 182 (read-map-function-address state) |
183 ])) | 183 ])) |
184 | 184 |
185 (defn test-trampoline | 185 (defn test-trampoline |
186 "Demonstrates item-program execution via the map-function that | 186 "Demonstrates item-program execution via the map-function that |
187 returns control to the main pokemon game after one loop." | 187 returns control to the main pokemon game after one loop." |
188 [] | 188 [assembly-fn state] |
189 (let [insertion-address 0xD33D | 189 (let [insertion-address 0xD33D |
190 insertion-address-bits [0x3D 0xD3]] | 190 insertion-address-bits [0x3D 0xD3]] |
191 (-> | 191 (-> |
192 (menu-open-state) | 192 state |
193 (set-memory-range | 193 (set-memory-range |
194 insertion-address | 194 insertion-address |
195 (trampoline-assembly (menu-open-state))) | 195 (assembly-fn state)) |
196 (set-memory-range | 196 (set-memory-range |
197 memory-function-address-start | 197 memory-function-address-start |
198 insertion-address-bits)))) | 198 insertion-address-bits)))) |
199 | 199 |
200 | 200 (def lemonade-trampoline (partial test-trampoline |
201 | 201 trampoline-assembly |
202 ;;map-functions | 202 (menu-open-state))) |
203 | 203 |
204 ;; Room, Upstairs 0xBO 0x40 | 204 (defn trampoline-assembly-burn-heal [^SaveState state] |
205 ;; Room, Downstairs 0x02 0x41 | 205 (flatten |
206 ;; Pallet Town 0xFA 0x4D | 206 [0x3E ;; |
207 ;; Rival's House 0x3B 0x5C | 207 0x3E ;; load lemonade into A |
208 ;; Oak's Lab 0x92 0x43 | 208 |
209 ;; Route 1 0x58 0x43 | 209 0xEA |
210 ;; Viridian City 0x2A 0x50 | 210 0x1D |
211 ;; Viridian PkmnCenter 0x5D 0x42 | 211 0xD3 ;; set first item to lemonade |
212 ;; Viridian Mart 0x7A 0x4C | 212 |
213 ;; Viridian House #1 0x79 0x4D | 213 0xC3 ;; return control to the game via absolute jump. |
214 ;; Viridian House #2 0xD3 0x4D | 214 0x0C ;; return control to Route 3's map-function |
215 ;; Route 22 0xB3 0x4E | 215 0x55 |
216 ;; League Front Gate 0x8D 0x5F | 216 ])) |
217 | |
218 |