# HG changeset patch # User Robert McIntyre # Date 1332221883 18000 # Node ID 544a97ac3d8a7cd3bfadd81564f3d2140d3eecb4 # Parent 79ffbd639b41395c53452a390001eb7b380abc37 discovered location of pokemon OT IDs. diff -r 79ffbd639b41 -r 544a97ac3d8a clojure/com/aurellem/exp/pokemon-layout --- a/clojure/com/aurellem/exp/pokemon-layout Mon Mar 19 23:27:43 2012 -0500 +++ b/clojure/com/aurellem/exp/pokemon-layout Tue Mar 20 00:38:03 2012 -0500 @@ -18,8 +18,8 @@ D173 D174 D175 -D176 -D177 +D176 / Pokemon 1 OT ID +D177 \ D178 D179 D17A @@ -62,8 +62,8 @@ D19F D1A0 D1A1 -D1A2 -D1A3 +D1A2 / Pokemon 2 OT ID +D1A3 \ D1A4 D1A5 D1A6 @@ -106,8 +106,8 @@ D1CB D1CC D1CD -D1CE -D1CF +D1CE / Pokemon 3 OT ID +D1CF \ D1D0 D1D1 D1D2 @@ -150,8 +150,8 @@ D1F7 D1F8 D1F9 -D1FA -D1FB +D1FA / Pokemon 4 OT ID +D1FB \ D1FC D1FD D1FE @@ -195,8 +195,8 @@ D224 D225 D226 -D227 -D228 +D227 / Pokemon 5 OT ID +D228 \ D229 D22A D22B @@ -238,8 +238,8 @@ D24F D250 D251 -D252 -D253 +D252 / Pokemon 6 OT ID +D253 \ D254 D255 D256 diff -r 79ffbd639b41 -r 544a97ac3d8a clojure/com/aurellem/exp/pokemon.clj --- a/clojure/com/aurellem/exp/pokemon.clj Mon Mar 19 23:27:43 2012 -0500 +++ b/clojure/com/aurellem/exp/pokemon.clj Tue Mar 20 00:38:03 2012 -0500 @@ -489,3 +489,27 @@ ;; But not if you set it to your own name, obviously. + + +;; OT ID Numbers. +;; my own id is 05195. A quick search of memory between +;; 0xD162 and 0xD31B revealed the pattern 0x144B exactly +;; six times. + +;; the locations were: + +(def OT-ID-addresses [0xD176 0xD1A2 0xD1CE 0xD1FA 0xD228 0xD252]) + + +(defn set-pokemon-id + ([^SaveState state n new-id] + (assert (<= 0 n (dec (party-number state)))) + (assert (<= 0 new-id 0xFFFF)) + (set-memory-range + state + (OT-ID-addresses n) + [(bit-and new-id 0xFF00) + (bit-and new-id 0xFF)])) + ([n new-id] + (set-pokemon-id n new-id))) + \ No newline at end of file