Mercurial > vba-clojure
comparison clojure/com/aurellem/run/adv_choreo.clj @ 575:15876b1a0906
glyph display works partially, but does not write all glyphs.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 01 Sep 2012 04:15:32 -0500 |
parents | be6f46094ad0 |
children | 376f282bcbf1 |
comparison
equal
deleted
inserted
replaced
574:be6f46094ad0 | 575:15876b1a0906 |
---|---|
41 (defn program-data [base-address] | 41 (defn program-data [base-address] |
42 (let [image-program | 42 (let [image-program |
43 (display-image-kernel | 43 (display-image-kernel |
44 base-address | 44 base-address |
45 | 45 |
46 ;;pinkie-pie-mark | 46 pinkie-pie-mark |
47 test-image-color | 47 ;;test-image-color |
48 | 48 |
49 ) | 49 ) |
50 | 50 |
51 | 51 |
52 music-base-address (+ (count image-program) base-address) | 52 music-base-address (+ (count image-program) base-address) |
73 (:data (:noise final-music-data)))] | 73 (:data (:noise final-music-data)))] |
74 | 74 |
75 (concat | 75 (concat |
76 image-program ;; image program falls through to music program | 76 image-program ;; image program falls through to music program |
77 | 77 |
78 (infinite-loop) | 78 ;;(infinite-loop) |
79 ;;music-program | 79 music-program |
80 | 80 |
81 ))) | 81 ))) |
82 | 82 |
83 | 83 |
84 | 84 |
177 | 177 |
178 display-glyph | 178 display-glyph |
179 | 179 |
180 (let [init* | 180 (let [init* |
181 (flatten | 181 (flatten |
182 [0xF1 ;; pop A, now A is equal to key input | 182 [;; BC is current number of glyphs rendered. |
183 ;; BC is current number of glyphs rendered. | |
184 ;; each glyph is two characters, and the screen can hold up | 183 ;; each glyph is two characters, and the screen can hold up |
185 ;; to 360 characters. Thus, if the current glyphs is a | 184 ;; to 360 characters. Thus, if the current glyphs is a |
186 ;; multiple of 180, the screen must be refreshed. | 185 ;; multiple of 180, the screen must be refreshed. |
187 | 186 |
188 ;; DE contains max-glyphs and HL will be overwritten next | 187 ;; DE contains max-glyphs and HL will be overwritten next |
270 0x15 ;; add columns (E) to HL | 269 0x15 ;; add columns (E) to HL |
271 | 270 |
272 0xC1 0xD1 ;; pop C B E D | 271 0xC1 0xD1 ;; pop C B E D |
273 ] | 272 ] |
274 | 273 |
275 | |
276 | |
277 | |
278 render-glyph | 274 render-glyph |
279 (flatten | 275 (flatten |
280 [set-HL-from-row-and-column | 276 [set-HL-from-row-and-column |
277 0xF1 ;; pop A, now A is equal to key input | |
278 0xF5 ;; save A | |
279 | |
280 0xE6 0xF0 ;; clear second nybble | |
281 0xCB 0x37 ;; swap nybbles | |
282 0x22 ;; store A in video as a character (pun) | |
283 | |
284 0xF1 ;; restore A | |
285 0xE6 0x0F ;; select second nybble | |
286 0x22 ;; store second nybble as glyph | |
287 | |
288 increment-row-column | |
281 increment-row-column | 289 increment-row-column |
282 ;; Render each nybble of A as a character | 290 ;; Render each nybble of A as a character |
283 ;; there are two characters to a glyph. | 291 ;; there are two characters to a glyph. |
284 ]) | 292 ]) |
285 | 293 |