# HG changeset patch # User Robert McIntyre # Date 1346494477 18000 # Node ID 385799ea1e9cc5604acbfe3a63bd7156dfa9f255 # Parent df3a7eac39d7272693f6210339e9219aac72b84d implemented row glyph drawing. diff -r df3a7eac39d7 -r 385799ea1e9c clojure/com/aurellem/gb/util.clj --- a/clojure/com/aurellem/gb/util.clj Sat Sep 01 04:42:41 2012 -0500 +++ b/clojure/com/aurellem/gb/util.clj Sat Sep 01 05:14:37 2012 -0500 @@ -80,7 +80,7 @@ (defn view-memory ([^SaveState state mem] - (let [val (aget (memory state) mem)] + (let [val (accurate-memory state mem)] (println (format "0x%04X = %s 0x%02X %d" mem (binary-str val) val val))) state) diff -r df3a7eac39d7 -r 385799ea1e9c clojure/com/aurellem/run/adv_choreo.clj --- a/clojure/com/aurellem/run/adv_choreo.clj Sat Sep 01 04:42:41 2012 -0500 +++ b/clojure/com/aurellem/run/adv_choreo.clj Sat Sep 01 05:14:37 2012 -0500 @@ -196,7 +196,7 @@ 0xF1 0xE1 0xD1 0xC1]) ;; RLM: for TESTING ONLY!!! - clear-screen (repeat 10 0) + ;;clear-screen (repeat 10 0) increment-row-column [;; D contains row and E contains column @@ -204,16 +204,25 @@ ;; column to 0 and increment row 0x1C ;; inc E 0x3E 20 0xBB ;; compare E to 20 - 0x20 ;; if E is 20 - 3 - 0x1E 0 ;; set E to zero - 0x14 ;; (inc D) -> D + 0x20 + 2 + 0x1E 0 + + - ;; every time row (D) reaches 18, set row to 0 - 0x3E 18 0xBA ;; compare D to 18 - 0x20 ;; if D is 18 - 2 - 0x16 0] ;; set D to zero + ;; 0x00 ;;0x1C ;; inc E + ;; 0x3E 20 0xBB ;; compare E to 20 + ;; 0x20 ;; if E is 20 + ;; 3 + ;; 0x1E 0 ;; set E to zero + ;; 0x00; 0x14 ;; (inc D) -> D + + ;; ;; every time row (D) reaches 18, set row to 0 + ;; 0x3E 18 0xBA ;; compare D to 18 + ;; 0x20 ;; if D is 18 + ;; 2 + ;; 0x16 0 + ] ;; set D to zero set-HL-from-row-and-column [;; formula for memory offset is: @@ -221,20 +230,24 @@ ;; (+ 0x97E0 (* 32 (+ 1 row)) column) 0xD5 0xC5 ;; push D E B C - 0x21 0xE0 0x97 ;; load HL with 0x97E0 + 0x21 0x00 0x98 ;; load HL with 0x97E0 0x06 0 - 0x0E 32 ;; load 32 into BC + 0x4B + 0x09 - 0x14 ;; inc D to handle case where D == 0 - ;; D will never be > 20, so this will never overflow. + ;; 0x06 0 + ;; 0x0E 32 ;; load 32 into BC - ;; do - 0x09 ;; HL += 32 - 0x15 ;; dec D - ;; while D != 0 - 0x20 - (->signed-8-bit -4) + ;; 0x14 ;; inc D to handle case where D == 0 + ;; ;; D will never be > 20, so this will never overflow. + + ;; ;; do + ;; 0x09 ;; HL += 32 + ;; 0x15 ;; dec D + ;; ;; while D != 0 + ;; 0x20 + ;; (->signed-8-bit -4) 0xC1 0xD1 ;; pop C B E D ] @@ -273,7 +286,8 @@ [;; Reset HL to initial value 0x21 (reverse (disect-bytes-2 data-start)) - 0x7A 0x22 ;; D -> rows -> to RAM + 0x23 + ;;0x7A 0x22 ;; D -> rows -> to RAM 0x7B 0x22 ;; E -> columns ])