diff clojure/com/aurellem/run/adv_choreo.clj @ 576:376f282bcbf1

removed max-glyph-count handling code as it is unnecessary.
author Robert McIntyre <rlm@mit.edu>
date Sat, 01 Sep 2012 04:19:15 -0500
parents 15876b1a0906
children df3a7eac39d7
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/adv_choreo.clj	Sat Sep 01 04:15:32 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/adv_choreo.clj	Sat Sep 01 04:19:15 2012 -0500
     1.3 @@ -43,8 +43,8 @@
     1.4          (display-image-kernel
     1.5           base-address
     1.6  
     1.7 -         pinkie-pie-mark
     1.8 -         ;;test-image-color
     1.9 +         ;;pinkie-pie-mark
    1.10 +         test-image-color
    1.11  
    1.12           )
    1.13           
    1.14 @@ -75,8 +75,8 @@
    1.15      (concat
    1.16       image-program ;; image program falls through to music program
    1.17  
    1.18 -     ;;(infinite-loop) 
    1.19 -     music-program
    1.20 +     (infinite-loop) 
    1.21 +     ;;music-program
    1.22  
    1.23       )))
    1.24  
    1.25 @@ -137,8 +137,7 @@
    1.26          (flatten
    1.27           [;; data region
    1.28            0x18
    1.29 -          4
    1.30 -          0 0 ;; current num of glyphs-rendered
    1.31 +          2
    1.32            0 0 ;; current row and column
    1.33            ;; save all registers
    1.34            0xC5 0xD5 0xE5 0xF5
    1.35 @@ -156,27 +155,8 @@
    1.36            0x1E max-glyphs-low   ;; into DE
    1.37            ])
    1.38  
    1.39 -        handle-glyph-count*
    1.40 -        (flatten
    1.41 -         [;; if glyphs-rendered = max-glyph count, go directly
    1.42 -          ;; to stack-cleanup
    1.43 -
    1.44 -          0x47 0xBA ;; compare B to D
    1.45 -          0x20 ;; skip next section B != D
    1.46 -          8 ;; this is equal to the number of instructions in the next
    1.47 -            ;; indented region!
    1.48 -            
    1.49 -            0x79 0xBB ;; compare C to E
    1.50 -            0x20 ;; JR NZ, skip if C != E
    1.51 -            4
    1.52 -            0xF1 ;; pop AF for stack maintainance!
    1.53 -            0x18
    1.54 -            :stack-cleanup-low
    1.55 -            :stack-cleanup-high
    1.56 -          ])
    1.57  
    1.58          display-glyph
    1.59 -
    1.60          (let [init*
    1.61                (flatten
    1.62                 [;; BC is current number of glyphs rendered.
    1.63 @@ -191,7 +171,6 @@
    1.64                  0x21
    1.65                  (reverse (disect-bytes-2 data-start))
    1.66                  ;; load row and column into DE
    1.67 -                0x23 0x23 ;; HL += 2
    1.68                  0x2A 0x57 ;; row -> D
    1.69                  0x2A 0x5F ;; column -> E
    1.70  
    1.71 @@ -301,35 +280,17 @@
    1.72          cleanup
    1.73          ;; restore all registers
    1.74          (flatten
    1.75 -         [0x03 ;; (inc glyphs-rednered) -> glyphs-rendered
    1.76 -
    1.77 -          ;; Reset HL to initial value
    1.78 +         [;; Reset HL to initial value
    1.79            0x21
    1.80            (reverse (disect-bytes-2 data-start))
    1.81 -          0x78 0x22 ;; BC ->  glyphs-rendered to RAM
    1.82 -          0x79 0x22 ;;
    1.83 -
    1.84            0x7A 0x22 ;; D -> rows       -> to RAM
    1.85            0x7B 0x22 ;; E -> columns
    1.86            ])
    1.87           
    1.88          stack-cleanup
    1.89          [0xF1 0xE1 0xD1 0xC1]
    1.90 -
    1.91 -        [stack-cleanup-high
    1.92 -         stack-cleanup-low]
    1.93 -        (disect-bytes-2 (+ start-address (count load-data)
    1.94 -                           (count handle-glyph-count*)
    1.95 -                           (count cleanup)
    1.96 -                           (count display-glyph)))
    1.97 -         
    1.98 -        handle-glyph-count
    1.99 -        (replace {:stack-cleanup-high stack-cleanup-high
   1.100 -                  :stack-cleanup-low  stack-cleanup-low}
   1.101 -                 handle-glyph-count*)]
   1.102 -    (println  (+ (count display-glyph) (count cleanup)))
   1.103 +        ]
   1.104      (concat load-data
   1.105 -            handle-glyph-count
   1.106              display-glyph
   1.107              cleanup stack-cleanup)))
   1.108