prepared QTSW flag for proper screen code -> PETSCII conversion

This commit is contained in:
FeralChild64 committed 2020-02-11 22:48:33 +01:00
1 parent dea993e4b7
commit 37ae435b2d
4 files changed
+38 -11

No files matched your search

+13 -5
View File
@@ -31,9 +31,10 @@ chrin_repeat:
cmp INDX cmp INDX
bne not_end_of_input bne not_end_of_input
// Return carriage return and clear pending input flag // Return carriage return and clear pending input and quote flags
lda #$00 lda #$00
sta CRSW sta CRSW
sta QTSW
// FALLTROUGH // FALLTROUGH
@@ -54,8 +55,10 @@ not_end_of_input:
// Return next byte of waiting // Return next byte of waiting
tay tay
chrin_keyboard_return_byte: chrin_keyboard_return_byte:
lda (LXSP),y lda (LXSP),y
jsr screen_check_toggle_quote
tax tax
ply_trash_a ply_trash_a
txa txa
@@ -123,12 +126,17 @@ chrin_enter_loop:
beq chrin_enter_loop beq chrin_enter_loop
iny iny
sty INDX sty INDX
lda #$01
sta CRSW // Set mark informing that we are returning a line
ldy #$01
sty CRSW
// Clear quote mode mark
dey // set .Y to 0
sty QTSW
// Return first char of line // Return first char of line
ldy #$00 beq chrin_keyboard_return_byte // branch always
beq chrin_keyboard_return_byte // branch always
not_enter: not_enter:
+1 -6
View File
@@ -86,13 +86,8 @@ chrout_screen_literal:
// Toggle quote flag if required // Toggle quote flag if required
txa txa
cmp #$22 jsr screen_check_toggle_quote
bne !+
lda QTSW
eor #$80
sta QTSW
!:
// Set colour of the newly printed character // Set colour of the newly printed character
lda COLOR lda COLOR
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 * #IGNORE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Helper routine - check character in .A, toggles quote flag if needed
//
screen_check_toggle_quote:
cmp #$22
bne !+
lda QTSW
eor #$80
sta QTSW
lda #$22 // restore previous .A valuee
!:
rts
@@ -4,6 +4,9 @@
// #LAYOUT# * * #IGNORE // #LAYOUT# * * #IGNORE
// XXX - conversion should depend on QTSW too
screen_code_to_petscii: screen_code_to_petscii:
cmp #$1B cmp #$1B
bcc s2p_adc_40 bcc s2p_adc_40