Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

joystick_get driver documentation error? #122

Open
jimmyor opened this issue Oct 18, 2023 · 0 comments
Open

joystick_get driver documentation error? #122

jimmyor opened this issue Oct 18, 2023 · 0 comments

Comments

@jimmyor
Copy link

jimmyor commented Oct 18, 2023

In the documentation for the X16 driver for the joystick, the comment block for joystick_get refers to passing 0-3 in A. Sending A with a 0 seems to correspond to providing the "keyboard SNES controller" output, and presumably 1-4 provide output for joysticks 1-4 if they are attached to the hardware. Should the comment block say 0-4 and clarify that 0 is keyboard? (The actual code below the comment block seems to match what I say above).

;---------------------------------------------------------------
; joystick_get
;
; Function: Return the state of a given joystick.
;
; Pass: a number of joystick (0-3) <---this is what I'm referring to
; Return: a byte 0: | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
; SNES | B | Y |SEL|STA|UP |DN |LT |RT |
;
; x byte 1: | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
; SNES | A | X | L | R | 1 | 1 | 1 | 1 |
; y byte 2:
; $00 = joystick present
; $FF = joystick not present
;
; Note: * Presence can be detected by checking byte 2.
;---------------------------------------------------------------
joystick_get:
KVARS_START_TRASH_X_NZ
tax
beq @0 ; -> joy0
dex
beq @1 ; -> joy1
dex
beq @2 ; -> joy2
dex
beq @3 ; -> joy3
dex
beq @4 ; -> joy4
lda #$ff
tax
tay
bra @5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant