# HG changeset patch # User Dylan Holmes # Date 1332928329 18000 # Node ID 516acb83410f604cfd1eb76ebeae99a820d859e5 # Parent 0c3fbb313e49b0b2c292a9eb610735f3d82f633b Added the hardcoded list of moves that the TMs and HMs teach. diff -r 0c3fbb313e49 -r 516acb83410f clojure/com/aurellem/gb/hxc.clj --- a/clojure/com/aurellem/gb/hxc.clj Wed Mar 28 03:28:36 2012 -0500 +++ b/clojure/com/aurellem/gb/hxc.clj Wed Mar 28 04:52:09 2012 -0500 @@ -20,9 +20,10 @@ "Convert the string of alphabetic/space characters into a keyword by replacing spaces with hyphens and converting to lowercase." [s] + (if (nil? s) nil (keyword (.toLowerCase (apply str - (map #(if (= % \space) "-" %) s))))) + (map #(if (= % \space) "-" %) s)))))) ;; used to decode item prices @@ -304,8 +305,6 @@ (hxc-dialog com.aurellem.gb.gb-driver/original-rom))) - - (def hxc-move-names "The hardcoded move names in memory. List begins at ROM@BC000" (hxc-thunk-words 0xBC000 1551)) @@ -372,7 +371,25 @@ (drop 0x38000 rom)))))))) - +(defn hxc-machines + "The hardcoded moves taught by TMs and HMs. List begins at ROM@0x1232D." + ([] (hxc-machines + com.aurellem.gb.gb-driver/original-rom)) + ([rom] + (let [moves (hxc-move-names rom)] + (zipmap + (range) + (take-while + (comp not nil?) + (map (comp + format-name + (zipmap + (range) + moves) + dec) + (take 100 + (drop 0x1232D rom)))))))) + (defn hxc-pokenames "The hardcoded names of the 190 species in memory. List begins at ROM@E8000. Although names in memory are padded with 0x50 to be 10 characters @@ -602,7 +619,7 @@ type-2 rarity rating-xp - pic-dimensions + pic-dimensions ;; tile_width|tile_height (8px/tile) ptr-pic-obverse-1 ptr-pic-obverse-2 ptr-pic-reverse-1 @@ -769,6 +786,8 @@ +;; note: 0x2f31 contains the names "TM" "HM"? + ;; note for later: credits start at F1290