]> git.sur5r.net Git - cc65/blobdiff - libsrc/c128/joy/c128-ptvjoy.s
Removed joy_masks array.
[cc65] / libsrc / c128 / joy / c128-ptvjoy.s
index e101997f10737b694b8502ca8c3573cc7974c382..c9ae39a47734a271cb026a5af4d1ee3418fe6a54 100644 (file)
         .include "c128.inc"
 
         .macpack generic
+        .macpack module
+
 
 ; ------------------------------------------------------------------------
 ; Header. Includes jump table
 
-        .segment "JUMPTABLE"
+        module_header   _c128_ptvjoy_joy
 
 ; Driver signature
 
         .byte   $6A, $6F, $79           ; "joy"
         .byte   JOY_API_VERSION         ; Driver API version number
 
-; Button state masks (8 values)
+; Library reference
 
-        .byte   $01                     ; JOY_UP
-        .byte   $02                     ; JOY_DOWN
-        .byte   $04                     ; JOY_LEFT
-        .byte   $08                     ; JOY_RIGHT
-        .byte   $10                     ; JOY_FIRE
-        .byte   $00                     ; JOY_FIRE2 unavailable
-        .byte   $00                     ; Future expansion
-        .byte   $00                     ; Future expansion
+        .addr   $0000
 
 ; Jump table.
 
@@ -61,7 +56,7 @@ JOY_COUNT       = 4             ; Number of joysticks we support
 INSTALL:
         lda     #<JOY_ERR_OK
         ldx     #>JOY_ERR_OK
-;      rts                     ; Run into UNINSTALL instead
+;       rts                     ; Run into UNINSTALL instead
 
 ; ------------------------------------------------------------------------
 ; UNINSTALL routine. Is called before the driver is removed from memory.
@@ -85,18 +80,18 @@ COUNT:
 ; READ: Read a particular joystick passed in A.
 ;
 
-READ:   tax                    ; Joystick number into X
+READ:   tax                     ; Joystick number into X
         bne     joy2
 
 ; Read joystick 1
 
-joy1:   lda    #$7F
+joy1:   lda     #$7F
         sei
-        sta    CIA1_PRA
-        lda    CIA1_PRB
+        sta     CIA1_PRA
+        lda     CIA1_PRB
         cli
-        and    #$1F
-        eor    #$1F
+        and     #$1F
+        eor     #$1F
         rts
 
 ; Read joystick 2
@@ -104,15 +99,15 @@ joy1:   lda        #$7F
 joy2:   dex
         bne     joy3
 
-        lda    #$E0
-        ldy    #$FF
+        lda     #$E0
+        ldy     #$FF
         sei
-        sta    CIA1_DDRA
-        lda    CIA1_PRA
-        sty    CIA1_DDRA
+        sta     CIA1_DDRA
+        lda     CIA1_PRA
+        sty     CIA1_DDRA
         cli
-        and    #$1F
-        eor    #$1F
+        and     #$1F
+        eor     #$1F
         rts
 
 ; Read joystick 3