1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

saves 2 bytes in the standard c64 joystick driver

remove redundant code and add jmp to the common sequence
two more bytes could be saved at the expense of longer sequence with interrupts disabled by moving sei/cli
This commit is contained in:
Gabriele Gorla 2021-09-08 15:00:20 -07:00 committed by Oliver Schmidt
parent f796c26091
commit 6637e28831

View File

@ -93,9 +93,7 @@ joy1: lda #$7F
sta CIA1_PRA sta CIA1_PRA
lda CIA1_PRB lda CIA1_PRB
cli cli
and #$1F jmp end
eor #$1F
rts
; Read joystick 2 ; Read joystick 2
@ -107,8 +105,6 @@ joy2: ldx #0
lda CIA1_PRA lda CIA1_PRA
sty CIA1_DDRA sty CIA1_DDRA
cli cli
and #$1F end: and #$1F
eor #$1F eor #$1F
rts rts