Mercurial > vba-clojure
view clojure/com/aurellem/run/basic_choreo.clj @ 541:cd557c922cec
working on basic choreo.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 25 Jun 2012 15:32:16 -0500 |
parents | |
children | 614eddc5b38c |
line wrap: on
line source
1 (ns com.aurellem.run.basic_choreo2 (:use (com.aurellem.gb saves gb-driver util constants3 items vbm characters money4 rlm-assembly))5 (:use (com.aurellem.run util music title save-corruption6 bootstrap-0 bootstrap-1 image7 ram-display))8 (:require clojure.string)9 (:import [com.aurellem.gb.gb_driver SaveState])10 (:import java.io.File))14 ;; take over game15 ;; [X] silence noise16 ;; [ ] run picture program to display pinkie pie mark17 ;; [ ] play pony song20 (defn-memo silence-noise21 ([] (silence-noise (relocate-main-bootstrap)))22 ([script]23 (->> script24 (write-RAM 0xFF1A [0 0 0]))))26 (def music-program-start 0xC000)27 (def image-program-start 0xCE00)29 (defn-memo write-pony-music-data30 ([] (write-pony-music-data (silence-noise)))31 ([script]32 (let [bytes (midi-bytes33 pony-csv34 0xC40035 0xC80036 0xCC0037 0xC000)]38 (->> script39 (write-RAM (:address (:voice-1 bytes))40 (:data (:voice-1 bytes)))41 (write-RAM (:address (:voice-2 bytes))42 (:data (:voice-2 bytes)))43 (write-RAM (:address (:noise bytes))44 (:data (:noise bytes)))45 (write-RAM (:address (:kernel bytes))46 (:data (:kernel bytes)))))))48 (defn-memo write-image-display-program49 ([] (write-image-display-program (write-pony-music-data)))50 ([script]51 (let [return-to-bootstrap52 (flatten53 [0xC354 (disect-bytes-2 relocated-bootstrap-start)])]55 (->> script56 (write-RAM57 image-program-start58 (concat59 (display-image-kernel60 image-program-start61 pinkie-pie-mark)62 return-to-bootstrap))))))64 (defn-memo activate-media65 ([] (activate-media (write-image-display-program)))66 ([script]67 (->> script68 (transfer-control image-program-start)69 (do-nothing 100)70 (transfer-control music-program-start))))