changeset 143:cd930ed1fd4d

determined location of sixth pokemon's name's first character.
author Robert McIntyre <rlm@mit.edu>
date Mon, 19 Mar 2012 20:30:37 -0500
parents b12d2408fd9b
children ec477931f077
files clojure/com/aurellem/pokemon.clj clojure/com/aurellem/rival_name.clj save-states/name-pidgeotto.sav save-states/named-A.sav save-states/named-B.sav save-states/named-C.sav save-states/named-D.sav save-states/named-E.sav save-states/named-F.sav save-states/pidgeot-lvl-37.sav save-states/pidgeot-lvl-38.sav save-states/pidgeot-lvl-39.sav save-states/pidgeot-lvl-40.sav
diffstat 13 files changed, 192 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/pokemon.clj	Mon Mar 19 19:56:55 2012 -0500
     1.2 +++ b/clojure/com/aurellem/pokemon.clj	Mon Mar 19 20:30:37 2012 -0500
     1.3 @@ -1,8 +1,94 @@
     1.4  (ns com.aurellem.pokemon
     1.5 +  "Here I find out how pokemon are stored in memory."
     1.6    (:use (com.aurellem gb-driver vbm
     1.7 +                      rival-name
     1.8                        title save-corruption items assembly))
     1.9 +  (:use com.aurellem.experiments.items)
    1.10    (:import [com.aurellem.gb_driver SaveState]))
    1.11  
    1.12  
    1.13 +(def pidgeot-lvl-36 (mid-game))
    1.14  
    1.15  
    1.16 +(def pidgeot-lvl-37 (read-state "pidgeot-lvl-37"))
    1.17 +
    1.18 +
    1.19 +(def pidgeot-lvl-38  (read-state "pidgeot-lvl-38"))
    1.20 +
    1.21 +
    1.22 +(def pidgeot-lvl-39  (read-state "pidgeot-lvl-39"))
    1.23 +
    1.24 +
    1.25 +(def pidgeot-lvl-40  (read-state "pidgeot-lvl-40"))
    1.26 +
    1.27 +
    1.28 +(defn level-analysis []
    1.29 +  (apply common-differences
    1.30 +         (map (comp vec memory)
    1.31 +              [pidgeot-lvl-36
    1.32 +               pidgeot-lvl-37
    1.33 +               pidgeot-lvl-38
    1.34 +               pidgeot-lvl-39
    1.35 +               pidgeot-lvl-40])))
    1.36 +
    1.37 +;; inconclusive -- implies that level is calculated from
    1.38 +;; some other values.
    1.39 +
    1.40 +
    1.41 +(def name-pidgeotto (read-state "name-pidgeotto"))
    1.42 +(def named-A (read-state "named-A"))
    1.43 +(def named-B (read-state "named-B"))
    1.44 +(def named-C (read-state "named-C"))
    1.45 +(def named-D (read-state "named-D"))
    1.46 +(def named-E (read-state "named-E"))
    1.47 +(def named-F (read-state "named-F"))
    1.48 +
    1.49 +(defn name-analysis []
    1.50 +  (apply common-differences
    1.51 +         (map (comp vec memory)
    1.52 +              [named-A
    1.53 +               named-B
    1.54 +               named-C
    1.55 +               named-D
    1.56 +               named-E
    1.57 +               named-F])))
    1.58 +
    1.59 +;; resluted in 3 separate locations that could
    1.60 +;; possibly hold the first letter of the pokemon's name
    1.61 +
    1.62 +0xCF4A
    1.63 +0xD2EB
    1.64 +0xCEED
    1.65 +
    1.66 +;; try changing each of them
    1.67 +
    1.68 +
    1.69 +(defn test-cf4a []
    1.70 +  (continue!
    1.71 +   (set-memory named-A 0xCF4A (character->character-code "Z"))))
    1.72 +;; result -- pidgeotto named "A"
    1.73 +
    1.74 +(defn test-d2eb []
    1.75 +  (continue!
    1.76 +   (set-memory named-A 0xD2EB (character->character-code "Z"))))
    1.77 +;; result -- pidgeotto named "Z"
    1.78 +
    1.79 +(defn test-ceed []
    1.80 +  (continue!
    1.81 +   (set-memory named-A 0xCEED (character->character-code "Z"))))
    1.82 +;; result -- pidgeotto named "A"
    1.83 +
    1.84 +(def sixth-pokemon-name-start 0xD2EB)
    1.85 +
    1.86 +
    1.87 +(defn set-sixth-pokemon-name-first-character
    1.88 +  ([state character]
    1.89 +     (set-memory state sixth-pokemon-name-start
    1.90 +                 (character->character-code character)))
    1.91 +  ([character]
    1.92 +     (set-sixth-pokemon-name-first-character @current-state
    1.93 +                                             character)))
    1.94 +
    1.95 +
    1.96 +
    1.97 +
     2.1 --- a/clojure/com/aurellem/rival_name.clj	Mon Mar 19 19:56:55 2012 -0500
     2.2 +++ b/clojure/com/aurellem/rival_name.clj	Mon Mar 19 20:30:37 2012 -0500
     2.3 @@ -32,7 +32,110 @@
     2.4          (println codes)
     2.5          (view-rival-name codes)
     2.6          (reset! i (+ 5 @i))))))
     2.7 -      
     2.8 +
     2.9 +(def character-code->character
    2.10 +  {
    2.11 +   0x00   "end-of-name-sentinel"
    2.12 +   0x60   "A-bold"
    2.13 +   0x61   "B-bold"
    2.14 +   0x62   "C-bold"
    2.15 +   0x63   "D-bold"
    2.16 +   0x64   "E-bold"
    2.17 +   0x65   "F-bold"
    2.18 +   0x66   "G-bold"
    2.19 +   0x67   "H-bold"
    2.20 +   0x68   "I-bold"
    2.21 +   0x69   "V-bold"
    2.22 +   0x6A   "S-bold"
    2.23 +   0x6B   "L-bold"
    2.24 +   0x6C   "M-bold"
    2.25 +   0x80   "A"
    2.26 +   0x81   "B"
    2.27 +   0x82   "C"
    2.28 +   0x83   "D"
    2.29 +   0x84   "E"
    2.30 +   0x85   "F"
    2.31 +   0x86   "G"
    2.32 +   0x87   "H"
    2.33 +   0x88   "I"
    2.34 +   0x89   "J"
    2.35 +   0x8A   "K"
    2.36 +   0x8B   "L"
    2.37 +   0x8C   "M"
    2.38 +   0x8D   "N"
    2.39 +   0x8E   "O"
    2.40 +   0x8F   "P"
    2.41 +   0x90   "Q"
    2.42 +   0x91   "R"
    2.43 +   0x92   "S"
    2.44 +   0x93   "T"
    2.45 +   0x94   "U"
    2.46 +   0x95   "V"
    2.47 +   0x96   "W"
    2.48 +   0x97   "X"
    2.49 +   0x98   "Y"
    2.50 +   0x99   "Z"
    2.51 +   0x9A   "("
    2.52 +   0x9B   ")"
    2.53 +   0x9C   ":"
    2.54 +   0x9D   ";"
    2.55 +   0xA0   "a"
    2.56 +   0xA1   "b"
    2.57 +   0xA2   "c"
    2.58 +   0xA3   "d"
    2.59 +   0xA4   "e"
    2.60 +   0xA5   "f"
    2.61 +   0xA6   "g"
    2.62 +   0xA7   "h"
    2.63 +   0xA8   "i"
    2.64 +   0xA9   "j"
    2.65 +   0xAA   "k"
    2.66 +   0xAB   "l"
    2.67 +   0xAC   "m"
    2.68 +   0xAD   "n"
    2.69 +   0xAE   "o"
    2.70 +   0xAF   "p"
    2.71 +   0xB0   "q"
    2.72 +   0xB1   "r"
    2.73 +   0xB2   "s"
    2.74 +   0xB3   "t"
    2.75 +   0xB4   "u"
    2.76 +   0xB5   "v"
    2.77 +   0xB6   "w"
    2.78 +   0xB7   "x"
    2.79 +   0xB8   "y"
    2.80 +   0xB9   "z"
    2.81 +   0xBA   "e-with-grave"
    2.82 +   0xE0   "'"
    2.83 +   0xE1   "PK"
    2.84 +   0xE2   "MN"
    2.85 +   0xE6   "?"
    2.86 +   0xE7   "!"
    2.87 +   0xE8   "."
    2.88 +   0xEF   "male-symbol"
    2.89 +   0xF0   "pokemon-money-symbol"
    2.90 +   0xF1   "."
    2.91 +   0xF2   "/"
    2.92 +   0xF3   ","
    2.93 +   0xF4   "female-symbol"
    2.94 +   0xF6   "0 "
    2.95 +   0xF7   "1"
    2.96 +   0xF8   "2"
    2.97 +   0xF9   "3"
    2.98 +   0xFA   "4"
    2.99 +   0xFB   "5"
   2.100 +   0xFC   "6"
   2.101 +   0xFD   "7"
   2.102 +   0xFE   "8"
   2.103 +   0xFF   "9"
   2.104 +   })
   2.105 +
   2.106 +(def character->character-code
   2.107 +  (zipmap (vals character-code->character)
   2.108 +          (keys character-code->character)))
   2.109 +
   2.110 +
   2.111 +
   2.112  
   2.113  
   2.114  ;; 0x00 :  end-of-name-sentinel
   2.115 @@ -293,3 +396,5 @@
   2.116  ;; 0xFF :  9
   2.117             
   2.118                  
   2.119 +
   2.120 +
     3.1 Binary file save-states/name-pidgeotto.sav has changed
     4.1 Binary file save-states/named-A.sav has changed
     5.1 Binary file save-states/named-B.sav has changed
     6.1 Binary file save-states/named-C.sav has changed
     7.1 Binary file save-states/named-D.sav has changed
     8.1 Binary file save-states/named-E.sav has changed
     9.1 Binary file save-states/named-F.sav has changed
    10.1 Binary file save-states/pidgeot-lvl-37.sav has changed
    11.1 Binary file save-states/pidgeot-lvl-38.sav has changed
    12.1 Binary file save-states/pidgeot-lvl-39.sav has changed
    13.1 Binary file save-states/pidgeot-lvl-40.sav has changed