Mercurial > vba-clojure
changeset 131:7f7cc8858d2e
added rival-name letter-map
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 17 Mar 2012 21:29:08 -0500 |
parents | 69f241de436d |
children | d16cf9d829dd |
files | clojure/com/aurellem/assembly.clj clojure/com/aurellem/item_bridge.clj clojure/com/aurellem/save_corruption.clj |
diffstat | 3 files changed, 365 insertions(+), 39 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/clojure/com/aurellem/assembly.clj Sat Mar 17 19:30:45 2012 -0500 1.2 +++ b/clojure/com/aurellem/assembly.clj Sat Mar 17 21:29:08 2012 -0500 1.3 @@ -464,42 +464,6 @@ 1.4 (set-state! (input-number)) 1.5 (dotimes [_ 90000] (step (view-memory @current-state 0xD352)))) 1.6 1.7 -(defn d2 [] 1.8 - (-> 1.9 - (write-mem-dyl) 1.10 - (view-memory 0xD31F) 1.11 - step step step step step 1.12 - (view-memory 0xD31F))) 1.13 - 1.14 -(defn dylan [] 1.15 - (-> 1.16 - (write-mem-dyl) 1.17 - (tick) 1.18 - (tick) 1.19 - (tick) 1.20 - (tick) 1.21 - (tick) 1.22 - (tick) 1.23 - (tick) 1.24 - (tick) 1.25 - (tick) 1.26 - (tick) 1.27 - (tick) 1.28 - (tick) 1.29 - 1.30 - (tick) 1.31 - (tick) 1.32 - (tick) 1.33 - (tick) 1.34 - (tick) 1.35 - 1.36 - (d-tick) 1.37 - (view-register "A" A) 1.38 - (view-register "B" B) 1.39 - (view-register "C" C) 1.40 - 1.41 - )) 1.42 - 1.43 1.44 1.45 1.46 @@ -559,7 +523,45 @@ 1.47 (-> (tick (mid-game)) 1.48 (IE! 0) 1.49 (inject-item-assembly (write-memory-assembly*)))) 1.50 - 1.51 + 1.52 + 1.53 +(defn d2 [] 1.54 + (-> 1.55 + (write-mem-dyl) 1.56 + (view-memory 0xD31F) 1.57 + step step step step step 1.58 + (view-memory 0xD31F))) 1.59 + 1.60 +(defn dylan [] 1.61 + (-> 1.62 + (write-mem-dyl) 1.63 + (tick) 1.64 + (tick) 1.65 + (tick) 1.66 + (tick) 1.67 + (tick) 1.68 + (tick) 1.69 + (tick) 1.70 + (tick) 1.71 + (tick) 1.72 + (tick) 1.73 + (tick) 1.74 + (tick) 1.75 + 1.76 + (tick) 1.77 + (tick) 1.78 + (tick) 1.79 + (tick) 1.80 + (tick) 1.81 + 1.82 + (d-tick) 1.83 + (view-register "A" A) 1.84 + (view-register "B" B) 1.85 + (view-register "C" C) 1.86 + 1.87 + )) 1.88 + 1.89 + 1.90 1.91 1.92 (defn write-memory-assembly []
2.1 --- a/clojure/com/aurellem/item_bridge.clj Sat Mar 17 19:30:45 2012 -0500 2.2 +++ b/clojure/com/aurellem/item_bridge.clj Sat Mar 17 21:29:08 2012 -0500 2.3 @@ -1,5 +1,302 @@ 2.4 (ns com.aurellem.item-bridge 2.5 - (:use (com.aurellem gb-driver vbm title items assembly)) 2.6 + (:use (com.aurellem gb-driver vbm title save-corruption items assembly)) 2.7 (:import [com.aurellem.gb_driver SaveState])) 2.8 2.9 2.10 +(defn corrupt-item-state [] 2.11 + (second (destroy-item-end-of-list-marker))) 2.12 + 2.13 +(defn corrupt-item-state [] 2.14 + (read-state "corrupt-items")) 2.15 + 2.16 +(defn talk-to-rival [] 2.17 + (read-state "talk-to-rival")) 2.18 + 2.19 +(def rival-name-start 0xD349) 2.20 + 2.21 + 2.22 +(defn set-rival-name [^SaveState state codes] 2.23 + (set-state! state) 2.24 + (let [mem (memory state)] 2.25 + (dorun (map (fn [index val] 2.26 + (aset mem index val)) 2.27 + (range rival-name-start 2.28 + (+ rival-name-start 2.29 + (count codes))) codes)) 2.30 + (write-memory! mem) 2.31 + (update-state))) 2.32 + 2.33 +(defn view-rival-name [name-codes] 2.34 + (-> 2.35 + (set-rival-name (talk-to-rival) name-codes) 2.36 + (step [:a]) 2.37 + (play 50))) 2.38 + 2.39 +(defn rival-name-sequence [] 2.40 + (let [i (atom 1)] 2.41 + (fn [] 2.42 + (let [codes (range @i (+ 5 @i))] 2.43 + (println codes) 2.44 + (view-rival-name codes) 2.45 + (reset! i (+ 5 @i)))))) 2.46 + 2.47 + 2.48 + 2.49 +0 : end-of-name-sentinel 2.50 +1 : 2.51 +2 : 2.52 +3 : 2.53 +4 : 2.54 +5 : 2.55 +6 : 2.56 +7 : 2.57 +8 : 2.58 +9 : 2.59 +10 : 2.60 +11 : 2.61 +12 : 2.62 +13 : 2.63 +14 : 2.64 +15 : 2.65 +16 : 2.66 +17 : 2.67 +18 : 2.68 +19 : 2.69 +20 : 2.70 +21 : 2.71 +22 : 2.72 +23 : 2.73 +24 : 2.74 +25 : 2.75 +26 : 2.76 +27 : 2.77 +28 : 2.78 +29 : 2.79 +30 : 2.80 +31 : 2.81 +32 : 2.82 +33 : 2.83 +34 : 2.84 +35 : 2.85 +36 : 2.86 +37 : 2.87 +38 : 2.88 +39 : 2.89 +40 : 2.90 +41 : 2.91 +42 : 2.92 +43 : 2.93 +44 : 2.94 +45 : 2.95 +46 : 2.96 +47 : 2.97 +48 : 2.98 +49 : 2.99 +50 : 2.100 +51 : 2.101 +52 : 2.102 +53 : 2.103 +54 : 2.104 +55 : 2.105 +56 : 2.106 +57 : 2.107 +58 : 2.108 +59 : 2.109 +60 : 2.110 +61 : 2.111 +62 : 2.112 +63 : 2.113 +64 : 2.114 +65 : 2.115 +66 : 2.116 +67 : 2.117 +68 : 2.118 +69 : 2.119 +70 : 2.120 +71 : 2.121 +72 : 2.122 +73 : 2.123 +74 : 2.124 +75 : 2.125 +76 : 2.126 +77 : 2.127 +78 : 2.128 +79 : 2.129 +80 : 2.130 +81 : 2.131 +82 : 2.132 +83 : 2.133 +84 : 2.134 +85 : 2.135 +86 : 2.136 +87 : 2.137 +88 : 2.138 +89 : 2.139 +90 : 2.140 +91 : 2.141 +92 : 2.142 +93 : 2.143 +94 : 2.144 +95 : 2.145 +96 : A (small-bold) 2.146 +97 : B (small-bold) 2.147 +98 : C (small-bold) 2.148 +99 : D (small-bold) 2.149 +100 : E (small-bold) 2.150 +101 : F (small-bold) 2.151 +102 : G (small-bold) 2.152 +103 : H (small-bold) 2.153 +104 : I (small-bold) 2.154 +105 : V (small-bold) 2.155 +106 : S (small-bold) 2.156 +107 : L (small-bold) 2.157 +108 : M (small-bold) 2.158 +109 : 2.159 +110 : 2.160 +111 : 2.161 +112 : 2.162 +113 : 2.163 +114 : 2.164 +115 : 2.165 +116 : 2.166 +117 : 2.167 +118 : 2.168 +119 : 2.169 +120 : 2.170 +121 : 2.171 +122 : 2.172 +123 : 2.173 +124 : 2.174 +125 : 2.175 +126 : 2.176 +127 : 2.177 +128 : A 2.178 +129 : B 2.179 +130 : C 2.180 +131 : D 2.181 +132 : E 2.182 +133 : F 2.183 +134 : G 2.184 +135 : H 2.185 +136 : I 2.186 +137 : J 2.187 +138 : K 2.188 +139 : L 2.189 +140 : M 2.190 +141 : N 2.191 +142 : O 2.192 +143 : P 2.193 +144 : Q 2.194 +145 : R 2.195 +146 : S 2.196 +147 : T 2.197 +148 : U 2.198 +149 : V 2.199 +150 : W 2.200 +151 : X 2.201 +152 : Y 2.202 +153 : Z 2.203 +154 : ( 2.204 +155 : ) 2.205 +156 : : 2.206 +157 : ; 2.207 +158 : 2.208 +159 : 2.209 +160 : a 2.210 +161 : b 2.211 +162 : c 2.212 +163 : d 2.213 +164 : e 2.214 +165 : f 2.215 +166 : g 2.216 +167 : h 2.217 +168 : i 2.218 +169 : j 2.219 +170 : k 2.220 +171 : l 2.221 +172 : m 2.222 +173 : n 2.223 +174 : o 2.224 +175 : p 2.225 +176 : q 2.226 +177 : r 2.227 +178 : s 2.228 +179 : t 2.229 +180 : u 2.230 +181 : v 2.231 +182 : w 2.232 +183 : x 2.233 +184 : y 2.234 +185 : z 2.235 +186 : e-with-grave 2.236 +187 : 2.237 +188 : 2.238 +189 : 2.239 +190 : 2.240 +191 : 2.241 +192 : 2.242 +193 : 2.243 +194 : 2.244 +195 : 2.245 +196 : 2.246 +197 : 2.247 +198 : 2.248 +199 : 2.249 +200 : 2.250 +201 : 2.251 +202 : 2.252 +203 : 2.253 +204 : 2.254 +205 : 2.255 +206 : 2.256 +207 : 2.257 +208 : 2.258 +209 : 2.259 +210 : 2.260 +211 : 2.261 +212 : 2.262 +213 : 2.263 +214 : 2.264 +215 : 2.265 +216 : 2.266 +217 : 2.267 +218 : 2.268 +219 : 2.269 +220 : 2.270 +221 : 2.271 +222 : 2.272 +223 : 2.273 +224 : ' 2.274 +225 : PK 2.275 +226 : MN 2.276 +227 : 2.277 +228 : 2.278 +229 : 2.279 +230 : ? 2.280 +231 : ! 2.281 +232 : . 2.282 +233 : 2.283 +234 : 2.284 +235 : 2.285 +236 : 2.286 +237 : 2.287 +238 : 2.288 +239 : male-symbol 2.289 +240 : pokemon-money-symbol 2.290 +241 : . 2.291 +242 : / 2.292 +243 : , 2.293 +244 : female-symbol 2.294 +245 : 2.295 +246 : 0 2.296 +247 : 1 2.297 +248 : 2 2.298 +249 : 3 2.299 +250 : 4 2.300 +251 : 5 2.301 +252 : 6 2.302 +253 : 7 2.303 +254 : 8 2.304 +255 : 9 2.305 + 2.306 +
3.1 --- a/clojure/com/aurellem/save_corruption.clj Sat Mar 17 19:30:45 2012 -0500 3.2 +++ b/clojure/com/aurellem/save_corruption.clj Sat Mar 17 21:29:08 2012 -0500 3.3 @@ -62,7 +62,34 @@ 3.4 (defn-memo start-game [] 3.5 (->> (skip-title-again) 3.6 (advance [] [:start]) 3.7 - (advance [] [:a]))) 3.8 + (advance [] [:a]) 3.9 + (advance [:a] [:a :start]))) 3.10 + 3.11 +(defn-memo destroy-item-end-of-list-marker [] 3.12 + (->> (start-game) 3.13 + (play-moves 3.14 + [ 3.15 + [:start] [] [] [] [] [] [] [] [] [] [] [] 3.16 + [] [] [] [] [] [] [] [] [] [] [] [:a] [] [] [] [] [] [] [] [] 3.17 + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] 3.18 + [] [] [] [:a] [] [] [:d] [] [] [:a] [] [] [] [] [] [] [] [] [] 3.19 + [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] 3.20 + [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] [] [] [:d] [] [] 3.21 + [] [] [:d] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] 3.22 + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] 3.23 + [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:a] [] [] [:d] 3.24 + [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [:u] [] [] 3.25 + [] [] [:u] [] [] [] [:a] [] [] [] [] [] [] [] [] [] [] [] [] 3.26 + [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] 3.27 + [] [] [] [] [] [] [] [] [] [] [] 3.28 + 3.29 + ;; [:b] [] [] [] [] [] [] [] [] 3.30 + ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] 3.31 + ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [:a] [] [] 3.32 + ;; [] [] [] [] [] [] [] [] [] [] [] [] [] [:d] [] [] [] [:d] [] 3.33 + ]))) 3.34 + 3.35 + 3.36 3.37 (defn warp-to-elite-four 3.38 "This is copied from speedrun-2942 to ensure that everything is good