SCNKEY can now use joystick port 2 too
This commit is contained in:
1 parent
83f038c780
commit
3b69cd398b
1 file changed
+16
-7
@@ -22,8 +22,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// XXX add Commodore 128 keyboard support
|
// XXX add Commodore 128 keyboard support
|
||||||
// XXX add Commodore 65 keybopard support
|
// XXX add Commodore 65 keyboard support
|
||||||
// XXX fix support for joystick port 2 to move cursor keys
|
|
||||||
|
|
||||||
|
|
||||||
#if !CONFIG_SCNKEY_TWW_CTR
|
#if !CONFIG_SCNKEY_TWW_CTR
|
||||||
@@ -45,12 +44,16 @@ SCNKEY:
|
|||||||
|
|
||||||
// Check for any activity
|
// Check for any activity
|
||||||
|
|
||||||
lda #$00
|
#if !CONFIG_JOY2_CURSOR
|
||||||
sta CIA1_PRA // connect all the rows
|
|
||||||
ldx #$FF
|
ldx #$00
|
||||||
|
stx CIA1_PRA // connect all the rows
|
||||||
|
dex // puts $FF
|
||||||
cpx CIA1_PRB
|
cpx CIA1_PRB
|
||||||
beq scnkey_no_keys
|
beq scnkey_no_keys
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// Retrieve SHIFT / VENDOR / CTRL status
|
// Retrieve SHIFT / VENDOR / CTRL status
|
||||||
// Use .X to detect 2 or more keys pressed (should be $FF now)
|
// Use .X to detect 2 or more keys pressed (should be $FF now)
|
||||||
ldy #$03
|
ldy #$03
|
||||||
@@ -73,7 +76,7 @@ scnkey_bucky_loop:
|
|||||||
|
|
||||||
#if CONFIG_JOY2_CURSOR
|
#if CONFIG_JOY2_CURSOR
|
||||||
|
|
||||||
// XXX why this does not work
|
// XXX why this does not work ???
|
||||||
|
|
||||||
// Check for control port 2 activity
|
// Check for control port 2 activity
|
||||||
|
|
||||||
@@ -82,7 +85,7 @@ scnkey_bucky_loop:
|
|||||||
|
|
||||||
lda CIA1_PRA // read the joystick 2 status
|
lda CIA1_PRA // read the joystick 2 status
|
||||||
|
|
||||||
ldx #$FF
|
dex // puts $FF
|
||||||
stx CIA1_DDRA // set port back to output
|
stx CIA1_DDRA // set port back to output
|
||||||
|
|
||||||
and #%00001111 // filter out anything but joystick movement
|
and #%00001111 // filter out anything but joystick movement
|
||||||
@@ -90,6 +93,12 @@ scnkey_bucky_loop:
|
|||||||
|
|
||||||
bne scnkey_joystick_filtered
|
bne scnkey_joystick_filtered
|
||||||
|
|
||||||
|
inx // puts $00
|
||||||
|
stx CIA1_PRA // connect all the rows
|
||||||
|
dex // puts $FF
|
||||||
|
cpx CIA1_PRB
|
||||||
|
beq scnkey_no_keys
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check for control port 1 activity (can interfere with keyboard)
|
// Check for control port 1 activity (can interfere with keyboard)
|
||||||
|
|||||||
Reference in new issue
Block a user