From 20899a49d9d126ded5d566bc6aeed66be9c4ffdb Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 9 Oct 2019 20:06:53 +0200 Subject: [PATCH] simplified directory structure, updated configuration system --- CONFIG.md | 24 ++++- Makefile | 50 +++++------ c64/,,config_generic.s | 25 +++++- c64/,,config_mega65.s | 25 +++++- c64/,,config_ultimate64.s | 25 +++++- c64/aliases/,aliases_config.s | 69 ++++++++++++--- c64/aliases/,aliases_hardware.s | 7 +- c64/aliases/,aliases_ram_lowmem.s | 10 +-- c64/basic/,target_generic/,hooks_generic.s | 26 ------ c64/basic/,target_mega65/,hooks_mega65.s | 52 ----------- .../,target_ultimate64/,hooks_ultimate64.s | 26 ------ c64/basic/startup_banner.s | 88 ++++++++++++++++++- .../,aliases_ultimate64.s | 0 .../u64_load.s} | 0 c64/kernal/,target_generic/,hooks_generic.s | 6 -- c64/kernal/,target_mega65/,hooks_mega65.s | 6 -- .../,target_ultimate64/,hooks_ultimate64.s | 9 -- c64/kernal/f4a5.load.s | 3 - c64/kernal/{scnkey.s => scnkey_tww_ctr.s} | 7 ++ 19 files changed, 281 insertions(+), 177 deletions(-) delete mode 100644 c64/basic/,target_generic/,hooks_generic.s delete mode 100644 c64/basic/,target_mega65/,hooks_mega65.s delete mode 100644 c64/basic/,target_ultimate64/,hooks_ultimate64.s rename c64/kernal/{,target_ultimate64 => ,disabled}/,aliases_ultimate64.s (100%) rename c64/kernal/{,target_ultimate64/u64_load.s.disabled => ,disabled/u64_load.s} (100%) delete mode 100644 c64/kernal/,target_generic/,hooks_generic.s delete mode 100644 c64/kernal/,target_mega65/,hooks_mega65.s delete mode 100644 c64/kernal/,target_ultimate64/,hooks_ultimate64.s rename c64/kernal/{scnkey.s => scnkey_tww_ctr.s} (99%) diff --git a/CONFIG.md b/CONFIG.md index 26c426da..69dc2575 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -13,6 +13,26 @@ Note however, that features do not came for free - enabling them needs some addi Sane defaults are already present - different for each target. +## Hardware platform and variant + +### `CONFIG_PLATFORM_COMMODORE_64` + +Commodore 64 is the only hardware platform available now - and the main one, as the Open ROMs API is meant to be compatible with the Commodore 64. + +Since Open ROMs is highly modular, it should be possible to add other platforms in the future (like 8-bit Atari computers or Commander X16), if they share the following common characteristics: + +* MOS 6502 CPU or compatible +* 8KB ROM area `$A000`-`$BFFF` +* 8KB ROM area `$E000`-`$FFFF` + +### `CONFIG_VARIANT_GENERIC` + +If you don't know which variant to choose - select this one. + +### `CONFIG_VARIANT_MEGA_65`, `CONFIG_VARIANT_ULTIMATE_64` + +Select if you are using appropriate motherboard. + ## Processor instruction set ### `CONFIG_CPU_MOS_6502` @@ -44,7 +64,7 @@ Choose if your CPU supports the 16-bit Western Design Center 65816 instruction s It enables some speed/size code optimizations. Warning - this is untested! -## Memory models +## Memory model Different layouts of memory are possible - but they can be selected at compile time only. @@ -80,7 +100,7 @@ Cause the system to support SIDs in `$D4xx` and `$D5xx` ranges, respectively. Each of them needs a couple of bytes in KERNAL segment - but they can share some code, and `$D4xx` range support replaces the standard `$D400` address handling, so exact amount depends on the exact configuration. -## Miscelaneous features +## Software features ### `CONFIG_BANNER_FANCY` diff --git a/Makefile b/Makefile index bd47fec9..d73f87c5 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,17 @@ # Source files -SRCDIR_COMMON = c64/aliases -SRCDIR_BASIC_COMMON = $(SRCDIR_COMMON) c64/basic -SRCDIR_KERNAL_COMMON = $(SRCDIR_COMMON) c64/kernal c64/kernal/assets c64/kernal/jumptable c64/kernal/iec c64/kernal/interrupts c64/kernal/print c64/kernal/screen - -SRCDIR_BASIC_generic = $(SRCDIR_BASIC_COMMON) c64/basic/,target_generic -SRCDIR_BASIC_mega65 = $(SRCDIR_BASIC_COMMON) c64/basic/,target_mega65 -SRCDIR_BASIC_ultimate64 = $(SRCDIR_BASIC_COMMON) c64/basic/,target_ultimate64 - -SRCDIR_KERNAL_generic = $(SRCDIR_KERNAL_COMMON) c64/kernal/,target_generic -SRCDIR_KERNAL_mega65 = $(SRCDIR_KERNAL_COMMON) c64/kernal/,target_mega65 -SRCDIR_KERNAL_ultimate64 = $(SRCDIR_KERNAL_COMMON) c64/kernal/,target_ultimate64 +SRCDIR_COMMON = c64/aliases +SRCDIR_BASIC = $(SRCDIR_COMMON) \ + c64/basic +SRCDIR_KERNAL = $(SRCDIR_COMMON) \ + c64/kernal \ + c64/kernal/assets \ + c64/kernal/jumptable \ + c64/kernal/iec \ + c64/kernal/interrupts \ + c64/kernal/print \ + c64/kernal/screen SRC_TOOLS = $(wildcard src/tools/*.c,src/tools/*.cc) @@ -94,30 +94,30 @@ build/chargen.rom: $(TOOL_PNGPREPARE) assets/8x8font.png # Dependencies - BASIC and KERNAL build/target_generic/OUTB.BIN build/target_generic/BASIC_combined.vs: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_generic) \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \ c64/,,config_generic.s build/target_generic/KERNAL_combined.sym \ - $(foreach dir,$(SRCDIR_BASIC_generic),$(wildcard $(dir)/*.s)) + $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s)) build/target_mega65/OUTB.BIN build/target_mega65/BASIC_combined.vs: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_mega65) \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \ c64/,,config_mega65.s build/target_mega65/KERNAL_combined.sym \ - $(foreach dir,$(SRCDIR_BASIC_mega65),$(wildcard $(dir)/*.s)) + $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s)) build/target_ultimate64/OUTB.BIN build/target_ultimate64/BASIC_combined.vs: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_ultimate64) \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \ c64/,,config_ultimate64.s build/target_ultimate64/KERNAL_combined.sym \ - $(foreach dir,$(SRCDIR_BASIC_ultimate64),$(wildcard $(dir)/*.s)) + $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s)) build/target_generic/OUTK.BIN build/target_generic/KERNAL_combined.vs build/target_generic/KERNAL_combined.sym: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_generic) \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \ c64/,,config_generic.s \ - $(foreach dir,$(SRCDIR_KERNAL_generic),$(wildcard $(dir)/*.s)) + $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) build/target_mega65/OUTK.BIN build/target_mega65/KERNAL_combined.vs build/target_mega65/KERNAL_combined.sym: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_mega65) \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \ c64/,,config_mega65.s \ - $(foreach dir,$(SRCDIR_KERNAL_mega65),$(wildcard $(dir)/*.s)) + $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) build/target_ultimate64/OUTK.BIN build/target_ultimate64/KERNAL_combined.vs build/target_ultimate64/KERNAL_combined.sym: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_ultimate64) \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \ c64/,,config_ultimate64.s \ - $(foreach dir,$(SRCDIR_KERNAL_ultimate64),$(wildcard $(dir)/*.s)) + $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s)) build/target_generic/newrom: build/target_generic/OUTB.BIN build/target_generic/OUTK.BIN build/target_mega65/newrom: build/target_mega65/OUTB.BIN build/target_mega65/OUTK.BIN @@ -145,13 +145,13 @@ build/,generated/packed_messages.s: $(TOOL_COMPRESS_TEXT) build/target_%/OUTB.BIN build/target_%/BASIC_combined.vs: @mkdir -p build/target_$* @rm -f $@* build/target_$*/BASIC* - @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s BASIC -i BASIC-$* -o OUTB.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC_$*) $(GEN_BASIC) + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s BASIC -i BASIC-$* -o OUTB.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC) $(GEN_BASIC) .PRECIOUS: build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym: @mkdir -p build/target_$* @rm -f $@* build/target_$*/KERNAL* - @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s KERNAL -i KERNAL-$* -o OUTK.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL_$*) $(GEN_KERNAL) + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s KERNAL -i KERNAL-$* -o OUTK.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL) $(GEN_KERNAL) .PRECIOUS: build/target_%/newrom build/target_%/newrom: diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 11c29f43..d8c319e2 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -4,13 +4,30 @@ // +// Hardware platform and variant + +#define CONFIG_PLATFORM_COMMODORE_64 + +#define CONFIG_VARIANT_GENERIC +// #define CONFIG_VARIANT_MEGA_65 +// #define CONFIG_VARIANT_ULTIMATE_64 + + +// Processor instruction set + #define CONFIG_CPU_MOS_6502 // #define CONFIG_CPU_WDC_65C02 // #define CONFIG_CPU_WDC_65816 + +// Memory model + #define CONFIG_MEMORY_MODEL_38K // #define CONFIG_MEMORY_MODEL_60K + +// Multiple SID support + // #define CONFIG_SID_2ND .const CONFIG_SID_2ND_ADDRESS = $D420 @@ -20,11 +37,17 @@ // #define CONFIG_SID_D4XX // #define CONFIG_SID_D5XX + +// Software features + #define CONFIG_BANNER_FANCY #define CONFIG_BANNER_PAL_NTSC #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS -#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled +#define CONFIG_SCNKEY_TWW_CTR // for now has to be enabled + + +// Debug options // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index 8466b5ff..fca49f1d 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -4,13 +4,30 @@ // +// Hardware platform and variant + +#define CONFIG_PLATFORM_COMMODORE_64 + +// #define CONFIG_VARIANT_GENERIC +#define CONFIG_VARIANT_MEGA_65 +// #define CONFIG_VARIANT_ULTIMATE_64 + + +// Processor instruction set + #define CONFIG_CPU_MOS_6502 // #define CONFIG_CPU_WDC_65C02 // #define CONFIG_CPU_WDC_65816 + +// Memory model configuration + // #define CONFIG_MEMORY_MODEL_38K #define CONFIG_MEMORY_MODEL_60K + +// Multiple SID support + #define CONFIG_SID_2ND .const CONFIG_SID_2ND_ADDRESS = $D420 @@ -20,11 +37,17 @@ // #define CONFIG_SID_D4XX // #define CONFIG_SID_D5XX + +// Software features + #define CONFIG_BANNER_FANCY #define CONFIG_BANNER_PAL_NTSC #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS -#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled +#define CONFIG_SCNKEY_TWW_CTR // for now has to be enabled + + +// Debug options // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index 3e63e6a1..5631c865 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -4,13 +4,30 @@ // +// Hardware platform and variant + +#define CONFIG_PLATFORM_COMMODORE_64 + +// #define CONFIG_VARIANT_GENERIC +// #define CONFIG_VARIANT_MEGA_65 +#define CONFIG_VARIANT_ULTIMATE_64 + + +// Processor instruction set + #define CONFIG_CPU_MOS_6502 // #define CONFIG_CPU_WDC_65C02 // #define CONFIG_CPU_WDC_65816 + +// Memory model configuration + #define CONFIG_MEMORY_MODEL_38K // #define CONFIG_MEMORY_MODEL_60K + +// Multiple SID support + // #define CONFIG_SID_2ND .const CONFIG_SID_2ND_ADDRESS = $D420 @@ -20,11 +37,17 @@ #define CONFIG_SID_D4XX #define CONFIG_SID_D5XX + +// Software features + #define CONFIG_BANNER_FANCY #define CONFIG_BANNER_PAL_NTSC #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS -#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled +#define CONFIG_SCNKEY_TWW_CTR // for now has to be enabled + + +// Debug options // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s index 868fc670..ea8a5d0d 100644 --- a/c64/aliases/,aliases_config.s +++ b/c64/aliases/,aliases_config.s @@ -1,26 +1,52 @@ - // Various configuration dependent aliases/macros/checks +// +// Various configuration dependent aliases/macros/checks +// - // Check that memory model configuration is correct +// Check that platform configuration is correct { .var selected = 0; -#if CONFIG_MEMORY_MODEL_38K - .eval selected++ -#endif -#if CONFIG_MEMORY_MODEL_60K +#if CONFIG_PLATFORM_COMMODORE_64 .eval selected++ #endif - .if (selected != 1) .error "Please select exactly one CONFIG_MEMORY_MODEL_* option" + .if (selected != 1) .error "Please select exactly one CONFIG_PLATFORM_* option" } - // Check that processor configuration is correct +// Check that platform variant configuration is correct + +{ + .var selected = 0; + +#if CONFIG_VARIANT_GENERIC + .eval selected++ +#endif +#if CONFIG_VARIANT_MEGA_65 + .eval selected++ +#endif +#if CONFIG_VARIANT_ULTIMATE_64 + .eval selected++ +#endif + + .if (selected != 1) .error "Please select exactly one CONFIG_VARIANT_* option" + +#if !CONFIG_PLATFORM_COMMODORE_64 && CONFIG_VARIANT_MEGA_65 && + .error "CONFIG_VARIANT_MEGA_65 can only be used with CONFIG_PLATFORM_COMMODORE_64" +#endif +#if !CONFIG_PLATFORM_COMMODORE_64 && CONFIG_VARIANT_ULTIMATE_64 && + .error "CONFIG_VARIANT_ULTIMATE_64 can only be used with CONFIG_PLATFORM_COMMODORE_64" +#endif +} + + + +// Check that processor configuration is correct { .var selected = 0; @@ -40,7 +66,24 @@ - // Handle processor configuration +// Check that memory model configuration is correct + +{ + .var selected = 0; + +#if CONFIG_MEMORY_MODEL_38K + .eval selected++ +#endif +#if CONFIG_MEMORY_MODEL_60K + .eval selected++ +#endif + + .if (selected != 1) .error "Please select exactly one CONFIG_MEMORY_MODEL_* option" +} + + + +// Handle processor configuration #if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_WDC_65816 @@ -54,13 +97,17 @@ #endif - // Handle misc configuration entrues + + +// Handle configuration of various features #if CONFIG_BCD_SAFE_INTERRUPTS #define HAS_BCD_SAFE_INTERRUPTS #endif - // Stub configuration + + +// Handle configuration of debug infrastructure .macro STUB_IMPLEMENTATION_RTS() { rts diff --git a/c64/aliases/,aliases_hardware.s b/c64/aliases/,aliases_hardware.s index 73abfd8c..5d3dc91b 100644 --- a/c64/aliases/,aliases_hardware.s +++ b/c64/aliases/,aliases_hardware.s @@ -1,8 +1,11 @@ // -// Names of hardware registers - slightly modified names from C64 Programmer's Reference Guide +// Names of hardware registers - names from C64 Programmer's Reference Guide, sometimes slightly modified // + +#if CONFIG_PLATFORM_COMMODORE_64 + // CPU memory registers .label CPU_D6510 = $00 @@ -154,3 +157,5 @@ .const BIT_CIA2_PRA_DAT_OUT = $20 // 1 - low (pulled), 0 - high (released) .const BIT_CIA2_PRA_CLK_IN = $40 // 0 - low (pulled), 1 - high (released) .const BIT_CIA2_PRA_DAT_IN = $80 // 0 - low (pulled), 1 - high (released) + +#endif diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index bc391aae..a7fa7f02 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -105,7 +105,7 @@ .label BUFPNT = $A6 // -- NOT IMPLEMENTED -- .label INBIT = $A7 // -- NOT IMPLEMENTED -- -#if CONFIG_EXTENDED_SCNKEY +#if CONFIG_SCNKEY_TWW_CTR // Reuse RS232 variables, since they should not be used by other things. // Carefully avoid $A7 which is used by 64NET @@ -125,7 +125,7 @@ .label CMP0 = $B0 // $B0-$B1 temporary tape storage, [!] here used for BRK instruction address .label TAPE1 = $B2 // $B2-$B3 tape buffer pointer -#if CONFIG_EXTENDED_SCNKEY +#if CONFIG_SCNKEY_TWW_CTR // Reuse RS232 variables, since they should not be used by other things. // This one should be initialized in cinit to $FF @@ -139,7 +139,7 @@ .label NXTBIT = $B5 // -- NOT IMPLEMENTED -- -#if CONFIG_EXTENDED_SCNKEY +#if CONFIG_SCNKEY_TWW_CTR // Reuse RS232 variables, since they should not be used by other things. // Carefully avoiding $A7 which is used by 64NET @@ -200,7 +200,7 @@ .label BUF = $200 // $200-$250, BASIC line editor input buffer (81 bytes) -#if CONFIG_EXTENDED_SCNKEY +#if CONFIG_SCNKEY_TWW_CTR // $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20 // and not used on C64, so safe for us to use, probably. @@ -229,7 +229,7 @@ .label MODE = $291 // flag, is case switch allowed .label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable -#if CONFIG_EXTENDED_SCNKEY +#if CONFIG_SCNKEY_TWW_CTR // Reuse RS232 variables, since they should not be used by other things. // This one should be initialized in cinit to $FF diff --git a/c64/basic/,target_generic/,hooks_generic.s b/c64/basic/,target_generic/,hooks_generic.s deleted file mode 100644 index 6c6fc033..00000000 --- a/c64/basic/,target_generic/,hooks_generic.s +++ /dev/null @@ -1,26 +0,0 @@ - -// Target-specific hooks - - -.macro TARGET_HOOK_BANNER() { - -#if CONFIG_BANNER_FANCY - - .byte $1C, $12, $A4, $A4, $A4, $A4, $A4, $A4, $A4, $92, $0D - .byte $9E, $12, $A4, $A4, $A4, $A4, $A4, $A4, $92, $05, $20 - .text " OPEN ROMS GENERIC BUILD" - .byte $0D - .byte $1E, $12, $A4, $A4, $A4, $A4, $A4, $92, $0D - .byte $9F, $12, $A4, $A4, $A4, $A4, $92, $20, $05, $20, $20 - .text " " - -#else - - .text " OPEN ROMS GENERIC BUILD" - .byte $0D, $0D - .text " " - -#endif - - .byte $00 // end of banner -} diff --git a/c64/basic/,target_mega65/,hooks_mega65.s b/c64/basic/,target_mega65/,hooks_mega65.s deleted file mode 100644 index 4bb36fc2..00000000 --- a/c64/basic/,target_mega65/,hooks_mega65.s +++ /dev/null @@ -1,52 +0,0 @@ - -// Target-specific hooks - - -.macro TARGET_HOOK_BANNER() { - -#if CONFIG_BANNER_FANCY - - // New banner from Retrofan - .byte $9a, $12, $20, $20, $7f, $a9, $20, $20, $1f, $20, $9a, $20, $20, $20 - .byte $20, $1f, $20, $9a, $a9, $20, $20, $20, $92, $a1, $1f, $12, $20, $9a, $a9, $20 - .byte $20, $20, $7f, $1f, $20, $20, $9a, $a3, $a3, $a3, $a3, $a3, $a3, $a3, $1f, $20 - .byte $20, $20, $20, $05, $92, $4d, $45, $47, $41, $9a, $12, $20, $20, $20, $20, $20 - .byte $20, $1f, $20, $9a, $20, $20, $92, $a2, $bb, $1f, $12, $20, $9a, $20, $20, $92 - .byte $ac, $a2, $a2, $1f, $12, $20, $9a, $20, $20, $1f, $20, $9a, $20, $20, $1f, $20 - .byte $20, $1e, $a3, $a3, $a3, $a3, $a3, $a3, $1f, $20, $20, $20, $20, $05, $92, $42 - .byte $41, $53, $49, $43, $9a, $12, $20, $20, $92, $7f, $a9, $12, $20, $20, $1f, $20 - .byte $9a, $20, $20, $a2, $92, $be, $1f, $12, $20, $9a, $20, $20, $92, $bc, $12, $20 - .byte $20, $1f, $20, $9a, $20, $20, $20, $20, $20, $1f, $20, $20, $9e, $a3, $a3, $a3 - .byte $a3, $a3, $1f, $20, $20, $20, $20, $05, $92, $2d, $2d, $2d, $2d, $2d, $2d, $9a - .byte $12, $20, $20, $1f, $20, $20, $9a, $20, $20, $1f, $20, $9a, $20, $20, $20, $20 - .byte $1f, $20, $9a, $20, $20, $20, $20, $20, $1f, $20, $9a, $20, $20, $1f, $20, $9a - .byte $20, $20, $1f, $20, $20, $96, $a3, $a3, $a3, $a3, $1f - .byte $92, $0D, $0D, $05 - - // Original Deft-supplied banner - // .byte $9A,$12,$A3,$A3,$A3,$A3,$A3,$A3,$DF,$9B,$92,$20,$05,$12,$A0,$A0 - // .byte $DF,$9B,$92,$20,$05,$12,$A0,$A0,$DF,$9B,$92,$20,$05,$12,$A0,$A0 - // .byte $DF,$9B,$92,$20,$05,$12,$A0,$A0,$DF,$9A,$92,$20,$05,$20,$20,$20 - // .byte $4D,$20,$45,$20,$47,$20,$41,$0D,$99,$12,$A3,$A3,$A3,$A3,$A3,$A3 - // .byte $A3,$DF,$92,$7F,$12,$CD,$CD,$DF,$92,$7F,$12,$DF,$05,$92,$20,$20 - // .byte $99,$7F,$12,$DF,$05,$92,$20,$20,$99,$7F,$12,$DF,$92,$7F,$12,$DF - // .byte $05,$92,$20,$20,$99,$42,$20,$41,$20,$53,$20,$49,$20,$43,$0D,$9E - // .byte $12,$A3,$A3,$A3,$A3,$A3,$A3,$A3,$A3,$DF,$9B,$92,$7F,$12,$DF,$92 - // .byte $7F,$12,$DF,$92,$7F,$12,$CD,$05,$92,$20,$20,$9B,$7F,$12,$CD,$92 - // .byte $7F,$12,$DF,$92,$7F,$12,$CD,$92,$7F,$12,$DF,$9A,$92,$20,$05,$20 - // .byte $9A,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$0D,$96,$12,$A3,$A3,$A3,$A3,$A3 - // .byte $A3,$A3,$A3,$A3,$DF,$9A,$92,$7F,$12,$DF,$92,$7F,$9B,$20,$9A,$7F - // .byte $12,$A0,$A0,$9B,$92,$20,$9A,$7F,$12,$A0,$A0,$9B,$92,$20,$9A,$7F - // .byte $12,$DF,$92,$7F,$9B,$20,$9A,$20,$9B,"0.2.0.0",$0D - // .byte $0D,$05,$92 - -#else - - .text " OPEN ROMS FOR MEGA65" - .byte $0D, $0D - .text " " - -#endif - - .byte $00 // end of banner -} diff --git a/c64/basic/,target_ultimate64/,hooks_ultimate64.s b/c64/basic/,target_ultimate64/,hooks_ultimate64.s deleted file mode 100644 index 05c8d324..00000000 --- a/c64/basic/,target_ultimate64/,hooks_ultimate64.s +++ /dev/null @@ -1,26 +0,0 @@ - -// Target-specific hooks - - -.macro TARGET_HOOK_BANNER() { - -#if CONFIG_BANNER_FANCY - - .byte $1C, $12, $A4, $A4, $A4, $A4, $A4, $A4, $A4, $92, $0D - .byte $9E, $12, $A4, $A4, $A4, $A4, $A4, $A4, $92, $05, $20 - .text " OPEN ROMS FOR ULTIMATE 64" - .byte $0D - .byte $1E, $12, $A4, $A4, $A4, $A4, $A4, $92, $0D - .byte $9F, $12, $A4, $A4, $A4, $A4, $92, $20, $05, $20, $20 - .text " " - -#else - - .text " OPEN ROMS FOR ULTIMATE 64" - .byte $0D, $0D - .text " " - -#endif - - .byte $00 // end of banner -} diff --git a/c64/basic/startup_banner.s b/c64/basic/startup_banner.s index 957ab11d..3e099df4 100644 --- a/c64/basic/startup_banner.s +++ b/c64/basic/startup_banner.s @@ -1,7 +1,91 @@ // -// Startup banner, to be displayed durin cold start +// Startup banner, to be displayed during cold start // + +.macro BANNER_TEXT() { + +#if CONFIG_VARIANT_GENERIC + .text "OPEN ROMS GENERIC BUILD" +#elif CONFIG_VARIANT_MEGA_65 + .text "OPEN ROMS FOR MEGA65" +#elif CONFIG_VARIANT_ULTIMATE_64 + .text "OPEN ROMS FOR ULTIMATE 64" +#endif + +} + + startup_banner: - TARGET_HOOK_BANNER() + + +#if !CONFIG_BANNER_FANCY + + // Simple banner + + .text " " + BANNER_TEXT() + .byte $0D, $0D + .text " " + +#endif + + +#if CONFIG_BANNER_FANCY && !CONFIG_VARIANT_MEGA_65 + + // Fancy banner + + .byte $1C, $12, $A4, $A4, $A4, $A4, $A4, $A4, $A4, $92, $0D + .byte $9E, $12, $A4, $A4, $A4, $A4, $A4, $A4, $92, $05, $20 + .text " " + BANNER_TEXT() + .byte $0D + .byte $1E, $12, $A4, $A4, $A4, $A4, $A4, $92, $0D + .byte $9F, $12, $A4, $A4, $A4, $A4, $92, $20, $05, $20, $20 + .text " " + +#endif + + +#if CONFIG_BANNER_FANCY && CONFIG_VARIANT_MEGA_65 + + // Fancy Mega65 banner - from Retrofan + .byte $9a, $12, $20, $20, $7f, $a9, $20, $20, $1f, $20, $9a, $20, $20, $20 + .byte $20, $1f, $20, $9a, $a9, $20, $20, $20, $92, $a1, $1f, $12, $20, $9a, $a9, $20 + .byte $20, $20, $7f, $1f, $20, $20, $9a, $a3, $a3, $a3, $a3, $a3, $a3, $a3, $1f, $20 + .byte $20, $20, $20, $05, $92, $4d, $45, $47, $41, $9a, $12, $20, $20, $20, $20, $20 + .byte $20, $1f, $20, $9a, $20, $20, $92, $a2, $bb, $1f, $12, $20, $9a, $20, $20, $92 + .byte $ac, $a2, $a2, $1f, $12, $20, $9a, $20, $20, $1f, $20, $9a, $20, $20, $1f, $20 + .byte $20, $1e, $a3, $a3, $a3, $a3, $a3, $a3, $1f, $20, $20, $20, $20, $05, $92, $42 + .byte $41, $53, $49, $43, $9a, $12, $20, $20, $92, $7f, $a9, $12, $20, $20, $1f, $20 + .byte $9a, $20, $20, $a2, $92, $be, $1f, $12, $20, $9a, $20, $20, $92, $bc, $12, $20 + .byte $20, $1f, $20, $9a, $20, $20, $20, $20, $20, $1f, $20, $20, $9e, $a3, $a3, $a3 + .byte $a3, $a3, $1f, $20, $20, $20, $20, $05, $92, $2d, $2d, $2d, $2d, $2d, $2d, $9a + .byte $12, $20, $20, $1f, $20, $20, $9a, $20, $20, $1f, $20, $9a, $20, $20, $20, $20 + .byte $1f, $20, $9a, $20, $20, $20, $20, $20, $1f, $20, $9a, $20, $20, $1f, $20, $9a + .byte $20, $20, $1f, $20, $20, $96, $a3, $a3, $a3, $a3, $1f + .byte $92, $0D, $0D, $05 + + // Original Mega65 banner - supplied by Deft + // .byte $9A,$12,$A3,$A3,$A3,$A3,$A3,$A3,$DF,$9B,$92,$20,$05,$12,$A0,$A0 + // .byte $DF,$9B,$92,$20,$05,$12,$A0,$A0,$DF,$9B,$92,$20,$05,$12,$A0,$A0 + // .byte $DF,$9B,$92,$20,$05,$12,$A0,$A0,$DF,$9A,$92,$20,$05,$20,$20,$20 + // .byte $4D,$20,$45,$20,$47,$20,$41,$0D,$99,$12,$A3,$A3,$A3,$A3,$A3,$A3 + // .byte $A3,$DF,$92,$7F,$12,$CD,$CD,$DF,$92,$7F,$12,$DF,$05,$92,$20,$20 + // .byte $99,$7F,$12,$DF,$05,$92,$20,$20,$99,$7F,$12,$DF,$92,$7F,$12,$DF + // .byte $05,$92,$20,$20,$99,$42,$20,$41,$20,$53,$20,$49,$20,$43,$0D,$9E + // .byte $12,$A3,$A3,$A3,$A3,$A3,$A3,$A3,$A3,$DF,$9B,$92,$7F,$12,$DF,$92 + // .byte $7F,$12,$DF,$92,$7F,$12,$CD,$05,$92,$20,$20,$9B,$7F,$12,$CD,$92 + // .byte $7F,$12,$DF,$92,$7F,$12,$CD,$92,$7F,$12,$DF,$9A,$92,$20,$05,$20 + // .byte $9A,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$0D,$96,$12,$A3,$A3,$A3,$A3,$A3 + // .byte $A3,$A3,$A3,$A3,$DF,$9A,$92,$7F,$12,$DF,$92,$7F,$9B,$20,$9A,$7F + // .byte $12,$A0,$A0,$9B,$92,$20,$9A,$7F,$12,$A0,$A0,$9B,$92,$20,$9A,$7F + // .byte $12,$DF,$92,$7F,$9B,$20,$9A,$20,$9B,"0.2.0.0",$0D + // .byte $0D,$05,$92 + +#endif + + + + .byte $00 // end of banner diff --git a/c64/kernal/,target_ultimate64/,aliases_ultimate64.s b/c64/kernal/,disabled/,aliases_ultimate64.s similarity index 100% rename from c64/kernal/,target_ultimate64/,aliases_ultimate64.s rename to c64/kernal/,disabled/,aliases_ultimate64.s diff --git a/c64/kernal/,target_ultimate64/u64_load.s.disabled b/c64/kernal/,disabled/u64_load.s similarity index 100% rename from c64/kernal/,target_ultimate64/u64_load.s.disabled rename to c64/kernal/,disabled/u64_load.s diff --git a/c64/kernal/,target_generic/,hooks_generic.s b/c64/kernal/,target_generic/,hooks_generic.s deleted file mode 100644 index 84c261a2..00000000 --- a/c64/kernal/,target_generic/,hooks_generic.s +++ /dev/null @@ -1,6 +0,0 @@ - -// Target-specific hooks - - -.macro TARGET_HOOK_LOAD() { -} diff --git a/c64/kernal/,target_mega65/,hooks_mega65.s b/c64/kernal/,target_mega65/,hooks_mega65.s deleted file mode 100644 index 84c261a2..00000000 --- a/c64/kernal/,target_mega65/,hooks_mega65.s +++ /dev/null @@ -1,6 +0,0 @@ - -// Target-specific hooks - - -.macro TARGET_HOOK_LOAD() { -} diff --git a/c64/kernal/,target_ultimate64/,hooks_ultimate64.s b/c64/kernal/,target_ultimate64/,hooks_ultimate64.s deleted file mode 100644 index efc1f52f..00000000 --- a/c64/kernal/,target_ultimate64/,hooks_ultimate64.s +++ /dev/null @@ -1,9 +0,0 @@ - -// Target-specific hooks - - -.macro TARGET_HOOK_LOAD() { - // XXX disabled for now - the current file opening API is not - // really suitable for easy usage from Kernal - // jsr u64_load -} diff --git a/c64/kernal/f4a5.load.s b/c64/kernal/f4a5.load.s index e1cccc1d..76307dc6 100644 --- a/c64/kernal/f4a5.load.s +++ b/c64/kernal/f4a5.load.s @@ -36,9 +36,6 @@ LOAD: jsr install_ram_routines #endif - // Allow platform-specific routine to takeover the flow - TARGET_HOOK_LOAD() - // Check whether we support the requested device lda FA and #$FC diff --git a/c64/kernal/scnkey.s b/c64/kernal/scnkey_tww_ctr.s similarity index 99% rename from c64/kernal/scnkey.s rename to c64/kernal/scnkey_tww_ctr.s index ac22a7ca..899ecf94 100644 --- a/c64/kernal/scnkey.s +++ b/c64/kernal/scnkey_tww_ctr.s @@ -8,6 +8,10 @@ // CPU registers that has to be preserved (see [RG64]): none // + +#if CONFIG_SCNKEY_TWW_CTR + + // Scan the keyboard.. // Here we don't use the horrible buggy original routine, // not just because of copyright. Instead, we use the @@ -513,3 +517,6 @@ KeyCanRepeat: KeyRepeatWait: pla jmp ConsiderNextKey + + +#endif // #if CONFIG_SCNKEY_TWW_CTR