changeset 97:abb5add24b26

derived item list
author Robert McIntyre <rlm@mit.edu>
date Mon, 12 Mar 2012 00:30:28 -0500
parents cb487c4ce5c0
children 08cd8be1edc1
files clojure/com/aurellem/inspect.clj
diffstat 1 files changed, 332 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/inspect.clj	Sun Mar 11 23:27:19 2012 -0500
     1.2 +++ b/clojure/com/aurellem/inspect.clj	Mon Mar 12 00:30:28 2012 -0500
     1.3 @@ -1,5 +1,5 @@
     1.4  (ns com.aurellem.inspect
     1.5 -  (:use (com.aurellem gb-driver vbm))
     1.6 +  (:use (com.aurellem gb-driver vbm title))
     1.7    ;; this is fucking bullshit
     1.8    (:import [com.aurellem.gb_driver SaveState]))
     1.9  
    1.10 @@ -20,11 +20,6 @@
    1.11  
    1.12  
    1.13  
    1.14 -
    1.15 -
    1.16 -
    1.17 -
    1.18 -
    1.19  ;; try just buying five potions in sequence and see what changes
    1.20  ;; each time.
    1.21  
    1.22 @@ -75,4 +70,334 @@
    1.23    [53561 (132 185 145 162 159 183)]
    1.24    [54046 (0 1 2 3 4 5)])
    1.25  
    1.26 -;;; hmmmmmm...... I guess that the potion quantities are at 54046, huh?
    1.27 \ No newline at end of file
    1.28 +;;; hmmmmmm...... I guess that the potion quantities are at 54046,
    1.29 +;;;huh?
    1.30 +
    1.31 +
    1.32 +
    1.33 +(def item-hack (read-state 7999))
    1.34 +
    1.35 +(def item-hack2 (read-state 75882))
    1.36 +
    1.37 +(defn get-mem []
    1.38 +  (subvec (vec (memory @current-state)) 54040 (+ 54046 100)))
    1.39 +
    1.40 +
    1.41 +;; potion -- 99
    1.42 +[0 16 0 0 1 20 99 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.43 +
    1.44 +;; potion -- 95
    1.45 +[0 16 0 0 1 20 95 255 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 49 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.46 +
    1.47 +;; potion -- 95
    1.48 +;; pokeball -- 1
    1.49 +[0 16 0 0 2 20 95 4 1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.50 +
    1.51 +;; potion -- 95
    1.52 +;; pokeball -- 10
    1.53 +[0 16 0 0 2 20 95 4 10 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.54 +
    1.55 +
    1.56 +;; pokeball -- 10
    1.57 +;; potion -- 95
    1.58 +[0 16 0 0 2 4 10 20 95 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.59 +
    1.60 +;; pokeball -- 10
    1.61 +;; potion -- 95
    1.62 +;; antidote -- 1
    1.63 +
    1.64 +;;prediction
    1.65 +;;[0 16 0 0 3 4 10 20 95 ?? 1 255 0 0 0 0 0 ....]
    1.66 +  [0 16 0 0 3 4 10 20 95 11 1 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 117 129 139 148 132 80 134 128 145 152 80 137 3 0 0 1 191 223 189 2 0 42 8 199 5 2 1 0 1 20 2 4 4 93 77 23 77 122 76 0 255 208 65 240 198 10 10 71 246 41 201 255 252 64 18 201 10 10]
    1.67 +
    1.68 +
    1.69 +
    1.70 +;; now it's time to learn the item codes
    1.71 +
    1.72 +(def item-hack-3 (read-state 77557))
    1.73 +(defn show-item
    1.74 +  "Run a saved pokemon with the first item replaced by the item named
    1.75 +   by n."
    1.76 +  [n]
    1.77 +  (set-state! item-hack-3)
    1.78 +  (let [mem (memory)]
    1.79 +    (aset mem 54045 n)
    1.80 +    (write-memory! mem))
    1.81 +  (step)
    1.82 +  (->> [[] @current-state]
    1.83 +       (play-moves
    1.84 +        [[:a] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
    1.85 +         [] [] [] [] []])))
    1.86 +
    1.87 +
    1.88 +(defn get-item-names []
    1.89 +  (dorun (map (fn [n] (println n)
    1.90 +                (show-item n)
    1.91 +                (Thread/sleep 5000))
    1.92 +              (range 0x00 0xFF))))
    1.93 +
    1.94 +
    1.95 +
    1.96 +;; 0   garbage
    1.97 +;; 1   master-ball
    1.98 +;; 2   ultra-ball
    1.99 +;; 3   great-ball
   1.100 +;; 4   poke-ball
   1.101 +;; 5   town-map
   1.102 +;; 6   bicycle
   1.103 +;; 7   ?????
   1.104 +;; 8   safari-ball
   1.105 +;; 9   pokedex
   1.106 +;; 10  moon-stone 
   1.107 +;; 11   antidote
   1.108 +;; 12   burn-heal
   1.109 +;; 13   ice-heal
   1.110 +;; 14   awakening
   1.111 +;; 15   parlyz-heal
   1.112 +;; 16   full-restore
   1.113 +;; 17   max-potion
   1.114 +;; 18   hyper-potion
   1.115 +;; 19   super-potion
   1.116 +;; 20   potion
   1.117 +;; 21   boulderbadge
   1.118 +;; 22   cascadebadge
   1.119 +;; 23   thunderbadge
   1.120 +;; 24   rainbowbadge
   1.121 +;; 25   soulbadge
   1.122 +;; 26   marshbadge
   1.123 +;; 27   volcanobadge
   1.124 +;; 28   earthbadge
   1.125 +;; 29   escape-rope
   1.126 +;; 30   repel
   1.127 +;; 31   old amber
   1.128 +;; 32   fire-stone
   1.129 +;; 33   thunderstone
   1.130 +;; 34   water-stone
   1.131 +;; 35   hp-up
   1.132 +;; 36   protein
   1.133 +;; 37   iron
   1.134 +;; 38   carbos
   1.135 +;; 39   calcium
   1.136 +;; 40   rare-candy
   1.137 +;; 41   dome-fossil
   1.138 +;; 42   helix-fossil
   1.139 +;; 43   secret-key
   1.140 +;; 44   ?????
   1.141 +;; 45   bike-voucher
   1.142 +;; 46   x-accuracy
   1.143 +;; 47   leaf-stone
   1.144 +;; 48   card-key
   1.145 +;; 49   nugget
   1.146 +;; 50   pp-up
   1.147 +;; 51   poke-doll
   1.148 +;; 52   full-heal
   1.149 +;; 53   revive
   1.150 +;; 54   max-revive
   1.151 +;; 55   guard-spec.
   1.152 +;; 56   super-repel
   1.153 +;; 57   max-repel
   1.154 +;; 58   dire-hit
   1.155 +;; 59   coin
   1.156 +;; 60   fresh-water
   1.157 +;; 61   soda-pop
   1.158 +;; 62   lemonade
   1.159 +;; 63   s.s.ticket
   1.160 +;; 64   gold-teeth
   1.161 +;; 65   x-attach
   1.162 +;; 66   x-defend
   1.163 +;; 67   x-speed
   1.164 +;; 68   x-special
   1.165 +;; 69   coin-case
   1.166 +;; 70   oak's-parcel
   1.167 +;; 71   itemfinder
   1.168 +;; 72   silph-scope
   1.169 +;; 73   poke-flute
   1.170 +;; 74   lift-key
   1.171 +;; 75   exp.all
   1.172 +;; 76   old-rod
   1.173 +;; 77   good-rod
   1.174 +;; 78   super-rod
   1.175 +;; 79   pp-up
   1.176 +;; 80   ether
   1.177 +;; 81   max-ether
   1.178 +;; 82   elixer
   1.179 +;; 83   max-elixer
   1.180 +;; 84   B2F
   1.181 +;; 85   B1F
   1.182 +;; 86   1F
   1.183 +;; 87   2F
   1.184 +;; 88   3F
   1.185 +;; 89   4F
   1.186 +;; 90   5F
   1.187 +;; 91   6F
   1.188 +;; 92   7F
   1.189 +;; 93   8F
   1.190 +;; 94   9F
   1.191 +;; 95   10F
   1.192 +;; 96   11F
   1.193 +;; 97   B4F
   1.194 +;; 98   garbage
   1.195 +;; 99   garbage
   1.196 +;; 100   garbage
   1.197 +;; 101   garbage
   1.198 +;; 102   garbage
   1.199 +;; 103   garbage
   1.200 +;; 104   garbage
   1.201 +;; 105   garbage
   1.202 +;; 106   garbage
   1.203 +;; 107   garbage
   1.204 +;; 108   garbage
   1.205 +;; 109   garbage
   1.206 +;; 110   garbage
   1.207 +;; 111   garbage
   1.208 +;; 112   garbage
   1.209 +;; 113   garbage
   1.210 +;; 114   garbage
   1.211 +;; 115   garbage
   1.212 +;; 116   garbage
   1.213 +;; 117   garbage
   1.214 +;; 118   garbage
   1.215 +;; 119   4
   1.216 +;; 120   garbage
   1.217 +;; 121   garbage
   1.218 +;; 122   slow
   1.219 +;; 123   garbage
   1.220 +;; 124   garbage
   1.221 +;; 125   garbage
   1.222 +;; 126   garbage
   1.223 +;; 127   garbage
   1.224 +;; 128   garbage
   1.225 +;; 129   garbage
   1.226 +;; 130   garbage
   1.227 +;; 131   slow
   1.228 +;; 132   slow
   1.229 +;; 133   garbage
   1.230 +;; 134   slow
   1.231 +;; 135   garbage
   1.232 +;; 136   garbage
   1.233 +;; 137   slow
   1.234 +;; 138   garbage
   1.235 +;; 139   garbage
   1.236 +;; 140   garbage
   1.237 +;; 141   slow
   1.238 +;; 142   garbage
   1.239 +;; 143   garbage
   1.240 +;; 144   garbage
   1.241 +;; 145   garbage
   1.242 +;; 146   garbage
   1.243 +;; 147   garbage
   1.244 +;; 148   garbage
   1.245 +;; 149   garbage
   1.246 +;; 150   slow
   1.247 +;; 151   garbage
   1.248 +;; 152   Q
   1.249 +;; 153   garbage
   1.250 +;; 154   garbage
   1.251 +;; 155   garbage
   1.252 +;; 156   garbage
   1.253 +;; 157   garbage
   1.254 +;; 158   garbage
   1.255 +;; 159   garbage
   1.256 +;; 160   garbage (alaphabet)
   1.257 +;; 161   garbage
   1.258 +;; 162   garbage
   1.259 +;; 163   garbage
   1.260 +;; 164   rival's
   1.261 +;; 165   name?
   1.262 +;; 166   nickname?
   1.263 +;; 167   slow
   1.264 +;; 168   garbage
   1.265 +;; 169   slow
   1.266 +;; 170   garbage
   1.267 +;; 171   garbage
   1.268 +;; 172   garbage
   1.269 +;; 173   garbage
   1.270 +;; 174   garbage
   1.271 +;; 175   yellow
   1.272 +;; 176   ash
   1.273 +;; 177   jack
   1.274 +;; 178   new-name
   1.275 +;; 179   blue
   1.276 +;; 180   gary
   1.277 +;; 181   john
   1.278 +;; 182   garbage
   1.279 +;; 183   garbage
   1.280 +;; 184   garbage
   1.281 +;; 185   garbage
   1.282 +;; 186   slow
   1.283 +;; 187   garbage
   1.284 +;; 188   garbage
   1.285 +;; 189   garbage
   1.286 +;; 190   garbage
   1.287 +;; 191   garbage
   1.288 +;; 192   garbage
   1.289 +;; 193   garbage
   1.290 +;; 194   garbage
   1.291 +;; 195   slow
   1.292 +;; 196   HM01
   1.293 +;; 197   HM02
   1.294 +;; 198   HM03
   1.295 +;; 199   HM04
   1.296 +;; 200   HM05
   1.297 +;; 201   TM01
   1.298 +;; 202   TM02
   1.299 +;; 203   TM03
   1.300 +;; 204   TM04
   1.301 +;; 205   TM05
   1.302 +;; 206   TM06
   1.303 +;; 207   TM07
   1.304 +;; 208   TM08
   1.305 +;; 209   TM09
   1.306 +;; 210   TM10
   1.307 +;; 211   TM11
   1.308 +;; 212   TM12
   1.309 +;; 213   TM13
   1.310 +;; 214   TM13
   1.311 +;; 215   TM15
   1.312 +;; 216   TM16
   1.313 +;; 217   TM17
   1.314 +;; 218   TM18
   1.315 +;; 219   TM19
   1.316 +;; 220   TM20
   1.317 +;; 221   TM21
   1.318 +;; 222   TM22
   1.319 +;; 223   TM23
   1.320 +;; 224   TM24
   1.321 +;; 225   TM25
   1.322 +;; 226   TM26
   1.323 +;; 227   TM27
   1.324 +;; 228   TM28
   1.325 +;; 229   TM29
   1.326 +;; 230   TM30
   1.327 +;; 231   TM31
   1.328 +;; 232   TM32
   1.329 +;; 233   TM33
   1.330 +;; 234   TM34
   1.331 +;; 235   TM35
   1.332 +;; 236   TM36
   1.333 +;; 237   TM37
   1.334 +;; 238   TM38
   1.335 +;; 239   TM39
   1.336 +;; 240   TM40
   1.337 +;; 241   TM41
   1.338 +;; 242   TM42
   1.339 +;; 243   TM43
   1.340 +;; 244   TM44
   1.341 +;; 245   TM45
   1.342 +;; 246   TM46
   1.343 +;; 247   TM47
   1.344 +;; 248   TM48
   1.345 +;; 249   TM49
   1.346 +;; 250   TM50
   1.347 +;; 251   TM51
   1.348 +;; 252   TM52
   1.349 +;; 253   TM53
   1.350 +;; 254   TM54
   1.351 +;; 255   end-of-list-sentinel   
   1.352 +
   1.353 +
   1.354 +  
   1.355 +
   1.356 +  
   1.357 +  
   1.358 +