Skip to content

Commit f5671cd

Browse files
committed
A5200: Simplify ATASCII to screen code conversion.
Based on code from Altirra OS Kernel.
1 parent 2b61399 commit f5671cd

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/interp/a5200/putchar.asm

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,14 @@ no_eol:
5858

5959
; Convert character from ATASCII to screen codes
6060
asl
61-
tax ; X holds the value without high bit
62-
ror
63-
cpx #$C0 ; chars >= $60 don't need conversion
64-
bcs conv_ok
65-
cpx #$40 ; chars >= $20 needs -$20 (upper case and numbers)
66-
bcs normal_char
67-
adc #$61 ; Chars from $00 to $1F, add $40 (+$21, subtracted bellow)
68-
normal_char:
69-
sbc #$20 ; Chars from $20 to $5F, subtract $20
61+
php
62+
sbc #$3F
63+
bpl conv_ok
64+
eor #$40
7065
conv_ok:
66+
plp
67+
ror
68+
7169
pha ; Store A
7270

7371
; Calculate coordinates - only valid for text modes

0 commit comments

Comments
 (0)