comparison clojure/com/aurellem/run/bootstrap_1.clj @ 417:0b6624c1291c

made basic tone player.
author Robert McIntyre <rlm@mit.edu>
date Mon, 16 Apr 2012 14:08:56 -0500
parents 21b8b3350b20
children cd557c922cec
comparison
equal deleted inserted replaced
416:21b8b3350b20 417:0b6624c1291c
856 (write-RAM target (main-bootstrap-program target)) 856 (write-RAM target (main-bootstrap-program target))
857 (do-nothing 1) 857 (do-nothing 1)
858 (transfer-control target) 858 (transfer-control target)
859 (do-nothing 1))))) 859 (do-nothing 1)))))
860 860
861 (defn gen-new-kernel-checkpoint! []
862 (write-script! (do-nothing 10 (relocate-main-bootstrap))
863 "new-kernel"))
864
865 (defn new-kernel [] (read-script "new-kernel"))
866
867
861 (def mid-game-data 868 (def mid-game-data
862 (subvec (vec (memory (mid-game))) 869 (subvec (vec (memory (mid-game)))
863 pokemon-list-start 870 pokemon-list-start
864 (+ pokemon-list-start 697))) 871 (+ pokemon-list-start 697)))
865 872
866 (def mid-game-map-address 0x46BC) 873 (def mid-game-map-address 0x46BC)
867 874
868 (defn set-mid-game-data 875 (defn-memo set-mid-game-data
869 ([] (set-mid-game-data (relocate-main-bootstrap))) 876 ([] (set-mid-game-data (relocate-main-bootstrap)))
870 ([script] 877 ([script]
871 (->> script 878 (->> script
872 (do-nothing 10) 879 (do-nothing 10)
873 (write-RAM pokemon-list-start 880 (write-RAM pokemon-list-start
886 (+ pokemon-list-start 500)) 893 (+ pokemon-list-start 500))
887 (subvec (vec (memory (mid-game))) 894 (subvec (vec (memory (mid-game)))
888 pokemon-list-start 895 pokemon-list-start
889 (+ pokemon-list-start 500)))) 896 (+ pokemon-list-start 500))))
890 897
891 (defn return-to-pokemon-kernel 898 (defn-memo return-to-pokemon-kernel
892 ([] (return-to-pokemon-kernel (set-mid-game-data))) 899 ([] (return-to-pokemon-kernel (set-mid-game-data)))
893 ([script] 900 ([script]
894 (let [scratch (+ 200 pokemon-box-1-address) 901 (let [scratch (+ 200 pokemon-box-1-address)
895 return-program 902 return-program
896 (flatten 903 (flatten