comparison clojure/com/aurellem/run/adv_choreo.clj @ 571:c6b01ff2f1e5

added row and column variables; clear-screen logic works now.
author Robert McIntyre <rlm@mit.edu>
date Sat, 01 Sep 2012 03:40:50 -0500
parents a6dcb6236fbc
children 58a25fa15176
comparison
equal deleted inserted replaced
570:a6dcb6236fbc 571:c6b01ff2f1e5
135 (disect-bytes-2 max-glyphs) 135 (disect-bytes-2 max-glyphs)
136 load-data 136 load-data
137 (flatten 137 (flatten
138 [;; data region 138 [;; data region
139 0x18 139 0x18
140 2 140 4
141 0 0 ;; current num of glyphs-rendered 141 0 0 ;; current num of glyphs-rendered
142 142 0 0 ;; current row and column
143 ;; save all registers 143 ;; save all registers
144 0xC5 0xD5 0xE5 0xF5 144 0xC5 0xD5 0xE5 0xF5
145 145
146 ;; load data from data region into registers 146 ;; load data from data region into registers
147 147
196 0x2A 0x57 ;; row -> D 196 0x2A 0x57 ;; row -> D
197 0x2A 0x5F ;; column -> E 197 0x2A 0x5F ;; column -> E
198 198
199 ;; clear screen if we are at 0,0 199 ;; clear screen if we are at 0,0
200 0x57 0xB3 ;; D->A, OR E A ==> (= D E 0) 200 0x57 0xB3 ;; D->A, OR E A ==> (= D E 0)
201 ;;0x20 ;; skip clear-screen if D and E are not both zero 201 0x20 ;; skip clear-screen if D and E are not both zero
202 ;;:clear-screen-length 202 :clear-screen-length
203 203
204 ]) 204 ])
205 clear-screen 205 clear-screen
206 (flatten 206 (flatten
207 [;; save all registers 207 [;; save all registers
239 {:clear-screen-length (count clear-screen)} init*) 239 {:clear-screen-length (count clear-screen)} init*)
240 ] 240 ]
241 241
242 (concat init clear-screen)) 242 (concat init clear-screen))
243 243
244
245
246 cleanup 244 cleanup
247 ;; restore all registers 245 ;; restore all registers
248 (flatten 246 (flatten
249 [0x03 ;; (inc glyphs-rednered) -> glyphs-rendered 247 [0x03 ;; (inc glyphs-rednered) -> glyphs-rendered
250 248