# HG changeset patch # User Robert McIntyre # Date 1346510107 18000 # Node ID 5f09601abe8cf5fdaf89c880ea6235f52eda6398 # Parent 46bbeac1b329dbbad5c78cc366507a2baf959f34 saving progress. diff -r 46bbeac1b329 -r 5f09601abe8c clojure/com/aurellem/run/adv_choreo.clj --- a/clojure/com/aurellem/run/adv_choreo.clj Sat Sep 01 06:15:23 2012 -0500 +++ b/clojure/com/aurellem/run/adv_choreo.clj Sat Sep 01 09:35:07 2012 -0500 @@ -231,17 +231,18 @@ ] ;; set D to zero set-HL-from-row-and-column + (flatten [;; formula for memory offset is: ;; (+ 0x9800 (* 32 row) column) == ;; (+ 0x97E0 (* 32 (+ 1 row)) column) - + 0xD5 ;; push DE ;; RLM: this should be 0x9800, investigate - 0x21 0x00 0x98 ;; load HL with 0x97E0 + 0x21 0x00 0x98 ;; load HL with something 0x06 0 - 0x4B - 0x09 + 0x4B ;; columns (E) -> BC + 0x09 ;; HL += columns 0xAF ;; 0 -> A @@ -249,14 +250,16 @@ 0x06 0 0x0E 32 ;; load 32 into BC - 0xBA + 0xBA ;; CP A D 0x20 4 + ;;(+ 32 3) 0x09 ;; HL += 32 + ;;(repeat 32 0x23) 0x3C 0x18 + ;;(->signed-8-bit (+ -6 -32)) (->signed-8-bit -7) - ;; 0x14 ;; inc D to handle case where D == 0 ;; ;; D will never be > 20, so this will never overflow. @@ -267,8 +270,8 @@ ;; 0x20 ;; (->signed-8-bit -4) - - ] + 0xD1 ;; pop DE + ]) render-glyph (flatten @@ -279,18 +282,22 @@ ;; load row and column into DE 0x2A 0x57 ;; row -> D 0x2A 0x5F ;; column -> E - + + set-HL-from-row-and-column + 0xF1 ;; pop A, now A is equal to key input - 0x3E 0xFF + 0x3E 0xFF ;; RLM: TESTING set A = 0xFF 0xF5 ;; save A 0xE6 0xF0 ;; clear second nybble 0xCB 0x37 ;; swap nybbles 0x77 ;; store A in video RAM as a character (pun) increment-row-column - + + set-HL-from-row-and-column + 0xF1 ;; restore A 0xE6 0x0F ;; select second nybble 0x77 ;; store second nybble as character