initial support for Mega65 extra ROM

This commit is contained in:
FeralChild64 committed 2020-01-10 22:03:10 +01:00
1 parent 7539c6b072
commit 4d56864327
333 files changed
+1747 -289

No files matched your search

+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 274
// - [CM64] Compute's Mapping the Commodore 64 - page 224/225
// - [RG64] C64 Programmers Reference Guide - page 274
// - [CM64] Computes Mapping the Commodore 64 - page 224/225
//
// CPU registers that has to be preserved (see [RG64]): .Y
//
@@ -28,3 +29,6 @@ ACPTR:
#else
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#endif
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the CHKIN routine
@@ -29,3 +30,6 @@ chkin_iec:
jmp chkin_set_device
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the CHRIN routine
@@ -8,3 +9,6 @@ chrin_iec:
// XXX is this really all?
jmp JACPTR
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the CHROUT routine
@@ -10,3 +11,6 @@ chrout_iec:
jsr JCIOUT
bcc_far chrout_done_success
jmp chrout_done_fail
#endif // ROM layout
+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 279/280
// - [CM64] Compute's Mapping the Commodore 64 - page 224
// - [RG64] C64 Programmers Reference Guide - page 279/280
// - [CM64] Computes Mapping the Commodore 64 - page 224
//
// CPU registers that has to be preserved (see [RG64]): .X, .Y
//
@@ -47,3 +48,6 @@ ciout_send_byte:
rts
#endif
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the CKOUT routine
@@ -29,3 +30,6 @@ ckout_iec:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the CLOSE routine
@@ -33,3 +34,6 @@ close_iec_end:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the CLRCHN routine
@@ -28,3 +29,6 @@ clrchn_iec:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Checks whether device number (in .A) is a correct IEC device number
@@ -31,3 +32,6 @@ iec_check_devnum_failed:
rts
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Common part of CLOSE and LOAD/SAVE routines for IEC
@@ -29,3 +30,6 @@ iec_close_load:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Kernal internal IEC routine
@@ -21,3 +22,6 @@ iec_cmd_close:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Kernal internal IEC routine
@@ -66,3 +67,6 @@ iec_check_channel_openclose:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Helper IEC routines to pull/release certain lines
@@ -83,3 +84,6 @@ iec_pull_release_end:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Helper routines to return with error/success
@@ -39,3 +40,6 @@ iec_return_DEVICE_NOT_FOUND:
#endif // CONFIG_IEC
#endif // ROM layout
+5
View File
@@ -1,3 +1,5 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
// Receive a byte from the IEC bus.
// Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc,
// http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf (page 11)
@@ -155,3 +157,6 @@ iec_rx_end:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Helper routine to check for EOI while receiving byte from IEC
@@ -33,3 +34,6 @@ iec_rx_check_eoi_confirm:
iec_rx_check_eoi_done:
rts
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Sends file (stream) name to IEC device
@@ -42,3 +43,6 @@ iec_send_file_name_done:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
#if CONFIG_IEC
@@ -12,3 +13,6 @@ iec_set_idle:
#endif // CONFIG_IEC
#endif // ROM layout
@@ -1,3 +1,5 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
// According to http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
// pages 7--8.
// See also https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc
@@ -39,3 +41,6 @@ iec_turnaround_to_listen:
#endif // CONFIG_IEC
#endif // ROM layout
+5
View File
@@ -1,3 +1,5 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
// According to http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
// pages 7--8.
// See also https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc
@@ -31,3 +33,6 @@ iec_turnaround_to_talk:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
// Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc
@@ -161,3 +162,6 @@ iec_tx_common_finalize:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
// Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc
@@ -41,3 +42,6 @@ iec_tx_command:
#endif // CONFIG_IEC
#endif // ROM layout
+5
View File
@@ -1,3 +1,5 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
// Routine to finalize some IEC commands - which do not end in turnaround and are not followed by others
// Implemented based on https://www.pagetable.com/?p=1135, https://github.com/mist64/cbmbus_doc
@@ -22,3 +24,6 @@ iec_tx_command_finalize:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
// Flush the IEC output buffer (if not empty) - send byte with EOI
//
@@ -20,3 +21,6 @@ iec_tx_flush:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Common EAL update routine
@@ -19,3 +20,6 @@ iec_update_EAL_by_Y: // note: Carry has to be set by caller!
#endif
#endif // ROM layout
+5 -1
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Wait 1 ms (1000 usec)
//
// On NTSC this means 1023 cycles (slightly less on PAL, but we have to be sure).
// We can't count on badlines, as the screen might be disabled.
// We cant count on badlines, as the screen might be disabled.
// Delay here is implemented using VIC-II raster register. Since one raster is
// 63 cycles, we need at least 17 full rasters to be 100% sure we wait enough
@@ -31,3 +32,6 @@ wait_x_bars: // additional entry point for delayy in screen and tape support
iec_wait_rts: // dummy RTS, for very short waits
rts
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
#if CONFIG_IEC
@@ -26,3 +27,6 @@ iec_wait20us:
// 21 cycles
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Note: damages .X
@@ -31,3 +32,6 @@ iec_wait60us:
#endif // CONFIG_IEC
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
#if CONFIG_IEC
@@ -11,3 +12,6 @@ iec_wait_for_clk_release:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
#if CONFIG_IEC
@@ -13,3 +14,6 @@ iec_wait_for_data_pull:
#endif // CONFIG_IEC
#endif // ROM layout
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
#if CONFIG_IEC
@@ -12,3 +13,6 @@ iec_wait_for_data_release:
rts
#endif // CONFIG_IEC
#endif // ROM layout
+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 285
// - [CM64] Compute's Mapping the Commodore 64 - page 223
// - [RG64] C64 Programmers Reference Guide - page 285
// - [CM64] Computes Mapping the Commodore 64 - page 223
// - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc
// - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
//
@@ -33,3 +34,6 @@ LISTEN:
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#endif
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the LOAD routine
@@ -192,3 +193,6 @@ load_iec_get_addr_byte:
#endif // CONFIG_IEC
#endif // ROM layout
+4
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the OPEN routine
@@ -38,3 +39,6 @@ open_iec_done:
#endif // CONFIG_IEC
#endif // ROM layout
+5 -1
View File
@@ -1,3 +1,4 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// IEC part of the SAVE routine
@@ -124,4 +125,7 @@ iec_save_loop_end:
rts
#endif // CONFIG_IEC
#endif // CONFIG_IEC
#endif // ROM layout
+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 296
// - [CM64] Compute's Mapping the Commodore 64 - page 223/224
// - [RG64] C64 Programmers Reference Guide - page 296
// - [CM64] Computes Mapping the Commodore 64 - page 223/224
// - https://www.pagetable.com/?p=1031, , https://github.com/mist64/cbmbus_doc
//
// CPU registers that has to be preserved (see [RG64]): .X, .Y
@@ -28,3 +29,6 @@ SECOND:
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#endif
#endif // ROM layout
+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 301/302
// - [CM64] Compute's Mapping the Commodore 64 - page 223
// - [RG64] C64 Programmers Reference Guide - page 301/302
// - [CM64] Computes Mapping the Commodore 64 - page 223
// - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc
// - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
//
@@ -46,3 +47,6 @@ common_talk_listen: // common part of TALK and LISTEN
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#endif
#endif // ROM layout
+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 302
// - [CM64] Compute's Mapping the Commodore 64 - page 224
// - [RG64] C64 Programmers Reference Guide - page 302
// - [CM64] Computes Mapping the Commodore 64 - page 224
// - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc
//
// CPU registers that has to be preserved (see [RG64]): .X, .Y
@@ -28,3 +29,6 @@ TKSA:
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#endif
#endif // ROM layout
+6 -2
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 303
// - [CM64] Compute's Mapping the Commodore 64 - page 224
// - [RG64] C64 Programmers Reference Guide - page 303
// - [CM64] Computes Mapping the Commodore 64 - page 224
// - https://www.pagetable.com/?p=1031, , https://github.com/mist64/cbmbus_doc
// - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
//
@@ -35,3 +36,6 @@ UNLSN:
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#endif
#endif // ROM layout
+7 -3
View File
@@ -1,9 +1,10 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
//
// Official Kernal routine, described in:
//
// - [RG64] C64 Programmer's Reference Guide - page 304
// - [CM64] Compute's Mapping the Commodore 64 - page 224
// - [RG64] C64 Programmers Reference Guide - page 304
// - [CM64] Computes Mapping the Commodore 64 - page 224
// - https://www.pagetable.com/?p=1031, , https://github.com/mist64/cbmbus_doc
// - http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
//
@@ -33,7 +34,7 @@ common_untlk_tksa: // common part of UNTLK and TKSA
sta TBTCNT
jsr iec_tx_command
bcs !+ // branch if error
// XXX - for TKSA, is it really the right place to do a turnaround? I've got some doubts
// XXX - for TKSA, is it really the right place to do a turnaround? I have some doubts
// (it forces us to send the TKSA command 'manually' sometimes), but
// Luigi Di Fraia (https://luigidifraia.wordpress.com/2017/06/27/codebase64-on-the-kernal-behaviour/)
// claims TKSA Kernal routine actually does the turnaround
@@ -46,3 +47,6 @@ common_untlk_tksa: // common part of UNTLK and TKSA
jmp kernalerror_ILLEGAL_DEVICE_NUMBER
#endif
#endif // ROM layout