mirror of
https://github.com/cc65/cc65.git
synced 2025-02-05 20:31:53 +00:00
Apple2 SSC: Implement no flow control
This commit is contained in:
parent
5b47def166
commit
94239525ca
@ -87,6 +87,7 @@ SendFreeCnt: .res 1 ; Number of free bytes in send buffer
|
||||
Stopped: .res 1 ; Flow-stopped flag
|
||||
RtsOff: .res 1 ; Cached value of command register with
|
||||
; flow stopped
|
||||
HSType: .res 1 ; Flow-control type
|
||||
|
||||
RecvBuf: .res 256 ; Receive buffer: 256 bytes
|
||||
SendBuf: .res 256 ; Send buffer: 256 bytes
|
||||
@ -276,13 +277,15 @@ NoDev: lda #SER_ERR_NO_DEVICE
|
||||
; Check if the handshake setting is valid
|
||||
AciaOK: ldy #SER_PARAMS::HANDSHAKE
|
||||
lda (ptr1),y
|
||||
cmp #SER_HS_HW ; This is all we support
|
||||
beq HandshakeOK
|
||||
cmp #SER_HS_SW ; Not supported
|
||||
bne HandshakeOK
|
||||
|
||||
lda #SER_ERR_INIT_FAILED
|
||||
bne Out
|
||||
|
||||
HandshakeOK:
|
||||
sta HSType ; Store flow control type
|
||||
|
||||
ldy #$00 ; Initialize buffers
|
||||
sty Stopped
|
||||
sty RecvHead
|
||||
@ -473,11 +476,14 @@ SER_IRQ:
|
||||
bcc Flow ; Assert flow control if buffer space low
|
||||
rts ; Interrupt handled (carry already set)
|
||||
|
||||
Flow: ldx Index ; Assert flow control if buffer space too low
|
||||
lda RtsOff
|
||||
Flow: lda HSType ; Don't touch if no flow control
|
||||
beq IRQDone
|
||||
|
||||
ldx Index ; Assert flow control if buffer space too low
|
||||
lda RtsOff
|
||||
sta ACIA_CMD,x
|
||||
sta Stopped
|
||||
sec ; Interrupt handled
|
||||
IRQDone:sec ; Interrupt handled
|
||||
Done: rts
|
||||
|
||||
;----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user