Mercurial > vba-clojure
view clojure/com/aurellem/gb/hxc.clj @ 244:27ca947084cf
minor fixes
author | Dylan Holmes <ocsenave@gmail.com> |
---|---|
date | Sun, 25 Mar 2012 22:33:17 -0500 |
parents | 5b59c6f17cd5 |
children | a50faba43967 |
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))))))))26 (def hxc-types27 "The hardcoded type names in memory. List begins at ROM@27D99,28 shortly before hxc-titles."29 (map character-codes->str30 (take-nth 231 (partition-by #(= 0x50 %)32 (take 10233 (drop 0x27D9934 (rom (root))))))))36 (def hxc-titles37 "The hardcoded names of the trainer titles in memory. List begins at38 ROM@27E77"39 (map character-codes->str40 (take-nth 241 (partition-by #(= 0x50 %)42 (take 19643 (drop 0x27E7744 (rom (root))))))))47 (def hxc-pokedex48 "The hardcoded pokedex entries in memory. List begins at49 ROM@B8000, shortly before move names."50 (map character-codes->str51 (take-nth 252 (partition-by #(= % 0x50)53 (take 1475454 (drop 0xB800055 (rom (root))))))))56 (def hxc-moves57 "The hardcoded move names in memory. List begins at ROM@BC000"58 (map character-codes->str59 (take-nth 260 (partition-by #(= % 0x50)61 (take 155162 (drop 0xBC00063 (rom (root))))))))67 (def hxc-places68 "The hardcoded place names in memory. List begins at69 ROM@71500. Cinnabar Mansion is dynamically calculated."70 (map character-codes->str71 (take-nth 272 (partition-by #(= % 0x50)73 (take 56074 (drop 0x7150075 (rom (root))))))))78 (def hxc-dialog79 "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000."80 (character-codes->str(take 0x0F72881 (drop (+ 0x98000)82 (rom (root))))))87 (def pkmn-types88 [:normal89 :fighting90 :flying91 :poison92 :ground93 :rock94 :bug95 :ghost96 :A97 :B98 :C99 :D100 :E101 :F102 :G103 :H104 :I105 :J106 :K107 :fire108 :water109 :grass110 :electric111 :psychic112 :ice113 :dragon114 ])117 (def hxc-advantage118 (map119 (fn [[atk def mult]] [(get pkmn-types atk (hex atk))120 (get pkmn-types def (hex def))121 (/ mult 10)])122 (partition 3123 (take-while (partial not= 0xFF)124 (drop 0x3E62D (rom(root)))))))146 (def hxc-later147 "Running this code produces, e.g. hardcoded names NPCs give148 their pokemon. Will sort through it later."149 (print (character-codes->str(take 10000150 (drop 0x71597151 (rom (root)))))))153 (let [dex154 (partition-by #(= 0x50 %)155 (take 2540156 (drop 0x40687157 (rom (root)))))]158 (def dex dex)159 (def hxc-species160 (map character-codes->str161 (take-nth 4 dex))))