]> git.sur5r.net Git - cc65/commitdiff
Adjusted to recent driver interface change.
authorOliver Schmidt <ol.sc@web.de>
Sun, 20 Aug 2017 09:49:02 +0000 (11:49 +0200)
committerOliver Schmidt <ol.sc@web.de>
Sun, 20 Aug 2017 09:49:02 +0000 (11:49 +0200)
The change is inspired by the code of the standard joystick driver. It is however absolutely untested.

Note: Sites like http://raster.atariportal.cz/english.htm state that there needs to be a delay when reading joysticks via the MultiJoy adapter. There's no such delay in the driver. But I don't dare to decide to add it.

libsrc/atari/joy/atrmj8.s

index 46766070b4c9335c84a3112d2e2c3d1150a287cc..0e8cd2a0a020836c15b2381d3e31d29a2930948a 100644 (file)
 
         .addr   $0000
 
-; Button state masks (8 values)
-
-        .byte   $02                     ; JOY_UP
-        .byte   $04                     ; JOY_DOWN
-        .byte   $08                     ; JOY_LEFT
-        .byte   $10                     ; JOY_RIGHT
-        .byte   $01                     ; JOY_FIRE
-        .byte   $00                     ; JOY_FIRE2 not available
-        .byte   $00                     ; Future expansion
-        .byte   $00                     ; Future expansion
-
 ; Jump table.
 
         .addr   INSTALL
@@ -115,10 +104,12 @@ READJOY:
 
 ; Read joystick
 
-        lda     PORTA           ; get position
-        and     #%00001111
+        lda     STRIG0          ; get button
+        asl     a
+        asl     a
+        asl     a
         asl     a
-        ora     TRIG0           ; add button information
-        eor     #%00011111
+        ora     PORTA           ; add position information
+        eor     #$1F
         ldx     #0              ; fix X
         rts