keyboard part of CHRIN now preserves .Y

This commit is contained in:
FeralChild64 committed 2019-11-07 22:40:03 +01:00
1 parent 671a3bc3bf
commit 8cd2eac996
12 files changed
+12 -7

No files matched your search

+1 -1
View File
@@ -89,7 +89,7 @@
.label C3PO = $94 // flag - is BSOUR content valid
.label BSOUR = $95 // serial bus buffered output byte
.label SYNO = $96 // -- NOT IMPLEMENTED --
.label XSAV = $97 // -- NOT IMPLEMENTED --
.label XSAV = $97 // temporary register storage for ASCII related routines [!] usage details might differ
.label LDTND = $98 // number of entries in LAT / FAT / SAT tables
.label DFLTN = $99 // default input device
.label DFLTO = $9A // default output device
-2
View File
@@ -8,8 +8,6 @@
// CPU registers that has to be preserved (see [RG64]): .Y
//
// XXX keyboard part currently does not preserve register Y, to be fixed!
// Reads a byte of input, unless from keyboard.
// If from keyboard, then it gets a whole line of input, and returns the first char.
// Repeated calls after that read out the successive bytes of the line of input.
+10 -3
View File
@@ -7,7 +7,10 @@
chrin_keyboard:
// Save .X
phx_trash_a
stx XSAV
// Save .Y
phy_trash_a
chrin_repeat:
@@ -35,7 +38,8 @@ empty_line:
// (and don't forget to actually print the carriage return, so that
// the cursor advances and screen scrolls as required)
plx_trash_a
ply_trash_a
ldx XSAV
clc
lda #$0d
rts
@@ -47,8 +51,11 @@ not_end_of_input:
// Return next byte of waiting
tay
chrin_keyboard_return_byte:
plx_trash_a
lda (LXSP),y
tax
ply_trash_a
txa
ldx XSAV
jsr screen_code_to_petscii
clc
rts