view clojure/com/aurellem/gb/hxc.clj @ 218:ca9d2897435b

moved hardcoded stuff into its own namespace.
author Robert McIntyre <rlm@mit.edu>
date Fri, 23 Mar 2012 20:18:03 -0500
parents
children 5b59c6f17cd5
line wrap: on
line source
1 (ns com.aurellem.gb.hxc
2 (:use (com.aurellem.gb assembly characters gb-driver util
3 constants))
4 (:use (com.aurellem.world practice))
5 (:import [com.aurellem.gb.gb_driver SaveState]))
8 (def hxc-pokenames
9 "The hardcoded names of the 190 species in memory. List begins at ROM@E8000."
10 (let [count-species 190
11 name-length 10]
12 (map character-codes->str
13 (partition name-length
14 (take (* count-species name-length)
15 (drop 0xE8000
16 (rom(root))))))))
18 (def hxc-items
19 "The hardcoded names of the items in memory. List begins at ROM@45B7 "
20 (map character-codes->str
21 (take-nth 2
22 (partition-by #(= % 0x50)
23 (take 1200
24 (drop 0x45B7 (rom (root))))))))
25 (def hxc-titles
26 "The hardcoded names of the trainer titles in memory. List begins at
27 ROM@27E77"
28 (map character-codes->str
29 (take-nth 2
30 (partition-by #(= 0x50 %)
31 (take 196
32 (drop 0x27E77
33 (rom (root))))))))
36 (def hxc-pokedex
37 "The hardcoded pokedex entries in memory. List begins at
38 ROM@B8000, shortly before move names."
39 (map character-codes->str
40 (take-nth 2
41 (partition-by #(= % 0x50)
42 (take 14754
43 (drop 0xB8000
44 (rom (root))))))))
45 (def hxc-moves
46 "The hardcoded move names in memory. List begins at ROM@BC000"
47 (map character-codes->str
48 (take-nth 2
49 (partition-by #(= % 0x50)
50 (take 1551
51 (drop 0xBC000
52 (rom (root))))))))
56 (def hxc-places
57 "The hardcoded place names in memory. List begins at
58 ROM@71500. Cinnabar Mansion is dynamically calculated."
59 (map character-codes->str
60 (take-nth 2
61 (partition-by #(= % 0x50)
62 (take 560
63 (drop 0x71500
64 (rom (root))))))))
67 (def hxc-dialog
68 "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000."
69 (character-codes->str(take 0x0F728
70 (drop (+ 0x98000)
71 (rom (root))))))
73 (def hxc-later
74 "Running this code produces, e.g. hardcoded names NPCs give
75 their pokemon. Will sort through it later."
76 (print (character-codes->str(take 10000
77 (drop 0x71597
78 (rom (root)))))))
80 (let [dex
81 (partition-by #(= 0x50 %)
82 (take 2540
83 (drop 0x40687
84 (rom (root)))))]
85 (def dex dex)
86 (def hxc-species
87 (map character-codes->str
88 (take-nth 4 dex))))