mirror of
https://github.com/cc65/cc65.git
synced 2024-09-06 18:54:30 +00:00
fixed bug on C64 GEOS (I/O was not enabled when reading joystick)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1803 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
712af18e96
commit
3dc9b06127
@ -10,31 +10,39 @@
|
|||||||
|
|
||||||
.proc _readjoy
|
.proc _readjoy
|
||||||
|
|
||||||
|
php
|
||||||
|
sei ; disable IRQ
|
||||||
|
lda $01
|
||||||
|
pha
|
||||||
|
lda #$35
|
||||||
|
sta $01 ; enable I/O
|
||||||
|
|
||||||
tax ; Joystick number into X
|
tax ; Joystick number into X
|
||||||
bne joy2
|
bne joy2
|
||||||
|
|
||||||
; Read joystick 1
|
; Read joystick 1
|
||||||
|
|
||||||
joy1: lda #$7F
|
joy1:
|
||||||
sei
|
lda #$7F
|
||||||
sta cia1base
|
sta cia1base
|
||||||
lda cia1base+1
|
lda cia1base+1
|
||||||
cli
|
back: tax
|
||||||
|
pla
|
||||||
|
sta $01
|
||||||
|
plp
|
||||||
|
txa
|
||||||
and #$1F
|
and #$1F
|
||||||
eor #$1F
|
eor #$1F
|
||||||
|
ldx #0
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; Read joystick 2
|
; Read joystick 2
|
||||||
|
|
||||||
joy2: ldx #0
|
joy2: lda #$E0
|
||||||
lda #$E0
|
|
||||||
ldy #$FF
|
ldy #$FF
|
||||||
sta cia1base+2
|
sta cia1base+2
|
||||||
lda cia1base+1
|
lda cia1base+1
|
||||||
sty cia1base+2
|
sty cia1base+2
|
||||||
and #$1F
|
jmp back
|
||||||
eor #$1F
|
|
||||||
rts
|
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user