# HG changeset patch # User Robert McIntyre # Date 1346395711 18000 # Node ID 6e6b7961595be1d54d630e0662a6ddd44706fce8 # Parent 2d9bf762a0734de3e550fc13b48a039ed05e8abe created scaffold for displaying terminal characters. diff -r 2d9bf762a073 -r 6e6b7961595b clojure/com/aurellem/run/adv_choreo.clj --- a/clojure/com/aurellem/run/adv_choreo.clj Fri Aug 31 00:52:33 2012 -0500 +++ b/clojure/com/aurellem/run/adv_choreo.clj Fri Aug 31 01:48:31 2012 -0500 @@ -127,22 +127,52 @@ (defn glyph-display-program [start-address + monitor-address delay-count total-glyph-count] - [0xC5 - 0xD5 - 0xE5 - 0xF5 + (let [data-start (+ 2 start-address) + monitor-address-high (+ 0 data-start) + monitor-address-low (+ 1 data-start) + glyph-count-high (+ 2 data-start) + glyph-count-low (+ 3 data-start) + delay-address (+ 4 data-start)] + + + (flatten + [;; data region - 0xF1 - 0xE1 - 0xD1 - 0xC1 - - ]) + 0x18 + 5 + (disect-bytes-2 monitor-address) + (disect-bytes-2 total-glyph-count) + delay-count + ;; save all registers + 0xC5 0xD5 0xE5 0xF5 + + ;; load data from data region into registers + + 0x21 + (disect-bytes-2 monitor-address-high) + + 0x2A 0x47 ;; monitor-address-high -> B + 0x2A 0x4F ;; monitor-address-low -> C + + 0x2A 0x57 ;; glyph-count-high -> D + 0x2A 0x5F ;; glyph-count-low -> E + + 0x2A ;; delay -> A + + + + + ;; restore all registers + 0xF1 0xE1 0xD1 0xC1 + ]))) + +(def main-program-base-address 0xC000) (defn glyph-bootstrap-program [start-address delay-count total-glyph-count] @@ -152,7 +182,8 @@ glyph-display (glyph-display-program (+ (count init) (count header) start-address) - 0 0) ;; ONLY FOR TESTING + main-program-base-address 100 + (- (count (program-data 0)) 100)) state-machine-start-address (+ start-address (count init) (count header) (count glyph-display)) @@ -173,7 +204,7 @@ (concat init glyph-display header state-machine return-to-header))) -(def main-program-base-address 0xC000) + (defn begin-glyph-bootstrap ([] (begin-glyph-bootstrap (launch-main-bootstrap-program)))