various I/O updates

This commit is contained in:
FeralChild64 committed 2019-10-31 17:16:32 +01:00
1 parent bdcebb554f
commit c03c7abf45
11 files changed
+263 -15

No files matched your search

+93
View File
@@ -0,0 +1,93 @@
//
// JiffyDOS protocol support for IEC
//
// XXX finish this
#if CONFIG_IEC_JIFFYDOS
iec_tx_byte_jiffydos:
// JiffyDOS timing regime is very strict - before transmitting anything
// we need to disable sprites and (if screen is not disabled) wait for
// appropriate moment, so that no badline interruption can happen
jsr jiffydos_hide_sprites
jsr jiffydos_wait_line
__jd_check1:
// XXX send byte
// Re-enable sprites
jsr jiffydos_restore_sprites
rts
iec_rx_byte_jiffydos:
// JiffyDOS timing regime is very strict - before transmitting anything
// we need to disable sprites and (if screen is not disabled) wait for
// appropriate moment, so that no badline interruption can happen
jsr jiffydos_hide_sprites
jsr jiffydos_wait_line
// XXX retrieve byte
// Re-enable sprites
jsr jiffydos_restore_sprites
rts
jiffydos_wait_line:
// XXX if screen not disabled, wait for badline to pass
rts
__jd_check2:
jiffydos_hide_sprites:
// XXX implement
rts
jiffydos_restore_sprites:
// XXX implement
rts
.function SAME_PAGE_CHECK(label_1, label_2)
{
#if !PASS_SIZETEST
return (label_1 - label_1 % 256) == (label_2 - label_2 % 256)
#else
return true
#endif
}
.if (!SAME_PAGE_CHECK(__jd_check1, __jd_check2))
{
// To meet the strict JiffyDOS timing, we need to make sure
// it does not span across multiple pages, as this would add
// 1 cycle to some jump instructions - maybe this wont cause
// problems, but better safe than sorry.
.error "JiffyDOS code can't span across multiple pages"
}
#endif // CONFIG_IEC_JIFFYDOS
+37
View File
@@ -0,0 +1,37 @@
//
// IEC part of the SAVE routine
//
#if CONFIG_IEC
save_iec:
/*
// Display SAVING
// XXX jsr lvs_display_saving
// Call device to LISTEN
lda FA
jsr LISTEN
bcs save_iec_dev_not_found // XXX redirecto to load
// Open channel XXX (reserved for file writing)
lda #XXX
jsr iec_cmd_open
bcs // XXX error
// Send file name
jsr lvs_send_file_name
bcs load_iec_error
// XXX finish the implementation
rts
*/
STUB_IMPLEMENTATION()
#endif // CONFIG_IEC