# HG changeset patch # User Robert McIntyre # Date 1346491155 18000 # Node ID 376f282bcbf12998ba6cfb47e9d504504722bc9d # Parent 15876b1a0906d07ca45a845b59f875cace4f7b1e removed max-glyph-count handling code as it is unnecessary. diff -r 15876b1a0906 -r 376f282bcbf1 clojure/com/aurellem/run/adv_choreo.clj --- a/clojure/com/aurellem/run/adv_choreo.clj Sat Sep 01 04:15:32 2012 -0500 +++ b/clojure/com/aurellem/run/adv_choreo.clj Sat Sep 01 04:19:15 2012 -0500 @@ -43,8 +43,8 @@ (display-image-kernel base-address - pinkie-pie-mark - ;;test-image-color + ;;pinkie-pie-mark + test-image-color ) @@ -75,8 +75,8 @@ (concat image-program ;; image program falls through to music program - ;;(infinite-loop) - music-program + (infinite-loop) + ;;music-program ))) @@ -137,8 +137,7 @@ (flatten [;; data region 0x18 - 4 - 0 0 ;; current num of glyphs-rendered + 2 0 0 ;; current row and column ;; save all registers 0xC5 0xD5 0xE5 0xF5 @@ -156,27 +155,8 @@ 0x1E max-glyphs-low ;; into DE ]) - handle-glyph-count* - (flatten - [;; if glyphs-rendered = max-glyph count, go directly - ;; to stack-cleanup - - 0x47 0xBA ;; compare B to D - 0x20 ;; skip next section B != D - 8 ;; this is equal to the number of instructions in the next - ;; indented region! - - 0x79 0xBB ;; compare C to E - 0x20 ;; JR NZ, skip if C != E - 4 - 0xF1 ;; pop AF for stack maintainance! - 0x18 - :stack-cleanup-low - :stack-cleanup-high - ]) display-glyph - (let [init* (flatten [;; BC is current number of glyphs rendered. @@ -191,7 +171,6 @@ 0x21 (reverse (disect-bytes-2 data-start)) ;; load row and column into DE - 0x23 0x23 ;; HL += 2 0x2A 0x57 ;; row -> D 0x2A 0x5F ;; column -> E @@ -301,35 +280,17 @@ cleanup ;; restore all registers (flatten - [0x03 ;; (inc glyphs-rednered) -> glyphs-rendered - - ;; Reset HL to initial value + [;; Reset HL to initial value 0x21 (reverse (disect-bytes-2 data-start)) - 0x78 0x22 ;; BC -> glyphs-rendered to RAM - 0x79 0x22 ;; - 0x7A 0x22 ;; D -> rows -> to RAM 0x7B 0x22 ;; E -> columns ]) stack-cleanup [0xF1 0xE1 0xD1 0xC1] - - [stack-cleanup-high - stack-cleanup-low] - (disect-bytes-2 (+ start-address (count load-data) - (count handle-glyph-count*) - (count cleanup) - (count display-glyph))) - - handle-glyph-count - (replace {:stack-cleanup-high stack-cleanup-high - :stack-cleanup-low stack-cleanup-low} - handle-glyph-count*)] - (println (+ (count display-glyph) (count cleanup))) + ] (concat load-data - handle-glyph-count display-glyph cleanup stack-cleanup)))