diff --git a/STATUS.md b/STATUS.md index 7c0e8663..b2121aa4 100644 --- a/STATUS.md +++ b/STATUS.md @@ -29,7 +29,6 @@ The following ROM features are currently missing: * floating point routines * tape support * RS-232 support -* breaking Kernal routines with RUN/STOP key * NMI handling is incomplete @@ -133,7 +132,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFCF` | `$F157` | `CHRIN` | PARTIAL | no screen support, keyboard does not preserve .Y | | `$FFD2` | `$F1CA` | `CHROUT` | DONE | | | `$FFD5` | `$F49E` | `LOAD` | DONE | | -| `($0330)` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support, no STOP key support | +| `($0330)` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support | | `$FFD8` | `$F5DD` | `SAVE` | DONE | only this preparation routine part is done | | `($0332)` | `$F5ED` | `SAVE` | NOT DONE | | | `$FFDB` | | `SETTIM` | DONE | | diff --git a/c64/basic/commands/cmd_load.s b/c64/basic/commands/cmd_load.s index 9dfe60f0..e7dc76f1 100644 --- a/c64/basic/commands/cmd_load.s +++ b/c64/basic/commands/cmd_load.s @@ -97,16 +97,18 @@ got_loadaddress: jsr print_return pla plp - bcc !+ + bcc load_no_error // A = KERNAL error code, which also almost match - // basic ERROR codes, so we can just copy the - // error code to X, decrement, and handle normally + // basic ERROR codes tax dex + bpl !+ + ldx #B_ERR_BREAK +!: jmp do_basic_error -!: +load_no_error: // $YYXX is the last loaded address, so store it stx VARTAB+0 sty VARTAB+1 diff --git a/c64/kernal/iec/load_iec.s b/c64/kernal/iec/load_iec.s index eb37bcf0..bbca2af8 100644 --- a/c64/kernal/iec/load_iec.s +++ b/c64/kernal/iec/load_iec.s @@ -14,8 +14,16 @@ load_iec_file_not_found: jmp kernalerror_FILE_NOT_FOUND load_iec_error: + lda FA + jsr iec_close_load jmp lvs_load_verify_error +load_break_error: + pla + lda FA + jsr iec_close_load + jmp kernalerror_ROUTINE_TERMINATED + load_iec: @@ -85,7 +93,18 @@ iec_load_loop: // Advance pointer to data jsr lvs_advance_pointer bcs_far lvs_wrap_around_error - + + // Handle STOP key; it is probably an overkill to do it + // with every byte, once per 32 bytes should be enough + lda STAL + and #$1F + bne !+ + phx_trash_a + jsr udtim_keyboard + jsr STOP + bcs load_break_error + plx_trash_a +!: // Check for EOI - if so, this was the last byte lda IOSTATUS and #K_STS_EOI diff --git a/c64/kernal/screen/chrout_screen_control.s b/c64/kernal/screen/chrout_screen_control.s index dda912c7..89b2390a 100644 --- a/c64/kernal/screen/chrout_screen_control.s +++ b/c64/kernal/screen/chrout_screen_control.s @@ -8,10 +8,9 @@ chrout_screen_control: txa // Order here is not random - // 1. First handle the ones that do not depend on quoote mode + // 1. First handle the ones that do not depend on quote mode // 2. Handle remaining control codes starting from the most commonly used - // in situations when speed might matter, we want to be - // as snappy as possible + // We want to be as snappy as possible chrout_try_RETURN: @@ -28,15 +27,13 @@ chrout_try_RETURN: chrout_try_DEL: cmp #KEY_DEL - bne !+ - jmp chrout_screen_DEL -!: + beq_far chrout_screen_DEL + chrout_try_INS: cmp #KEY_INS - bne !+ - jmp chrout_screen_INS -!: + beq_far chrout_screen_INS + #if CONFIG_EDIT_STOPQUOTE chrout_try_STOP: diff --git a/c64/kernal/screen/chrout_screen_jumptable_codes.s b/c64/kernal/screen/chrout_screen_jumptable_codes.s index b12dbb7a..5ee6b9fc 100644 --- a/c64/kernal/screen/chrout_screen_jumptable_codes.s +++ b/c64/kernal/screen/chrout_screen_jumptable_codes.s @@ -4,6 +4,7 @@ // starting from the least probable routine // + chrout_screen_jumptable_codes: .byte KEY_CLR @@ -21,6 +22,7 @@ chrout_screen_jumptable_codes: __chrout_screen_jumptable_codes_end: + chrout_screen_jumptable_lo: .byte <(chrout_screen_CLR - 1) @@ -36,6 +38,7 @@ chrout_screen_jumptable_lo: .byte <(chrout_screen_CRSR_DOWN - 1) .byte <(chrout_screen_CRSR_UP - 1) + chrout_screen_jumptable_hi: .byte >(chrout_screen_CLR - 1)