1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +00:00

fixed a bug (joy #1 would never be tested)

git-svn-id: svn://svn.cc65.org/cc65/trunk@2390 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst 2003-08-20 12:09:39 +00:00
parent e5613ad9eb
commit e1c6745c9a

View File

@ -89,14 +89,16 @@ COUNT:
; READ: Read a particular joystick passed in A. ; READ: Read a particular joystick passed in A.
; ;
READ: php READ:
tax
php
sei ; disable IRQ sei ; disable IRQ
lda $01 lda $01
pha pha
lda #$35 lda #$35
sta $01 ; enable I/O sta $01 ; enable I/O
tax ; Joystick number into X txa ; Joystick number into X
bne joy2 bne joy2
; Read joystick 1 ; Read joystick 1
@ -105,19 +107,19 @@ joy1:
lda #$7F lda #$7F
sta cia1base sta cia1base
lda cia1base+1 lda cia1base+1
back: tax back: tay
pla pla
sta $01 sta $01
plp plp
txa tya
and #$1F and #$1F
eor #$1F eor #$1F
ldx #0
rts rts
; Read joystick 2 ; Read joystick 2
joy2: lda #$E0 joy2: ldx #0
lda #$E0
ldy #$FF ldy #$FF
sta cia1base+2 sta cia1base+2
lda cia1base+1 lda cia1base+1