some fixes and refactoring for IEC SAVE
This commit is contained in:
1 parent
ce68834035
commit
dd09e2432e
6 files changed
+67
-36
No files matched your search
@@ -139,8 +139,8 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
|
|||||||
| `$FFD2` | `$F1CA` | `CHROUT` | DONE | |
|
| `$FFD2` | `$F1CA` | `CHROUT` | DONE | |
|
||||||
| `$FFD5` | `$F49E` | `LOAD` | DONE | |
|
| `$FFD5` | `$F49E` | `LOAD` | DONE | |
|
||||||
| `($0330)` | `$F4A5` | `LOAD` | DONE | |
|
| `($0330)` | `$F4A5` | `LOAD` | DONE | |
|
||||||
| `$FFD8` | `$F5DD` | `SAVE` | DONE | main routine not done yet |
|
| `$FFD8` | `$F5DD` | `SAVE` | DONE | |
|
||||||
| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | work in progress, not tested yet |
|
| `($0332)` | `$F5ED` | `SAVE` | PARTIAL | not fully tested yet |
|
||||||
| `$FFDB` | | `SETTIM` | DONE | |
|
| `$FFDB` | | `SETTIM` | DONE | |
|
||||||
| `$FFDE` | | `RDTIM` | DONE | |
|
| `$FFDE` | | `RDTIM` | DONE | |
|
||||||
| `$FFE1` | `$F6ED` | `STOP` | DONE | |
|
| `$FFE1` | `$F6ED` | `STOP` | DONE | |
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ iec_load_loop:
|
|||||||
|
|
||||||
// Advance pointer to data; it is OK if it advances past $FFFF,
|
// Advance pointer to data; it is OK if it advances past $FFFF,
|
||||||
// one autostart technique does exactly this
|
// 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
|
// Handle STOP key; it is probably an overkill to do it
|
||||||
// with every byte, once per 32 bytes should be enough
|
// with every byte, once per 32 bytes should be enough
|
||||||
|
|||||||
@@ -86,17 +86,12 @@ iec_save_loop:
|
|||||||
sta TBTCNT
|
sta TBTCNT
|
||||||
clc
|
clc
|
||||||
jsr iec_tx_byte
|
jsr iec_tx_byte
|
||||||
jsr lvs_advance_pointer
|
jsr lvs_advance_STAL
|
||||||
jmp iec_save_loop
|
jmp iec_save_loop
|
||||||
|
|
||||||
iec_save_loop_end:
|
iec_save_loop_end:
|
||||||
|
|
||||||
// Send last byte
|
// Close file on drive
|
||||||
sta TBTCNT
|
|
||||||
clc // XXX really?
|
|
||||||
jsr iec_tx_byte
|
|
||||||
|
|
||||||
// Close file on drive // XXX does not work properly
|
|
||||||
lda FA
|
lda FA
|
||||||
jsr UNLSN
|
jsr UNLSN
|
||||||
|
|
||||||
@@ -112,7 +107,6 @@ iec_save_loop_end:
|
|||||||
lda FA
|
lda FA
|
||||||
jsr UNLSN
|
jsr UNLSN
|
||||||
|
|
||||||
|
|
||||||
// Return success
|
// Return success
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -75,8 +75,19 @@ lvs_handle_byte_verify:
|
|||||||
sec
|
sec
|
||||||
rts
|
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
|
// Advance pointer
|
||||||
inc EAL+0
|
inc EAL+0
|
||||||
@@ -85,6 +96,26 @@ lvs_advance_pointer:
|
|||||||
!:
|
!:
|
||||||
rts
|
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:
|
lvs_display_searching_for:
|
||||||
|
|
||||||
@@ -132,14 +163,39 @@ lvs_display_loading_verifying:
|
|||||||
lvs_display_start_addr:
|
lvs_display_start_addr:
|
||||||
|
|
||||||
ldx #__MSG_KERNAL_FROM_HEX
|
ldx #__MSG_KERNAL_FROM_HEX
|
||||||
!:
|
|
||||||
jsr print_kernal_message
|
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
|
lda EAL+1
|
||||||
jsr print_hex_byte
|
jsr print_hex_byte
|
||||||
lda EAL+0
|
lda EAL+0
|
||||||
jmp print_hex_byte
|
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:
|
lvs_display_done:
|
||||||
|
|
||||||
// Display end address
|
// Display end address
|
||||||
@@ -147,8 +203,8 @@ lvs_display_done:
|
|||||||
bpl lvs_display_end
|
bpl lvs_display_end
|
||||||
|
|
||||||
ldx #__MSG_KERNAL_TO_HEX
|
ldx #__MSG_KERNAL_TO_HEX
|
||||||
jmp !-
|
jsr print_kernal_message
|
||||||
|
jmp lvs_display_addr_EAL
|
||||||
|
|
||||||
lvs_display_saving:
|
lvs_display_saving:
|
||||||
|
|
||||||
|
|||||||
@@ -81,15 +81,7 @@ load_tape_turbo_loop:
|
|||||||
sta PRTY
|
sta PRTY
|
||||||
|
|
||||||
// Advance MEMUSS (see Mapping the C64, page 36)
|
// Advance MEMUSS (see Mapping the C64, page 36)
|
||||||
inc MEMUSS+0
|
jsr lvs_advance_MEMUSS_check_EAL
|
||||||
bne !+
|
|
||||||
inc MEMUSS+1
|
|
||||||
!:
|
|
||||||
lda MEMUSS+1
|
|
||||||
cmp EAL+1
|
|
||||||
bne load_tape_turbo_loop
|
|
||||||
lda MEMUSS+0
|
|
||||||
cmp EAL+0
|
|
||||||
bne load_tape_turbo_loop
|
bne load_tape_turbo_loop
|
||||||
|
|
||||||
// Get the checksum
|
// Get the checksum
|
||||||
|
|||||||
@@ -217,18 +217,7 @@ tape_handle_header:
|
|||||||
|
|
||||||
// Print LOADING and start address
|
// Print LOADING and start address
|
||||||
|
|
||||||
lda MSGFLG
|
jsr lvs_display_loading_verifying
|
||||||
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
|
|
||||||
|
|
||||||
tape_handle_header_displayed:
|
tape_handle_header_displayed:
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user