comparison clojure/com/aurellem/run/adv_choreo.clj @ 570:a6dcb6236fbc

clear-screen complete
author Robert McIntyre <rlm@mit.edu>
date Sat, 01 Sep 2012 03:36:33 -0500
parents 3fcc395b76ef
children c6b01ff2f1e5
comparison
equal deleted inserted replaced
569:3fcc395b76ef 570:a6dcb6236fbc
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
208 0xC5 0xD5 0xE5 0xF5 208 0xC5 0xD5 0xE5 0xF5
209 209
210 (select-LCD-bank 0)
211 ;; write 0x00 to memory locations
212 ;; 0x9800 to 0x9A34
213 0x21
214 0x00 0x98 ;; load 0x9800 into HL
215
216
217 0x16 3 ;; 3 -> D
218 0x1E 190 ;; 188 -> E
219
220 0x3E 0 ;; 0-> A
221
222 ;; begin of do-while loop
223 0x22 ;; load 0 to 0x9800
224 0x1D ;; dec E
225 0x20
226 (->signed-8-bit -4)
227 0x15 ;; dec D
228 0x1E 190 ;; 188 -> E
229 0x20
230 (->signed-8-bit -8)
231 ;; end of do-while-loop
232
233
210 ;; restore all registers 234 ;; restore all registers
211 0xF1 0xE1 0xD1 0xC1 235 0xF1 0xE1 0xD1 0xC1
212 ]) 236 ])
213 237
214 init (replace 238 init (replace