more work on SAVE routine

This commit is contained in:
FeralChild64 committed 2019-11-06 17:29:27 +01:00
1 parent fc9a95116f
commit 86e8bcbe7f
3 files changed
+31 -16

No files matched your search

@@ -13,7 +13,7 @@ iec_close_load:
// Command drive to stop talking before closing the file
jsr UNTLK
!:
txa
jsr LISTEN
@@ -28,14 +28,4 @@ iec_close_load:
rts
iec_close_save:
tax
// Command drive to stop listening before closing the file
jsr UNLSN
bne !- // branch alwayys
#endif // CONFIG_IEC
+1 -1
View File
@@ -28,7 +28,7 @@ iec_tx_common:
// Timing is critical here - execute on disabled IRQs
// The best practice would be to do PHP first, but it seems this is not
// what the original ROM does; furthermore, pushing additional bytes to
// stack can wreck autostart softwaree loading at $0100
// stack can wreck autostart software loading at $0100
sei
// Wait till all receivers are ready, they should all release DATA
+29 -4
View File
@@ -5,6 +5,8 @@
// XXX this is untested!
// test EAL/STAL - LOAD (tape, disk), SAVE - Open ROMs vs hybrid vs original
#if CONFIG_IEC
@@ -46,6 +48,17 @@ save_iec: // XXX finish the implementation
jsr iec_tx_command
bcs save_iec_error
// Save start address XXX optimize this
lda STAL+0
sta TBTCNT
clc
jsr iec_tx_byte
lda STAL+1
sta TBTCNT
clc
jsr iec_tx_byte
ldy #$00
iec_save_loop:
@@ -76,13 +89,25 @@ iec_save_loop_end:
// Send last byte
sta TBTCNT
sec // mark end of stream
clc // XXX really?
jsr iec_tx_byte
// Close file on drive
// Close file on drive // XXX does not work properly
lda FA
jsr iec_close_save
jsr UNLSN
lda FA
jsr LISTEN
lda #$E1 // CLOSE command
sta TBTCNT
jsr iec_tx_command
jsr iec_tx_command_finalize
// Tell drive to unlisten
lda FA
jsr UNLSN
// Return success
clc