From 9a609f6766f62ff0b609c6174bbaf24b8e2b8eb8 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Mon, 11 Dec 2017 21:53:00 +0100 Subject: [PATCH] fix petscii conversion for C128 --- libsrc/c128/cpeekc.s | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 -- 2.39.5