Skip to content

Commit 4851bcf

Browse files
author
SlithyMatt
committed
Fixed joystick handling, default to keyboard if joy1 not present
1 parent c56edef commit 4851bcf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

joystick.asm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ joystick2_a: .byte 0
3434

3535
joystick_tick:
3636
jsr JOYSTICK_SCAN
37+
lda #1
38+
jsr JOYSTICK_GET
39+
cpy #0
40+
beq @check_buttons
3741
lda #0
3842
jsr JOYSTICK_GET
43+
@check_buttons:
3944
ldx #1
4045
bit #JOY_RT
4146
beq :+
@@ -77,7 +82,7 @@ joystick_tick:
7782
stz joystick1_a
7883
bra :++
7984
: stx joystick1_a
80-
: lda #1
85+
: lda #2
8186
jsr JOYSTICK_GET
8287
ldx #1
8388
bit #JOY_RT

0 commit comments

Comments
 (0)