rlm@542
|
1 ;;;; "Basic Choreography" -- just show off audio/video
|
rlm@542
|
2
|
rlm@541
|
3 (ns com.aurellem.run.basic_choreo
|
rlm@541
|
4 (:use (com.aurellem.gb saves gb-driver util constants
|
rlm@541
|
5 items vbm characters money
|
rlm@541
|
6 rlm-assembly))
|
rlm@541
|
7 (:use (com.aurellem.run util music title save-corruption
|
rlm@541
|
8 bootstrap-0 bootstrap-1 image
|
rlm@542
|
9 ram-display final-cut))
|
rlm@541
|
10 (:require clojure.string)
|
rlm@541
|
11 (:import [com.aurellem.gb.gb_driver SaveState])
|
rlm@541
|
12 (:import java.io.File))
|
rlm@541
|
13
|
rlm@541
|
14 ;; take over game
|
rlm@541
|
15 ;; [X] silence noise
|
rlm@542
|
16 ;; [X] preload audio/video programs
|
rlm@542
|
17 ;; [X] run picture program to display pinkie pie mark
|
rlm@542
|
18 ;; [X] play pony song
|
rlm@541
|
19
|
rlm@541
|
20 (defn-memo silence-noise
|
rlm@542
|
21 ([] (silence-noise (launch-main-bootstrap-program)))
|
rlm@541
|
22 ([script]
|
rlm@541
|
23 (->> script
|
rlm@542
|
24 (write-RAM 0xFF1A [0 0 0])
|
rlm@542
|
25 (relocate-main-bootstrap))))
|
rlm@541
|
26
|
rlm@541
|
27 (def music-program-start 0xC000)
|
rlm@541
|
28 (def image-program-start 0xCE00)
|
rlm@541
|
29
|
rlm@542
|
30 (defn-memo write-pony-music
|
rlm@542
|
31 ([] (write-pony-music (silence-noise)))
|
rlm@541
|
32 ([script]
|
rlm@541
|
33 (let [bytes (midi-bytes
|
rlm@541
|
34 pony-csv
|
rlm@541
|
35 0xC400
|
rlm@541
|
36 0xC800
|
rlm@541
|
37 0xCC00
|
rlm@542
|
38 music-program-start)]
|
rlm@541
|
39 (->> script
|
rlm@541
|
40 (write-RAM (:address (:voice-1 bytes))
|
rlm@541
|
41 (:data (:voice-1 bytes)))
|
rlm@541
|
42 (write-RAM (:address (:voice-2 bytes))
|
rlm@541
|
43 (:data (:voice-2 bytes)))
|
rlm@541
|
44 (write-RAM (:address (:noise bytes))
|
rlm@541
|
45 (:data (:noise bytes)))
|
rlm@541
|
46 (write-RAM (:address (:kernel bytes))
|
rlm@541
|
47 (:data (:kernel bytes)))))))
|
rlm@541
|
48
|
rlm@541
|
49 (defn-memo write-image-display-program
|
rlm@542
|
50 ([] (write-image-display-program (write-pony-music)))
|
rlm@541
|
51 ([script]
|
rlm@542
|
52 (let [goto-music
|
rlm@541
|
53 (flatten
|
rlm@541
|
54 [0xC3
|
rlm@542
|
55 (reverse (disect-bytes-2 music-program-start))])]
|
rlm@541
|
56 (->> script
|
rlm@541
|
57 (write-RAM
|
rlm@541
|
58 image-program-start
|
rlm@541
|
59 (concat
|
rlm@541
|
60 (display-image-kernel
|
rlm@541
|
61 image-program-start
|
rlm@541
|
62 pinkie-pie-mark)
|
rlm@542
|
63 goto-music))))))
|
rlm@542
|
64
|
rlm@541
|
65 (defn-memo activate-media
|
rlm@541
|
66 ([] (activate-media (write-image-display-program)))
|
rlm@541
|
67 ([script]
|
rlm@541
|
68 (->> script
|
rlm@541
|
69 (transfer-control image-program-start)
|
rlm@542
|
70 (do-nothing 1800))))
|
rlm@541
|
71
|
rlm@541
|
72
|
rlm@542
|
73
|
rlm@542
|
74 (def basic-render-dir
|
rlm@542
|
75 (File. user-home "proj/vba-clojure/render/basic"))
|
rlm@542
|
76
|
rlm@542
|
77 (defn basic-steps [] (first (activate-media)))
|
rlm@542
|
78
|
rlm@542
|
79 (defn basic-step-1! []
|
rlm@542
|
80 (render-files!
|
rlm@542
|
81 basic-render-dir
|
rlm@542
|
82 (root) (basic-steps)))
|
rlm@542
|
83
|
rlm@542
|
84 (defn basic-step-2! []
|
rlm@542
|
85 (generate-composite-frames!
|
rlm@542
|
86 basic-render-dir
|
rlm@543
|
87 (basic-steps)))
|
rlm@542
|
88
|
rlm@542
|
89 (defn basic-step-3! [] (final-cut! basic-render-dir))
|