diff --git a/c64/basic/,imports.s b/c64/basic/,imports.s index ebcf56c9..b45fc2ab 100644 --- a/c64/basic/,imports.s +++ b/c64/basic/,imports.s @@ -18,6 +18,11 @@ } +#if ROM_LAYOUT_M65 +.label map_end = KERNAL().map_end +.label map_NORMAL = KERNAL().map_NORMAL +#endif + #if CONFIG_PANIC_SCREEN .label panic = KERNAL().panic #endif diff --git a/c64/basic/board_m65/4000.mega65_vectable_basic_1.s b/c64/basic/board_m65/4000.mega65_vectable_basic_1.s new file mode 100644 index 00000000..18b1e0cc --- /dev/null +++ b/c64/basic/board_m65/4000.mega65_vectable_basic_1.s @@ -0,0 +1,35 @@ +// #LAYOUT# M65 BASIC_0 #TAKE-FLOAT +// #LAYOUT# M65 BASIC_1 #TAKE +// #LAYOUT# * * #IGNORE + +// +// Definitions for communication with Mega65 segment BASIC_1 from BASIC_0 +// + + +#if SEGMENT_BASIC_0 + + // Label definitions + + .label VB1__TEST = $4000 + 2 * 0 + +TEST: + + jsr map_BASIC_1 + jmp (VB1__TEST) + +#else + + // Vector table (OpenROMs private!) + + .word TEST + + +TEST: + + inc 53280 + inc 53281 + + jmp map_NORMAL + +#endif diff --git a/c64/basic/board_m65/mega65_map_helpers.s b/c64/basic/board_m65/mega65_map_helpers.s new file mode 100644 index 00000000..73e22cdb --- /dev/null +++ b/c64/basic/board_m65/mega65_map_helpers.s @@ -0,0 +1,28 @@ +// #LAYOUT# M65 BASIC_0 #TAKE +// #LAYOUT# * * #IGNORE + +// +// ROM mapping routines for Mega65 +// + +// Available memory maps: +// - NORMAL - nothing mapped in (taken from Kernal) +// - BASIC_1 - for calling KERNAL_1 segment code + + +map_BASIC_1: + + php + pha + phx + phy + phz + + lda #$00 + tay + taz + + lda #$20 + ldx #$42 // 0x4000 <- map 8KB from 0x22000 + + jmp map_end