From: mrdudz Date: Mon, 11 Dec 2017 20:53:00 +0000 (+0100) Subject: fix petscii conversion for C128 X-Git-Tag: V2.17~59^2~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9a609f6766f62ff0b609c6174bbaf24b8e2b8eb8;p=cc65 fix petscii conversion for C128 --- diff --git a/libsrc/c128/cpeekc.s b/libsrc/c128/cpeekc.s index ce6bb4ff5..9d64388a4 100644 --- a/libsrc/c128/cpeekc.s +++ b/libsrc/c128/cpeekc.s @@ -26,7 +26,8 @@ _cpeekc: ; Convert the screen code into a PetSCII code. ; $00 - $1F: +$40 ; $20 - $3F -; $40 - $7F: +$80 +; $40 - $5f: +$20 +; $60 - $7F: +$40 cmp #$20 bcs @sk1 ;(bge) @@ -35,9 +36,13 @@ _cpeekc: @sk1: cmp #$40 bcc @end ;(blt) - ora #$80 -@end: ldx #0 - rts + cmp #$60 + bcc @sk2 ;(blt) + ;sec + adc #$20 - $01 +@sk2: ;clc ; both above cmp and adc clear carry flag + adc #$20 +@end: rts @c80: lda SCREEN_PTR