Mercurial > vba-clojure
comparison clojure/com/aurellem/run/adv_choreo.clj @ 568:d2d41ecc88e0
added skeleton for clear-screen.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 01 Sep 2012 03:15:13 -0500 |
parents | dba6bb38d2fb |
children | 3fcc395b76ef |
comparison
equal
deleted
inserted
replaced
567:dba6bb38d2fb | 568:d2d41ecc88e0 |
---|---|
175 :stack-cleanup-high | 175 :stack-cleanup-high |
176 ]) | 176 ]) |
177 | 177 |
178 display-glyph | 178 display-glyph |
179 | 179 |
180 (let [init | 180 (let [init* |
181 | |
182 (flatten | 181 (flatten |
183 [0xF1 ;; pop A, now A is equal to key input | 182 [0xF1 ;; pop A, now A is equal to key input |
184 ;; BC is current number of glyphs rendered. | 183 ;; BC is current number of glyphs rendered. |
185 ;; each glyph is two characters, and the screen can hold up | 184 ;; each glyph is two characters, and the screen can hold up |
186 ;; to 360 characters. Thus, if the current glyphs is a | 185 ;; to 360 characters. Thus, if the current glyphs is a |
195 ;; load row and column into DE | 194 ;; load row and column into DE |
196 0x23 0x23 ;; HL += 2 | 195 0x23 0x23 ;; HL += 2 |
197 0x2A 0x57 ;; row -> D | 196 0x2A 0x57 ;; row -> D |
198 0x2A 0x5F ;; column -> E | 197 0x2A 0x5F ;; column -> E |
199 | 198 |
200 | 199 ;; clear screen if we are at 0,0 |
201 | 200 0x57 0xB3 ;; D->A, OR E A ==> (= D E 0) |
201 0x20 ;; skip clear-screen if D and E are not both zero | |
202 :clear-screen-length | |
202 | 203 |
203 ]) | 204 ]) |
204 clear-screen | 205 clear-screen |
205 | 206 (flatten |
206 []] | 207 [0 0 0]) |
208 | |
209 init (replace | |
210 {:clear-screen-length (count clear-screen)} init*) | |
211 ] | |
212 | |
207 (concat init clear-screen)) | 213 (concat init clear-screen)) |
208 | 214 |
209 | 215 |
210 | 216 |
211 cleanup | 217 cleanup |