# HG changeset patch # User Dylan Holmes # Date 1332121780 18000 # Node ID 1c58fa3cfc6809a82d6b7c2eb3428de23e05ddc4 # Parent ffeeabae7dcd281a47f3e56de059454480418ba6 Checkpoint: about to include the state machine in the assembly* code. diff -r ffeeabae7dcd -r 1c58fa3cfc68 clojure/com/aurellem/assembly.clj --- a/clojure/com/aurellem/assembly.clj Sun Mar 18 05:53:25 2012 -0500 +++ b/clojure/com/aurellem/assembly.clj Sun Mar 18 20:49:40 2012 -0500 @@ -531,55 +531,60 @@ 0x41 0x20 ; JUMP ahead to button input if nonzero 0x03 - 0x18 ; JUMP back to beginning - 0xE7 + 0x18 ; JUMP back to frame metronome (D31E) + 0xE7 ;; -------- GET BUTTON INPUT - 0x00 ;; var: which-input D336 + + ;; btw, C_0 is now 1 + 0x00 ;; var: which-input D337 ;; prepare to select bits - 0x01 ;; load 0x0000 into BC - 0x00 + 0x06 ;; load 0x00 into B 0x00 - - 0x3E ;; load 0x20 into A + + 0x3E ;; load 0x20 into A, to measure dpad 0x20 - 0xEA ;; load A into [FF00] ;; D33D + 0xE0 ;; load A into [FF00] ;; D33C 0x00 - 0xFF - - 0xFA ;; load A from [FF00] + + 0xF0 ;; load A from [FF00] 0x00 - 0xFF 0xE6 ;; bitmask 00001111 0x0F 0xB0 ;; A or B --> A - 0xCB 0x41 ;; test bit 0 of C - 0x20 ;; JUMP forward if 1 + 0x28 ;; JUMP forward if 0 0x08 0x47 ;; A -> B 0xCB ;; swap B nybbles 0x30 0x0C ;; increment C - 0x3E ;; load 0x10 into A + 0x3E ;; load 0x10 into A, to measure btns 0x10 0x18 ;; JUMP back to "load A into [FF00]" [20 steps?] - 0xEB + 0xED ;; now A contains the pressed keys - 0xEA ;; copy keys to input-number [D336] - 0x39 + + + + + + + + + 0xC3 ;; todo replace with relative jump + 0x1E 0xD3 - 0x18 ;;JUMP back to "beginning" [D31E] - 0xC7 - + ;;0x18 ;;JUMP back to "metronome" in one hop [D31E] + ;;0xCA ;; E1 ] )