view clojure/com/aurellem/run/choreo.clj @ 538:3ebd321f198e

song sucessfully plays.
author Robert McIntyre <rlm@mit.edu>
date Mon, 25 Jun 2012 14:53:59 -0500
parents 04f61ade7879
children a64485223afa
line wrap: on
line source
1 (ns com.aurellem.run.choreo
2 (:use (com.aurellem.gb saves gb-driver util constants
3 items vbm characters money
4 rlm-assembly))
5 (:use (com.aurellem.run util music title save-corruption
6 bootstrap-0 bootstrap-1 image
7 ram-display))
8 (:require clojure.string)
9 (:import [com.aurellem.gb.gb_driver SaveState])
10 (:import java.io.File))
14 ;; take over game
15 ;; [X] silence noise
16 ;; [ ] construct writing/playing kernel
17 ;; [ ] play pony song while writing picture-program
18 ;; [ ] run picture program to display pinkie pie mark
22 (defn-memo silence-noise
23 ([] (silence-noise (launch-main-bootstrap-program)))
24 ([script]
25 (->> script
26 (write-RAM 0xFF1A [0 0 0]))))
29 (defn-memo write-pony-music-data
30 ([] (write-pony-music-data (launch-main-bootstrap-program)))
31 ([script]
32 (let [bytes (midi-bytes pony-csv)]
33 (->> script
34 (do-nothing 10)
35 (write-RAM (:address (:voice-1 bytes))
36 (:data (:voice-1 bytes)))
38 (do-nothing 100)
39 (write-RAM (:address (:voice-2 bytes))
40 (:data (:voice-2 bytes)))
42 (do-nothing 100)
43 (write-RAM (:address (:noise bytes))
44 (:data (:noise bytes)))
46 (do-nothing 100)
47 (write-RAM (:address (:kernel bytes))
48 (:data (:kernel bytes)))
50 (transfer-control (:address (:kernel bytes)))))))