changeset 332:5c2041d1cdda

solving problem with rival name becomming a key item.
author Robert McIntyre <rlm@mit.edu>
date Fri, 06 Apr 2012 13:52:08 -0500
parents 6ec288064d49
children 61a096a53330
files clojure/com/aurellem/exp/notes.txt clojure/com/aurellem/run/bootstrap_0.clj moves/cor-checkpoint.vbm save-states/cor-checkpoint.sav
diffstat 4 files changed, 57 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/notes.txt	Fri Apr 06 12:18:58 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/notes.txt	Fri Apr 06 13:52:08 2012 -0500
     1.3 @@ -3,7 +3,7 @@
     1.4  start game
     1.5  
     1.6  name rival "L<PK>U<PK><PK><any-character>" 
     1.7 -(0x8B 0xE1 0x94 0xE1 0xE1 0x<any> in character codes)
     1.8 +(0x8B 0xE1 0x95 0xE1 0xE1 0x<any> in character codes)
     1.9  
    1.10  get pikachu, fight rival, deliver oak's parcel, go back to
    1.11  viridian poke mart.
    1.12 @@ -37,6 +37,9 @@
    1.13  ;; Second part of program to swap item ID and quantity at
    1.14  ;; fixed address.
    1.15  
    1.16 +0x00  ;; decrement HL
    1.17 +0x2B
    1.18 +
    1.19  0x00  ;; this starts at address 0xD56C
    1.20  0x2A  ;; save (HL)=(target) to A, increment HL
    1.21  
    1.22 @@ -58,7 +61,7 @@
    1.23  burn-heal   (0x0C) 
    1.24  x 95        (0x5F)  -- address of Route 3 memory-function
    1.25  
    1.26 -[repeat the following 8 times]
    1.27 +[repeat the following 4 times]
    1.28  0xFF
    1.29  0x01
    1.30  [end repeat]
    1.31 @@ -137,7 +140,7 @@
    1.32     0x91   "R" ;          [x]
    1.33     0x92   "S" ;          [x]
    1.34     0x93   "T" ;          [good]
    1.35 -   0x94   "U" ;          [good]
    1.36 +   0x94   "U" ;          [good] [key :(]
    1.37     0x95   "V" ;          [good]
    1.38     0x96   "W" ;          [x]
    1.39     0x97   "X" ;          [x]
     2.1 --- a/clojure/com/aurellem/run/bootstrap_0.clj	Fri Apr 06 12:18:58 2012 -0500
     2.2 +++ b/clojure/com/aurellem/run/bootstrap_0.clj	Fri Apr 06 13:52:08 2012 -0500
     2.3 @@ -28,15 +28,38 @@
     2.4             [] [] [:r] [] [:d] [:a]           ;; L
     2.5             [:r] [] [:r] [] [:r] [] [:r] [] 
     2.6             [:r] [] [:d] [] [:d] [:a]         ;; [PK]
     2.7 -           [:u] [] [:l] [] [:l] []
     2.8 -           [:l] [] [:l] [] [:l] [:a]         ;; U
     2.9 -           [:r] [] [:r] [] [:r] []
    2.10 -           [:r] [] [:r] [] [:d] [:a]         ;; [PK]
    2.11 +           [:u] [] [:l] [] [:l] [] [:l] []
    2.12 +           [:l] [] [:l] [] [:a]              ;; U
    2.13 +           [:r] [] [:r] [] [:r] [] [:r] []
    2.14 +           [:r] [] [] [:d] [:a]              ;; [PK]
    2.15             [] [:a]                           ;; [PK]
    2.16             [] [:a]                           ;; [PK]
    2.17             [:r] [] [:d] [:a]                 ;; END
    2.18             ]))))
    2.19  
    2.20 +;; (defn-memo name-rival-bootstrap
    2.21 +;;   ([] (name-rival-bootstrap (to-rival-name)))
    2.22 +;;   ([script]
    2.23 +;;      (->> script
    2.24 +;;          (first-difference [] [:a] AF)
    2.25 +;;          (first-difference [] [:r] DE)
    2.26 +;;          (play-moves
    2.27 +;;           [[]
    2.28 +;;            [] [] [:r] []           
    2.29 +;;            [:r] [] [:r] [] [:r] [] [:r] []
    2.30 +;;            [:r] [] [:d] [] [:d] [] [:d] [:a];; PK
    2.31 +;;            [] [:a]                          ;; PK
    2.32 +;;            [:u] [] [:l] [] [:l] [] [:l] []
    2.33 +;;            [:l] [] [:l] [:a]                ;; U
    2.34 +;;            [:d] [] [:r] [] [:r] [] [:r] []
    2.35 +;;            [:r] [] [:r] [:a]                ;; PK
    2.36 +;;            [:u] [] [:l] [] [:l] [] [:l] []
    2.37 +;;            [:l] [] [:l] [] [:u] [:a]        ;; L
    2.38 +;;            [:d] [] [:r] [] [:r] [] [:r] []
    2.39 +;;            [:r] [] [:r] [] [:d] [:a]        ;; PK
    2.40 +;;            [:r] [] [:d] [:a]                ;; END
    2.41 +;;            ]))))
    2.42 +
    2.43  (defn-memo leave-house
    2.44    ([] (leave-house (name-rival-bootstrap)))
    2.45    ([script]
    2.46 @@ -270,9 +293,9 @@
    2.47              → → → ↓])
    2.48  
    2.49            (walk-thru-grass
    2.50 -           [↓ ↓ ↓])
    2.51 +           [↓ ↓ ↓ ↓])
    2.52  
    2.53 -          (walk [↓ ← ← ↓ ↓ ↓ ↓ ↓ ↓])
    2.54 +          (walk [← ← ↓ ↓ ↓ ↓ ↓ ↓])
    2.55            
    2.56            (walk-thru-grass
    2.57             [↓ ↓ ↓ ↓ ↓ ↓])
    2.58 @@ -352,8 +375,6 @@
    2.59            (aget mem list-cursor-offset-address))))
    2.60    ([] (list-offset @current-state)))
    2.61  
    2.62 -
    2.63 -
    2.64  (defn exp-item-selection []
    2.65    (clojure.pprint/pprint
    2.66     (apply memory-compare
    2.67 @@ -421,6 +442,18 @@
    2.68  (defn activate-start-menu [script]
    2.69    (first-difference [:b] [:b :start] AF script))
    2.70  
    2.71 +(defn wait-until [script-fn script]
    2.72 +  (let [wait-time
    2.73 +        (- (dec (count (first (script-fn script))))
    2.74 +           (count (first script)))]
    2.75 +    (println "wait-time" wait-time)
    2.76 +    (do-nothing wait-time script)))
    2.77 +
    2.78 +(defn select-menu-entry [script]
    2.79 +  (->> script
    2.80 +       (wait-until (partial set-cursor-relative 1))
    2.81 +       (play-moves [[:a] []])))
    2.82 +
    2.83  (defn-memo do-save-corruption
    2.84    ([] (do-save-corruption
    2.85         (walk-to-counter)))
    2.86 @@ -455,12 +488,7 @@
    2.87  (defn close-menu [script]
    2.88    (first-difference [] [:b] AF script))
    2.89  
    2.90 -(defn wait-until [script-fn script]
    2.91 -  (let [wait-time
    2.92 -        (- (dec (count (first (script-fn script))))
    2.93 -           (count (first script)))]
    2.94 -    (println "wait-time" wait-time)
    2.95 -    (do-nothing wait-time script)))
    2.96 +
    2.97  
    2.98  ;; (defn select-menu-entry* [script]
    2.99  ;;   (let [wait-time
   2.100 @@ -469,10 +497,6 @@
   2.101  ;;     (println "wait-time" wait-time)
   2.102  ;;     (play-moves (concat (repeat wait-time []) [[:a] []]) script)))
   2.103  
   2.104 -(defn select-menu-entry [script]
   2.105 -  (->> script
   2.106 -       (wait-until (partial set-cursor-relative 1))
   2.107 -       (play-moves [[:a] []])))
   2.108  
   2.109  (defn purchase-item
   2.110    "Assumes that the cursor is over the desired item, and purchases
   2.111 @@ -506,7 +530,7 @@
   2.112            (set-cursor 9)
   2.113            select-menu-entry     ; switch 6th with 10th
   2.114            close-menu
   2.115 -          close-menu)))
   2.116 +          close-menu )))
   2.117  
   2.118  (defn-memo get-lots-of-money
   2.119    "Sell 0xFE cancel buttons to make a tremendous amount of money."
   2.120 @@ -519,9 +543,12 @@
   2.121            select-menu-entry
   2.122            (repeat-until-different [] list-offset)
   2.123            select-menu-entry
   2.124 -          (set-quantity 0xFF 0xFE)
   2.125 -          (scroll-text)
   2.126 -          select-menu-entry)))
   2.127 +          (set-quantity 0xFF 0xF7)
   2.128 +          (first-difference [] [:a] AF)
   2.129 +          select-menu-entry
   2.130 +          close-menu
   2.131 +          )))
   2.132 +          
   2.133  
   2.134  (defn note [str script]
   2.135    (println str) script)
   2.136 @@ -705,9 +732,9 @@
   2.137  
   2.138           [;; first part of item manipulation program
   2.139            0x00
   2.140 -          0x21   ;; load target into HL
   2.141 +          0x21   ;; load target + 1  into HL
   2.142  
   2.143 -          0x94   ;; this is the target address
   2.144 +          0x95   ;; this is the target address + 1
   2.145            0xD5
   2.146  
   2.147            0x00   ;; relative jump back to first part
     3.1 Binary file moves/cor-checkpoint.vbm has changed
     4.1 Binary file save-states/cor-checkpoint.sav has changed