]> git.sur5r.net Git - cc65/commitdiff
fixed bug on C64 GEOS (I/O was not enabled when reading joystick)
authorizydorst <izydorst@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 20 Dec 2002 22:54:56 +0000 (22:54 +0000)
committerizydorst <izydorst@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Fri, 20 Dec 2002 22:54:56 +0000 (22:54 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1803 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/geos/mousesprite/readjoy.s

index e96a0e58d9cd8fc21e15528ef7381a01156910e7..85948739ec15c3fd87a8b2a6e0bd31dae1c51742 100644 (file)
 
 .proc  _readjoy
 
+       php
+       sei                     ; disable IRQ
+       lda     $01
+       pha
+       lda     #$35
+       sta     $01             ; enable I/O
+
        tax                     ; Joystick number into X
        bne     joy2
 
 ; Read joystick 1
 
-joy1:  lda     #$7F
-       sei
+joy1:  
+       lda     #$7F
        sta     cia1base
        lda     cia1base+1
-       cli
+back:  tax
+       pla
+       sta     $01
+       plp
+       txa
        and     #$1F
        eor     #$1F
+       ldx     #0
        rts
 
 ; Read joystick 2
 
-joy2:  ldx     #0
-       lda     #$E0
+joy2:  lda     #$E0
        ldy     #$FF
        sta     cia1base+2
        lda     cia1base+1
        sty     cia1base+2
-       and     #$1F
-       eor     #$1F
-       rts
+       jmp     back
 
 .endproc
-