Serial: Optimize TryToSend

We don't need to reload SendFreeCnt each time we loop to wait
for the ACIA to be ready.
This commit is contained in:
Colin Leroy-Mira
2023-08-30 21:28:09 +02:00
parent c674b7ced4
commit 3f3b6123b9
7 changed files with 43 additions and 41 deletions

View File

@@ -427,12 +427,13 @@ Done: rts
TryToSend:
sta tmp1 ; Remember tryHard flag
Again: lda SendFreeCnt
NextByte:
lda SendFreeCnt
cmp #$FF
beq Quit ; Bail out
; Check for flow stopped
lda Stopped
Again: lda Stopped
bne Quit ; Bail out
; Check that ACIA is ready to send
@@ -449,4 +450,4 @@ Send: ldy SendHead
sta ACIA_DATA,x
inc SendHead
inc SendFreeCnt
jmp Again
jmp NextByte