# HG changeset patch # User Robert McIntyre # Date 1346407233 18000 # Node ID 3194a4f438cacc5f44f5df60c896a7f51a43f492 # Parent 91e99cc36bda660a4ce9e0e84a3b44ed1cfd1988 restored previous functionality of glyph-display program. diff -r 91e99cc36bda -r 3194a4f438ca clojure/com/aurellem/run/adv_choreo.clj --- a/clojure/com/aurellem/run/adv_choreo.clj Fri Aug 31 04:58:15 2012 -0500 +++ b/clojure/com/aurellem/run/adv_choreo.clj Fri Aug 31 05:00:33 2012 -0500 @@ -126,43 +126,7 @@ (concat A B ))) - ;; handle-delay* - ;; (flatten - ;; [0xA7 ;; test if delay is zero - ;; ;; if delay is not 0, decrement and skip to cleanup - ;; 0x28 ;; JR Z, skip this section if A==0 - ;; 4 - ;; 0x3D ;; dec A - ;; 0x77 ;; (dec delay) -> delay - ;; 0x18 - ;; :to-cleanup]) - - ;; handle-glyph-count* - ;; (flatten - ;; [;; if glyph-count is 0, go directly to stack-cleanup - - ;; ;;0x79 0xB0 ;; check if BC == 0 - ;; 0 0 - ;; 0x20 ;; JR NZ, skip if BC !=0 - ;; 2 - ;; 0 0 - ;; ;;0x18 - ;; ;;:to-stack-cleanup - ;; ]) -;; handle-glyph-count* [0 0 0 0] - - - ;; handle-delay - ;; (replace {:to-cleanup - ;; (+ (count display-glyph) (count handle-glyph-count*))} - ;; handle-delay*) - - ;; handle-glyph-count - ;; (replace {:to-stack-cleanup - ;; (+ (count display-glyph) (count cleanup))} - ;; handle-glyph-count*) - - + (defn glyph-display-program [start-address monitor-address @@ -195,6 +159,27 @@ 0x7E ;; delay -> A ]) + handle-delay* + (flatten + [0xA7 ;; test if delay is zero + ;; if delay is not 0, decrement and skip to cleanup + 0x28 ;; JR Z, skip this section if A==0 + 4 + 0x3D ;; dec A + 0x77 ;; (dec delay) -> delay + 0x18 + :to-cleanup]) + + handle-glyph-count* + (flatten + [;; if glyph-count is 0, go directly to stack-cleanup + 0x79 0xB0 ;; check if BC == 0 + 0x20 ;; JR NZ, skip if BC !=0 + 2 + 0x18 + :to-stack-cleanup + ]) + display-glyph [0 0 0] cleanup ;; restore all registers @@ -216,10 +201,19 @@ stack-cleanup [0xF1 0xE1 0xD1 0xC1] + + handle-delay + (replace {:to-cleanup + (+ (count display-glyph) (count handle-glyph-count*))} + handle-delay*) + handle-glyph-count + (replace {:to-stack-cleanup + (+ (count display-glyph) (count cleanup))} + handle-glyph-count*) ] (concat load-data - ;;handle-delay handle-glyph-count + handle-delay handle-glyph-count display-glyph cleanup stack-cleanup)))