# HG changeset patch # User Robert McIntyre # Date 1332500321 18000 # Node ID 661d35f1b56e37cb81487f80e55b2be08efdeb6a # Parent 565f5d17f90a1e64ac8725575105e054218ee9c2# Parent a67f1df5d09610871c42910e1002898519dcd9df merge. diff -r 565f5d17f90a -r 661d35f1b56e clojure/com/aurellem/gb/characters.clj --- a/clojure/com/aurellem/gb/characters.clj Fri Mar 23 05:58:04 2012 -0500 +++ b/clojure/com/aurellem/gb/characters.clj Fri Mar 23 05:58:41 2012 -0500 @@ -5,12 +5,14 @@ (def character-code->character { 0x00 "<";;"end-of-name-sentinel" ;; begin messsage + 0x4E "[...]" ; ocsenave: scroll pokedex page 0x4F "\n" ; newline 0x50 "#";;"end-of-pokemon-name-sentinel" 0x51 "\n\n" ;; ocsenave: clear screen 0x54 "[POKE]" 0x55 "_" ;; ocsenave: breaking space? 0x57 ">" ;; ocsenave: end message + 0x5F ">" ;; ocsenave: end pokedex entry?? 0x60 "A-bold" 0x61 "B-bold" 0x62 "C-bold" diff -r 565f5d17f90a -r 661d35f1b56e clojure/com/aurellem/gb/species.clj --- a/clojure/com/aurellem/gb/species.clj Fri Mar 23 05:58:04 2012 -0500 +++ b/clojure/com/aurellem/gb/species.clj Fri Mar 23 05:58:41 2012 -0500 @@ -1,7 +1,88 @@ (ns com.aurellem.gb.species - (:use (com.aurellem.gb gb-driver util constants)) + (:use (com.aurellem.gb characters gb-driver util constants)) (:import [com.aurellem.gb.gb_driver SaveState])) + +(def hxc-pokenames + "The hardcoded names of the 190 species in memory. List begins at ROM@E8000." + (let [count-species 190 + name-length 10] + (map character-codes->str + (partition name-length + (take (* count-species name-length) + (drop 0xE8000 + (rom(root)))))))) +) +(def hxc-items + "The hardcoded names of the items in memory. List begins at ROM@45B7 " + (map character-codes->str + (take-nth 2 + (partition-by #(= % 0x50) + (take 1200 + (drop 0x45B7 (rom (root)))))))) +(def hxc-titles + "The hardcoded names of the trainer titles in memory. List begins at +ROM@27E77" + (map character-codes->str + (take-nth 2 + (partition-by #(= 0x50 %) + (take 196 + (drop 0x27E77 + (rom (root)))))))) + + +(def hxc-pokedex + "The hardcoded pokedex entries in memory. List begins at +ROM@B8000, shortly before move names." + (map character-codes->str + (take-nth 2 + (partition-by #(= % 0x50) + (take 14754 + (drop 0xB8000 + (rom (root)))))))) +(def hxc-moves + "The hardcoded move names in memory. List begins at ROM@BC000" + (map character-codes->str + (take-nth 2 + (partition-by #(= % 0x50) + (take 1551 + (drop 0xBC000 + (rom (root)))))))) + + + +(def hxc-places + "The hardcoded place names in memory. List begins at +ROM@71500. Cinnabar Mansion is dynamically calculated." + (map character-codes->str + (take-nth 2 + (partition-by #(= % 0x50) + (take 560 + (drop 0x71500 + (rom (root)))))))) + +(def hxc-later + "Running this code produces, e.g. hardcoded names NPCs give +their pokemon" +(print (character-codes->str(take 10000 + (drop 0x71597 + (rom (root))))))) + + + + +(let [dex + (partition-by #(= 0x50 %) + (take 2540 + (drop 0x40687 + (rom (root)))))] + (def dex dex) + (def hxc-species + (map character-codes->str + (take-nth 4 dex)))) + + + (def species-code->species-name {0x01 :rhydon 0x02 :kangaskhan