]> git.sur5r.net Git - cc65/blobdiff - libsrc/c64/joy/c64-ptvjoy.s
Added library reference address to lightpen driver header.
[cc65] / libsrc / c64 / joy / c64-ptvjoy.s
index b4314968e1ddfeaa31505e0d86e650d3c04636c7..bb1ba0982da3f30b9d06af375ea508d0d1d0dca7 100644 (file)
 ; Driver signature
 
         .byte   $6A, $6F, $79   ; "joy"
-        .byte   JOY_API_VERSION        ; Driver API version number
+        .byte   JOY_API_VERSION ; Driver API version number
+
+; Library reference
+
+        .addr   $0000
 
 ; Button state masks (8 values)
 
@@ -60,7 +64,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.
@@ -84,18 +88,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
@@ -103,15 +107,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