diff clojure/com/aurellem/exp/pokemon.clj @ 150:544a97ac3d8a

discovered location of pokemon OT IDs.
author Robert McIntyre <rlm@mit.edu>
date Tue, 20 Mar 2012 00:38:03 -0500
parents 79ffbd639b41
children ced1c4cd1eea
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/exp/pokemon.clj	Mon Mar 19 23:27:43 2012 -0500
     1.2 +++ b/clojure/com/aurellem/exp/pokemon.clj	Tue Mar 20 00:38:03 2012 -0500
     1.3 @@ -489,3 +489,27 @@
     1.4  ;; But not if you set it to your own name, obviously.
     1.5  
     1.6  
     1.7 +
     1.8 +
     1.9 +;; OT ID Numbers.
    1.10 +;; my own id is 05195.  A quick search of memory between
    1.11 +;; 0xD162 and 0xD31B revealed the pattern 0x144B exactly
    1.12 +;; six times.
    1.13 +
    1.14 +;; the locations were:
    1.15 +
    1.16 +(def OT-ID-addresses [0xD176 0xD1A2 0xD1CE 0xD1FA 0xD228 0xD252])
    1.17 +
    1.18 +
    1.19 +(defn set-pokemon-id
    1.20 +  ([^SaveState state n new-id]
    1.21 +     (assert (<= 0 n (dec (party-number state))))
    1.22 +     (assert (<= 0 new-id 0xFFFF))
    1.23 +     (set-memory-range 
    1.24 +      state
    1.25 +      (OT-ID-addresses n)
    1.26 +      [(bit-and new-id 0xFF00)
    1.27 +       (bit-and new-id 0xFF)]))
    1.28 +  ([n new-id]
    1.29 +     (set-pokemon-id n new-id)))
    1.30 +  
    1.31 \ No newline at end of file