]> git.sur5r.net Git - cc65/commitdiff
fix petscii conversion for C128
authormrdudz <mrdudz@users.noreply.github.com>
Mon, 11 Dec 2017 20:53:00 +0000 (21:53 +0100)
committermrdudz <mrdudz@users.noreply.github.com>
Mon, 11 Dec 2017 20:53:00 +0000 (21:53 +0100)
libsrc/c128/cpeekc.s

index ce6bb4ff57893a46214237e80bf297a7212adc3b..9d64388a4c7e4fe5c4338235baec1b8e5b4ed411 100644 (file)
@@ -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