diff clojure/com/aurellem/assembly.clj @ 114:a454730d92dd

added test for count-frames
author Robert McIntyre <rlm@mit.edu>
date Fri, 16 Mar 2012 13:51:17 -0500
parents 0831da75d2c5
children 39fb0cbab25e
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/assembly.clj	Fri Mar 16 00:43:28 2012 -0500
     1.2 +++ b/clojure/com/aurellem/assembly.clj	Fri Mar 16 13:51:17 2012 -0500
     1.3 @@ -178,7 +178,7 @@
     1.4          0x43   ;D32C                     ; GOTO not-v-blank
     1.5          0xD3   ;D32D
     1.6          
     1.7 -        ;; in v-blank mode
     1.8 +        ;;; in v-blank mode
     1.9  
    1.10             ;; if v-blank-prev was 0,
    1.11             ;; increment frame-count
    1.12 @@ -204,7 +204,7 @@
    1.13          0x1F   ;D33A
    1.14          0xD3   ;D33B
    1.15  
    1.16 -           ;; set v-blank? to 1
    1.17 +           ;; set v-blank-prev to 1
    1.18          0x3E   ;D33C                    ; load 1 into A
    1.19          0x01   ;D33D                    
    1.20  
    1.21 @@ -215,8 +215,8 @@
    1.22          0x18   ;D341                    ; skip not-in-v-blank section
    1.23          0x05   ;D342
    1.24  
    1.25 -        ;; not in v-blank mode
    1.26 -           ;; set b-blank? to 0
    1.27 +        ;;; not in v-blank mode
    1.28 +           ;; set v-blank-prev to 0
    1.29          0x3E   ;D343                    ; load 0 into A        
    1.30          0x00   ;D344
    1.31  
    1.32 @@ -228,15 +228,9 @@
    1.33          0xC3   ;D348                   ; return to beginning
    1.34          0x1D   ;D349
    1.35          0xD3   ;D34A
    1.36 - 
    1.37 -        
    1.38 -        
    1.39          ])))
    1.40  
    1.41 -
    1.42 -
    1.43 -
    1.44 -(defn run-a-bit []
    1.45 +(defn step-count-frames []
    1.46    (-> (read-down-button)
    1.47        (info)
    1.48        (tick)  ;; skip over data section
    1.49 @@ -262,7 +256,7 @@
    1.50        (tick)
    1.51        (print-inventory)))
    1.52  
    1.53 -(defn test-read-pad []
    1.54 +(defn test-read-down []
    1.55    (= (view-memory (step (step (read-buttons) [:d])) 0xD328)
    1.56       (view-memory (step (step (read-buttons))) 0xD328)))
    1.57    
    1.58 @@ -286,3 +280,12 @@
    1.59        (set-inv-mem [0x00 0x00 0X00 0x00])
    1.60        (PC! item-list-start)(print-interrupt)
    1.61        (info) (tick) (info) (tick) (info)))
    1.62 +
    1.63 +
    1.64 +
    1.65 +
    1.66 +
    1.67 +
    1.68 +
    1.69 +
    1.70 +