STOP key now terminates loading, some cleanups

This commit is contained in:
FeralChild64 committed 2019-10-30 21:26:26 +01:00
1 parent 18dc9d9b61
commit 1065930539
5 files changed
+35 -15

No files matched your search

+1 -2
View File
@@ -29,7 +29,6 @@ The following ROM features are currently missing:
* floating point routines * floating point routines
* tape support * tape support
* RS-232 support * RS-232 support
* breaking Kernal routines with RUN/STOP key
* NMI handling is incomplete * 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 | | `$FFCF` | `$F157` | `CHRIN` | PARTIAL | no screen support, keyboard does not preserve .Y |
| `$FFD2` | `$F1CA` | `CHROUT` | DONE | | | `$FFD2` | `$F1CA` | `CHROUT` | DONE | |
| `$FFD5` | `$F49E` | `LOAD` | 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 | | `$FFD8` | `$F5DD` | `SAVE` | DONE | only this preparation routine part is done |
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | | | `($0332)` | `$F5ED` | `SAVE` | NOT DONE | |
| `$FFDB` | | `SETTIM` | DONE | | | `$FFDB` | | `SETTIM` | DONE | |
+6 -4
View File
@@ -97,16 +97,18 @@ got_loadaddress:
jsr print_return jsr print_return
pla pla
plp plp
bcc !+ bcc load_no_error
// A = KERNAL error code, which also almost match // A = KERNAL error code, which also almost match
// basic ERROR codes, so we can just copy the // basic ERROR codes
// error code to X, decrement, and handle normally
tax tax
dex dex
bpl !+
ldx #B_ERR_BREAK
!:
jmp do_basic_error jmp do_basic_error
!: load_no_error:
// $YYXX is the last loaded address, so store it // $YYXX is the last loaded address, so store it
stx VARTAB+0 stx VARTAB+0
sty VARTAB+1 sty VARTAB+1
+19
View File
@@ -14,8 +14,16 @@ load_iec_file_not_found:
jmp kernalerror_FILE_NOT_FOUND jmp kernalerror_FILE_NOT_FOUND
load_iec_error: load_iec_error:
lda FA
jsr iec_close_load
jmp lvs_load_verify_error jmp lvs_load_verify_error
load_break_error:
pla
lda FA
jsr iec_close_load
jmp kernalerror_ROUTINE_TERMINATED
load_iec: load_iec:
@@ -86,6 +94,17 @@ iec_load_loop:
jsr lvs_advance_pointer jsr lvs_advance_pointer
bcs_far lvs_wrap_around_error 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 // Check for EOI - if so, this was the last byte
lda IOSTATUS lda IOSTATUS
and #K_STS_EOI and #K_STS_EOI
+6 -9
View File
@@ -8,10 +8,9 @@ chrout_screen_control:
txa txa
// Order here is not random // 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 // 2. Handle remaining control codes starting from the most commonly used
// in situations when speed might matter, we want to be // We want to be as snappy as possible
// as snappy as possible
chrout_try_RETURN: chrout_try_RETURN:
@@ -28,15 +27,13 @@ chrout_try_RETURN:
chrout_try_DEL: chrout_try_DEL:
cmp #KEY_DEL cmp #KEY_DEL
bne !+ beq_far chrout_screen_DEL
jmp chrout_screen_DEL
!:
chrout_try_INS: chrout_try_INS:
cmp #KEY_INS cmp #KEY_INS
bne !+ beq_far chrout_screen_INS
jmp chrout_screen_INS
!:
#if CONFIG_EDIT_STOPQUOTE #if CONFIG_EDIT_STOPQUOTE
chrout_try_STOP: chrout_try_STOP:
@@ -4,6 +4,7 @@
// starting from the least probable routine // starting from the least probable routine
// //
chrout_screen_jumptable_codes: chrout_screen_jumptable_codes:
.byte KEY_CLR .byte KEY_CLR
@@ -21,6 +22,7 @@ chrout_screen_jumptable_codes:
__chrout_screen_jumptable_codes_end: __chrout_screen_jumptable_codes_end:
chrout_screen_jumptable_lo: chrout_screen_jumptable_lo:
.byte <(chrout_screen_CLR - 1) .byte <(chrout_screen_CLR - 1)
@@ -36,6 +38,7 @@ chrout_screen_jumptable_lo:
.byte <(chrout_screen_CRSR_DOWN - 1) .byte <(chrout_screen_CRSR_DOWN - 1)
.byte <(chrout_screen_CRSR_UP - 1) .byte <(chrout_screen_CRSR_UP - 1)
chrout_screen_jumptable_hi: chrout_screen_jumptable_hi:
.byte >(chrout_screen_CLR - 1) .byte >(chrout_screen_CLR - 1)