more work towards MEGA65 native mode screen support
This commit is contained in:
1 parent
0d4898d91c
commit
ee549361ab
7 files changed
+101
-38
No files matched your search
@@ -26,49 +26,16 @@ chrout_screen:
|
||||
// ones are always printable characters; separate away control codes
|
||||
|
||||
and #$60
|
||||
bne !+
|
||||
jmp chrout_screen_control
|
||||
!:
|
||||
beq_16 chrout_screen_control
|
||||
txa
|
||||
|
||||
// Literals - first convert PETSCII to screen code
|
||||
|
||||
// Codes $C0-$DF become $40-$5F
|
||||
cmp #$E0
|
||||
bcs !+
|
||||
cmp #$C0
|
||||
bcc !+
|
||||
|
||||
and #$7F
|
||||
jmp chrout_screen_literal // not high char
|
||||
|
||||
!:
|
||||
// Range $20-$3F is unchanged
|
||||
cmp #$40
|
||||
bcc chrout_screen_literal // not high char
|
||||
|
||||
// Unshifted letters and symbols from $40-$5F
|
||||
// all end up being -$40
|
||||
// (C64 PRG p376)
|
||||
|
||||
// But anything >= $80 needs to be -$40
|
||||
// (C64 PRG p380-381)
|
||||
// And bit 7 should be cleared, only to be
|
||||
// set by reverse video
|
||||
sec
|
||||
sbc #$40
|
||||
|
||||
// Fix shifted chars by adding $20 again
|
||||
cmp #$20
|
||||
bcc chrout_screen_literal // not high char
|
||||
cmp #$40
|
||||
bcs chrout_screen_literal // not high char
|
||||
clc
|
||||
adc #$20
|
||||
jsr chrout_to_screen_code
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
chrout_screen_literal:
|
||||
chrout_screen_literal: // entry point for chrout_screen_quote
|
||||
|
||||
// Write normal character on the screen
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// CHROUT routine - convert PETSCII to screen code
|
||||
//
|
||||
|
||||
|
||||
chrout_to_screen_code:
|
||||
|
||||
// Codes $C0-$DF become $40-$5F
|
||||
cmp #$E0
|
||||
bcs !+
|
||||
cmp #$C0
|
||||
bcc !+
|
||||
|
||||
and #$7F
|
||||
rts // not high char
|
||||
!:
|
||||
// Range $20-$3F is unchanged
|
||||
cmp #$40
|
||||
bcc !+ // not high char
|
||||
|
||||
// Unshifted letters and symbols from $40-$5F
|
||||
// all end up being -$40
|
||||
// (C64 PRG p376)
|
||||
|
||||
// But anything >= $80 needs to be -$40
|
||||
// (C64 PRG p380-381)
|
||||
// And bit 7 should be cleared, only to be
|
||||
// set by reverse video
|
||||
sec
|
||||
sbc #$40
|
||||
|
||||
// Fix shifted chars by adding $20 again
|
||||
cmp #$20
|
||||
bcc !+ // not high char
|
||||
cmp #$40
|
||||
bcs !+ // not high char
|
||||
clc
|
||||
adc #$20
|
||||
!:
|
||||
rts
|
||||
Reference in new issue
Block a user