# HG changeset patch # User Robert McIntyre # Date 1332287449 18000 # Node ID 76b031d2f586c0ca4713a71e15d29bb2d69746d3 # Parent 8f1b32d3f229f2b36814dcf65149c574a00e1c51 determined position of pokemon color maps diff -r 8f1b32d3f229 -r 76b031d2f586 clojure/com/aurellem/exp/pokemon-layout --- a/clojure/com/aurellem/exp/pokemon-layout Tue Mar 20 18:07:42 2012 -0500 +++ b/clojure/com/aurellem/exp/pokemon-layout Tue Mar 20 18:50:49 2012 -0500 @@ -6,7 +6,7 @@ D167 Pokemon 5 Species D168 Pokemon 6 Species D169 -D16A +D16A Pokemon 1 Color Map D16B /h D16C \l Pokemon 1 Current Hit Points D16D @@ -50,7 +50,7 @@ D193 \l D194 /h Pokemon 1 Special D195 \l -D196 +D196 Pokemon 2 Color Map D197 /h D198 \l Pokemon 2 Current Hit Points D199 @@ -94,7 +94,7 @@ D1BF \l D1C0 /h Pokemon 2 Special D1C1 \l -D1C2 +D1C2 Pokemon 3 Color Map D1C3 /h D1C4 \l Pokemon 3 Current Hit Points D1C5 @@ -138,7 +138,7 @@ D1EB \l D1EC /h Pokemon 3 Special D1ED \l -D1EE +D1EE Pokemon 4 Color Map D1EF /h D1F0 \l Pokemon 4 Current Hit Points D1F1 @@ -182,7 +182,7 @@ D217 \l D218 /h Pokemon 4 Special D219 \l -D21A +D21A Pokemon 5 Color Map D21B /h D21C \l Pokemon 5 Current Hit Points D21D @@ -226,7 +226,7 @@ D243 \l D244 /h Pokemon 5 Special D245 \l -D246 +D246 Pokemon 6 Color Map D247 /h D248 \l Pokemon 6 Current Hit Points D249 diff -r 8f1b32d3f229 -r 76b031d2f586 clojure/com/aurellem/exp/pokemon.clj --- a/clojure/com/aurellem/exp/pokemon.clj Tue Mar 20 18:07:42 2012 -0500 +++ b/clojure/com/aurellem/exp/pokemon.clj Tue Mar 20 18:50:49 2012 -0500 @@ -1,7 +1,8 @@ (ns com.aurellem.exp.pokemon "Here I find out how pokemon are stored in memory." (:use (com.aurellem.gb gb-driver items assembly util - characters)) + constants + characters species moves)) (:import java.io.File) (:import [com.aurellem.gb.gb_driver SaveState])) @@ -552,3 +553,73 @@ (defn crazy-pid [] (read-state "crazy-pidgeot")) + +(def unknown "") + +(def pokemon-1-info + {0xD16A "Color Map" ;; 0 + 0xD16B "Current-HP (h)" ;; 1 + 0xD16C "Current-HP (l)" ;; 2 + 0XD16D unknown ;; 3 + 0xD16E unknown ;; 4 + 0xD16F unknown ;; 5 + 0xD170 unknown ;; 6 + 0xD171 unknown ;; 7 + 0xD172 "Move 1 ID" ;; 8 + 0xD173 "Move 2 ID" ;; 9 + 0xD174 "Move 3 ID" ;; 10 + 0xD175 "Move 4 ID" ;; 11 + 0xD176 "OT-ID (h)" ;; 12 + 0xD177 "OT-ID (l)" ;; 13 + 0xD178 "Exp. Points (h)" ;; 14 + 0xD179 "Exp. Points (m)" ;; 15 + 0xD17A "Exp. Points (l)" ;; 16 + 0xD17B "HP DV" ;; 17 + 0xD17C unknown ;; 18 + 0xD17D "Attack DV" ;; 19 + 0xD17E unknown ;; 20 + 0xD17F "Defense DV" ;; 21 + 0xD180 unknown ;; 22 + 0xD181 "Speed DV" ;; 23 + 0xD182 unknown ;; 24 + 0xD183 "Special DV" ;; 25 + 0xD184 unknown ;; 26 + 0xD185 unknown ;; 27 + 0xD186 unknown ;; 28 + 0xD187 "PP Move 1" ;; 29 + 0xD188 "PP Move 2" ;; 30 + 0xD189 "PP Move 3" ;; 31 + 0xD18A "PP Move 4" ;; 32 + 0xD18B "Current Level" ;; 33 + 0xD18C "HP Total (h)" ;; 34 + 0xD18D "HP Total (l)" ;; 35 + 0xD18E "Attack (h)" ;; 36 + 0xD18F "Attack (l)" ;; 37 + 0xD190 "Defense (h)" ;; 38 + 0xD191 "Defense (l)" ;; 39 + 0xD192 "Speed (h)" ;; 40 + 0xD193 "Speed (l)" ;; 41 + 0xD194 "Special (h)" ;; 42 + 0xD195 "Special (h)" ;; 43 + }) + +(defn pokemon-data + ([^SaveState state pokemon-num] + (assert (<= 0 pokemon-num 5)) + (let [base (+ (* pokemon-num pokemon-record-width) 0xD16A)] + (subvec (vec (memory state)) base + (+ base pokemon-record-width)))) + ([pokemon-num] (pokemon-data @current-state pokemon-num))) + +(defn set-pokemon-data + ([^SaveState state pokemon-num new-data] + (assert (<= 0 pokemon-num 5)) + (let [base (+ (* pokemon-num pokemon-record-width) 0xD16A)] + (set-memory-range state base new-data))) + ([pokemon-num new-data] + (set-pokemon-data @current-state pokemon-num new-data))) + +(defn print-pokemon-data [^SaveState save pokemon-num]) + + +(defn pre-battle [] (read-state "prepare-for-battle")) \ No newline at end of file diff -r 8f1b32d3f229 -r 76b031d2f586 clojure/com/aurellem/gb/species.clj --- a/clojure/com/aurellem/gb/species.clj Tue Mar 20 18:07:42 2012 -0500 +++ b/clojure/com/aurellem/gb/species.clj Tue Mar 20 18:50:49 2012 -0500 @@ -2,7 +2,6 @@ (:use (com.aurellem.gb gb-driver util)) (:import [com.aurellem.gb.gb_driver SaveState])) - (def species-code->species-name {0x01 :rhydon 0x02 :kangaskhan @@ -172,4 +171,6 @@ (set-memory state (+ species-ID-1 pokemon-num) species-code))) ([pokemon-num species-name] - (set-species @current-state pokemon-num species-name))) \ No newline at end of file + (set-species @current-state pokemon-num species-name))) + + diff -r 8f1b32d3f229 -r 76b031d2f586 save-states/prepare-for-battle.sav Binary file save-states/prepare-for-battle.sav has changed