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

+5
View File
@@ -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
+13 -9
View File
@@ -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
+6 -2
View File
@@ -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
+6 -2
View File
@@ -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
+5
View File
@@ -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
+9 -5
View File
@@ -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
+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 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
+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 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
+5
View File
@@ -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
+5 -1
View File
@@ -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