diff 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
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/species.clj	Fri Mar 23 04:36:16 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/species.clj	Fri Mar 23 04:43:44 2012 -0500
     1.3 @@ -1,7 +1,88 @@
     1.4  (ns com.aurellem.gb.species
     1.5 -  (:use (com.aurellem.gb gb-driver util constants))
     1.6 +  (:use (com.aurellem.gb characters gb-driver util constants))
     1.7    (:import [com.aurellem.gb.gb_driver SaveState]))
     1.8  
     1.9 +
    1.10 +(def hxc-pokenames
    1.11 +  "The hardcoded names of the 190 species in memory. List begins at ROM@E8000."
    1.12 +  (let [count-species 190
    1.13 +        name-length 10]
    1.14 +    (map character-codes->str
    1.15 +         (partition name-length
    1.16 +                    (take (* count-species name-length)
    1.17 +                          (drop 0xE8000
    1.18 +                                (rom(root)))))))) 
    1.19 +)
    1.20 +(def hxc-items
    1.21 +  "The hardcoded names of the items in memory. List begins at ROM@45B7 "
    1.22 +  (map character-codes->str
    1.23 +       (take-nth 2
    1.24 +                 (partition-by #(= % 0x50)
    1.25 +                               (take 1200
    1.26 +                                     (drop 0x45B7 (rom (root))))))))
    1.27 +(def hxc-titles
    1.28 +  "The hardcoded names of the trainer titles in memory. List begins at
    1.29 +ROM@27E77"
    1.30 +  (map character-codes->str
    1.31 +       (take-nth 2
    1.32 +                 (partition-by #(= 0x50 %)
    1.33 +                               (take 196
    1.34 +                                     (drop 0x27E77
    1.35 +                                           (rom (root))))))))
    1.36 +
    1.37 +
    1.38 +(def hxc-pokedex
    1.39 +  "The hardcoded pokedex entries in memory. List begins at
    1.40 +ROM@B8000, shortly before move names."
    1.41 +  (map character-codes->str
    1.42 +       (take-nth 2
    1.43 +                 (partition-by #(= % 0x50)
    1.44 +                               (take 14754
    1.45 +                                     (drop 0xB8000
    1.46 +                                           (rom (root))))))))
    1.47 +(def hxc-moves
    1.48 +  "The hardcoded move names in memory. List begins at ROM@BC000"
    1.49 +  (map character-codes->str
    1.50 +       (take-nth 2
    1.51 +                 (partition-by #(= % 0x50)
    1.52 +                               (take 1551
    1.53 +                                     (drop 0xBC000
    1.54 +                                           (rom (root))))))))   
    1.55 +
    1.56 +
    1.57 +
    1.58 +(def hxc-places
    1.59 +  "The hardcoded place names in memory. List begins at
    1.60 +ROM@71500. Cinnabar Mansion is dynamically calculated."
    1.61 +  (map character-codes->str
    1.62 +       (take-nth 2
    1.63 +                 (partition-by #(= % 0x50)
    1.64 +                               (take 560
    1.65 +                                     (drop 0x71500
    1.66 +                                           (rom (root))))))))
    1.67 +
    1.68 +(def hxc-later
    1.69 +  "Running this code produces, e.g. hardcoded names NPCs give
    1.70 +their pokemon"
    1.71 +(print (character-codes->str(take 10000
    1.72 +                          (drop 0x71597
    1.73 +                                (rom (root)))))))
    1.74 +
    1.75 +
    1.76 +
    1.77 +
    1.78 +(let [dex
    1.79 +      (partition-by #(= 0x50 %)
    1.80 +                    (take 2540
    1.81 +                          (drop 0x40687
    1.82 +                                (rom (root)))))]
    1.83 +  (def dex dex)
    1.84 +  (def hxc-species
    1.85 +    (map character-codes->str
    1.86 +         (take-nth 4 dex))))
    1.87 +
    1.88 +
    1.89 +
    1.90  (def species-code->species-name
    1.91    {0x01  :rhydon
    1.92     0x02  :kangaskhan