1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00

fix petscii conversion for C128

This commit is contained in:
mrdudz 2017-12-11 21:53:00 +01:00
parent a54b4bebde
commit 9a609f6766

View File

@ -26,7 +26,8 @@ _cpeekc:
; Convert the screen code into a PetSCII code. ; Convert the screen code into a PetSCII code.
; $00 - $1F: +$40 ; $00 - $1F: +$40
; $20 - $3F ; $20 - $3F
; $40 - $7F: +$80 ; $40 - $5f: +$20
; $60 - $7F: +$40
cmp #$20 cmp #$20
bcs @sk1 ;(bge) bcs @sk1 ;(bge)
@ -35,9 +36,13 @@ _cpeekc:
@sk1: cmp #$40 @sk1: cmp #$40
bcc @end ;(blt) bcc @end ;(blt)
ora #$80 cmp #$60
@end: ldx #0 bcc @sk2 ;(blt)
rts ;sec
adc #$20 - $01
@sk2: ;clc ; both above cmp and adc clear carry flag
adc #$20
@end: rts
@c80: @c80:
lda SCREEN_PTR lda SCREEN_PTR