.include "joy-kernel.inc"
.include "joy-error.inc"
.include "lynx.inc"
+ .include "extzp.inc"
.macpack generic
; Button state masks (8 values)
+joy_mask:
.byte $80 ; JOY_UP
.byte $40 ; JOY_DOWN
.byte $20 ; JOY_LEFT
; Jump table.
- .word INSTALL
- .word UNINSTALL
- .word COUNT
- .word READ
+ .addr INSTALL
+ .addr UNINSTALL
+ .addr COUNT
+ .addr READ
+ .addr 0 ; IRQ entry unused
; ------------------------------------------------------------------------
; Constants
;
INSTALL:
- lda #<JOY_ERR_OK
- ldx #>JOY_ERR_OK
+ lda #<JOY_ERR_OK
+ ldx #>JOY_ERR_OK
; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
READ:
ldx #$00 ; Clear high byte
lda JOYSTICK ; Read joystick
+ and #$F3 ; Mask relevant keys
rts