annotate clojure/com/aurellem/run/choreo.clj @ 536:c2ee7222a3c4

investigating a problem with bad sound when writing RAM with bootstrapping program
author Robert McIntyre <rlm@mit.edu>
date Mon, 25 Jun 2012 14:23:16 -0500
parents 2de44c6184ee
children 04f61ade7879
rev   line source
rlm@521 1 (ns com.aurellem.run.choreo
rlm@521 2 (:use (com.aurellem.gb saves gb-driver util constants
rlm@521 3 items vbm characters money
rlm@521 4 rlm-assembly))
rlm@521 5 (:use (com.aurellem.run util music title save-corruption
rlm@521 6 bootstrap-0 bootstrap-1 image))
rlm@521 7 (:require clojure.string)
rlm@521 8 (:import [com.aurellem.gb.gb_driver SaveState])
rlm@521 9 (:import java.io.File))
rlm@521 10
rlm@521 11
rlm@535 12
rlm@535 13 ;; take over game
rlm@535 14 ;; [X] silence noise
rlm@535 15 ;; [ ] construct writing/playing kernel
rlm@535 16 ;; [ ] play pony song while writing picture-program
rlm@535 17 ;; [ ] run picture program to display pinkie pie mark
rlm@535 18
rlm@535 19
rlm@535 20
rlm@535 21 (defn-memo silence-noise
rlm@535 22 ([] (silence-noise (launch-main-bootstrap-program)))
rlm@535 23 ([script]
rlm@535 24 (->> script
rlm@535 25 (write-RAM 0xFF1A [0 0 0]))))
rlm@535 26
rlm@535 27
rlm@535 28 (defn-memo write-pony-music-data
rlm@535 29 ([] (write-pony-music-data (silence-noise)))
rlm@535 30 ([script]
rlm@536 31 (let [bytes (midi-bytes pony-csv)]
rlm@536 32 (->> script
rlm@536 33 (write-RAM (:address (:voice-1 bytes))
rlm@536 34 (:data (:voice-1 bytes)))
rlm@535 35
rlm@536 36 (write-RAM (:address (:voice-2 bytes))
rlm@536 37 (:data (:voice-2 bytes)))
rlm@535 38
rlm@536 39 (write-RAM (:address (:noise bytes))
rlm@536 40 (:data (:noise bytes)))
rlm@535 41
rlm@536 42 (write-RAM (:address (:kernel bytes))
rlm@536 43 (:data (:kernel bytes)))
rlm@536 44
rlm@536 45 (transfer-control (:address (:kernel bytes)))))))
rlm@536 46
rlm@536 47
rlm@536 48