some fixes and refactoring for IEC SAVE

This commit is contained in:
FeralChild64 committed 2019-11-07 19:34:31 +01:00
1 parent ce68834035
commit dd09e2432e
6 files changed
+67 -36

No files matched your search

+2 -2
View File
@@ -139,8 +139,8 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
| `$FFD2` | `$F1CA` | `CHROUT` | DONE | |
| `$FFD5` | `$F49E` | `LOAD` | DONE | |
| `($0330)` | `$F4A5` | `LOAD` | DONE | |
| `$FFD8` | `$F5DD` | `SAVE` | DONE | main routine not done yet |
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | work in progress, not tested yet |
| `$FFD8` | `$F5DD` | `SAVE` | DONE | |
| `($0332)` | `$F5ED` | `SAVE` | PARTIAL | not fully tested yet |
| `$FFDB` | | `SETTIM` | DONE | |
| `$FFDE` | | `RDTIM` | DONE | |
| `$FFE1` | `$F6ED` | `STOP` | DONE | |
+1 -1
View File
@@ -101,7 +101,7 @@ iec_load_loop:
// Advance pointer to data; it is OK if it advances past $FFFF,
// one autostart technique does exactly this
jsr lvs_advance_pointer
jsr lvs_advance_EAL
// Handle STOP key; it is probably an overkill to do it
// with every byte, once per 32 bytes should be enough
+2 -8
View File
@@ -86,17 +86,12 @@ iec_save_loop:
sta TBTCNT
clc
jsr iec_tx_byte
jsr lvs_advance_pointer
jsr lvs_advance_STAL
jmp iec_save_loop
iec_save_loop_end:
// Send last byte
sta TBTCNT
clc // XXX really?
jsr iec_tx_byte
// Close file on drive // XXX does not work properly
// Close file on drive
lda FA
jsr UNLSN
@@ -112,7 +107,6 @@ iec_save_loop_end:
lda FA
jsr UNLSN
// Return success
clc
rts
+60 -4
View File
@@ -75,8 +75,19 @@ lvs_handle_byte_verify:
sec
rts
#if CONFIG_IEC
lvs_advance_pointer:
lvs_advance_STAL:
// Advance pointer
inc STAL+0
bne !+
inc STAL+1
!:
rts
lvs_advance_EAL:
// Advance pointer
inc EAL+0
@@ -85,6 +96,26 @@ lvs_advance_pointer:
!:
rts
#endif
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
lvs_advance_MEMUSS_check_EAL:
// Advance pointer
inc MEMUSS+0
bne !+
inc MEMUSS+1
!:
lda MEMUSS+1
cmp EAL+1
bne !+
lda MEMUSS+0
cmp EAL+0
!:
rts
#endif
lvs_display_searching_for:
@@ -132,14 +163,39 @@ lvs_display_loading_verifying:
lvs_display_start_addr:
ldx #__MSG_KERNAL_FROM_HEX
!:
jsr print_kernal_message
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
lda FA
#if CONFIG_TAPE_NORMAL
cmp #$01
beq lvs_display_addr_STAL
#endif
#if CONFIG_TAPE_TURBO
cmp #$07
beq lvs_display_addr_STAL
#endif
#endif
// FALLTROUGH
lvs_display_addr_EAL:
lda EAL+1
jsr print_hex_byte
lda EAL+0
jmp print_hex_byte
lvs_display_addr_STAL:
lda STAL+1
jsr print_hex_byte
lda STAL+0
jmp print_hex_byte
lvs_display_done:
// Display end address
@@ -147,8 +203,8 @@ lvs_display_done:
bpl lvs_display_end
ldx #__MSG_KERNAL_TO_HEX
jmp !-
jsr print_kernal_message
jmp lvs_display_addr_EAL
lvs_display_saving:
+1 -9
View File
@@ -81,15 +81,7 @@ load_tape_turbo_loop:
sta PRTY
// Advance MEMUSS (see Mapping the C64, page 36)
inc MEMUSS+0
bne !+
inc MEMUSS+1
!:
lda MEMUSS+1
cmp EAL+1
bne load_tape_turbo_loop
lda MEMUSS+0
cmp EAL+0
jsr lvs_advance_MEMUSS_check_EAL
bne load_tape_turbo_loop
// Get the checksum
+1 -12
View File
@@ -217,18 +217,7 @@ tape_handle_header:
// Print LOADING and start address
lda MSGFLG
bpl tape_handle_header_displayed
ldx #__MSG_KERNAL_LOADING
jsr print_kernal_message
ldx #__MSG_KERNAL_FROM_HEX
jsr print_kernal_message
lda STAL+1
jsr print_hex_byte
lda STAL+0
jsr print_hex_byte
jsr lvs_display_loading_verifying
tape_handle_header_displayed: