# HG changeset patch # User Robert McIntyre # Date 1333738328 18000 # Node ID 5c2041d1cdda7c9b22b89982a29964c0e0a62551 # Parent 6ec288064d492132a64b90c3f3481efa6f5e8a9c solving problem with rival name becomming a key item. diff -r 6ec288064d49 -r 5c2041d1cdda clojure/com/aurellem/exp/notes.txt --- a/clojure/com/aurellem/exp/notes.txt Fri Apr 06 12:18:58 2012 -0500 +++ b/clojure/com/aurellem/exp/notes.txt Fri Apr 06 13:52:08 2012 -0500 @@ -3,7 +3,7 @@ start game name rival "LU" -(0x8B 0xE1 0x94 0xE1 0xE1 0x in character codes) +(0x8B 0xE1 0x95 0xE1 0xE1 0x in character codes) get pikachu, fight rival, deliver oak's parcel, go back to viridian poke mart. @@ -37,6 +37,9 @@ ;; Second part of program to swap item ID and quantity at ;; fixed address. +0x00 ;; decrement HL +0x2B + 0x00 ;; this starts at address 0xD56C 0x2A ;; save (HL)=(target) to A, increment HL @@ -58,7 +61,7 @@ burn-heal (0x0C) x 95 (0x5F) -- address of Route 3 memory-function -[repeat the following 8 times] +[repeat the following 4 times] 0xFF 0x01 [end repeat] @@ -137,7 +140,7 @@ 0x91 "R" ; [x] 0x92 "S" ; [x] 0x93 "T" ; [good] - 0x94 "U" ; [good] + 0x94 "U" ; [good] [key :(] 0x95 "V" ; [good] 0x96 "W" ; [x] 0x97 "X" ; [x] diff -r 6ec288064d49 -r 5c2041d1cdda clojure/com/aurellem/run/bootstrap_0.clj --- a/clojure/com/aurellem/run/bootstrap_0.clj Fri Apr 06 12:18:58 2012 -0500 +++ b/clojure/com/aurellem/run/bootstrap_0.clj Fri Apr 06 13:52:08 2012 -0500 @@ -28,15 +28,38 @@ [] [] [:r] [] [:d] [:a] ;; L [:r] [] [:r] [] [:r] [] [:r] [] [:r] [] [:d] [] [:d] [:a] ;; [PK] - [:u] [] [:l] [] [:l] [] - [:l] [] [:l] [] [:l] [:a] ;; U - [:r] [] [:r] [] [:r] [] - [:r] [] [:r] [] [:d] [:a] ;; [PK] + [:u] [] [:l] [] [:l] [] [:l] [] + [:l] [] [:l] [] [:a] ;; U + [:r] [] [:r] [] [:r] [] [:r] [] + [:r] [] [] [:d] [:a] ;; [PK] [] [:a] ;; [PK] [] [:a] ;; [PK] [:r] [] [:d] [:a] ;; END ])))) +;; (defn-memo name-rival-bootstrap +;; ([] (name-rival-bootstrap (to-rival-name))) +;; ([script] +;; (->> script +;; (first-difference [] [:a] AF) +;; (first-difference [] [:r] DE) +;; (play-moves +;; [[] +;; [] [] [:r] [] +;; [:r] [] [:r] [] [:r] [] [:r] [] +;; [:r] [] [:d] [] [:d] [] [:d] [:a];; PK +;; [] [:a] ;; PK +;; [:u] [] [:l] [] [:l] [] [:l] [] +;; [:l] [] [:l] [:a] ;; U +;; [:d] [] [:r] [] [:r] [] [:r] [] +;; [:r] [] [:r] [:a] ;; PK +;; [:u] [] [:l] [] [:l] [] [:l] [] +;; [:l] [] [:l] [] [:u] [:a] ;; L +;; [:d] [] [:r] [] [:r] [] [:r] [] +;; [:r] [] [:r] [] [:d] [:a] ;; PK +;; [:r] [] [:d] [:a] ;; END +;; ])))) + (defn-memo leave-house ([] (leave-house (name-rival-bootstrap))) ([script] @@ -270,9 +293,9 @@ → → → ↓]) (walk-thru-grass - [↓ ↓ ↓]) + [↓ ↓ ↓ ↓]) - (walk [↓ ← ← ↓ ↓ ↓ ↓ ↓ ↓]) + (walk [← ← ↓ ↓ ↓ ↓ ↓ ↓]) (walk-thru-grass [↓ ↓ ↓ ↓ ↓ ↓]) @@ -352,8 +375,6 @@ (aget mem list-cursor-offset-address)))) ([] (list-offset @current-state))) - - (defn exp-item-selection [] (clojure.pprint/pprint (apply memory-compare @@ -421,6 +442,18 @@ (defn activate-start-menu [script] (first-difference [:b] [:b :start] AF script)) +(defn wait-until [script-fn script] + (let [wait-time + (- (dec (count (first (script-fn script)))) + (count (first script)))] + (println "wait-time" wait-time) + (do-nothing wait-time script))) + +(defn select-menu-entry [script] + (->> script + (wait-until (partial set-cursor-relative 1)) + (play-moves [[:a] []]))) + (defn-memo do-save-corruption ([] (do-save-corruption (walk-to-counter))) @@ -455,12 +488,7 @@ (defn close-menu [script] (first-difference [] [:b] AF script)) -(defn wait-until [script-fn script] - (let [wait-time - (- (dec (count (first (script-fn script)))) - (count (first script)))] - (println "wait-time" wait-time) - (do-nothing wait-time script))) + ;; (defn select-menu-entry* [script] ;; (let [wait-time @@ -469,10 +497,6 @@ ;; (println "wait-time" wait-time) ;; (play-moves (concat (repeat wait-time []) [[:a] []]) script))) -(defn select-menu-entry [script] - (->> script - (wait-until (partial set-cursor-relative 1)) - (play-moves [[:a] []]))) (defn purchase-item "Assumes that the cursor is over the desired item, and purchases @@ -506,7 +530,7 @@ (set-cursor 9) select-menu-entry ; switch 6th with 10th close-menu - close-menu))) + close-menu ))) (defn-memo get-lots-of-money "Sell 0xFE cancel buttons to make a tremendous amount of money." @@ -519,9 +543,12 @@ select-menu-entry (repeat-until-different [] list-offset) select-menu-entry - (set-quantity 0xFF 0xFE) - (scroll-text) - select-menu-entry))) + (set-quantity 0xFF 0xF7) + (first-difference [] [:a] AF) + select-menu-entry + close-menu + ))) + (defn note [str script] (println str) script) @@ -705,9 +732,9 @@ [;; first part of item manipulation program 0x00 - 0x21 ;; load target into HL + 0x21 ;; load target + 1 into HL - 0x94 ;; this is the target address + 0x95 ;; this is the target address + 1 0xD5 0x00 ;; relative jump back to first part diff -r 6ec288064d49 -r 5c2041d1cdda moves/cor-checkpoint.vbm Binary file moves/cor-checkpoint.vbm has changed diff -r 6ec288064d49 -r 5c2041d1cdda save-states/cor-checkpoint.sav Binary file save-states/cor-checkpoint.sav has changed