annotate 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
rev   line source
rlm@218 1 (ns com.aurellem.gb.hxc
rlm@218 2 (:use (com.aurellem.gb assembly characters gb-driver util
rlm@218 3 constants))
rlm@218 4 (:use (com.aurellem.world practice))
rlm@218 5 (:import [com.aurellem.gb.gb_driver SaveState]))
rlm@218 6
rlm@218 7
rlm@218 8 (def hxc-pokenames
rlm@218 9 "The hardcoded names of the 190 species in memory. List begins at ROM@E8000."
rlm@218 10 (let [count-species 190
rlm@218 11 name-length 10]
rlm@218 12 (map character-codes->str
rlm@218 13 (partition name-length
rlm@218 14 (take (* count-species name-length)
rlm@218 15 (drop 0xE8000
rlm@218 16 (rom(root))))))))
rlm@218 17
rlm@218 18 (def hxc-items
rlm@218 19 "The hardcoded names of the items in memory. List begins at ROM@45B7 "
rlm@218 20 (map character-codes->str
rlm@218 21 (take-nth 2
rlm@218 22 (partition-by #(= % 0x50)
rlm@218 23 (take 1200
rlm@218 24 (drop 0x45B7 (rom (root))))))))
rlm@218 25 (def hxc-titles
rlm@218 26 "The hardcoded names of the trainer titles in memory. List begins at
rlm@218 27 ROM@27E77"
rlm@218 28 (map character-codes->str
rlm@218 29 (take-nth 2
rlm@218 30 (partition-by #(= 0x50 %)
rlm@218 31 (take 196
rlm@218 32 (drop 0x27E77
rlm@218 33 (rom (root))))))))
rlm@218 34
rlm@218 35
rlm@218 36 (def hxc-pokedex
rlm@218 37 "The hardcoded pokedex entries in memory. List begins at
rlm@218 38 ROM@B8000, shortly before move names."
rlm@218 39 (map character-codes->str
rlm@218 40 (take-nth 2
rlm@218 41 (partition-by #(= % 0x50)
rlm@218 42 (take 14754
rlm@218 43 (drop 0xB8000
rlm@218 44 (rom (root))))))))
rlm@218 45 (def hxc-moves
rlm@218 46 "The hardcoded move names in memory. List begins at ROM@BC000"
rlm@218 47 (map character-codes->str
rlm@218 48 (take-nth 2
rlm@218 49 (partition-by #(= % 0x50)
rlm@218 50 (take 1551
rlm@218 51 (drop 0xBC000
rlm@218 52 (rom (root))))))))
rlm@218 53
rlm@218 54
rlm@218 55
rlm@218 56 (def hxc-places
rlm@218 57 "The hardcoded place names in memory. List begins at
rlm@218 58 ROM@71500. Cinnabar Mansion is dynamically calculated."
rlm@218 59 (map character-codes->str
ocsenave@243 60 (take-nth 2
ocsenave@243 61 (partition-by #(= % 0x50)
rlm@218 62 (take 560
rlm@218 63 (drop 0x71500
rlm@218 64 (rom (root))))))))
rlm@218 65
rlm@218 66
rlm@218 67 (def hxc-dialog
rlm@218 68 "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000."
rlm@218 69 (character-codes->str(take 0x0F728
rlm@218 70 (drop (+ 0x98000)
rlm@218 71 (rom (root))))))
rlm@218 72
ocsenave@243 73
ocsenave@243 74
ocsenave@243 75
ocsenave@243 76 (def pkmn-types
ocsenave@243 77 {0 :normal
ocsenave@243 78 1 :fighting
ocsenave@243 79 2 :flying
ocsenave@243 80 3 :poison
ocsenave@243 81 4 :ground
ocsenave@243 82 5 :rock
ocsenave@243 83 7 :bug
ocsenave@243 84 8 :ghost
ocsenave@243 85
ocsenave@243 86 20 :fire
ocsenave@243 87 21 :water
ocsenave@243 88 22 :grass
ocsenave@243 89 23 :electric
ocsenave@243 90 24 :psychic
ocsenave@243 91 25 :ice
ocsenave@243 92 26 :dragon
ocsenave@243 93 })
ocsenave@243 94
ocsenave@243 95
ocsenave@243 96 (def hxc-advantage
ocsenave@243 97 (map
ocsenave@243 98 (fn [[atk def mult]] [(get pkmn-types atk (hex atk))
ocsenave@243 99 (get pkmn-types def (hex def))
ocsenave@243 100 (/ mult 10)])
ocsenave@243 101 (partition 3
ocsenave@243 102 (take-while (partial not= 0xFF)
ocsenave@243 103 (drop 0x3E62D (rom(root)))))))
ocsenave@243 104
ocsenave@243 105
ocsenave@243 106
ocsenave@243 107 ;; (def pkmn-types
ocsenave@243 108 ;; [:normal
ocsenave@243 109 ;; :fighting
ocsenave@243 110 ;; :flying
ocsenave@243 111 ;; :poison
ocsenave@243 112 ;; :ground
ocsenave@243 113 ;; :rock
ocsenave@243 114 ;; :bird ;;?
ocsenave@243 115 ;; :bug
ocsenave@243 116 ;; :ghost
ocsenave@243 117 ;; :A
ocsenave@243 118 ;; :B
ocsenave@243 119 ;; :C
ocsenave@243 120 ;; :D
ocsenave@243 121 ;; :E
ocsenave@243 122 ;; :fire
ocsenave@243 123 ;; :water
ocsenave@243 124 ;; :grass
ocsenave@243 125 ;; :electric
ocsenave@243 126 ;; :psychic
ocsenave@243 127 ;; :ice
ocsenave@243 128 ;; :poision?])
ocsenave@243 129
ocsenave@243 130
ocsenave@243 131
ocsenave@243 132
ocsenave@243 133
ocsenave@243 134
ocsenave@243 135
ocsenave@243 136
ocsenave@243 137
ocsenave@243 138
ocsenave@243 139
ocsenave@243 140
ocsenave@243 141
ocsenave@243 142
ocsenave@243 143
ocsenave@243 144
ocsenave@243 145
ocsenave@243 146
ocsenave@243 147
ocsenave@243 148
rlm@218 149 (def hxc-later
rlm@218 150 "Running this code produces, e.g. hardcoded names NPCs give
rlm@218 151 their pokemon. Will sort through it later."
rlm@218 152 (print (character-codes->str(take 10000
rlm@218 153 (drop 0x71597
rlm@218 154 (rom (root)))))))
rlm@218 155
rlm@218 156 (let [dex
rlm@218 157 (partition-by #(= 0x50 %)
rlm@218 158 (take 2540
rlm@218 159 (drop 0x40687
rlm@218 160 (rom (root)))))]
rlm@218 161 (def dex dex)
rlm@218 162 (def hxc-species
rlm@218 163 (map character-codes->str
rlm@218 164 (take-nth 4 dex))))