modify keyboard scan routine to extract bucky bits and store in expected variables
This commit is contained in:
1 parent
dbf865fc6d
commit
5f6cc08a97
1 file changed
+61
-20
+61
-20
@@ -159,8 +159,18 @@
|
|||||||
;// Operational Variables
|
;// Operational Variables
|
||||||
.alias MaxKeyRollover 3
|
.alias MaxKeyRollover 3
|
||||||
|
|
||||||
Keyboard:
|
scan_keyboard:
|
||||||
jmp Main
|
;; Call main keyboard scanning routine
|
||||||
|
jsr Main
|
||||||
|
bcc +
|
||||||
|
rts
|
||||||
|
*
|
||||||
|
;; Work out what is new and needs to be added
|
||||||
|
;; to the input buffer.
|
||||||
|
;; Also update the bucky key status flags etc
|
||||||
|
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@@ -372,26 +382,57 @@ skip0:
|
|||||||
;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
;; // Check and flag Non Alphanumeric Keys
|
;; // Check and flag Non Alphanumeric Keys
|
||||||
|
|
||||||
lda ScanResult+6
|
;; Store last row of keyboard scan result,
|
||||||
eor #$ff
|
;; so that RUN/STOP etc can be checked easily
|
||||||
and #%10000000 ;// Left Shift
|
;; (Compute's Mapping the 64, p27)
|
||||||
lsr
|
lda ScanResult+0
|
||||||
sta NonAlphaFlagY
|
sta BUCKYSTATUS
|
||||||
lda ScanResult+0
|
|
||||||
eor #$ff
|
|
||||||
and #%10100100 ;// RUN STOP - C= - CTRL
|
|
||||||
ora NonAlphaFlagY
|
|
||||||
sta NonAlphaFlagY
|
|
||||||
lda ScanResult+1
|
|
||||||
eor #$ff
|
|
||||||
and #%00011000 ;// Right SHIFT - CLR HOME
|
|
||||||
ora NonAlphaFlagY
|
|
||||||
sta NonAlphaFlagY
|
|
||||||
|
|
||||||
lda ScanResult+7 ;// The rest
|
;; Store de-bounce data for bucky keys
|
||||||
eor #$ff
|
;; (Compute's Mapping the 64, p58-59)
|
||||||
sta NonAlphaFlagX
|
lda key_bucky_state
|
||||||
|
sta key_last_bucky_state
|
||||||
|
|
||||||
|
;; Build bucky state
|
||||||
|
lda #$00
|
||||||
|
sta key_bucky_state
|
||||||
|
lda ScanResult+6
|
||||||
|
eor #$ff
|
||||||
|
and #%10000000 ;// Left Shift
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
and #$01
|
||||||
|
ora key_bucky_state
|
||||||
|
sta key_bucky_state
|
||||||
|
|
||||||
|
;; Right shift
|
||||||
|
lda ScanResult+1
|
||||||
|
eor #$ff
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
and #$01
|
||||||
|
ora key_bucky_state
|
||||||
|
sta key_bucky_state
|
||||||
|
|
||||||
|
;; Control
|
||||||
|
lda ScanResult+0
|
||||||
|
eor #$ff
|
||||||
|
and #$04
|
||||||
|
ora key_bucky_state
|
||||||
|
sta key_bucky_state
|
||||||
|
|
||||||
|
;; C= key
|
||||||
|
lda ScanResult+0
|
||||||
|
eor #$ff
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
and #$02
|
||||||
|
ora key_bucky_state
|
||||||
|
sta key_bucky_state
|
||||||
|
|
||||||
;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
;; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
;; // Check for pressed key(s)
|
;; // Check for pressed key(s)
|
||||||
|
|||||||
Reference in new issue
Block a user