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
+39 -12

No files matched your search

+14 -6
View File
@@ -31,9 +31,10 @@ chrin_repeat:
cmp INDX
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
sta CRSW
sta QTSW
// FALLTROUGH
@@ -54,8 +55,10 @@ not_end_of_input:
// Return next byte of waiting
tay
chrin_keyboard_return_byte:
lda (LXSP),y
jsr screen_check_toggle_quote
tax
ply_trash_a
txa
@@ -112,7 +115,7 @@ chrin_enter_calc_length:
// Calculate length
jsr screen_get_logical_line_end_ptr
iny
chrin_enter_loop:
// Retrieve bytes
@@ -123,12 +126,17 @@ chrin_enter_loop:
beq chrin_enter_loop
iny
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
ldy #$00
beq chrin_keyboard_return_byte // branch always
beq chrin_keyboard_return_byte // branch always
not_enter:
+1 -6
View File
@@ -86,13 +86,8 @@ chrout_screen_literal:
// Toggle quote flag if required
txa
cmp #$22
bne !+
jsr screen_check_toggle_quote
lda QTSW
eor #$80
sta QTSW
!:
// Set colour of the newly printed character
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
// XXX - conversion should depend on QTSW too
screen_code_to_petscii:
cmp #$1B
bcc s2p_adc_40