1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 06:30:16 +00:00

Implemented mark and space checks.

This commit is contained in:
Alex Thissen 2024-02-09 12:54:00 +00:00
parent 014f85f226
commit 65bce9ecde

View File

@ -151,7 +151,7 @@ SER_OPEN:
cmp #SER_BAUD_600 cmp #SER_BAUD_600
beq setbaudrate beq setbaudrate
; Source period is 4 us ; Source period is 8 us
ldy #%00011011 ; ENABLE_RELOAD|ENABLE_COUNT|AUD_8 ldy #%00011011 ; ENABLE_RELOAD|ENABLE_COUNT|AUD_8
ldx #51 ldx #51
@ -341,8 +341,9 @@ SER_IRQ:
ldx SERDAT ; Read received data ldx SERDAT ; Read received data
lda contrl lda contrl
and #PAREN ; Parity enabled implies SER_PAR_EVEN or SER_PAR_ODD and #PAREN ; Parity enabled implies SER_PAR_EVEN or SER_PAR_ODD
tay
ora #OVERRUN|FRAMERR|RXBRK ora #OVERRUN|FRAMERR|RXBRK
bit SERCTL ; Compare with SERCTL bit SERCTL ; Check error flags in SERCTL
beq @rx_irq ; No errors so far beq @rx_irq ; No errors so far
@ -358,6 +359,15 @@ SER_IRQ:
bra @exit0 bra @exit0
@rx_irq: @rx_irq:
tya
bne @2 ; Parity was enabled so no marker bit check needed
lda contrl
eor SERCTL ; Should match current parity bit
and #PARBIT ; Check for mark or space value
bne @exit0
@2:
txa txa
ldx RxPtrIn ldx RxPtrIn
sta RxBuffer,x sta RxBuffer,x