initial support for Mega65 extra ROM
This commit is contained in:
1 parent
7539c6b072
commit
4d56864327
333 files changed
+1747
-289
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD
|
||||
|
||||
//
|
||||
// LOAD routine hook for fast loading via UltiDOS
|
||||
@@ -129,3 +130,6 @@ u64_load_check_status_ok:
|
||||
jmp !-
|
||||
!:
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,4 +1,8 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// XXX provide documentation and implementation
|
||||
|
||||
STUB_IMPLEMENTATION()
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,4 +1,8 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// XXX provide documentation and implementation
|
||||
|
||||
STUB_IMPLEMENTATION()
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,4 +1,8 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// Screen CHROUT
|
||||
|
||||
STUB_IMPLEMENTATION()
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,4 +1,8 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// Insert line at top of screen
|
||||
|
||||
STUB_IMPLEMENTATION()
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,5 +1,8 @@
|
||||
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// IEC close
|
||||
|
||||
STUB_IMPLEMENTATION()
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,4 +1,8 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// XXX provide documentation and implementation
|
||||
|
||||
STUB_IMPLEMENTATION()
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,9 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
|
||||
cartridge_signature:
|
||||
|
||||
.byte $C3,$C2,$CD,$38,$30
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,6 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// CHR$ codes for the 16 colours
|
||||
|
||||
colour_codes:
|
||||
.byte 144,5,28,159,156,30,31,158
|
||||
.byte 129,149,150,151,152,153,154,155
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,9 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Default values for Kernal vectors - described in:
|
||||
//
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 293 (RESTOR), 304 (VECTOR)
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 237
|
||||
// - [RG64] C64 Programmers Reference Guide - page 293 (RESTOR), 304 (VECTOR)
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 237
|
||||
//
|
||||
|
||||
vector_defaults:
|
||||
@@ -24,3 +25,6 @@ vector_defaults:
|
||||
.word default_brk_handler // USRCMD
|
||||
.word LOAD // ILOAD
|
||||
.word SAVE // ISAVE
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Values for IRQ generation timer - original idea was:
|
||||
@@ -21,3 +22,6 @@ irq_timing_hi: // high bytes
|
||||
|
||||
.byte >17045 // NTSC
|
||||
.byte >16421 // PAL
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Values for IRQ generation timer - original idea was:
|
||||
@@ -21,3 +22,6 @@ irq_timing_lo: // low bytes
|
||||
|
||||
.byte <17045 // NTSC
|
||||
.byte <16421 // PAL
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Messages to be prined out by Kernal
|
||||
@@ -110,3 +111,6 @@ __msg_kernalfeatures:
|
||||
.byte $80 + $0D // end of string mark + return
|
||||
|
||||
#endif // CONFIG_SHOW_FEATURES
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
+9
-3
@@ -1,5 +1,7 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// Kernal error codes are described in 'Commodore 64 Programmer's Reference Guide', page 306
|
||||
|
||||
// Kernal error codes are described in 'Commodore 64 Programmers Reference Guide', page 306
|
||||
|
||||
kernalerror_ROUTINE_TERMINATED: // by a STOP key
|
||||
lda #K_ERR_ROUTINE_TERMINATED
|
||||
@@ -56,14 +58,15 @@ kernalerror_TOP_MEM_RS232:
|
||||
sec
|
||||
rts
|
||||
|
||||
// Kernal status codes are described in 'Commodore 64 Programmer's Reference Guide', page 292
|
||||
|
||||
// Kernal status codes are described in 'Commodore 64 Programmers Reference Guide', page 292
|
||||
|
||||
kernalstatus_reset:
|
||||
lda #$00
|
||||
sta IOSTATUS
|
||||
rts
|
||||
|
||||
// The following two statuses are currentl not implemented - and most likely not really needed
|
||||
// The following two statuses are currently not implemented - and most likely not really needed
|
||||
|
||||
// kernalstatus_TIMEOUT_WRITE:
|
||||
// lda IOSTATUS
|
||||
@@ -88,3 +91,6 @@ kernalstatus_DEVICE_NOT_FOUND:
|
||||
ora #K_STS_DEVICE_NOT_FOUND
|
||||
sta IOSTATUS
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Advertise burst IEC protocol support to the receiver
|
||||
@@ -31,3 +32,6 @@ burst_advertise_done:
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Advertise burst IEC protocol support to the receiver
|
||||
@@ -55,3 +56,6 @@ burst_advertise_done:
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Advertise burst IEC protocol support to the receiver
|
||||
@@ -26,3 +27,6 @@ burst_advertise_done:
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Helper routine for JiffyDOS detection
|
||||
@@ -60,3 +61,6 @@ dolphindos_detect_success:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_DOLPHINDOS
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// DolphinDOS protocol support for IEC - optimized load loop
|
||||
@@ -117,3 +118,6 @@ dolphindos_load_end:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_DOLPHINDOS and not CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Helper table for encoding lower nibble for JiffyDOS,
|
||||
@@ -37,3 +38,6 @@ jiffydos_bittable:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_JIFFYDOS
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Helper routine for JiffyDOS detection
|
||||
@@ -49,3 +50,6 @@ jiffydos_detect_end:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_JIFFYDOS
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// JiffyDOS protocol support for IEC - optimized load loop
|
||||
@@ -168,3 +169,6 @@ jiffydos_load_end:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_JIFFYDOS and not CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// JiffyDOS transfer preparation routine
|
||||
@@ -27,3 +28,6 @@ jiffydos_prepare:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_JIFFYDOS
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// JiffyDOS protocol support for IEC - byte reception
|
||||
@@ -108,3 +109,6 @@ jiffydos_rx_byte_end:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_JIFFYDOS
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// JiffyDOS protocol support for IEC - byte transfer
|
||||
@@ -101,3 +102,6 @@ jiffydos_tx_byte_wait_eoi:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_JIFFYDOS
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// JiffyDOS helper routine to wait for appropriate moment,
|
||||
@@ -32,3 +33,6 @@ jiffydos_wait_line_done:
|
||||
|
||||
|
||||
#endif // CONFIG_IEC_JIFFYDOS
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,5 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// c64 prg p263
|
||||
|
||||
cartridge_check:
|
||||
@@ -11,3 +13,6 @@ cartridge_check_l1:
|
||||
// FALLTROUGH
|
||||
no_cartridge:
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,10 +1,11 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// This is a part CINT which initializes screen and keyboard
|
||||
//
|
||||
// For more details see:
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 280
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 242
|
||||
// - [RG64] C64 Programmers Reference Guide - page 280
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 242
|
||||
|
||||
cint_screen_keyboard:
|
||||
|
||||
@@ -15,7 +16,7 @@ cint_screen_keyboard:
|
||||
lda #>scnkey_set_keytab
|
||||
sta KEYLOG+1
|
||||
|
||||
// Initialise cursor blink flags (Compute's Mapping the 64 p215)
|
||||
// Initialise cursor blink flags (Computes Mapping the 64 p215)
|
||||
|
||||
lda #$01
|
||||
sta BLNCT
|
||||
@@ -30,7 +31,7 @@ cint_screen_keyboard:
|
||||
|
||||
#endif
|
||||
|
||||
// Set keyboard decode vector (Compute's Mapping the 64 p215)
|
||||
// Set keyboard decode vector (Computes Mapping the 64 p215)
|
||||
|
||||
#if CONFIG_LEGACY_SCNKEY
|
||||
|
||||
@@ -42,10 +43,10 @@ cint_screen_keyboard:
|
||||
bpl !-
|
||||
sta BufferQuantity
|
||||
|
||||
// Set key repeat delay (Compute's Mapping the 64 p215)
|
||||
// Set key repeat delay (Computes Mapping the 64 p215)
|
||||
// Making some numbers up here: Repeat every ~1/10th sec
|
||||
// But require key to be held for ~1/3sec before
|
||||
// repeating (Compute's Mapping the 64 p58)
|
||||
// repeating (Computes Mapping the 64 p58)
|
||||
|
||||
// Not needed for default keyboard scanning code
|
||||
|
||||
@@ -54,11 +55,11 @@ cint_screen_keyboard:
|
||||
|
||||
#endif
|
||||
|
||||
// Set current colour for text (Compute's Mapping the 64 p215)
|
||||
// Set current colour for text (Computes Mapping the 64 p215)
|
||||
ldx #$01 // default is light blue ($0E), but we use a different one
|
||||
stx COLOR
|
||||
|
||||
// Set maximum keyboard buffer size (Compute's Mapping the 64 p215)
|
||||
// Set maximum keyboard buffer size (Computes Mapping the 64 p215)
|
||||
ldx #10
|
||||
stx XMAX
|
||||
|
||||
@@ -66,6 +67,9 @@ cint_screen_keyboard:
|
||||
ldx #$00
|
||||
stx MODE
|
||||
|
||||
// Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215)
|
||||
// Fallthrough/jump to screen clear routine (Computes Mapping the 64 p215)
|
||||
|
||||
jmp clear_screen
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,9 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Part of the official Kernal routine, described in:
|
||||
//
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 280
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 242
|
||||
// - [RG64] C64 Programmers Reference Guide - page 280
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 242
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
//
|
||||
@@ -20,3 +21,6 @@ cint_legacy: // $E518
|
||||
// Game 'Operacja Proboszcz' is one example.
|
||||
|
||||
jmp cint_screen_keyboard // XXX try to fit the code here
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,8 +1,9 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Well-known Kernal routine, described in:
|
||||
//
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 215
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 215
|
||||
//
|
||||
|
||||
|
||||
@@ -20,7 +21,7 @@ setup_vicii:
|
||||
|
||||
#if !CONFIG_MB_MEGA_65 && !CONFIG_MB_ULTIMATE_64
|
||||
|
||||
// Disable C128 extra keys - just to be sure they won't interfere with anything
|
||||
// Disable C128 extra keys - just to be sure they will not interfere with anything
|
||||
|
||||
stx VIC_XSCAN
|
||||
|
||||
@@ -64,3 +65,6 @@ setup_vicii:
|
||||
// Setup default I/O devices
|
||||
|
||||
jmp clrchn_reset
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,5 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// Resources describing the C64 reset sequence:
|
||||
// https://www.c64-wiki.com/wiki/Reset_(Process)
|
||||
|
||||
@@ -48,3 +50,6 @@ hw_entry_reset:
|
||||
|
||||
// c64 prg p269
|
||||
jmp (IBASIC_COLD_START)
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,18 +1,19 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Official Kernal routine, described in:
|
||||
//
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 291
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 237
|
||||
// - [RG64] C64 Programmers Reference Guide - page 291
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 237
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
//
|
||||
|
||||
RAMTAS:
|
||||
|
||||
// C64 Programmer's Reference guide p291:
|
||||
// C64 Programmers Reference guide p291:
|
||||
// Clear $0000-$0101, $0200-$03ff
|
||||
// PGS: $0000, $0001 are CPU IO ports, so shouldn't get written to
|
||||
// PGS: $0000, $0001 are CPU IO ports, so should not get written to
|
||||
|
||||
// How many ways are there to efficiently erase these two pages
|
||||
// of RAM? We would like to avoid any unnecessary byte similarity
|
||||
@@ -26,7 +27,7 @@ RAMTAS:
|
||||
!:
|
||||
sta $0300,Y
|
||||
sta $0200,Y
|
||||
sta $0002,Y // that's why we don't use .X for index, we do not want zeropage addressing here!
|
||||
sta $0002,Y // that is why we do not use .X for index, we do not want zeropage addressing here!
|
||||
iny
|
||||
bne !-
|
||||
|
||||
@@ -81,3 +82,6 @@ ramtas_32k:
|
||||
|
||||
ldy #$80
|
||||
bne !- // branch always
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 238
|
||||
// - [RG64] C64 Programmers Reference Guide - page 285
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 238
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
//
|
||||
@@ -142,3 +143,6 @@ IOINIT:
|
||||
rts
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 280
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 242
|
||||
// - [RG64] C64 Programmers Reference Guide - page 280
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 242
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
//
|
||||
@@ -12,3 +13,6 @@ CINT:
|
||||
|
||||
jsr cint_legacy
|
||||
jmp setup_pal_ntsc
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,4 +1,9 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// $FFFC - CPU Reset Vector
|
||||
// Uncontrovertial, as it is a CPU requirement, and nothing else.
|
||||
|
||||
.word hw_entry_reset
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,5 +1,6 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// Detect video system (PAL/NTSC), use Graham's method, as it's short and reliable
|
||||
// Detect video system (PAL/NTSC), use method by Graham, as it is short and reliable
|
||||
// see here: https://codebase64.org/doku.php?id=base:detect_pal_ntsc
|
||||
|
||||
|
||||
@@ -59,3 +60,6 @@ setup_irq_timer: // entry point needed by UP9600 and CIA1 burst mod support
|
||||
sta CIA1_TIMAHI // $DC05
|
||||
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,5 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
|
||||
default_irq_handler:
|
||||
|
||||
@@ -42,3 +44,6 @@ default_irq_handler_end_tape:
|
||||
|
||||
// Acknowledge CIA interrupt and return
|
||||
jmp clear_cia1_interrupt_flag_and_return_from_interrupt
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,5 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// https://csdb.dk/forums/index.php?roomid=11&topicid=5776
|
||||
// Clear the CIA1 interrupt flag, and then fall through to
|
||||
// the return from interrupt routine
|
||||
@@ -9,3 +11,6 @@ clear_cia1_interrupt_flag_and_return_from_interrupt:
|
||||
ldy CIA1_ICR
|
||||
|
||||
// FALL THROUGH to $EA81
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,8 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// The IRQ is a commonly messed with thing on the C64,
|
||||
// so we need to handle entry points that are commonly
|
||||
// relied upon, including:
|
||||
// $EA31 - Standard IRQ routine
|
||||
// $EA61 - Check keyboard, but don't update timer? https://github.com/cc65/cc65/issues/324
|
||||
// $EA61 - Check keyboard, but do not update timer? https://github.com/cc65/cc65/issues/324
|
||||
// $EA81 - https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb
|
||||
// Also the $0314 vector is widely used (e.g., https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb)
|
||||
|
||||
@@ -10,9 +12,12 @@
|
||||
return_from_interrupt:
|
||||
|
||||
// Restore registers and return
|
||||
// Sequence according to Compute's Mapping the 64 p73
|
||||
// Sequence according to Computes Mapping the 64 p73
|
||||
|
||||
ply_trash_a
|
||||
plx_trash_a
|
||||
pla
|
||||
rti
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,10 +1,11 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
default_nmi_handler:
|
||||
|
||||
// Implemented according to Compute's Mapping the Commodore 64, page 74
|
||||
// Implemented according to Computes Mapping the Commodore 64, page 74
|
||||
// and to https://www.c64-wiki.com/wiki/Interrupt
|
||||
|
||||
// Save registers, sequence according to Compute's Mapping the Commodore 64, page 73
|
||||
// Save registers, sequence according to Computes Mapping the Commodore 64, page 73
|
||||
pha
|
||||
phx_trash_a
|
||||
phy_trash_a
|
||||
@@ -25,8 +26,11 @@ default_nmi_handler:
|
||||
bcs !+
|
||||
jmp return_from_interrupt // no STOP pressed
|
||||
!:
|
||||
// STOP + RESTORE - clean the address of the BRK instruction (it's not BRK) first
|
||||
// STOP + RESTORE - clean the address of the BRK instruction (it is not BRK) first
|
||||
lda #$00
|
||||
sta CMP0+0
|
||||
sta CMP0+1
|
||||
jmp (CBINV)
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,9 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
default_brk_handler:
|
||||
|
||||
// Implemented according to Compute's Mapping the Commodore 64, pages 73-74
|
||||
// Implemented according to Computes Mapping the Commodore 64, pages 73-74
|
||||
|
||||
sei // disable IRQs, to be sure they won't interfere
|
||||
sei // disable IRQs, to be sure they wont interfere
|
||||
|
||||
ldx #$00
|
||||
sta VIC_SCROLX // turn the display off - we want as little screen artifacts as possible
|
||||
@@ -13,8 +14,8 @@ default_brk_handler:
|
||||
jsr JRESTOR
|
||||
jsr JIOINIT
|
||||
|
||||
// Original routine calls just a part of CINT - but I'm not sure which one. Most likely it
|
||||
// skips the PAL/NTSC check by calling $E518. I suspect bug in the original ROM, let's
|
||||
// Original routine calls just a part of CINT - but I am not sure which one. Most likely it
|
||||
// skips the PAL/NTSC check by calling $E518. I suspect bug in the original ROM, lets
|
||||
// call the whole CINT, just to be sure everything is initialized.
|
||||
|
||||
jsr CINT
|
||||
@@ -22,3 +23,6 @@ default_brk_handler:
|
||||
cli
|
||||
|
||||
jmp (IBASIC_WARM_START)
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,4 +1,9 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// $FFFA - CPU NMI Hanlder
|
||||
// Uncontrovertial as this is also a CPU requirement.
|
||||
|
||||
.word hw_entry_nmi
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,5 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// $FFFE - CPU IRQ Vector.
|
||||
// This is non-controvertial, as it is a 6502 CPU requirement, and we just have to point
|
||||
// it to whatever IRQ routine we make.
|
||||
|
||||
.word hw_entry_irq
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,5 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
|
||||
hw_entry_irq:
|
||||
|
||||
@@ -5,11 +7,11 @@ hw_entry_irq:
|
||||
// so we need to handle entry points that are commonly
|
||||
// relied upon, including:
|
||||
// $EA31 - Standard IRQ routine
|
||||
// $EA61 - Check keyboard, but don't update timer? https://github.com/cc65/cc65/issues/324
|
||||
// $EA61 - Check keyboard, but do not update timer? https://github.com/cc65/cc65/issues/324
|
||||
// $EA81 - https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb
|
||||
// Also the $0314 vector is widely used (e.g., https://www.lemon64.com/forum/viewtopic.php?t=2112&sid=6ea01982b26da69783120a7923ca46fb)
|
||||
|
||||
// Save registers, sequence according to Compute's Mapping the Commodore 64, page 73
|
||||
// Save registers, sequence according to Computes Mapping the Commodore 64, page 73
|
||||
pha
|
||||
phx_trash_a
|
||||
phy_trash_a
|
||||
@@ -46,3 +48,6 @@ irq_handler_brk:
|
||||
|
||||
// Interrupt caused by BRK
|
||||
jmp (CBINV)
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,7 +1,9 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
|
||||
hw_entry_nmi:
|
||||
|
||||
sei // don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt
|
||||
sei // do not allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt
|
||||
|
||||
#if CONFIG_CPU_MOS_6502 && CONFIG_BCD_SAFE_INTERRUPTS
|
||||
cld // clear decimal flag to allow using it without disabling interrupts
|
||||
@@ -18,3 +20,6 @@ hw_entry_nmi:
|
||||
// Vector not initialized - call default interrupt routine
|
||||
pla
|
||||
jmp default_nmi_handler
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Common part of CHKIN and CKOUT
|
||||
@@ -16,3 +17,6 @@ chkinout_file_not_open:
|
||||
ply_trash_a
|
||||
pla
|
||||
jmp kernalerror_FILE_NOT_OPEN
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 281
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 230
|
||||
// - [RG64] C64 Programmers Reference Guide - page 281
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 230
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): .Y
|
||||
//
|
||||
@@ -16,7 +17,7 @@ clall_real:
|
||||
|
||||
// Original routine probably just sets LDTND to 0, but this is not really safe,
|
||||
// so we actually close all the channels; at least IDE64 does the same for
|
||||
// it's channels, see CLALL description in the IDE64 User's Guide
|
||||
// its channels, see CLALL description in the IDE64 Users Guide
|
||||
!:
|
||||
ldy LDTND
|
||||
beq !+
|
||||
@@ -34,3 +35,5 @@ clall_real:
|
||||
// Not sure whether original Kernal does so, but it seems sane to also clear possible errors
|
||||
jmp kernalstatus_reset
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 283
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 227/228
|
||||
// - [RG64] C64 Programmers Reference Guide - page 283
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 227/228
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): for RS-232: .X, .Y
|
||||
//
|
||||
@@ -11,3 +12,6 @@
|
||||
|
||||
GETIN:
|
||||
jmp getin_real
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 277/278
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 228
|
||||
// - [RG64] C64 Programmers Reference Guide - page 277/278
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 228
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): .Y
|
||||
//
|
||||
@@ -46,3 +47,6 @@ chrin_getin: // jump entry for GETIN
|
||||
// Not a supported device
|
||||
|
||||
jmp lvs_device_not_found_error
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 278/279
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 228
|
||||
// - [RG64] C64 Programmers Reference Guide - page 278/279
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 228
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): .Y
|
||||
// Additionally we have to preserve .X for out CHRIN and implementation
|
||||
@@ -15,7 +16,7 @@ CHROUT:
|
||||
|
||||
// Save X and Y values
|
||||
// (Confirmed by writing a test program that X and Y
|
||||
// don't get modified, in agreement with C64 PRG's
|
||||
// do not get modified, in agreement with C64 PRG
|
||||
// description of CHROUT)
|
||||
|
||||
phx_trash_a
|
||||
@@ -74,3 +75,6 @@ chrout_done_success:
|
||||
lda SCHAR
|
||||
clc // indicate success
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,9 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Official Kernal routines, described in:
|
||||
//
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 275
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 229
|
||||
// - [RG64] C64 Programmers Reference Guide - page 275
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 229
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213)
|
||||
//
|
||||
@@ -67,3 +68,6 @@ chkin_file_not_input:
|
||||
ply_trash_a
|
||||
pla
|
||||
jmp kernalerror_FILE_NOT_INPUT
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,9 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Official Kernal routines, described in:
|
||||
//
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 276
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 229
|
||||
// - [RG64] C64 Programmers Reference Guide - page 276
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 229
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): .Y, .A (see [CM64], page 213)
|
||||
//
|
||||
@@ -62,15 +63,4 @@ ckout_file_not_output:
|
||||
jmp kernalerror_FILE_NOT_OUTPUT
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 281/282
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 229/230
|
||||
// - [RG64] C64 Programmers Reference Guide - page 281/282
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 229/230
|
||||
// - https://www.pagetable.com/?p=1031, https://github.com/mist64/cbmbus_doc (IEC command)
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
@@ -51,7 +52,10 @@ close_remove_from_table:
|
||||
// Decrement the list size variable
|
||||
dec LDTND
|
||||
|
||||
clc // report success - not sure if original CLOSE does this, but it's nevertheless a good practice
|
||||
clc // report success - not sure if original CLOSE does this, but it is nevertheless a good practice
|
||||
|
||||
close_end:
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,6 +1,11 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
// Our implementation is longer than the original one,
|
||||
// placing it here would cause a collision with CLRCHN
|
||||
|
||||
|
||||
CLALL:
|
||||
jmp clall_real
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 282
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 230
|
||||
// - [RG64] C64 Programmers Reference Guide - page 282
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 230
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): .Y
|
||||
//
|
||||
@@ -30,3 +31,6 @@ clrchn_reset: // entry needed by setup_vicii
|
||||
sta DFLTO
|
||||
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 289
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 230/231
|
||||
// - [RG64] C64 Programmers Reference Guide - page 289
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 230/231
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
//
|
||||
@@ -42,7 +43,7 @@ open_has_space:
|
||||
// Update the tables
|
||||
|
||||
// LAT / FAT / SAT support implemented according to
|
||||
// 'Compute's Mapping the Commodore 64', page 52
|
||||
// 'Computes Mapping the Commodore 64', page 52
|
||||
|
||||
lda LA
|
||||
sta LAT, y
|
||||
@@ -76,3 +77,6 @@ open_done_success:
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// LOAD preparation routine
|
||||
@@ -21,3 +22,6 @@ LOAD_PREP:
|
||||
sty MEMUSS+1
|
||||
stx MEMUSS+0
|
||||
jmp (ILOAD)
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,8 +1,10 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// Official Kernal routine, described in:
|
||||
//
|
||||
// - [RG64] C64 Programmer's Reference Guide - page 286
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 231
|
||||
// - [RG64] C64 Programmers Reference Guide - page 286
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 231
|
||||
// - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
@@ -55,3 +57,6 @@ LOAD:
|
||||
#endif
|
||||
|
||||
jmp lvs_illegal_device_number
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,3 +1,4 @@
|
||||
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
|
||||
|
||||
//
|
||||
// SAVE preparation routine
|
||||
@@ -27,3 +28,6 @@ SAVE_PREP:
|
||||
sta STAL+0
|
||||
|
||||
jmp (ISAVE)
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -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 293/294
|
||||
// - [CM64] Compute's Mapping the Commodore 64 - page 231/232
|
||||
// - [RG64] C64 Programmers Reference Guide - page 293/294
|
||||
// - [CM64] Computes Mapping the Commodore 64 - page 231/232
|
||||
// - IEC reference at http://www.zimmers.net/anonftp/pub/cbm/programming/serial-bus.pdf
|
||||
//
|
||||
// CPU registers that has to be preserved (see [RG64]): none
|
||||
@@ -28,3 +29,6 @@ SAVE:
|
||||
#endif
|
||||
|
||||
jmp lvs_illegal_device_number
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
Loaded 100 of 333 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user