changeset 136:ffeeabae7dcd

minor tweaking; incremental results: 91 -> 58
author Dylan Holmes <ocsenave@gmail.com>
date Sun, 18 Mar 2012 05:53:25 -0500
parents eb6ba88088d3
children 1c58fa3cfc68
files clojure/com/aurellem/assembly.clj
diffstat 1 files changed, 30 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/assembly.clj	Sun Mar 18 05:13:19 2012 -0500
     1.2 +++ b/clojure/com/aurellem/assembly.clj	Sun Mar 18 05:53:25 2012 -0500
     1.3 @@ -492,13 +492,12 @@
     1.4  
     1.5  
     1.6  
     1.7 -(defn write-memory-assembly* []
     1.8 +(defn write-memory-assembly*
     1.9 +  "Currently, grabs input from the user each frame."
    1.10 +  []
    1.11    [
    1.12     ;; --------- FRAME METRONOME
    1.13 -   
    1.14 -   0x18 ;; D31D
    1.15 -   0x01
    1.16 -   0x00 ;; v-blank-prev D31F
    1.17 +   0x00 ;; v-blank-prev D31D
    1.18  
    1.19     0xFA ;; load modes into A
    1.20     0x41
    1.21 @@ -513,7 +512,7 @@
    1.22     0x47 ;; now B_0 contains (VB==1)
    1.23  
    1.24     0xFA ;; load v-blank-prev
    1.25 -   0x1F
    1.26 +   0x1D
    1.27     0xD3
    1.28  
    1.29     0x2F ;; complement v-blank-prev
    1.30 @@ -525,19 +524,18 @@
    1.31     0x78 ;; B->A
    1.32     
    1.33     0xEA ;; spit A --> vbprev
    1.34 -   0x1F
    1.35 +   0x1D
    1.36     0xD3
    1.37  
    1.38 -   0x41   ;test C_0
    1.39 -   0x20   ; nonzero jump
    1.40 -   0x04
    1.41 -   
    1.42 -   0xC3   ;                    ; go back to beginning
    1.43 -   0x1D   ;
    1.44 -   0xD3   ;
    1.45 +   0xCB   ;test C_0
    1.46 +   0x41
    1.47 +   0x20   ; JUMP ahead to button input if nonzero
    1.48 +   0x03
    1.49 +   0x18   ; JUMP  back to beginning
    1.50 +   0xE7
    1.51     
    1.52     ;; -------- GET BUTTON INPUT
    1.53 -   0x00 ;; var: which-input D339
    1.54 +   0x00 ;; var: which-input D336
    1.55          ;; prepare to select bits
    1.56  
    1.57     0x01 ;; load 0x0000 into BC
    1.58 @@ -548,7 +546,7 @@
    1.59     0x20
    1.60  
    1.61     
    1.62 -   0xEA ;; load A into [FF00] ;; D33F (not D33C)
    1.63 +   0xEA ;; load A into [FF00] ;; D33D
    1.64     0x00
    1.65     0xFF
    1.66  
    1.67 @@ -563,7 +561,7 @@
    1.68  
    1.69     0xCB
    1.70     0x41 ;; test bit 0 of C
    1.71 -   0x20 ;; jump forward if 1
    1.72 +   0x20 ;; JUMP forward if 1
    1.73     0x08
    1.74  
    1.75     0x47 ;; A -> B
    1.76 @@ -576,11 +574,11 @@
    1.77     0xEB
    1.78  
    1.79     ;; now A contains the pressed keys
    1.80 -   0xEA ;; copy keys to input-number [D339]
    1.81 +   0xEA ;; copy keys to input-number [D336]
    1.82     0x39 
    1.83     0xD3
    1.84 -   0x18 ;;
    1.85 -   0xEB
    1.86 +   0x18 ;;JUMP back to "beginning" [D31E]
    1.87 +   0xC7
    1.88     
    1.89     
    1.90     ]
    1.91 @@ -609,6 +607,9 @@
    1.92     (tick)
    1.93     (tick)
    1.94     (tick)
    1.95 +   (tick) ;; first loop
    1.96 +
    1.97 +
    1.98     (tick)
    1.99     (tick)
   1.100     (tick)
   1.101 @@ -621,11 +622,18 @@
   1.102     (tick)
   1.103     (tick)
   1.104     (tick)
   1.105 +   (tick) ;; dpad bits
   1.106 +
   1.107     (tick)
   1.108     (tick)
   1.109 -
   1.110 +   (tick)
   1.111 +   (tick)
   1.112 +   (tick)
   1.113 +   (tick)
   1.114 +   (tick)
   1.115 +   (tick)
   1.116 +   (d-tick)
   1.117     
   1.118 -   (d-tick)
   1.119  
   1.120     
   1.121     (view-register "A" A)