# HG changeset patch # User Robert McIntyre # Date 1332652103 18000 # Node ID e23ab90fcc8698b037870b777ff2f7405ccb3893 # Parent ff37bc3004a7cd6c15a2ab1d99b6ad21fdac5c8e found appropriate map-function on Route 3 diff -r ff37bc3004a7 -r e23ab90fcc86 clojure/com/aurellem/exp/item_bridge.clj --- a/clojure/com/aurellem/exp/item_bridge.clj Sat Mar 24 23:38:21 2012 -0500 +++ b/clojure/com/aurellem/exp/item_bridge.clj Sun Mar 25 00:08:23 2012 -0500 @@ -178,39 +178,41 @@ 0x1D 0xD3 ;; set first item to lemonade - 0xC3 ;; return control to the game via absolute junp. + 0xC3 ;; return control to the game via absolute jump. (read-map-function-address state) ])) (defn test-trampoline "Demonstrates item-program execution via the map-function that returns control to the main pokemon game after one loop." - [] + [assembly-fn state] (let [insertion-address 0xD33D insertion-address-bits [0x3D 0xD3]] (-> - (menu-open-state) + state (set-memory-range insertion-address - (trampoline-assembly (menu-open-state))) + (assembly-fn state)) (set-memory-range memory-function-address-start insertion-address-bits)))) +(def lemonade-trampoline (partial test-trampoline + trampoline-assembly + (menu-open-state))) +(defn trampoline-assembly-burn-heal [^SaveState state] + (flatten + [0x3E ;; + 0x3E ;; load lemonade into A + + 0xEA + 0x1D + 0xD3 ;; set first item to lemonade + + 0xC3 ;; return control to the game via absolute jump. + 0x0C ;; return control to Route 3's map-function + 0x55 + ])) -;;map-functions -;; Room, Upstairs 0xBO 0x40 -;; Room, Downstairs 0x02 0x41 -;; Pallet Town 0xFA 0x4D -;; Rival's House 0x3B 0x5C -;; Oak's Lab 0x92 0x43 -;; Route 1 0x58 0x43 -;; Viridian City 0x2A 0x50 -;; Viridian PkmnCenter 0x5D 0x42 -;; Viridian Mart 0x7A 0x4C -;; Viridian House #1 0x79 0x4D -;; Viridian House #2 0xD3 0x4D -;; Route 22 0xB3 0x4E -;; League Front Gate 0x8D 0x5F \ No newline at end of file diff -r ff37bc3004a7 -r e23ab90fcc86 clojure/com/aurellem/exp/map-functions.txt --- a/clojure/com/aurellem/exp/map-functions.txt Sat Mar 24 23:38:21 2012 -0500 +++ b/clojure/com/aurellem/exp/map-functions.txt Sun Mar 25 00:08:23 2012 -0500 @@ -23,4 +23,4 @@ Pewter PkmnCenter 0x7A 0x44 Pewter House #1 0x92 0x4E Pewter House #2 0x3C 0x4E - +Route 3 0x0C 0x55 ** This will work!