diff clojure/com/aurellem/run/adv_choreo.clj @ 578:385799ea1e9c

implemented row glyph drawing.
author Robert McIntyre <rlm@mit.edu>
date Sat, 01 Sep 2012 05:14:37 -0500
parents df3a7eac39d7
children 9f2b221bbf9b
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/adv_choreo.clj	Sat Sep 01 04:42:41 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/adv_choreo.clj	Sat Sep 01 05:14:37 2012 -0500
     1.3 @@ -196,7 +196,7 @@
     1.4                  0xF1 0xE1 0xD1 0xC1])
     1.5  
     1.6                ;; RLM: for TESTING ONLY!!!
     1.7 -              clear-screen (repeat 10 0)
     1.8 +              ;;clear-screen (repeat 10 0)
     1.9                increment-row-column
    1.10                [;; D contains row and E contains column
    1.11                 
    1.12 @@ -204,16 +204,25 @@
    1.13                 ;; column to 0 and increment row
    1.14                 0x1C ;; inc E
    1.15                 0x3E 20 0xBB ;; compare E to 20
    1.16 -               0x20 ;; if E is 20
    1.17 -                 3
    1.18 -                 0x1E 0 ;; set E to zero
    1.19 -                 0x14   ;; (inc D) -> D
    1.20 +               0x20
    1.21 +               2
    1.22 +               0x1E 0
    1.23 +               
    1.24 +               
    1.25  
    1.26 -               ;; every time row (D) reaches 18, set row to 0                
    1.27 -               0x3E 18 0xBA ;; compare D to 18
    1.28 -               0x20 ;; if D is 18
    1.29 -                 2
    1.30 -                 0x16 0] ;; set D to zero
    1.31 +               ;; 0x00 ;;0x1C ;; inc E
    1.32 +               ;; 0x3E 20 0xBB ;; compare E to 20
    1.33 +               ;; 0x20 ;; if E is 20
    1.34 +               ;;   3
    1.35 +               ;;   0x1E 0 ;; set E to zero
    1.36 +               ;;   0x00; 0x14   ;; (inc D) -> D
    1.37 +
    1.38 +               ;; ;; every time row (D) reaches 18, set row to 0                
    1.39 +               ;; 0x3E 18 0xBA ;; compare D to 18
    1.40 +               ;; 0x20 ;; if D is 18
    1.41 +               ;;   2
    1.42 +               ;;   0x16 0
    1.43 +               ] ;; set D to zero
    1.44                 
    1.45                set-HL-from-row-and-column
    1.46                [;; formula for memory offset is:
    1.47 @@ -221,20 +230,24 @@
    1.48                 ;; (+ 0x97E0 (* 32 (+ 1 row)) column)
    1.49                 0xD5 0xC5 ;; push D E B C
    1.50  
    1.51 -               0x21 0xE0 0x97 ;; load HL with 0x97E0
    1.52 +               0x21 0x00 0x98 ;; load HL with 0x97E0
    1.53                 
    1.54                 0x06 0
    1.55 -               0x0E 32     ;; load 32 into BC
    1.56 +               0x4B
    1.57 +               0x09
    1.58  
    1.59 -               0x14 ;; inc D to handle case where D == 0
    1.60 -               ;; D will never be > 20, so this will never overflow.
    1.61 +               ;; 0x06 0
    1.62 +               ;; 0x0E 32     ;; load 32 into BC
    1.63  
    1.64 -               ;; do 
    1.65 -                 0x09 ;; HL += 32
    1.66 -                 0x15 ;; dec D
    1.67 -               ;; while D != 0
    1.68 -               0x20 
    1.69 -               (->signed-8-bit -4)
    1.70 +               ;; 0x14 ;; inc D to handle case where D == 0
    1.71 +               ;; ;; D will never be > 20, so this will never overflow.
    1.72 +
    1.73 +               ;; ;; do 
    1.74 +               ;;   0x09 ;; HL += 32
    1.75 +               ;;   0x15 ;; dec D
    1.76 +               ;; ;; while D != 0
    1.77 +               ;; 0x20 
    1.78 +               ;; (->signed-8-bit -4)
    1.79                 
    1.80                 0xC1 0xD1 ;; pop C B E D
    1.81                 ]
    1.82 @@ -273,7 +286,8 @@
    1.83           [;; Reset HL to initial value
    1.84            0x21
    1.85            (reverse (disect-bytes-2 data-start))
    1.86 -          0x7A 0x22 ;; D -> rows       -> to RAM
    1.87 +          0x23
    1.88 +          ;;0x7A 0x22 ;; D -> rows       -> to RAM
    1.89            0x7B 0x22 ;; E -> columns
    1.90            ])
    1.91