Mercurial > vba-clojure
changeset 154:3a3bb2197b7f
discovered hex-values for every move.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 20 Mar 2012 02:40:59 -0500 |
parents | 6135504976e6 |
children | 2af503ea0268 |
files | clojure/com/aurellem/exp/item_bridge.clj clojure/com/aurellem/exp/moves.clj clojure/com/aurellem/exp/pokemon-layout clojure/com/aurellem/gb/gb_driver.clj clojure/com/aurellem/gb/util.clj save-states/battle-using-pikachu.sav save-states/view-pika-attacks.sav |
diffstat | 7 files changed, 304 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
1.1 --- a/clojure/com/aurellem/exp/item_bridge.clj Tue Mar 20 01:32:48 2012 -0500 1.2 +++ b/clojure/com/aurellem/exp/item_bridge.clj Tue Mar 20 02:40:59 2012 -0500 1.3 @@ -1,6 +1,6 @@ 1.4 (ns com.aurellem.item-bridge 1.5 - (:use (com.aurellem gb-driver vbm title save-corruption items assembly)) 1.6 - (:import [com.aurellem.gb_driver SaveState])) 1.7 + (:use (com.aurellem.gb gb-driver vbm title save-corruption items assembly)) 1.8 + (:import [com.aurellem.gb.gb_driver SaveState])) 1.9 1.10 1.11 (defn corrupt-item-state []
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/clojure/com/aurellem/exp/moves.clj Tue Mar 20 02:40:59 2012 -0500 2.3 @@ -0,0 +1,284 @@ 2.4 +(ns com.aurellem.exp.moves 2.5 + (:use (com.aurellem.gb gb-driver items util )) 2.6 + (:import [com.aurellem.gb.gb_driver SaveState])) 2.7 + 2.8 +(defn move-state [] 2.9 + (read-state "view-pika-attacks")) 2.10 + 2.11 +(defn view-move [n] 2.12 + (run-moves 2.13 + (set-memory (move-state) 0xD19E n) 2.14 + (concat [[:a]] 2.15 + (repeat 200 []) 2.16 + [[:a]] 2.17 + (repeat 200 [])))) 2.18 + 2.19 +(defn give-move [pos n] 2.20 + (continue! 2.21 + (set-memory @current-state 2.22 + (+ pos (- 0xD19E 44)) n))) 2.23 + 2.24 +(defn iterate-moves [] 2.25 + (dorun 2.26 + (map (fn [n] (println n) 2.27 + (view-move n) 2.28 + (Thread/sleep 5000)) 2.29 + (range (inc 0xFF))))) 2.30 + 2.31 + 2.32 +;; 000 00 : null 2.33 +;; 001 01 : pound 2.34 +;; 002 02 : karate-chop 2.35 +;; 003 03 : doubleslap 2.36 +;; 004 04 : comet-punch 2.37 +;; 005 05 : mega-punch 2.38 +;; 006 06 : pay-day 2.39 +;; 007 07 : fire-punch 2.40 +;; 008 08 : ice-punch 2.41 +;; 009 09 : thunderpunch 2.42 +;; 010 0A : scratch 2.43 +;; 011 0B : vicegrip 2.44 +;; 012 0C : guillotine 2.45 +;; 013 0D : razor-wind 2.46 +;; 014 0E : swords-dance 2.47 +;; 015 0F : cut 2.48 +;; 016 10 : gust 2.49 +;; 017 11 : wing-attack 2.50 +;; 018 12 : whirlwind 2.51 +;; 019 13 : fly 2.52 +;; 020 14 : bind 2.53 +;; 021 15 : slam 2.54 +;; 022 16 : vine-whip 2.55 +;; 023 17 : stomp 2.56 +;; 024 18 : double-kick 2.57 +;; 025 19 : mega-kick 2.58 +;; 026 1A : jump-kick 2.59 +;; 027 1B : rolling-kick 2.60 +;; 028 1C : sand-attack 2.61 +;; 029 1D : headbutt 2.62 +;; 030 1E : horn-attack 2.63 +;; 031 1F : fury-attack 2.64 +;; 032 20 : horn-drill 2.65 +;; 033 21 : tackle 2.66 +;; 034 22 : body-slam 2.67 +;; 035 23 : wrap 2.68 +;; 036 24 : take-down 2.69 +;; 037 25 : thrash 2.70 +;; 038 26 : double-edge 2.71 +;; 039 27 : tail-whip 2.72 +;; 040 28 : poison-sting 2.73 +;; 041 29 : twinneedle 2.74 +;; 042 2A : pin-missle 2.75 +;; 043 2B : leer 2.76 +;; 044 2C : bite 2.77 +;; 045 2D : growl 2.78 +;; 046 2E : roar 2.79 +;; 047 2F : sing 2.80 +;; 048 30 : supersonic 2.81 +;; 049 31 : sonicboom 2.82 +;; 050 32 : disable 2.83 +;; 051 33 : acid 2.84 +;; 052 34 : ember 2.85 +;; 053 35 : flamethrower 2.86 +;; 054 36 : mist 2.87 +;; 055 37 : water-gun 2.88 +;; 056 38 : hydro-pump 2.89 +;; 057 39 : surf 2.90 +;; 058 3A : ice-beam 2.91 +;; 059 3B : blizzard 2.92 +;; 060 3C : psybeam 2.93 +;; 061 3D : bubblebeam 2.94 +;; 062 3E : aurora-beam 2.95 +;; 063 3F : hyper-beam 2.96 +;; 064 40 : peck 2.97 +;; 065 41 : drill-peck 2.98 +;; 066 42 : submission 2.99 +;; 067 43 : low-kick 2.100 +;; 068 44 : counter 2.101 +;; 069 45 : seismic-toss 2.102 +;; 070 46 : strength 2.103 +;; 071 47 : absorb 2.104 +;; 072 48 : mega-drain 2.105 +;; 073 49 : leech-seed 2.106 +;; 074 4A : growth 2.107 +;; 075 4B : razor-leaf 2.108 +;; 076 4C : solarbeam 2.109 +;; 077 4D : poisonpowder 2.110 +;; 078 4E : stun-spore 2.111 +;; 079 4F : sleep-powder 2.112 +;; 080 50 : petal-dance 2.113 +;; 081 51 : string-shot 2.114 +;; 082 52 : dragon-rage 2.115 +;; 083 53 : fire-spin 2.116 +;; 084 54 : thundershock 2.117 +;; 085 55 : thunderbolt 2.118 +;; 086 56 : thunder-wave 2.119 +;; 087 57 : thunder 2.120 +;; 088 58 : rock-throw 2.121 +;; 089 59 : earthquake 2.122 +;; 090 5A : fissure 2.123 +;; 091 5B : dig 2.124 +;; 092 5C : toxic 2.125 +;; 093 5D : confusion 2.126 +;; 094 5E : psychic 2.127 +;; 095 5F : hypnosis 2.128 +;; 096 60 : meditate 2.129 +;; 097 61 : agility 2.130 +;; 098 62 : quick-attack 2.131 +;; 099 63 : rage 2.132 +;; 100 64 : teleport 2.133 +;; 101 65 : night-shade 2.134 +;; 102 66 : mimic 2.135 +;; 103 67 : screech 2.136 +;; 104 68 : double-team 2.137 +;; 105 69 : recover 2.138 +;; 106 6A : harden 2.139 +;; 107 6B : minimize 2.140 +;; 108 6C : smokescreen 2.141 +;; 109 6D : confuse-ray 2.142 +;; 110 6E : withdraw 2.143 +;; 111 6F : defense-curl 2.144 +;; 112 70 : barrier 2.145 +;; 113 71 : light-screen 2.146 +;; 114 72 : haze 2.147 +;; 115 73 : reflect 2.148 +;; 116 74 : focus-energy 2.149 +;; 117 75 : bide 2.150 +;; 118 76 : metronome 2.151 +;; 119 77 : mirror-move 2.152 +;; 120 78 : selfdestruct 2.153 +;; 121 79 : egg-bomb 2.154 +;; 122 7A : lick 2.155 +;; 123 7B : smog 2.156 +;; 124 7C : sludge 2.157 +;; 125 7D : bone-club 2.158 +;; 126 7E : fire-blast 2.159 +;; 127 7F : waterfall 2.160 +;; 128 80 : clamp 2.161 +;; 129 81 : swift 2.162 +;; 130 82 : skull-bash 2.163 +;; 131 83 : spike-cannon 2.164 +;; 132 84 : constrict 2.165 +;; 133 85 : amnesia 2.166 +;; 134 86 : kinesis 2.167 +;; 135 87 : softboiled 2.168 +;; 136 88 : hi-jump-kick 2.169 +;; 137 89 : glare 2.170 +;; 138 8A : dream-eater 2.171 +;; 139 8B : poison-gas 2.172 +;; 140 8C : barrage 2.173 +;; 141 8D : leech-life 2.174 +;; 142 8E : lovely-kiss 2.175 +;; 143 8F : sky-attack 2.176 +;; 144 90 : transform 2.177 +;; 145 91 : bubble 2.178 +;; 146 92 : dizzy-punch 2.179 +;; 147 93 : spore 2.180 +;; 148 94 : flash 2.181 +;; 149 95 : psywave 2.182 +;; 150 96 : splash 2.183 +;; 151 97 : acid-armor 2.184 +;; 152 98 : crabhammer 2.185 +;; 153 99 : explosion 2.186 +;; 154 9A : fury-swipes 2.187 +;; 155 9B : bonemerang 2.188 +;; 156 9C : rest 2.189 +;; 157 9D : rock-slide 2.190 +;; 158 9E : hyper-fang 2.191 +;; 159 9F : sharpen 2.192 +;; 160 A0 : conversion 2.193 +;; 161 A1 : tri-attack 2.194 +;; 162 A2 : super-fang 2.195 +;; 163 A3 : slash 2.196 +;; 164 A4 : substitute 2.197 +;; 165 A5 : struggle 2.198 +;; 166 A6 : null 2.199 +;; 167 A7 : null 2.200 +;; 168 A8 : null 2.201 +;; 169 A9 : trash 2.202 +;; 170 AA : trash 2.203 +;; 171 AB : trash 2.204 +;; 172 AC : trash 2.205 +;; 173 AD : trash 2.206 +;; 174 AE : trash 2.207 +;; 175 AF : null 2.208 +;; 176 B0 : trash 2.209 +;; 177 B1 : trash 2.210 +;; 178 B2 : trash 2.211 +;; 179 B3 : trash 2.212 +;; 180 B4 : AA 2.213 +;; 181 B5 : trash 2.214 +;; 182 B6 : QQ 2.215 +;; 183 B7 : null 2.216 +;; 184 B8 : null 2.217 +;; 185 B9 : null 2.218 +;; 186 BA : null 2.219 +;; 187 BB : null 2.220 +;; 188 BC : null 2.221 +;; 189 BD : null 2.222 +;; 190 BE : trash 2.223 +;; 191 BF : null 2.224 +;; 192 C0 : null 2.225 +;; 193 C1 : null 2.226 +;; 194 C2 : null 2.227 +;; 195 C3 : null 2.228 +;; 196 C4 : HM01 2.229 +;; 197 C5 : HM02 2.230 +;; 198 C6 : HM03 2.231 +;; 199 C7 : HM04 2.232 +;; 200 C8 : HM05 2.233 +;; 201 C9 : TM01 2.234 +;; 202 CA : TM02 2.235 +;; 203 CB : TM03 2.236 +;; 204 CC : TM04 2.237 +;; 205 CD : TM05 2.238 +;; 206 CE : TM06 2.239 +;; 207 CF : TM07 2.240 +;; 208 D0 : TM08 2.241 +;; 209 D1 : TM09 2.242 +;; 210 D2 : TM10 2.243 +;; 211 D3 : TM11 2.244 +;; 212 D4 : TM12 2.245 +;; 213 D5 : TM13 2.246 +;; 214 D6 : TM14 2.247 +;; 215 D7 : TM15 2.248 +;; 216 D8 : TM16 2.249 +;; 217 D9 : TM17 2.250 +;; 218 DA : TM18 2.251 +;; 219 DB : TM19 2.252 +;; 220 DC : TM20 2.253 +;; 221 DD : TM21 2.254 +;; 222 DE : TM22 2.255 +;; 223 DF : TM23 2.256 +;; 224 E0 : TM24 2.257 +;; 225 E1 : TM25 2.258 +;; 226 E2 : TM26 2.259 +;; 227 E3 : TM27 2.260 +;; 228 E4 : TM28 2.261 +;; 229 E5 : TM29 2.262 +;; 230 E6 : TM30 2.263 +;; 231 E7 : TM31 2.264 +;; 232 E8 : TM32 2.265 +;; 233 E9 : TM33 2.266 +;; 234 EA : TM34 2.267 +;; 235 EB : TM35 2.268 +;; 236 EC : TM36 2.269 +;; 237 ED : TM37 2.270 +;; 238 EE : TM38 2.271 +;; 239 EF : TM39 2.272 +;; 240 F0 : TM40 2.273 +;; 241 F1 : TM41 2.274 +;; 242 F2 : TM42 2.275 +;; 243 F3 : TM43 2.276 +;; 244 F4 : TM44 2.277 +;; 245 F5 : TM45 2.278 +;; 246 F6 : TM46 2.279 +;; 247 F7 : TM47 2.280 +;; 248 F8 : TM48 2.281 +;; 249 F9 : TM49 2.282 +;; 250 FA : TM50 2.283 +;; 251 FB : TM51 2.284 +;; 252 FC : TM52 2.285 +;; 253 FD : TM53 2.286 +;; 254 FE : TM54 2.287 +;; 255 FF : TM55 2.288 \ No newline at end of file
3.1 --- a/clojure/com/aurellem/exp/pokemon-layout Tue Mar 20 01:32:48 2012 -0500 3.2 +++ b/clojure/com/aurellem/exp/pokemon-layout Tue Mar 20 02:40:59 2012 -0500 3.3 @@ -51,8 +51,8 @@ 3.4 D194 3.5 D195 3.6 D196 u 3.7 -D197 u 3.8 -D198 Pokemon 2 Status 3.9 +D197 /h 3.10 +D198 \l Pokemon 2 Current Hit Points 3.11 D199 u 3.12 D19A u 3.13 D19B u 3.14 @@ -105,7 +105,7 @@ 3.15 D1CA 3.16 D1CB 3.17 D1CC 3.18 -D1CD 3.19 +D1CD 3.20 D1CE / Pokemon 3 OT ID 3.21 D1CF \ 3.22 D1D0
4.1 --- a/clojure/com/aurellem/gb/gb_driver.clj Tue Mar 20 01:32:48 2012 -0500 4.2 +++ b/clojure/com/aurellem/gb/gb_driver.clj Tue Mar 20 02:40:59 2012 -0500 4.3 @@ -31,12 +31,12 @@ 4.4 4.5 (defn read-state [name] 4.6 (let [save (state-cache-file name)] 4.7 - (if (.exists save) 4.8 - (let [buffer (Gb/saveBuffer) 4.9 - bytes (FileUtils/readFileToByteArray save)] 4.10 - (.put buffer bytes) 4.11 - (.flip buffer) 4.12 - (SaveState. buffer))))) 4.13 + (assert (.exists save)) 4.14 + (let [buffer (Gb/saveBuffer) 4.15 + bytes (FileUtils/readFileToByteArray save)] 4.16 + (.put buffer bytes) 4.17 + (.flip buffer) 4.18 + (SaveState. buffer)))) 4.19 ;;;;;;;;;;;;;;;; 4.20 4.21 ;; Gameboy management 4.22 @@ -141,6 +141,12 @@ 4.23 ([] 4.24 (continue! @current-state))) 4.25 4.26 +(defn run-moves [state moves] 4.27 + (set-state! state) 4.28 + (dorun (map #(Gb/step (button-mask %)) 4.29 + moves)) 4.30 + (update-state)) 4.31 + 4.32 (defn play-moves 4.33 ([moves [prev state]] 4.34 (set-state! state)
5.1 --- a/clojure/com/aurellem/gb/util.clj Tue Mar 20 01:32:48 2012 -0500 5.2 +++ b/clojure/com/aurellem/gb/util.clj Tue Mar 20 02:40:59 2012 -0500 5.3 @@ -98,3 +98,6 @@ 5.4 5.5 (defn mid-game [] 5.6 (read-state "mid-game")) 5.7 + 5.8 + 5.9 + 5.10 \ No newline at end of file
6.1 Binary file save-states/battle-using-pikachu.sav has changed
7.1 Binary file save-states/view-pika-attacks.sav has changed