]> git.sur5r.net Git - cc65/blobdiff - libsrc/lynx/lynx-stdjoy.s
Normalized coding style.
[cc65] / libsrc / lynx / lynx-stdjoy.s
index ad7be484045c2f0f682545fc6f8946ca6255493c..a52d5cba6214bc232d9f5525b17f68d922df3d23 100644 (file)
@@ -12,6 +12,7 @@
        .include        "joy-kernel.inc"
         .include        "joy-error.inc"
         .include        "lynx.inc"
+        .include        "extzp.inc"
 
         .macpack        generic
 
@@ -28,6 +29,7 @@
 
 ; 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
@@ -64,8 +67,8 @@ JOY_COUNT       = 1             ; Number of joysticks we support
 ;
 
 INSTALL:
-        lda     #<JOY_ERR_OK
-        ldx     #>JOY_ERR_OK
+        lda #<JOY_ERR_OK
+        ldx #>JOY_ERR_OK
 ;      rts                     ; Run into UNINSTALL instead
 
 ; ------------------------------------------------------------------------
@@ -92,6 +95,7 @@ COUNT:
 READ:
                ldx     #$00            ; Clear high byte
         lda     JOYSTICK        ; Read joystick
+        and     #$F3            ; Mask relevant keys
         rts