comparison clojure/com/aurellem/gb/species.clj @ 207:a67f1df5d096

More hardcode expeditions.
author Dylan Holmes <ocsenave@gmail.com>
date Fri, 23 Mar 2012 04:43:44 -0500
parents 43bb461a7419
children 8523faa122b0
comparison
equal deleted inserted replaced
206:32ac21c9a30d 207:a67f1df5d096
1 (ns com.aurellem.gb.species 1 (ns com.aurellem.gb.species
2 (:use (com.aurellem.gb gb-driver util constants)) 2 (:use (com.aurellem.gb characters gb-driver util constants))
3 (:import [com.aurellem.gb.gb_driver SaveState])) 3 (:import [com.aurellem.gb.gb_driver SaveState]))
4
5
6 (def hxc-pokenames
7 "The hardcoded names of the 190 species in memory. List begins at ROM@E8000."
8 (let [count-species 190
9 name-length 10]
10 (map character-codes->str
11 (partition name-length
12 (take (* count-species name-length)
13 (drop 0xE8000
14 (rom(root))))))))
15 )
16 (def hxc-items
17 "The hardcoded names of the items in memory. List begins at ROM@45B7 "
18 (map character-codes->str
19 (take-nth 2
20 (partition-by #(= % 0x50)
21 (take 1200
22 (drop 0x45B7 (rom (root))))))))
23 (def hxc-titles
24 "The hardcoded names of the trainer titles in memory. List begins at
25 ROM@27E77"
26 (map character-codes->str
27 (take-nth 2
28 (partition-by #(= 0x50 %)
29 (take 196
30 (drop 0x27E77
31 (rom (root))))))))
32
33
34 (def hxc-pokedex
35 "The hardcoded pokedex entries in memory. List begins at
36 ROM@B8000, shortly before move names."
37 (map character-codes->str
38 (take-nth 2
39 (partition-by #(= % 0x50)
40 (take 14754
41 (drop 0xB8000
42 (rom (root))))))))
43 (def hxc-moves
44 "The hardcoded move names in memory. List begins at ROM@BC000"
45 (map character-codes->str
46 (take-nth 2
47 (partition-by #(= % 0x50)
48 (take 1551
49 (drop 0xBC000
50 (rom (root))))))))
51
52
53
54 (def hxc-places
55 "The hardcoded place names in memory. List begins at
56 ROM@71500. Cinnabar Mansion is dynamically calculated."
57 (map character-codes->str
58 (take-nth 2
59 (partition-by #(= % 0x50)
60 (take 560
61 (drop 0x71500
62 (rom (root))))))))
63
64 (def hxc-later
65 "Running this code produces, e.g. hardcoded names NPCs give
66 their pokemon"
67 (print (character-codes->str(take 10000
68 (drop 0x71597
69 (rom (root)))))))
70
71
72
73
74 (let [dex
75 (partition-by #(= 0x50 %)
76 (take 2540
77 (drop 0x40687
78 (rom (root)))))]
79 (def dex dex)
80 (def hxc-species
81 (map character-codes->str
82 (take-nth 4 dex))))
83
84
4 85
5 (def species-code->species-name 86 (def species-code->species-name
6 {0x01 :rhydon 87 {0x01 :rhydon
7 0x02 :kangaskhan 88 0x02 :kangaskhan
8 0x03 :nidoran-male 89 0x03 :nidoran-male