From e77ac8a230279ad29081fe50b5602ccfba17f203 Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Sat, 26 May 2018 16:37:03 +0200 Subject: [PATCH 1/4] 1 byte donation for Fabrizio ;) --- libsrc/vic20/cgetc.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/vic20/cgetc.s b/libsrc/vic20/cgetc.s index 4d3a30ea2..05f2f68dc 100644 --- a/libsrc/vic20/cgetc.s +++ b/libsrc/vic20/cgetc.s @@ -40,8 +40,8 @@ L3: jsr KBDREAD ; Read char and return in A bne seton ; Go set it on lda CURS_FLAG ; Is the cursor currently off? bne crs9 ; Jump if yes - lda #1 - sta CURS_FLAG ; Mark it as off + inx ; X is now 1 + stx CURS_FLAG ; Mark it as off lda CURS_STATE ; Cursor currently displayed? beq crs8 ; Jump if no ldy CURS_X ; Get the character column From 49a9b887343a91e2ed87da4c2c15df1c0f99b873 Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Sat, 26 May 2018 19:53:44 +0200 Subject: [PATCH 2/4] Saved even one more byte. --- libsrc/vic20/cgetc.s | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsrc/vic20/cgetc.s b/libsrc/vic20/cgetc.s index 05f2f68dc..d5af9a9f6 100644 --- a/libsrc/vic20/cgetc.s +++ b/libsrc/vic20/cgetc.s @@ -40,8 +40,7 @@ L3: jsr KBDREAD ; Read char and return in A bne seton ; Go set it on lda CURS_FLAG ; Is the cursor currently off? bne crs9 ; Jump if yes - inx ; X is now 1 - stx CURS_FLAG ; Mark it as off + inc CURS_FLAG ; Mark it as off lda CURS_STATE ; Cursor currently displayed? beq crs8 ; Jump if no ldy CURS_X ; Get the character column From 30a679ba360c5b80dcc472fab3886347aaed9e75 Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Sat, 26 May 2018 20:25:51 +0200 Subject: [PATCH 3/4] Saved 3 bytes for the C16 target. --- libsrc/c16/cgetc.s | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libsrc/c16/cgetc.s b/libsrc/c16/cgetc.s index 3ee31a757..a61373ac7 100644 --- a/libsrc/c16/cgetc.s +++ b/libsrc/c16/cgetc.s @@ -60,8 +60,10 @@ L2: jsr KBDREAD ; Read char and return in A .proc initkbd - ldy #15 + ldy #7 @L1: lda fnkeys,y + sta FKEY_SPACE+8,y + lda #$01 ; Lower 8 places are all $01 sta FKEY_SPACE,y dey bpl @L1 @@ -69,8 +71,7 @@ L2: jsr KBDREAD ; Read char and return in A .endproc -fnkeys: .byte $01, $01, $01, $01, $01, $01, $01, $01 - .byte 133, 137, 134, 138, 135, 139, 136, 140 +fnkeys: .byte 133, 137, 134, 138, 135, 139, 136, 140 .code From f55b564ca19fbf0f4da69688b7b2a8e13a82e1a7 Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Sun, 27 May 2018 00:10:58 +0200 Subject: [PATCH 4/4] Save the three bytes for the plus4 too. --- libsrc/plus4/cgetc.s | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libsrc/plus4/cgetc.s b/libsrc/plus4/cgetc.s index 784bac267..fcbc66064 100644 --- a/libsrc/plus4/cgetc.s +++ b/libsrc/plus4/cgetc.s @@ -63,8 +63,10 @@ L2: sta ENABLE_ROM ; Bank in the ROM .proc initkbd - ldy #15 + ldy #7 @L1: lda fnkeys,y + sta FKEY_SPACE+8,y + lda #$01 ; Lower 8 places are all $01 sta FKEY_SPACE,y dey bpl @L1 @@ -72,8 +74,7 @@ L2: sta ENABLE_ROM ; Bank in the ROM .endproc -fnkeys: .byte $01, $01, $01, $01, $01, $01, $01, $01 - .byte 133, 137, 134, 138, 135, 139, 136, 140 +fnkeys: .byte 133, 137, 134, 138, 135, 139, 136, 140 .segment "LOWCODE" ; Accesses the ROM - must go into low mem