From 6637e288318f10cf789faedb3ef46f2323691fa3 Mon Sep 17 00:00:00 2001 From: Gabriele Gorla <44734244+gorlik@users.noreply.github.com> Date: Wed, 8 Sep 2021 15:00:20 -0700 Subject: [PATCH] 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 --- libsrc/c64/joy/c64-stdjoy.s | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libsrc/c64/joy/c64-stdjoy.s b/libsrc/c64/joy/c64-stdjoy.s index c983d81bb..d11093fba 100644 --- a/libsrc/c64/joy/c64-stdjoy.s +++ b/libsrc/c64/joy/c64-stdjoy.s @@ -93,9 +93,7 @@ joy1: lda #$7F sta CIA1_PRA lda CIA1_PRB cli - and #$1F - eor #$1F - rts + jmp end ; Read joystick 2 @@ -107,8 +105,6 @@ joy2: ldx #0 lda CIA1_PRA sty CIA1_DDRA cli - and #$1F +end: and #$1F eor #$1F rts - -