changeset 574:be6f46094ad0

implemented video-memory pointer logic.
author Robert McIntyre <rlm@mit.edu>
date Sat, 01 Sep 2012 04:05:51 -0500
parents 40f62391db9d
children 15876b1a0906
files clojure/com/aurellem/run/adv_choreo.clj
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/run/adv_choreo.clj	Sat Sep 01 03:56:30 2012 -0500
     1.2 +++ b/clojure/com/aurellem/run/adv_choreo.clj	Sat Sep 01 04:05:51 2012 -0500
     1.3 @@ -253,10 +253,23 @@
     1.4                set-HL-from-row-and-column
     1.5                [;; formula for memory offset is:
     1.6                 ;; (+ 0x9800 (* 32 row) column)
     1.7 -               0xD5
     1.8 +               0xD5 0xC5 ;; push D E B C
     1.9  
    1.10 -               0xD1
    1.11 +               0x21 0x00 0x98 ;; load HL with 0x9800
    1.12  
    1.13 +               0x01 32 00  ;; load 32 into BC
    1.14 +
    1.15 +               ;; do 
    1.16 +               0x09 ;; HL += 32
    1.17 +               0x15 ;; dec D
    1.18 +               ;; while D != 0
    1.19 +               0x20 
    1.20 +               (->signed-8-bit -4)
    1.21 +
    1.22 +               0x4B ;; E->C
    1.23 +               0x15 ;; add columns (E) to HL
    1.24 +
    1.25 +               0xC1 0xD1 ;; pop C B E D
    1.26                 ]
    1.27                
    1.28