Mercurial > vba-clojure
view clojure/com/aurellem/gb/species.clj @ 213:57258c269bcb
Added spelling bee.
author | Dylan Holmes <ocsenave@gmail.com> |
---|---|
date | Fri, 23 Mar 2012 19:05:08 -0500 |
parents | 8523faa122b0 |
children | aba78e52faba |
line wrap: on
line source
1 (ns com.aurellem.gb.species2 (: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)))))73 (def hxc-later74 "Running this code produces, e.g. hardcoded names NPCs give75 their pokemon. Will sort through it later."76 (print (character-codes->str(take 1000077 (drop 0x7159778 (rom (root)))))))86 (let [dex87 (partition-by #(= 0x50 %)88 (take 254089 (drop 0x4068790 (rom (root)))))]91 (def dex dex)92 (def hxc-species93 (map character-codes->str94 (take-nth 4 dex))))98 (def species-code->species-name99 {0x01 :rhydon100 0x02 :kangaskhan101 0x03 :nidoran-male102 0x04 :clefairy103 0x05 :spearow104 0x06 :voltorb105 0x07 :nidoking106 0x08 :slowbro107 0x09 :ivysaur108 0x0A :exeggutor109 0x0B :lickitung110 0x0C :exeggcute111 0x0D :grimer112 0x0E :gengar113 0x0F :nidoran-female114 0x10 :nidoqueen115 0x11 :cubone116 0x12 :rhyhorn117 0x13 :lapras118 0x14 :arcanine119 0x15 :mew120 0x16 :gyarados121 0x17 :shellder122 0x18 :tentacool123 0x19 :gastly124 0x1A :scyther125 0x1B :staryu126 0x1C :blastoise127 0x1D :pinsir128 0x1E :tangela129 0x21 :growlithe130 0x22 :onix131 0x23 :fearow132 0x24 :pidgey133 0x25 :slowpoke134 0x26 :kadabra135 0x27 :graveler136 0x28 :chansey137 0x29 :machoke138 0x2A :mr-mime139 0x2B :hitmonlee140 0x2C :hitmonchan141 0x2D :arbok142 0x2E :parasect143 0x2F :psyduck144 0x30 :drowzee145 0x31 :golem146 0x33 :magmar147 0x35 :electabuzz148 0x36 :magneton149 0x37 :koffing150 0x39 :mankey151 0x3A :seel152 0x3B :diglett153 0x3C :tauros154 0x40 :farfetch'd155 0x41 :venonat156 0x42 :dragonite157 0x46 :doduo158 0x47 :poliwag159 0x48 :jynx160 0x49 :moltres161 0x4A :articuno162 0x4B :zapdos163 0x4C :ditto164 0x4D :meowth165 0x4E :krabby166 0x52 :vulpix167 0x53 :ninetails168 0x54 :pikachu169 0x55 :riachu170 0x58 :dratini171 0x59 :dragonair172 0x5A :kabuto173 0x5B :kabutops174 0x5C :horsea175 0x5D :sedra176 0x60 :sandshrew177 0x61 :sandslash178 0x62 :omanyte179 0x63 :omastar180 0x64 :jigglypuff181 0x65 :wigglytuff182 0x66 :eevee183 0x67 :flareon184 0x68 :jolteon185 0x69 :vaporeon186 0x6A :machop187 0x6B :zubat188 0x6C :ekans189 0x6D :paras190 0x6E :poliwhirl191 0x6F :poliwrath192 0x70 :weedle193 0x71 :kakuna194 0x72 :beedrill195 0x74 :dodrio196 0x75 :primeape197 0x76 :dugtrio198 0x77 :venomoth199 0x78 :dewgong200 0x7B :caterpie201 0x7C :metapod202 0x7D :butterfree203 0x7E :machamp204 0x80 :golduck205 0x81 :hypno206 0x82 :golbat207 0x83 :mewtwo208 0x84 :snorlax209 0x85 :magikarp210 0x88 :muk211 0x8A :kingler212 0x8B :cloyster213 0x8D :electrode214 0x8E :clefable215 0x8F :wheezing216 0x90 :persian217 0x91 :marowak218 0x93 :haunter219 0x94 :abra220 0x95 :alakazam221 0x96 :pidgeotto222 0x97 :pidgeot223 0x98 :starmie224 0x99 :bulbasaur225 0x9A :venusaur226 0x9B :tentacruel227 0x9D :goldeen228 0x9E :seaking229 0xA3 :ponyta230 0xA4 :rapidash231 0xA5 :rattata232 0xA6 :raticate233 0xA7 :nidorino234 0xA8 :nidorina235 0xA9 :geodude236 0xAA :porygon237 0xAB :aerodactyl238 0xAD :magnemite239 0xB0 :charmander240 0xB1 :squirtle241 0xB2 :charmeleon242 0xB3 :wartortle243 0xB4 :charizard244 0xB9 :oddish245 0xBA :gloom246 0xBB :vileplume247 0xBC :bellsprout248 0xBD :weepenbell249 0xBE :victreebel})251 (def species-ID-1 0xD163)253 (def species-name->species-code254 (zipmap (vals species-code->species-name)255 (keys species-code->species-name)))257 (defn pokemon-species-data-address [poke-num]258 (+ species-ID-1 poke-num))260 (defn read-species261 ([^SaveState state poke-num]262 (assert (<= 0 poke-num 5))263 (species-code->species-name264 (aget (memory state)265 (pokemon-species-data-address poke-num))))266 ([poke-num]267 (read-species @current-state poke-num)))269 (defn set-species270 ([^SaveState state poke-num species-name]271 (assert (<= 0 poke-num 5))272 (let [species-code (species-name->species-code273 species-name274 species-name)]276 (set-memory state (pokemon-species-data-address poke-num)277 species-code)))278 ([poke-num species-name]279 (set-species @current-state poke-num species-name)))282 (def pokemon-1-species2-address 0xD16A)284 (defn pokemon-species2-address [poke-num]285 (+ pokemon-1-species2-address286 (* pokemon-record-width poke-num)))288 (defn read-species2289 ([^SaveState state poke-num]290 (species-code->species-name291 (aget (memory state)292 (pokemon-species2-address poke-num))))293 ([poke-num]294 (read-species2 @current-state poke-num)))296 (defn set-species2297 ([^SaveState state poke-num new-species]298 (let [species-code (species-name->species-code299 new-species300 new-species)]302 (set-memory state (pokemon-species2-address poke-num)303 species-code)))304 ([poke-num new-species]305 (set-species2 @current-state poke-num new-species)))