Mercurial > vba-clojure
comparison clojure/com/aurellem/run/adv_choreo.clj @ 580:46bbeac1b329
saving progress.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 01 Sep 2012 06:15:23 -0500 |
parents | 9f2b221bbf9b |
children | 5f09601abe8c |
comparison
equal
deleted
inserted
replaced
579:9f2b221bbf9b | 580:46bbeac1b329 |
---|---|
232 | 232 |
233 set-HL-from-row-and-column | 233 set-HL-from-row-and-column |
234 [;; formula for memory offset is: | 234 [;; formula for memory offset is: |
235 ;; (+ 0x9800 (* 32 row) column) == | 235 ;; (+ 0x9800 (* 32 row) column) == |
236 ;; (+ 0x97E0 (* 32 (+ 1 row)) column) | 236 ;; (+ 0x97E0 (* 32 (+ 1 row)) column) |
237 0xD5 0xC5 ;; push D E B C | 237 |
238 | 238 |
239 ;; RLM: this should be 0x9800, investigate | 239 ;; RLM: this should be 0x9800, investigate |
240 0x21 0xE0 0x97 ;; load HL with 0x97E0 | 240 0x21 0x00 0x98 ;; load HL with 0x97E0 |
241 | 241 |
242 0x06 0 | 242 0x06 0 |
243 0x4B | 243 0x4B |
244 0x09 | 244 0x09 |
245 | 245 |
265 ;; 0x15 ;; dec D | 265 ;; 0x15 ;; dec D |
266 ;; ;; while D != 0 | 266 ;; ;; while D != 0 |
267 ;; 0x20 | 267 ;; 0x20 |
268 ;; (->signed-8-bit -4) | 268 ;; (->signed-8-bit -4) |
269 | 269 |
270 0xC1 0xD1 ;; pop C B E D | 270 |
271 ] | 271 ] |
272 | 272 |
273 render-glyph | 273 render-glyph |
274 (flatten | 274 (flatten |
275 [;; Render each nybble of A as a character | 275 [;; Render each nybble of A as a character |
280 0x2A 0x57 ;; row -> D | 280 0x2A 0x57 ;; row -> D |
281 0x2A 0x5F ;; column -> E | 281 0x2A 0x5F ;; column -> E |
282 | 282 |
283 set-HL-from-row-and-column | 283 set-HL-from-row-and-column |
284 0xF1 ;; pop A, now A is equal to key input | 284 0xF1 ;; pop A, now A is equal to key input |
285 0x3E 0xFF | |
285 0xF5 ;; save A | 286 0xF5 ;; save A |
286 | 287 |
287 0xE6 0xF0 ;; clear second nybble | 288 0xE6 0xF0 ;; clear second nybble |
288 0xCB 0x37 ;; swap nybbles | 289 0xCB 0x37 ;; swap nybbles |
289 0x77 ;; store A in video RAM as a character (pun) | 290 0x77 ;; store A in video RAM as a character (pun) |