comparison clojure/com/aurellem/gb/hxc.clj @ 310:3d4f60b4a4af

added hxc-intro-pkmn for seeing which pokemon is displayed in oak's intro, and sxc-intro-pkmn! for modifying it.
author Dylan Holmes <ocsenave@gmail.com>
date Sun, 01 Apr 2012 01:50:34 -0500
parents de172acc5a03
children 2060219691fa
comparison
equal deleted inserted replaced
309:e6a5dfd31230 310:3d4f60b4a4af
734 :base-hp rating-hp 734 :base-hp rating-hp
735 :base-atk rating-atk 735 :base-atk rating-atk
736 :base-def rating-def 736 :base-def rating-def
737 :base-speed rating-speed 737 :base-speed rating-speed
738 :base-special rating-special 738 :base-special rating-special
739 :o0 pic-dimensions
740 :o1 ptr-pic-obverse-1
741 :o2 ptr-pic-obverse-2
739 })) 742 }))
740 743
741 (partition entry-size 744 (partition entry-size
742 (take (* entry-size pkmn-count) 745 (take (* entry-size pkmn-count)
743 (drop 0x383DE 746 (drop 0x383DE
744 rom)))))))) 747 rom))))))))
745 748
746 749
750 (defn hxc-intro-pkmn
751 "The hardcoded pokemon to display in Prof. Oak's introduction; the pokemon's
752 internal id is stored at ROM@5EDB."
753 ([] (hxc-intro-pkmn
754 com.aurellem.gb.gb-driver/original-rom))
755 ([rom]
756 (nth (hxc-pokenames rom) (nth rom 0x5EDB))))
757
758 (defn sxc-intro-pkmn!
759 "Set the hardcoded pokemon to display in Prof. Oak's introduction."
760 [pokemon]
761 (write-rom!
762 (rewrite-rom 0x5EDB
763 [
764 (inc
765 ((zipmap
766 (hxc-pokenames)
767 (range))
768 pokemon))])))
747 769
770
748 (defn hxc-item-prices 771 (defn hxc-item-prices
749 "The hardcoded list of item prices in memory. List begins at ROM@4495" 772 "The hardcoded list of item prices in memory. List begins at ROM@4495"
750 ([] (hxc-item-prices com.aurellem.gb.gb-driver/original-rom)) 773 ([] (hxc-item-prices com.aurellem.gb.gb-driver/original-rom))
751 ([rom] 774 ([rom]
752 (let [items (hxc-items rom) 775 (let [items (hxc-items rom)