# HG changeset patch # User Robert McIntyre # Date 1332551883 18000 # Node ID ca9d2897435b20721dd96fd29bb3bfc8f41548dc # Parent 7ceaac84be5750d0017a189495fb48c84f1b1aac moved hardcoded stuff into its own namespace. diff -r 7ceaac84be57 -r ca9d2897435b clojure/com/aurellem/gb/hxc.clj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clojure/com/aurellem/gb/hxc.clj Fri Mar 23 20:18:03 2012 -0500 @@ -0,0 +1,88 @@ +(ns com.aurellem.gb.hxc + (:use (com.aurellem.gb assembly characters gb-driver util + constants)) + (:use (com.aurellem.world practice)) + (: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-dialog + "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000." +(character-codes->str(take 0x0F728 + (drop (+ 0x98000) + (rom (root)))))) + +(def hxc-later + "Running this code produces, e.g. hardcoded names NPCs give +their pokemon. Will sort through it later." +(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)))) diff -r 7ceaac84be57 -r ca9d2897435b clojure/com/aurellem/gb/species.clj --- a/clojure/com/aurellem/gb/species.clj Fri Mar 23 19:39:03 2012 -0500 +++ b/clojure/com/aurellem/gb/species.clj Fri Mar 23 20:18:03 2012 -0500 @@ -1,100 +1,8 @@ (ns com.aurellem.gb.species (:use (com.aurellem.gb assembly characters gb-driver util constants)) - (:use (com.aurellem.world practice)) (: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-dialog - "The hardcoded dialogue in memory, including in-game alerts. List begins at ROM@98000." -(character-codes->str(take 0x0F728 - (drop (+ 0x98000) - (rom (root))))) - -(def hxc-later - "Running this code produces, e.g. hardcoded names NPCs give -their pokemon. Will sort through it later." -(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