more work on SAVE routine
This commit is contained in:
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
|
// Command drive to stop talking before closing the file
|
||||||
jsr UNTLK
|
jsr UNTLK
|
||||||
!:
|
|
||||||
txa
|
txa
|
||||||
jsr LISTEN
|
jsr LISTEN
|
||||||
|
|
||||||
@@ -28,14 +28,4 @@ iec_close_load:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
iec_close_save:
|
|
||||||
|
|
||||||
tax
|
|
||||||
|
|
||||||
// Command drive to stop listening before closing the file
|
|
||||||
jsr UNLSN
|
|
||||||
|
|
||||||
bne !- // branch alwayys
|
|
||||||
|
|
||||||
|
|
||||||
#endif // CONFIG_IEC
|
#endif // CONFIG_IEC
|
||||||
@@ -28,7 +28,7 @@ iec_tx_common:
|
|||||||
// Timing is critical here - execute on disabled IRQs
|
// Timing is critical here - execute on disabled IRQs
|
||||||
// The best practice would be to do PHP first, but it seems this is not
|
// 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
|
// 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
|
sei
|
||||||
|
|
||||||
// Wait till all receivers are ready, they should all release DATA
|
// Wait till all receivers are ready, they should all release DATA
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
|
|
||||||
// XXX this is untested!
|
// XXX this is untested!
|
||||||
|
// test EAL/STAL - LOAD (tape, disk), SAVE - Open ROMs vs hybrid vs original
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_IEC
|
#if CONFIG_IEC
|
||||||
@@ -46,6 +48,17 @@ save_iec: // XXX finish the implementation
|
|||||||
jsr iec_tx_command
|
jsr iec_tx_command
|
||||||
bcs save_iec_error
|
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
|
ldy #$00
|
||||||
iec_save_loop:
|
iec_save_loop:
|
||||||
|
|
||||||
@@ -76,13 +89,25 @@ iec_save_loop_end:
|
|||||||
|
|
||||||
// Send last byte
|
// Send last byte
|
||||||
sta TBTCNT
|
sta TBTCNT
|
||||||
sec // mark end of stream
|
clc // XXX really?
|
||||||
jsr iec_tx_byte
|
jsr iec_tx_byte
|
||||||
|
|
||||||
|
// Close file on drive // XXX does not work properly
|
||||||
// Close file on drive
|
|
||||||
lda FA
|
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
|
// Return success
|
||||||
clc
|
clc
|
||||||
|
|||||||
Reference in new issue
Block a user