annotate clojure/com/aurellem/gb/hxc.clj @ 226:21641c1c3f87

reformat
author Robert McIntyre <rlm@mit.edu>
date Sat, 24 Mar 2012 05:38:17 -0500
parents ca9d2897435b
children 5b59c6f17cd5
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
rlm@218 60 (take-nth 2
rlm@218 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
rlm@218 73 (def hxc-later
rlm@218 74 "Running this code produces, e.g. hardcoded names NPCs give
rlm@218 75 their pokemon. Will sort through it later."
rlm@218 76 (print (character-codes->str(take 10000
rlm@218 77 (drop 0x71597
rlm@218 78 (rom (root)))))))
rlm@218 79
rlm@218 80 (let [dex
rlm@218 81 (partition-by #(= 0x50 %)
rlm@218 82 (take 2540
rlm@218 83 (drop 0x40687
rlm@218 84 (rom (root)))))]
rlm@218 85 (def dex dex)
rlm@218 86 (def hxc-species
rlm@218 87 (map character-codes->str
rlm@218 88 (take-nth 4 dex))))