From 734541ee05000bad9e9dd2f903a2db754e8c36f3 Mon Sep 17 00:00:00 2001 From: Colin Leroy-Mira Date: Wed, 30 Aug 2023 20:49:39 +0200 Subject: [PATCH] Serial: Optimize SER_GET There is no need to TryToSend before getting the character. We send bytes during SER_PUT, and if interrupted during sending, we still try to do it at the beginning of the next SER_PUT. --- libsrc/apple2/ser/a2.ssc.s | 7 +------ libsrc/atmos/ser/atmos-acia.s | 8 +------- libsrc/c128/ser/c128-swlink.s | 7 +------ libsrc/c64/ser/c64-swlink.s | 7 +------ libsrc/cbm510/ser/cbm510-std.s | 7 +------ libsrc/cbm610/ser/cbm610-std.s | 7 +------ libsrc/plus4/ser/plus4-stdser.s | 7 +------ 7 files changed, 7 insertions(+), 43 deletions(-) diff --git a/libsrc/apple2/ser/a2.ssc.s b/libsrc/apple2/ser/a2.ssc.s index 12e975965..5942d43e9 100644 --- a/libsrc/apple2/ser/a2.ssc.s +++ b/libsrc/apple2/ser/a2.ssc.s @@ -291,14 +291,9 @@ InvBaud:lda #SER_ERR_BAUD_UNAVAIL SER_GET: ldx Index - ldy SendFreeCnt ; Send data if necessary - iny ; Y == $FF? - beq :+ - lda #$00 ; TryHard = false - jsr TryToSend ; Check for buffer empty -: lda RecvFreeCnt ; (25) + lda RecvFreeCnt ; (25) cmp #$FF bne :+ lda #SER_ERR_NO_DATA diff --git a/libsrc/atmos/ser/atmos-acia.s b/libsrc/atmos/ser/atmos-acia.s index c918fe995..1509803d2 100644 --- a/libsrc/atmos/ser/atmos-acia.s +++ b/libsrc/atmos/ser/atmos-acia.s @@ -227,14 +227,8 @@ InvBaud:lda #