changeset 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 e6a5dfd31230
children 8fa0f36140b4
files clojure/com/aurellem/gb/hxc.clj clojure/com/aurellem/gb/mem_util.clj
diffstat 2 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/hxc.clj	Sat Mar 31 06:47:05 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/hxc.clj	Sun Apr 01 01:50:34 2012 -0500
     1.3 @@ -736,6 +736,9 @@
     1.4                :base-def rating-def
     1.5                :base-speed rating-speed
     1.6                :base-special rating-special
     1.7 +              :o0 pic-dimensions
     1.8 +              :o1 ptr-pic-obverse-1
     1.9 +              :o2 ptr-pic-obverse-2
    1.10                }))
    1.11           
    1.12           (partition entry-size
    1.13 @@ -744,7 +747,27 @@
    1.14                                  rom))))))))
    1.15    
    1.16    
    1.17 +(defn hxc-intro-pkmn
    1.18 +  "The hardcoded pokemon to display in Prof. Oak's introduction; the pokemon's
    1.19 +internal id is stored at ROM@5EDB."
    1.20 +  ([] (hxc-intro-pkmn
    1.21 +       com.aurellem.gb.gb-driver/original-rom))
    1.22 +  ([rom]
    1.23 +     (nth (hxc-pokenames rom) (nth rom 0x5EDB))))
    1.24 +
    1.25 +(defn sxc-intro-pkmn!
    1.26 +  "Set the hardcoded pokemon to display in Prof. Oak's introduction."
    1.27 +  [pokemon]
    1.28 +  (write-rom! 
    1.29 +   (rewrite-rom 0x5EDB
    1.30 +                [
    1.31 +                 (inc
    1.32 +                  ((zipmap
    1.33 +                    (hxc-pokenames)
    1.34 +                    (range))
    1.35 +                   pokemon))])))
    1.36    
    1.37 +
    1.38  (defn hxc-item-prices
    1.39    "The hardcoded list of item prices in memory. List begins at ROM@4495"
    1.40    ([] (hxc-item-prices com.aurellem.gb.gb-driver/original-rom))
     2.1 --- a/clojure/com/aurellem/gb/mem_util.clj	Sat Mar 31 06:47:05 2012 -0500
     2.2 +++ b/clojure/com/aurellem/gb/mem_util.clj	Sun Apr 01 01:50:34 2012 -0500
     2.3 @@ -140,10 +140,10 @@
     2.4       (map
     2.5        (fn [n]
     2.6          [(hex n)
     2.7 -         (take k (drop n rom))])
     2.8 +         (take k (drop n array))])
     2.9        
    2.10        (find-sublists
    2.11 -       rom
    2.12 +       array
    2.13         codes))))
    2.14  
    2.15  (defn spelling-bee