diff clojure/com/aurellem/gb/assembly.clj @ 242:2e751984b42d

making interesting data insights.
author Dylan Holmes <ocsenave@gmail.com>
date Sun, 25 Mar 2012 02:53:29 -0500
parents 19fd38fe376e
children
line wrap: on
line diff
     1.1 --- a/clojure/com/aurellem/gb/assembly.clj	Sun Mar 25 02:35:14 2012 -0500
     1.2 +++ b/clojure/com/aurellem/gb/assembly.clj	Sun Mar 25 02:53:29 2012 -0500
     1.3 @@ -415,7 +415,7 @@
     1.4    "A program for altering in-game memory by pressing buttons."
     1.5    []
     1.6    [
     1.7 -   0xF3 ; stop interrupts
     1.8 +   ;; 0xF3 ; stop interrupts
     1.9     ;; --------- CLEANUP
    1.10     0xAF ; zero A  [D31E]
    1.11     0x57 ; A->D; makes D=0.
    1.12 @@ -437,16 +437,16 @@
    1.13     0xF5 ;; push AF (vbprev)
    1.14     
    1.15     0xA1 ;; A & C --> A. Now A_0 contains "increment?"
    1.16 -   
    1.17 -   0xCB ;; test A_0. this result will be used twice.
    1.18 -   0x47
    1.19 +
    1.20 +   0x4F
    1.21 +   0xCB ;; test bit 0 of C. sadly, this result can't be reused below. 
    1.22 +   0x41
    1.23     
    1.24     0x28 ;; end frame (JUMP) if A_0 = 0.  
    1.25     0xF3 ;; TODO: set jump length
    1.26     
    1.27     ;; -------- GET BUTTON INPUT
    1.28     
    1.29 -        ;; btw, Z bit is now 1
    1.30          ;; prepare to select bits
    1.31   
    1.32     0x3E ;; load 0x20 into A, to measure dpad
    1.33 @@ -466,6 +466,9 @@
    1.34     
    1.35     0xB0 ;; A or B --> A
    1.36  
    1.37 +   0xCB ;; check bit 0 of C
    1.38 +   0x41
    1.39 +   
    1.40     0x28 ;; JUMP forward if Z=0
    1.41     0x08
    1.42  
    1.43 @@ -475,11 +478,9 @@
    1.44     
    1.45     0x3E ;; load 0x10 into A, to measure btns
    1.46     0x10
    1.47 -
    1.48 -   0xBF ;; compare(A,A) sets Z=0
    1.49     
    1.50     0x18 ;; JUMP back to "load A into [FF00]"
    1.51 -   0xEF
    1.52 +   0xF0
    1.53  
    1.54  
    1.55     ;; ------ TAKE ACTION BASED ON USER INPUT
    1.56 @@ -542,8 +543,8 @@
    1.57     0x57
    1.58     0x82 ;; add the mode to A
    1.59     0xEA ;; store A into "thing to execute"
    1.60 -   0x74
    1.61 -   0xD3
    1.62 +   0x74 ;; ABSOLUTE LOCATION
    1.63 +   0xD3 ;; ABSOLUTE LOCATION
    1.64  
    1.65     0x3E ;; load the constant 8 into A
    1.66     0x08