MEGA65 glue code for DOS finished

This commit is contained in:
FeralChild64 committed 2020-08-23 10:55:35 +02:00
1 parent 379eb746fe
commit ece9dc8f6f
20 files changed
+277 -24

No files matched your search

+5
View File
@@ -22,6 +22,11 @@ ACPTR:
rts
!:
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_acptr // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC
#if CONFIG_IEC_JIFFYDOS
jmp iec_rx_dispatch
+5
View File
@@ -35,6 +35,11 @@ ciout_store_in_buffer:
ciout_send_byte:
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_ciout // branch if device is handeld by internal DOS
#endif
clc // send without EOI
#if CONFIG_IEC_JIFFYDOS
jsr iec_tx_dispatch
+7
View File
@@ -20,6 +20,13 @@ iec_cmd_close:
!:
ora #$E0
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_second // branch if device is handeld by internal DOS
#endif
jmp common_open_close_unlsn_second
+7
View File
@@ -20,6 +20,13 @@ iec_cmd_open: // similar to TKSA, but without turnaround
!:
ora #$F0
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_second // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC_BURST_CIA1 || CONFIG_IEC_BURST_CIA2 || CONFIG_IEC_BURST_MEGA_65
pha
jsr burst_advertise
+12 -1
View File
@@ -16,11 +16,22 @@
LISTEN:
#if CONFIG_IEC
#if CONFIG_IEC || ROM_LAYOUT_M65
// According to serial-bus.pdf (page 15) this routine flushes the IEC out buffer
jsr iec_tx_flush
#endif
#if ROM_LAYOUT_M65
jsr m65dos_detect
bcc_16 m65dos_listen // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC
// Check whether device number is correct
jsr iec_check_devnum_oc
bcc !+
+10 -2
View File
@@ -13,8 +13,18 @@
//
// XXX cleanup: iec_cmd_open and iec_cmd_close should just do ORA and jump directly here
SECOND:
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_second // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC
// Due to OPEN/CLOSE/TKSA/SECOND command encoding, allowed channels are 0-15; it is the caller
@@ -22,8 +32,6 @@ SECOND:
// - https://www.lemon64.com/forum/viewtopic.php?t=57694&sid=531ba3592bcffadef2ac8b9162f2e529
// - https://www.pagetable.com/?p=1031 (Kernal API description)
// XXX consider checking whether value is in range (contrary to original ROM implementation)
jmp common_open_close_unlsn_second
#else
+12 -1
View File
@@ -16,11 +16,22 @@
TALK:
#if CONFIG_IEC
#if CONFIG_IEC || ROM_LAYOUT_M65
// According to serial-bus.pdf (page 15) this routine flushes the IEC out buffer
jsr iec_tx_flush
#endif
#if ROM_LAYOUT_M65
jsr m65dos_detect
bcc_16 m65dos_talk // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC
// Check whether device number is correct
jsr iec_check_devnum_oc
bcc !+
+7
View File
@@ -15,6 +15,13 @@
TKSA:
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_tksa // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC
// Due to OPEN/CLOSE/TKSA/SECOND command encoding, allowed channels are 0-15; it is the caller
+12 -1
View File
@@ -16,11 +16,22 @@
UNLSN:
#if CONFIG_IEC
#if CONFIG_IEC || ROM_LAYOUT_M65
// According to serial-bus.pdf (page 15) this routine flushes the IEC out buffer
jsr iec_tx_flush
#endif
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_unlsn // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC
#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS
lda #$FF // do not use JiffyDOS / DolphinDOS anymore, trigger JiffyDOS detection
+12 -1
View File
@@ -16,11 +16,22 @@
UNTLK:
#if CONFIG_IEC
#if CONFIG_IEC || ROM_LAYOUT_M65
// According to serial-bus.pdf (page 15) this routine flushes the IEC out buffer
jsr iec_tx_flush
#endif
#if ROM_LAYOUT_M65
jsr m65dos_check
bcc_16 m65dos_untlk // branch if device is handeld by internal DOS
#endif
#if CONFIG_IEC
#if CONFIG_IEC_JIFFYDOS || CONFIG_IEC_DOLPHINDOS
lda #$FF // do not use JiffyDOS / DolphinDOS anymore, trigger JiffyDOS detection