CHRIN fix, C64 part

This commit is contained in:
FeralChild64 authored and FeralChild64 committed 2021-01-26 00:03:07 +01:00
1 parent 559d087c39
commit 316f13f3c0
2 files changed
+17 -13

No files matched your search

+13 -9
View File
@@ -21,6 +21,11 @@ chrin_keyboard:
stx XSAV stx XSAV
+phy_trash_a +phy_trash_a
; Preserve old PNTR
lda PNTR
pha
; FALLTROUGH ; FALLTROUGH
chrin_keyboard_repeat: chrin_keyboard_repeat:
@@ -48,6 +53,7 @@ chrin_keyboard_empty_line:
; For an empty line, just return the carriage return ; For an empty line, just return the carriage return
+ply_trash_a +ply_trash_a
pla ; drop preserved PNTR
ldx XSAV ldx XSAV
clc clc
lda #$0D lda #$0D
@@ -60,14 +66,11 @@ chrin_keyboard_not_end_of_input:
inc CRSW inc CRSW
tay tay
; FALLTROUGH
chrin_keyboard_return_byte:
lda (LSXP),y lda (LSXP),y
jsr screen_check_toggle_quote jsr screen_check_toggle_quote
tax tax
+ply_trash_a +ply_trash_a
pla ; drop preserved PNTR
txa txa
ldx XSAV ldx XSAV
jsr screen_code_to_petscii jsr screen_code_to_petscii
@@ -134,16 +137,17 @@ chrin_enter_loop:
iny iny
sty INDX sty INDX
; Set mark informing that we are returning a line ; Set current character to return
ldy #$01 pla
sty CRSW ; XXX has to get previous PNTR+1, not 1 pha
sta CRSW
; Clear quote mode mark ; Clear quote mode mark
dey ; set .Y to 0 ldy #$00
sty QTSW sty QTSW
; Return first char of line ; Return first char of line
beq chrin_keyboard_return_byte ; branch always beq chrin_keyboard_not_end_of_input ; branch always
chrkn_keyboard_not_enter: chrkn_keyboard_not_enter:
@@ -144,15 +144,15 @@ m65_chrin_enter_loop:
; XXX add windowed mode support here - correct INDX and M65__SCRINPUT ; XXX add windowed mode support here - correct INDX and M65__SCRINPUT
; Clear quote mode mark
ldy #$00
sty QTSW
; Set current character to return ; Set current character to return
pla pla
pha pha
sta CRSW sta CRSW
; Clear quote mode mark
ldy #$00
sty QTSW
; Return first char ; Return first char
bra m65_chrin_keyboard_not_end_of_input bra m65_chrin_keyboard_not_end_of_input