diff --git a/Makefile b/Makefile index fc5883ec..65a602ff 100644 --- a/Makefile +++ b/Makefile @@ -203,6 +203,7 @@ SEG_LIST_M65 = $(DIR_M65)/basic.seg_0 \ $(DIR_M65)/basic.seg_1 \ $(DIR_M65)/dos.seg_1 \ $(DIR_M65)/kernal.seg_0 \ + $(DIR_M65)/kernal.seg_C \ $(DIR_M65)/kernal.seg_1 SEG_LIST_X16 = $(DIR_X16)/basic.seg_0 \ @@ -356,6 +357,8 @@ $(DIR_M65)/basic.seg_1 $(DIR_M65)/BASIC_1_combined.vs $(DIR_M65)/BASIC_1_combi $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_M65) $(GEN_STR_M65) $(DIR_M65)/KERNAL_0_combined.sym $(DIR_M65)/BASIC_0_combined.sym $(DIR_M65)/dos.seg_1 $(DIR_M65)/DOS_1_combined.vs $(DIR_M65)/DOS_1_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_DOS_M65) $(CFG_M65) +$(DIR_M65)/kernal.seg_C $(DIR_M65)/KERNAL_C_combined.vs $(DIR_M65)/KERNAL_C_combined.sym: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65) $(GEN_STR_M65) $(DIR_M65)/KERNAL_0_combined.sym $(DIR_M65)/kernal.seg_1 $(DIR_M65)/KERNAL_1_combined.vs $(DIR_M65)/KERNAL_1_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65) $(GEN_STR_M65) $(DIR_M65)/KERNAL_0_combined.sym @@ -513,6 +516,11 @@ $(DIR_M65)/dos.seg_1 $(DIR_M65)/DOS_1_combined.vs $(DIR_M65)/DOS_1_combined.sym: @rm -f $@* $(DIR_M65)/dos.seg_1 $(DIR_M65)/DOS_1* @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s DOS_1 -i DOS_1-mega65 -o dos.seg_1 -d $(DIR_M65) -l 4000 -h 7fff $(CFG_M65) $(SRCDIR_DOS_M65) +$(DIR_M65)/kernal.seg_C $(DIR_M65)/KERNAL_C_combined.vs $(DIR_M65)/KERNAL_C_combined.sym: + @mkdir -p $(DIR_M65) + @rm -f $@* $(DIR_M65)/kernal.seg_C $(DIR_M65)/KERNAL_C* + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_C -i KERNAL_C-mega65 -o kernal.seg_C -d $(DIR_M65) -l c000 -h cfff $(CFG_M65) $(GEN_STR_M65) $(SRCDIR_KERNAL) $(GEN_KERNAL) + $(DIR_M65)/kernal.seg_1 $(DIR_M65)/KERNAL_1_combined.vs $(DIR_M65)/KERNAL_1_combined.sym: @mkdir -p $(DIR_M65) @rm -f $@* $(DIR_M65)/kernal.seg_1 $(DIR_M65)/KERNAL_1* @@ -710,7 +718,7 @@ $(TARGET_M65_x_ORF) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_64_KB bui @cat $(DIR_M65)/basic.seg_1 >> $(TARGET_M65_x_ORF) @cat build/chargen_openroms.patched >> $(TARGET_M65_x_ORF) @cat $(DIR_M65)/basic.seg_0 >> $(TARGET_M65_x_ORF) - @cat build/padding_4_KB >> $(TARGET_M65_x_ORF) + @cat $(DIR_M65)/kernal.seg_C >> $(TARGET_M65_x_ORF) @cat $(TARGET_CHR_ORF) >> $(TARGET_M65_x_ORF) @cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x_ORF) @cat build/padding_64_KB >> $(TARGET_M65_x_ORF) @@ -725,7 +733,7 @@ $(TARGET_M65_x_ORF) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/padding_64_KB bui @cat $(DIR_M65)/basic.seg_1 >> $(TARGET_M65_x_PXL) @cat build/chargen_pxlfont.patched >> $(TARGET_M65_x_PXL) @cat $(DIR_M65)/basic.seg_0 >> $(TARGET_M65_x_PXL) - @cat build/padding_4_KB >> $(TARGET_M65_x_PXL) + @cat $(DIR_M65)/kernal.seg_C >> $(TARGET_M65_x_PXL) @cat $(TARGET_CHR_PXL) >> $(TARGET_M65_x_PXL) @cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x_PXL) @cat build/padding_64_KB >> $(TARGET_M65_x_PXL) diff --git a/doc/Development.md b/doc/Development.md index 2f76bdfd..85d534d9 100644 --- a/doc/Development.md +++ b/doc/Development.md @@ -95,7 +95,7 @@ Currently there are 4 ROM layouts defined: - `STD` - with 2 code segments: `BASIC` (`$A000-$E4D2`, where `$C000-$DFFF` is a skip-gap for RAM and I/O area) and `KERNAL` (`$E4D3 - $FFFF`) - `CRT` - where `BASIC` becames `BASIC_0` and `KERNAL` becames `KERNAL_0`, with additional `BASIC`/`KERNAL` segments are placed on the required cartridge image -- `M65` - where `BASIC` becames `BASIC_0` and `KERNAL` becames `KERNAL_0`, additional segments might be added to the build system in the future; at the moment of writing this document additional 12KB of ROM is defined as `BASIC_1` segment and additional 8KB of ROM is defined as `KERNAL_1` segment +- `M65` - where `BASIC` becames `BASIC_0` and `KERNAL` becames `KERNAL_0`, additional segments might be added to the build system in the future; at the moment of writing this document additional 12KB of ROM is defined as `BASIC_1` segment, additional 4KB of ROM is defined as `KERNAL_C` segment, and additional 8KB of ROM is defined as `KERNAL_1` segment - `X16` - memory layout for the Commander X16 machine Expect at least one more, `U64`, if the planned additional ROM banks support for Ultimate 64 gets implemented. To check for current ROM layout or code segment use KickAssembler preprocessor defines, like `ROM_LAYOUT_STD`, `SEGMENT_M65_BASIC_0`, `SEGMENT_X16_KERNAL_1`. diff --git a/src/kernal/board_m65/C000.interop b/src/kernal/board_m65/C000.interop new file mode 100644 index 00000000..7acd2a6f --- /dev/null +++ b/src/kernal/board_m65/C000.interop @@ -0,0 +1 @@ +This particular address is not for interoperability - we had to choose some fixed location for the extended ROM jumptable, beginning of the mapped memory block is just sane. diff --git a/src/kernal/board_m65/C000.mega65_vectable_kernal_C.s b/src/kernal/board_m65/C000.mega65_vectable_kernal_C.s new file mode 100644 index 00000000..d085403f --- /dev/null +++ b/src/kernal/board_m65/C000.mega65_vectable_kernal_C.s @@ -0,0 +1,21 @@ +;; #LAYOUT# M65 KERNAL_0 #TAKE-FLOAT +;; #LAYOUT# M65 KERNAL_C #TAKE +;; #LAYOUT# * * #IGNORE + +; +; Definitions for communication with MEGA65 segment KERNAL_C from KERNAL_0 +; + + +!ifdef SEGMENT_KERNAL_0 { + + ; Label definitions + + !addr VKC__m65_scnkey = $C000 + 2 * 0 + +} else { + + ; Vector table (Open ROMs private!) + + !word $0000 +}