# HG changeset patch # User Robert McIntyre # Date 1332449919 18000 # Node ID d954835b24a471c36f790f0007859959e05d610c # Parent 4e3d5f33875097a75d9311ce81ddba163d60dcf6 renamed *pokemon-data* to *pokemon-record* diff -r 4e3d5f338750 -r d954835b24a4 clojure/com/aurellem/gb/pokemon.clj --- a/clojure/com/aurellem/gb/pokemon.clj Thu Mar 22 07:38:00 2012 -0500 +++ b/clojure/com/aurellem/gb/pokemon.clj Thu Mar 22 15:58:39 2012 -0500 @@ -90,7 +90,7 @@ (def unknown "") -(def pokemon-1-info +(def pokemon-1-record {0xD16A "Color Map" ;; 0 0xD16B "Current-HP (h)" ;; 1 0xD16C "Current-HP (l)" ;; 2 @@ -137,27 +137,27 @@ 0xD195 "Special (l)" ;; 43 }) -(defn pokemon-data +(defn pokemon-record ([^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))) + ([pokemon-num] (pokemon-record @current-state pokemon-num))) -(defn set-pokemon-data +(defn set-pokemon-record ([^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))) + (set-pokemon-record @current-state pokemon-num new-data))) -(defn print-pokemon-data +(defn print-pokemon-record ([^SaveState state pokemon-num] (assert (<= 0 pokemon-num 5)) - (let [poke-data (pokemon-data state pokemon-num) - backbone (sort (keys pokemon-1-info))] + (let [poke-data (pokemon-record state pokemon-num) + backbone (sort (keys pokemon-1-record))] (println "Pokemon " pokemon-num " -- " (nth (party-names state) pokemon-num) \newline) @@ -175,7 +175,7 @@ str (concat (repeat (- 8 (count s)) "0" ) s)))))) - (map pokemon-1-info backbone) + (map pokemon-1-record backbone) poke-data)))) ([pokemon-num] - (print-pokemon-data @current-state pokemon-num))) + (print-pokemon-record @current-state pokemon-num)))