diff --git a/STATUS.md b/STATUS.md index c2864db9..821d2fc9 100644 --- a/STATUS.md +++ b/STATUS.md @@ -132,7 +132,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFC6` | `$F20E` | `CHKIN` | DONE | | | `$FFC9` | `$F250` | `CKOUT` | DONE | | | `$FFCC` | `$F333` | `CLRCHN` | DONE | | -| `$FFCF` | `$F157` | `CHRIN` | PARTIAL | no screen support, keyboard does not preserve .Y | +| `$FFCF` | `$F157` | `CHRIN` | PARTIAL | no screen device support | | `$FFD2` | `$F1CA` | `CHROUT` | DONE | | | `$FFD5` | `$F49E` | `LOAD` | DONE | | | `($0330)` | `$F4A5` | `LOAD` | DONE | | diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 075bec04..a31fe15d 100644 Binary files a/bin/basic_generic.rom and b/bin/basic_generic.rom differ diff --git a/bin/basic_mega65.rom b/bin/basic_mega65.rom index 31f6c4df..99e68005 100644 Binary files a/bin/basic_mega65.rom and b/bin/basic_mega65.rom differ diff --git a/bin/basic_testing.rom b/bin/basic_testing.rom index eeeba812..cdefb4d7 100644 Binary files a/bin/basic_testing.rom and b/bin/basic_testing.rom differ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index 025ea811..e809611d 100644 Binary files a/bin/basic_ultimate64.rom and b/bin/basic_ultimate64.rom differ diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 4c51d8d2..b6899f92 100644 Binary files a/bin/kernal_generic.rom and b/bin/kernal_generic.rom differ diff --git a/bin/kernal_mega65.rom b/bin/kernal_mega65.rom index d05ad7cc..7295e4f1 100644 Binary files a/bin/kernal_mega65.rom and b/bin/kernal_mega65.rom differ diff --git a/bin/kernal_testing.rom b/bin/kernal_testing.rom index 12cfea86..ae006d3f 100644 Binary files a/bin/kernal_testing.rom and b/bin/kernal_testing.rom differ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 1d79fd74..5383cfde 100644 Binary files a/bin/kernal_ultimate64.rom and b/bin/kernal_ultimate64.rom differ diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 34f5c632..71ba917c 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -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 diff --git a/c64/kernal/iostack/f157.chrin.s b/c64/kernal/iostack/f157.chrin.s index 32da72d0..f4deafb3 100644 --- a/c64/kernal/iostack/f157.chrin.s +++ b/c64/kernal/iostack/f157.chrin.s @@ -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. diff --git a/c64/kernal/keyboard/chrin_keyboard.s b/c64/kernal/keyboard/chrin_keyboard.s index dcefc146..40966536 100644 --- a/c64/kernal/keyboard/chrin_keyboard.s +++ b/c64/kernal/keyboard/chrin_keyboard.s @@ -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