Mercurial > vba-clojure
view clojure/com/aurellem/gb/hxc.clj @ 243:5b59c6f17cd5
Added the list of types and advantages to the hardcoded collection.
author | Dylan Holmes <ocsenave@gmail.com> |
---|---|
date | Sun, 25 Mar 2012 22:29:12 -0500 |
parents | ca9d2897435b |
children | 27ca947084cf |
line wrap: on
line source
1 (ns com.aurellem.gb.hxc2 (:use (com.aurellem.gb assembly characters gb-driver util3 constants))4 (:use (com.aurellem.world practice))5 (:import [com.aurellem.gb.gb_driver SaveState]))8 (def hxc-pokenames9 "The hardcoded names of the 190 species in memory. List begins at ROM@E8000."10 (let [count-species 19011 name-length 10]12 (map character-codes->str13 (partition name-length14 (take (* count-species name-length)15 (drop 0xE800016 (rom(root))))))))18 (def hxc-items19 "The hardcoded names of the items in memory. List begins at ROM@45B7 "20 (map character-codes->str21 (take-nth 222 (partition-by #(= % 0x50)23 (take 120024 (drop 0x45B7 (rom (root))))))))25 (def hxc-titles26 "The hardcoded names of the trainer titles in memory. List begins at27 ROM@27E77"28 (map character-codes->str29 (take-nth 230 (partition-by #(= 0x50 %)31 (take 19632 (drop 0x27E7733 (rom (root))))))))36 (def hxc-pokedex37 "The hardcoded pokedex entries in memory. List begins at38 ROM@B8000, shortly before move names."39 (map character-codes->str40 (take-nth 241 (partition-by #(= % 0x50)42 (take 1475443 (drop 0xB800044 (rom (root))))))))45 (def hxc-moves46 "The hardcoded move names in memory. List begins at ROM@BC000"47 (map character-codes->str48 (take-nth 249 (partition-by #(= % 0x50)50 (take 155151 (drop 0xBC00052 (rom (root))))))))56 (def hxc-places57 "The hardcoded place names in memory. List begins at58 ROM@71500. Cinnabar Mansion is dynamically calculated."59 (map character-codes->str60 (take-nth 261 (partition-by #(= % 0x50)62 (take 56063 (drop 0x7150064 (rom (root))))))))67 (def hxc-dialog68 "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000."69 (character-codes->str(take 0x0F72870 (drop (+ 0x98000)71 (rom (root))))))76 (def pkmn-types77 {0 :normal78 1 :fighting79 2 :flying80 3 :poison81 4 :ground82 5 :rock83 7 :bug84 8 :ghost86 20 :fire87 21 :water88 22 :grass89 23 :electric90 24 :psychic91 25 :ice92 26 :dragon93 })96 (def hxc-advantage97 (map98 (fn [[atk def mult]] [(get pkmn-types atk (hex atk))99 (get pkmn-types def (hex def))100 (/ mult 10)])101 (partition 3102 (take-while (partial not= 0xFF)103 (drop 0x3E62D (rom(root)))))))107 ;; (def pkmn-types108 ;; [:normal109 ;; :fighting110 ;; :flying111 ;; :poison112 ;; :ground113 ;; :rock114 ;; :bird ;;?115 ;; :bug116 ;; :ghost117 ;; :A118 ;; :B119 ;; :C120 ;; :D121 ;; :E122 ;; :fire123 ;; :water124 ;; :grass125 ;; :electric126 ;; :psychic127 ;; :ice128 ;; :poision?])149 (def hxc-later150 "Running this code produces, e.g. hardcoded names NPCs give151 their pokemon. Will sort through it later."152 (print (character-codes->str(take 10000153 (drop 0x71597154 (rom (root)))))))156 (let [dex157 (partition-by #(= 0x50 %)158 (take 2540159 (drop 0x40687160 (rom (root)))))]161 (def dex dex)162 (def hxc-species163 (map character-codes->str164 (take-nth 4 dex))))