771 files changed
+7415
-2457
No files matched your search
@@ -3,11 +3,11 @@
|
||||
|
||||
It's not possible to provide ROM builds that suit everyone needs - therefore configuration files were introduced, few predefined configurations are provided with sane defaults:
|
||||
|
||||
* [`c64/,,config_custom.s`](c64/,,config_custom.s)
|
||||
* [`c64/,,config_generic.s`](c64/,,config_generic.s)
|
||||
* [`c64/,,config_mega65.s`](c64/,,config_mega65.s)
|
||||
* [`c64/,,config_ultimate64.s`](c64/,,config_ultimate64.s)
|
||||
* [`c64/,,config_testing.s`](c64/,,config_testing.s)
|
||||
* [`src/,,config_custom.s`](src/,,config_custom.s)
|
||||
* [`src/,,config_generic.s`](src/,,config_generic.s)
|
||||
* [`src/,,config_mega65.s`](src/,,config_mega65.s)
|
||||
* [`src/,,config_ultimate64.s`](src/,,config_ultimate64.s)
|
||||
* [`src/,,config_testing.s`](src/,,config_testing.s)
|
||||
|
||||
Just edit them and recompile the project. To enable particular option - uncomment it by removing leading `//` from before `#define` directive (as you probably guessed, commenting out disables it). Some options are followed by constants - you can change them too to further fine-tune the build.
|
||||
|
||||
@@ -105,12 +105,14 @@ Memory model the original machine uses - memory available for BASIC ends at `$9F
|
||||
|
||||
### `CONFIG_MEMORY_MODEL_46K` and `CONFIG_MEMORY_MODEL_50K`
|
||||
|
||||
Planned for the future - not available yet.
|
||||
These models additionaly use RAM under BASIC, and the 50K additionally takes over `$C000`-`$CFFF` range. They should still be highly compatible (no additional RAM for helper routines is needed), and the performance penalty should be much lower than 60K model.
|
||||
|
||||
### `CONFIG_MEMORY_MODEL_60K`
|
||||
|
||||
Uses RAM under BASIC, I/O and KERNAL, takes over `$C000`-`$CFFF` area requires special helper routines installed in `$2A7`-`$2FF` area (normally unused and free for the user). Gives the most free memory for BASIC programs, but it's the slowest (for example, forces disabling optimized LOAD loop for JiffyDOS) and the least compatible model.
|
||||
|
||||
It is currently not compatible with Mega65 extended ROMs.
|
||||
|
||||
Comparing to standard memory model, it needs about 180 bytes in BASIC segment and 80 bytes in KERNAL segment - at the moment of doing the test, these values are expected to change often.
|
||||
|
||||
## IEC devices
|
||||
@@ -283,9 +285,15 @@ Feature needs about 330 bytes in BASIC segment. If unsure - enable.
|
||||
|
||||
### `CONFIG_TAPE_WEDGE`
|
||||
|
||||
If enabled, a simple DOS wedge is available from the direct mode for turbo tape loading - supports `←L` only
|
||||
If enabled, a simple DOS wedge is available from the direct mode for tape loading - supports `←L` only.
|
||||
|
||||
Feature needs about 5 bytes in BASIC segment. If unsure - enable.
|
||||
Feature needs few bytes in BASIC segment. If unsure - enable.
|
||||
|
||||
### `CONFIG_TAPE_HEAD_ALIGN`
|
||||
|
||||
If enabled, embeds a tape head align tool into the ROM, it can be started with `←H`. Requires `CONFIG_TAPE_WEDGE`.
|
||||
|
||||
Feature needs about 800 bytes in KERNAL segment. Only recomended for machines with extended ROM, like Mega65.
|
||||
|
||||
### `CONFIG_BCD_SAFE_INTERRUPTS`
|
||||
|
||||
@@ -307,16 +315,10 @@ Richer banners need more BASIC segment, varies between brands.
|
||||
|
||||
### `CONFIG_SHOW_FEATURES`
|
||||
|
||||
If enabled, shows the most important compiled-in features on the startup screen.
|
||||
If enabled, shows the most important compiled-in features on the startup screen. Also shows the video system (PAL/NTSC).
|
||||
|
||||
It is recommended to keep it enabled for informational purposes.
|
||||
|
||||
### `CONFIG_BANNER_PAL_NTSC`
|
||||
|
||||
If enabled, prints video system on startup banner. Eye candy only.
|
||||
|
||||
Feature needs few bytes in BASIC and about 25 bytes in KERNAL segment.
|
||||
|
||||
## Debug options
|
||||
|
||||
Options in this section are for debug purposes only. If unsure - disable.
|
||||
@@ -328,3 +330,9 @@ Replaces `RTS` stubbed routines implementation with one causing a break.
|
||||
### `CONFIG_DBG_PRINTF`
|
||||
|
||||
Makes `printf` routine available.
|
||||
|
||||
## Other options
|
||||
|
||||
### `CONFIG_COMPRESSION_LVL_2`
|
||||
|
||||
Adds additional step in compressing BASIC interpreter strings - a dictionary compression. Not tested extensively - and for now it won't bring any improvement (it will even increase the code/data size) as we do not have enough strings yet to make this method useful. Do not use!
|
||||
@@ -6,43 +6,51 @@ TESTTAPE = testsuite/testtape-c64-pal-turbo.tap
|
||||
|
||||
# Source files
|
||||
|
||||
SRCDIR_COMMON = c64/aliases
|
||||
SRCDIR_COMMON = src/aliases
|
||||
|
||||
SRCDIR_BASIC = $(SRCDIR_COMMON) \
|
||||
c64/basic \
|
||||
c64/basic/,stubs \
|
||||
c64/basic/,stubs_math \
|
||||
c64/basic/assets \
|
||||
c64/basic/board_m65 \
|
||||
c64/basic/board_x16 \
|
||||
c64/basic/commands \
|
||||
c64/basic/init \
|
||||
c64/basic/math \
|
||||
c64/basic/math_consts \
|
||||
c64/basic/math_mov \
|
||||
c64/basic/print \
|
||||
c64/basic/rom_revision
|
||||
src/basic \
|
||||
src/basic/,stubs \
|
||||
src/basic/,stubs_math \
|
||||
src/basic/assets \
|
||||
src/basic/basic_commands \
|
||||
src/basic/basic_commands_CC \
|
||||
src/basic/basic_commands_CD \
|
||||
src/basic/basic_operators \
|
||||
src/basic/basic_functions \
|
||||
src/basic/board_m65 \
|
||||
src/basic/board_x16 \
|
||||
src/basic/engine \
|
||||
src/basic/init \
|
||||
src/basic/math \
|
||||
src/basic/math_consts \
|
||||
src/basic/math_mov \
|
||||
src/basic/memory \
|
||||
src/basic/print \
|
||||
src/basic/rom_revision \
|
||||
src/basic/tokenizer \
|
||||
src/basic/wedge
|
||||
|
||||
SRCDIR_KERNAL = $(SRCDIR_COMMON) \
|
||||
c64/kernal \
|
||||
c64/kernal/,stubs \
|
||||
c64/kernal/assets \
|
||||
c64/kernal/board_m65 \
|
||||
c64/kernal/board_x16 \
|
||||
c64/kernal/iec \
|
||||
c64/kernal/iec_fast \
|
||||
c64/kernal/init \
|
||||
c64/kernal/interrupts \
|
||||
c64/kernal/iostack \
|
||||
c64/kernal/jumptable \
|
||||
c64/kernal/keyboard \
|
||||
c64/kernal/memory \
|
||||
c64/kernal/print \
|
||||
c64/kernal/rom_revision \
|
||||
c64/kernal/rs232 \
|
||||
c64/kernal/screen \
|
||||
c64/kernal/tape \
|
||||
c64/kernal/time
|
||||
src/kernal \
|
||||
src/kernal/,stubs \
|
||||
src/kernal/assets \
|
||||
src/kernal/board_m65 \
|
||||
src/kernal/board_x16 \
|
||||
src/kernal/iec \
|
||||
src/kernal/iec_fast \
|
||||
src/kernal/init \
|
||||
src/kernal/interrupts \
|
||||
src/kernal/iostack \
|
||||
src/kernal/jumptable \
|
||||
src/kernal/keyboard \
|
||||
src/kernal/memory \
|
||||
src/kernal/print \
|
||||
src/kernal/rom_revision \
|
||||
src/kernal/rs232 \
|
||||
src/kernal/screen \
|
||||
src/kernal/tape \
|
||||
src/kernal/time
|
||||
|
||||
SRC_BASIC = $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s))
|
||||
SRC_KERNAL = $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s))
|
||||
@@ -50,7 +58,7 @@ SRC_TOOLS = $(wildcard tools/*.c,tools/*.cc)
|
||||
|
||||
# Generated files
|
||||
|
||||
GEN_BASIC = build/,generated/packed_messages.s build/,generated/float_constants.s
|
||||
GEN_BASIC = build/,generated/float_constants.s
|
||||
GEN_KERNAL =
|
||||
|
||||
# List of build directories
|
||||
@@ -64,23 +72,32 @@ DIR_X16 = build/target_cx16
|
||||
|
||||
# List of config files
|
||||
|
||||
CFG_CUS = c64/,,config_custom.s
|
||||
CFG_GEN = c64/,,config_generic.s
|
||||
CFG_TST = c64/,,config_testing.s
|
||||
CFG_M65 = c64/,,config_mega65.s
|
||||
CFG_U64 = c64/,,config_ultimate64.s
|
||||
CFG_X16 = c64/,,config_cx16.s
|
||||
CFG_CUS = src/,,config_custom.s
|
||||
CFG_GEN = src/,,config_generic.s
|
||||
CFG_TST = src/,,config_testing.s
|
||||
CFG_M65 = src/,,config_mega65.s
|
||||
CFG_U64 = src/,,config_ultimate64.s
|
||||
CFG_X16 = src/,,config_cx16.s
|
||||
|
||||
# List of files with generated strings
|
||||
|
||||
GEN_STR_CUS = $(DIR_CUS)/,generated/packed_strings.s
|
||||
GEN_STR_GEN = $(DIR_GEN)/,generated/packed_strings.s
|
||||
GEN_STR_TST = $(DIR_TST)/,generated/packed_strings.s
|
||||
GEN_STR_M65 = $(DIR_M65)/,generated/packed_strings.s
|
||||
GEN_STR_U64 = $(DIR_U64)/,generated/packed_strings.s
|
||||
GEN_STR_X16 = $(DIR_X16)/,generated/packed_strings.s
|
||||
|
||||
# Dependencies - helper variables
|
||||
|
||||
DEP_BASIC = $(SRC_BASIC) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
DEP_KERNAL = $(SRC_KERNAL) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
DEP_BASIC = $(SRC_BASIC) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
DEP_KERNAL = $(SRC_KERNAL) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
|
||||
# List of tools
|
||||
|
||||
TOOL_COLLECT_DATA = build/tools/collect_data
|
||||
TOOL_COMPRESS_TEXT = build/tools/compress_text
|
||||
TOOL_GENERATE_CONSTANTS = build/tools/generate_constants
|
||||
TOOL_GENERATE_STRINGS = build/tools/generate_strings
|
||||
TOOL_PATCH_CHARGEN = build/tools/patch_chargen
|
||||
TOOL_PNGPREPARE = build/tools/pngprepare
|
||||
TOOL_BUILD_SEGMENT = build/tools/build_segment
|
||||
@@ -130,7 +147,7 @@ SEG_LIST_X16 = $(DIR_X16)/basic.seg_0 \
|
||||
$(DIR_X16)/kernal.seg_0 \
|
||||
$(DIR_X16)/kernal.seg_1
|
||||
|
||||
REL_TARGET_LIST = $(TARGET_LIST_GEN) $(TARGET_LIST_TST) $(TARGET_M65_x) $(TARGET_M65_x_PXL) $(TARGET_LIST_U64)
|
||||
REL_TARGET_LIST = $(TARGET_LIST_GEN) $(TARGET_M65_x) $(TARGET_M65_x_PXL) $(TARGET_LIST_U64)
|
||||
|
||||
# Misc strings
|
||||
|
||||
@@ -151,7 +168,7 @@ fast:
|
||||
$(MAKE) -j64 --output-sync=target $(TARGET_LIST) $(EXT_TARGET_LIST)
|
||||
|
||||
clean:
|
||||
@rm -rf build c64/basic/combined.s c64/kernal/combined.s
|
||||
@rm -rf build src/basic/combined.s src/kernal/combined.s
|
||||
|
||||
updatebin:
|
||||
$(MAKE) -j64 --output-sync=target $(TARGET_LIST) $(TOOL_RELEASE)
|
||||
@@ -164,10 +181,6 @@ $(TOOL_PNGPREPARE): tools/pngprepare.c
|
||||
@mkdir -p build/tools
|
||||
$(CC) -O2 -Wall -I/usr/local/include -L/usr/local/lib -o $@ $< -lpng
|
||||
|
||||
$(TOOL_COMPRESS_TEXT): tools/compress_text.c
|
||||
@mkdir -p build/tools
|
||||
$(CC) -O2 -Wall -I/usr/local/include -L/usr/local/lib -o $@ $< -lm
|
||||
|
||||
build/tools/%: tools/%.c
|
||||
@mkdir -p build/tools
|
||||
$(CC) -O2 -Wall -o $@ $<
|
||||
@@ -193,42 +206,42 @@ build/chargen_pxlfont.patched: $(TOOL_PATCH_CHARGEN) build/chargen_pxlfont.rom
|
||||
# Dependencies - BASIC and KERNAL
|
||||
|
||||
$(DIR_CUS)/OUTB_x.BIN $(DIR_CUS)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_CUS) $(DIR_CUS)/KERNAL_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_CUS) $(GEN_STR_CUS) $(DIR_CUS)/KERNAL_combined.sym
|
||||
$(DIR_GEN)/OUTB_x.BIN $(DIR_GEN)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_GEN) $(DIR_GEN)/KERNAL_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_GEN) $(GEN_STR_GEN) $(DIR_GEN)/KERNAL_combined.sym
|
||||
$(DIR_TST)/OUTB_x.BIN $(DIR_TST)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_TST) $(DIR_TST)/KERNAL_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_TST) $(GEN_STR_TST) $(DIR_TST)/KERNAL_combined.sym
|
||||
$(DIR_U64)/OUTB_x.BIN $(DIR_U64)/BASIC_combined.vs: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_U64) $(DIR_U64)/KERNAL_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_U64) $(GEN_STR_U64) $(DIR_U64)/KERNAL_combined.sym
|
||||
|
||||
$(DIR_CUS)/OUTK_x.BIN $(DIR_CUS)/KERNAL_combined.vs $(DIR_CUS)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_CUS)
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_CUS) $(GEN_STR_CUS)
|
||||
$(DIR_GEN)/OUTK_x.BIN $(DIR_GEN)/KERNAL_combined.vs $(DIR_GEN)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_GEN)
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_GEN) $(GEN_STR_GEN)
|
||||
$(DIR_TST)/OUTK_x.BIN $(DIR_TST)/KERNAL_combined.vs $(DIR_TST)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_TST)
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_TST) $(GEN_STR_TST)
|
||||
$(DIR_U64)/OUTK_x.BIN $(DIR_U64)/KERNAL_combined.vs $(DIR_U64)/KERNAL_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_U64)
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_U64) $(GEN_STR_U64)
|
||||
|
||||
$(DIR_M65)/OUTB_0.BIN $(DIR_M65)/BASIC_0_combined.vs $(DIR_M65)/BASIC_0_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_M65) $(GEN_STR_M65) $(DIR_M65)/KERNAL_0_combined.sym
|
||||
$(DIR_M65)/OUTK_0.BIN $(DIR_M65)/KERNAL_0_combined.vs $(DIR_M65)/KERNAL_0_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65)
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65) $(GEN_STR_M65)
|
||||
|
||||
$(DIR_X16)/OUTB_0.BIN $(DIR_X16)/BASIC_0_combined.vs $(DIR_X16)/BASIC_0_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(DIR_X16)/KERNAL_0_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(GEN_STR_X16) $(DIR_X16)/KERNAL_0_combined.sym
|
||||
$(DIR_X16)/OUTK_0.BIN $(DIR_X16)/KERNAL_0_combined.vs $(DIR_X16)/KERNAL_0_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_X16)
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_X16) $(GEN_STR_X16)
|
||||
|
||||
$(DIR_M65)/basic.seg_1 $(DIR_M65)/BASIC_1_combined.vs $(DIR_M65)/BASIC_1_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym $(DIR_M65)/BASIC_0_combined.sym
|
||||
$(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)/kernal.seg_1 $(DIR_M65)/KERNAL_1_combined.vs $(DIR_M65)/KERNAL_1_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65) $(GEN_STR_M65) $(DIR_M65)/KERNAL_0_combined.sym
|
||||
|
||||
$(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1_combined.vs $(DIR_X16)/BASIC_1_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(DIR_X16)/KERNAL_0_combined.sym $(DIR_X16)/BASIC_0_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(GEN_STR_X16) $(DIR_X16)/KERNAL_0_combined.sym $(DIR_X16)/BASIC_0_combined.sym
|
||||
$(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1_combined.vs $(DIR_X16)/KERNAL_1_combined.sym: \
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_X16) $(DIR_X16)/KERNAL_0_combined.sym
|
||||
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_X16) $(GEN_STR_X16) $(DIR_X16)/KERNAL_0_combined.sym
|
||||
|
||||
$(DIR_CUS)/OUTx_x.BIN: $(DIR_CUS)/OUTB_x.BIN $(DIR_CUS)/OUTK_x.BIN
|
||||
$(DIR_GEN)/OUTx_x.BIN: $(DIR_GEN)/OUTB_x.BIN $(DIR_GEN)/OUTK_x.BIN
|
||||
@@ -254,69 +267,96 @@ build/symbols_ultimate64.vs: $(DIR_U64)/BASIC_combined.vs $(DIR_U64)/KER
|
||||
|
||||
# Rules - BASIC and KERNAL intermediate files
|
||||
|
||||
build/,generated/packed_messages.s: $(TOOL_COMPRESS_TEXT)
|
||||
@mkdir -p build/,generated
|
||||
$(TOOL_COMPRESS_TEXT) > build/,generated/packed_messages.s
|
||||
$(GEN_STR_CUS): $(TOOL_GENERATE_STRINGS) $(CFG_CUS)
|
||||
@mkdir -p $(DIR_CUS)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_CUS)
|
||||
|
||||
$(GEN_STR_GEN): $(TOOL_GENERATE_STRINGS) $(CFG_GEN)
|
||||
@mkdir -p $(DIR_GEN)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_GEN)
|
||||
|
||||
$(GEN_STR_TST): $(TOOL_GENERATE_STRINGS) $(CFG_TST)
|
||||
@mkdir -p $(DIR_TST)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_TST)
|
||||
|
||||
$(GEN_STR_M65): $(TOOL_GENERATE_STRINGS) $(CFG_M65)
|
||||
@mkdir -p $(DIR_M65)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_M65)
|
||||
|
||||
$(GEN_STR_U64): $(TOOL_GENERATE_STRINGS) $(CFG_U64)
|
||||
@mkdir -p $(DIR_U64)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_U64)
|
||||
|
||||
$(GEN_STR_X16): $(TOOL_GENERATE_STRINGS) $(CFG_X16)
|
||||
@mkdir -p $(DIR_X16)/,generated
|
||||
$(TOOL_GENERATE_STRINGS) -o $@ -c $(CFG_X16)
|
||||
|
||||
build/,generated/float_constants.s: $(TOOL_GENERATE_CONSTANTS)
|
||||
@mkdir -p build/,generated
|
||||
$(TOOL_GENERATE_CONSTANTS) -o build/,generated/float_constants.s
|
||||
|
||||
GEN_STR_custom = $(GEN_STR_CUS)
|
||||
GEN_STR_generic = $(GEN_STR_GEN)
|
||||
GEN_STR_testing = $(GEN_STR_TST)
|
||||
GEN_STR_mega65 = $(GEN_STR_M65)
|
||||
GEN_STR_ultimate64 = $(GEN_STR_U64)
|
||||
GEN_STR_cx16 = $(GEN_STR_X16)
|
||||
|
||||
.PRECIOUS: build/target_%/OUTB_x.BIN build/target_%/BASIC_combined.vs
|
||||
build/target_%/OUTB_x.BIN build/target_%/BASIC_combined.vs:
|
||||
@mkdir -p build/target_$*
|
||||
@rm -f $@* build/target_$*/BASIC*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s BASIC -i BASIC-$* -o OUTB_x.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s BASIC -i BASIC-$* -o OUTB_x.BIN -d build/target_$* -l a000 -h e4d2 src/,,config_$*.s $(SRCDIR_BASIC) $(GEN_BASIC) $(GEN_STR_$*)
|
||||
|
||||
.PRECIOUS: build/target_%/OUTK_x.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym
|
||||
build/target_%/OUTK_x.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) -r STD -s KERNAL -i KERNAL-$* -o OUTK_x.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s KERNAL -i KERNAL-$* -o OUTK_x.BIN -d build/target_$* -l e4d3 -h ffff src/,,config_$*.s $(SRCDIR_KERNAL) $(GEN_KERNAL) $(GEN_STR_$*)
|
||||
|
||||
# Rules - BASIC and KERNAL intermediate files, for Mega65
|
||||
|
||||
$(DIR_M65)/OUTB_0.BIN $(DIR_M65)/BASIC_0_combined.vs $(DIR_M65)/BASIC_0_combined.sym:
|
||||
@mkdir -p $(DIR_M65)
|
||||
@rm -f $@* $(DIR_M65)/BASIC_0*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_0 -i BASIC_0-mega65 -o OUTB_0.BIN -d $(DIR_M65) -l a000 -h e4d2 $(CFG_M65) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_0 -i BASIC_0-mega65 -o OUTB_0.BIN -d $(DIR_M65) -l a000 -h e4d2 $(CFG_M65) $(GEN_STR_M65) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
|
||||
$(DIR_M65)/OUTK_0.BIN $(DIR_M65)/KERNAL_0_combined.vs $(DIR_M65)/KERNAL_0_combined.sym:
|
||||
@mkdir -p $(DIR_M65)
|
||||
@rm -f $@* $(DIR_M65)/KERNAL_0*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_0 -i KERNAL_0-mega65 -o OUTK_0.BIN -d $(DIR_M65) -l e4d3 -h ffff $(CFG_M65) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_0 -i KERNAL_0-mega65 -o OUTK_0.BIN -d $(DIR_M65) -l e4d3 -h ffff $(CFG_M65) $(GEN_STR_M65) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
|
||||
$(DIR_M65)/basic.seg_1 $(DIR_M65)/BASIC_1_combined.vs $(DIR_M65)/BASIC_1_combined.sym:
|
||||
@mkdir -p $(DIR_M65)
|
||||
@rm -f $@* $(DIR_M65)/basic.seg_1 $(DIR_M65)/BASIC_1*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_1 -i BASIC_1-mega65 -o basic.seg_1 -d $(DIR_M65) -l 4000 -h 5fff $(CFG_M65) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_1 -i BASIC_1-mega65 -o basic.seg_1 -d $(DIR_M65) -l 4000 -h 5fff $(CFG_M65) $(GEN_STR_M65) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
|
||||
$(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*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_1 -i KERNAL_1-mega65 -o kernal.seg_1 -d $(DIR_M65) -l 4000 -h 5fff $(CFG_M65) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_1 -i KERNAL_1-mega65 -o kernal.seg_1 -d $(DIR_M65) -l 4000 -h 5fff $(CFG_M65) $(GEN_STR_M65) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
|
||||
# Rules - BASIC and KERNAL intermediate files, for Commander X16
|
||||
|
||||
$(DIR_X16)/OUTB_0.BIN $(DIR_X16)/BASIC_0_combined.vs $(DIR_X16)/BASIC_0_combined.sym:
|
||||
@mkdir -p $(DIR_X16)
|
||||
@rm -f $@* $(DIR_X16)/BASIC_0*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s BASIC_0 -i BASIC_0-x16 -o OUTB_0.BIN -d $(DIR_X16) -l c000 -h e4d2 $(CFG_X16) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s BASIC_0 -i BASIC_0-x16 -o OUTB_0.BIN -d $(DIR_X16) -l c000 -h e4d2 $(CFG_X16) $(GEN_STR_X16) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
|
||||
$(DIR_X16)/OUTK_0.BIN $(DIR_X16)/KERNAL_0_combined.vs $(DIR_X16)/KERNAL_0_combined.sym:
|
||||
@mkdir -p $(DIR_X16)
|
||||
@rm -f $@* $(DIR_X16)/KERNAL_0*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s KERNAL_0 -i KERNAL_0-x16 -o OUTK_0.BIN -d $(DIR_X16) -l e4d3 -h ffff $(CFG_X16) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s KERNAL_0 -i KERNAL_0-x16 -o OUTK_0.BIN -d $(DIR_X16) -l e4d3 -h ffff $(CFG_X16) $(GEN_STR_X16) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
|
||||
$(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1_combined.vs $(DIR_X16)/BASIC_1_combined.sym:
|
||||
@mkdir -p $(DIR_X16)
|
||||
@rm -f $@* $(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s BASIC_1 -i BASIC_1-x16 -o basic.seg_1 -d $(DIR_X16) -l a000 -h bfff $(CFG_X16) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s BASIC_1 -i BASIC_1-x16 -o basic.seg_1 -d $(DIR_X16) -l a000 -h bfff $(CFG_X16) $(GEN_STR_X16) $(SRCDIR_BASIC) $(GEN_BASIC)
|
||||
|
||||
$(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1_combined.vs $(DIR_X16)/KERNAL_1_combined.sym:
|
||||
@mkdir -p $(DIR_X16)
|
||||
@rm -f $@* $(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1*
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s KERNAL_1 -i KERNAL_1-x16 -o kernal.seg_1 -d $(DIR_X16) -l a000 -h bfff $(CFG_X16) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s KERNAL_1 -i KERNAL_1-x16 -o kernal.seg_1 -d $(DIR_X16) -l a000 -h bfff $(CFG_X16) $(GEN_STR_X16) $(SRCDIR_KERNAL) $(GEN_KERNAL)
|
||||
|
||||
# Rules - BASIC and KERNAL
|
||||
|
||||
@@ -368,40 +408,39 @@ build/symbols_hybrid.vs: $(DIR_GEN)/KERNAL_combined.vs
|
||||
|
||||
# Rules - platform 'Mega65' specific
|
||||
|
||||
$(TARGET_M65_x) $(TARGET_M65_x_PXL): $(SEG_LIST_M65) build/chargen_openroms.rom build/chargen_openroms.patched build/chargen_pxlfont.rom build/chargen_pxlfont.patched
|
||||
dd if=/dev/zero bs=8192 count=1 of=build/m65_padding_08_KB
|
||||
dd if=/dev/zero bs=8192 count=8 of=build/m65_padding_64_KB
|
||||
build/padding_08_KB:
|
||||
dd if=/dev/zero bs=8192 count=1 of=build/padding_08_KB
|
||||
build/padding_64_KB:
|
||||
dd if=/dev/zero bs=8192 count=8 of=build/padding_64_KB
|
||||
|
||||
$(TARGET_M65_x) $(TARGET_M65_x_PXL): build/padding_08_KB build/padding_64_KB $(SEG_LIST_M65) build/chargen_openroms.rom build/chargen_openroms.patched build/chargen_pxlfont.rom build/chargen_pxlfont.patched
|
||||
@echo
|
||||
cat build/m65_padding_08_KB > $(TARGET_M65_x)
|
||||
cat build/m65_padding_08_KB >> $(TARGET_M65_x)
|
||||
cat build/padding_08_KB > $(TARGET_M65_x)
|
||||
cat build/padding_08_KB >> $(TARGET_M65_x)
|
||||
cat $(DIR_M65)/kernal.seg_1 >> $(TARGET_M65_x)
|
||||
cat $(DIR_M65)/basic.seg_1 >> $(TARGET_M65_x)
|
||||
cat build/m65_padding_08_KB >> $(TARGET_M65_x)
|
||||
cat build/padding_08_KB >> $(TARGET_M65_x)
|
||||
cat $(DIR_M65)/basic.seg_0 >> $(TARGET_M65_x)
|
||||
cat build/chargen_openroms.rom >> $(TARGET_M65_x)
|
||||
cat build/chargen_openroms.patched >> $(TARGET_M65_x)
|
||||
cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x)
|
||||
cat build/m65_padding_64_KB >> $(TARGET_M65_x)
|
||||
cat build/padding_64_KB >> $(TARGET_M65_x)
|
||||
@echo
|
||||
cat build/m65_padding_08_KB > $(TARGET_M65_x_PXL)
|
||||
cat build/m65_padding_08_KB >> $(TARGET_M65_x_PXL)
|
||||
cat build/padding_08_KB > $(TARGET_M65_x_PXL)
|
||||
cat build/padding_08_KB >> $(TARGET_M65_x_PXL)
|
||||
cat $(DIR_M65)/kernal.seg_1 >> $(TARGET_M65_x_PXL)
|
||||
cat $(DIR_M65)/basic.seg_1 >> $(TARGET_M65_x_PXL)
|
||||
cat build/m65_padding_08_KB >> $(TARGET_M65_x_PXL)
|
||||
cat build/padding_08_KB >> $(TARGET_M65_x_PXL)
|
||||
cat $(DIR_M65)/basic.seg_0 >> $(TARGET_M65_x_PXL)
|
||||
cat build/chargen_pxlfont.rom >> $(TARGET_M65_x_PXL)
|
||||
cat build/chargen_pxlfont.patched >> $(TARGET_M65_x_PXL)
|
||||
cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x_PXL)
|
||||
cat build/m65_padding_64_KB >> $(TARGET_M65_x_PXL)
|
||||
@echo
|
||||
rm -f build/m65_padding_*
|
||||
cat build/padding_64_KB >> $(TARGET_M65_x_PXL)
|
||||
@echo
|
||||
|
||||
# Rules - platform 'Commander X16' specific
|
||||
|
||||
$(TARGET_X16_x): $(SEG_LIST_X16) build/chargen_openroms.rom
|
||||
dd if=/dev/zero bs=8192 count=1 of=build/x16_padding_08_KB
|
||||
dd if=/dev/zero bs=8192 count=8 of=build/x16_padding_64_KB
|
||||
@echo
|
||||
cat $(DIR_X16)/basic.seg_0 > $(TARGET_X16_x)
|
||||
cat $(DIR_X16)/kernal.seg_0 >> $(TARGET_X16_x)
|
||||
@@ -409,8 +448,6 @@ $(TARGET_X16_x): $(SEG_LIST_X16) build/chargen_openroms.rom
|
||||
cat $(DIR_X16)/basic.seg_1 >> $(TARGET_X16_x)
|
||||
cat $(DIR_X16)/kernal.seg_1 >> $(TARGET_X16_x)
|
||||
@echo
|
||||
rm -f build/x16_padding_*
|
||||
@echo
|
||||
|
||||
# Rules - tests
|
||||
|
||||
@@ -436,8 +473,8 @@ test_testing: build/kernal_testing.rom build/basic_testing.rom build/symbols_tes
|
||||
test_ultimate64: build/kernal_ultimate64.rom build/basic_ultimate64.rom build/symbols_ultimate64.vs
|
||||
x64 -kernal build/kernal_ultimate64.rom -basic build/basic_ultimate64.rom -moncommands build/symbols_ultimate64.vs -1 $(TESTTAPE) -8 $(TESTDISK)
|
||||
|
||||
test_mega65: $(TARGET_M65_x) $(TARGET_M65_PXL)
|
||||
../xemu/build/bin/xmega65.native -dmarev 2 -forcerom -loadrom $(TARGET_M65_x)
|
||||
test_mega65: $(TARGET_M65_x) $(TARGET_M65_x_PXL)
|
||||
../xemu/build/bin/xmega65.native -dmarev 2 -besure -fontrefresh -forcerom -loadrom $(TARGET_M65_x_PXL)
|
||||
|
||||
test_cx16: $(TARGET_X16_x)
|
||||
../x16-emulator/x16emu -rom $(TARGET_X16_x)
|
||||
|
||||
@@ -4,6 +4,7 @@ A project to create unencumbered open-source ROMs for use on selected retro comp
|
||||
|
||||
* [implementation status](./STATUS.md) of various APIs and functionalities
|
||||
* [configuration options](./CONFIG.md) for those willing to compile their own, customized ROM set
|
||||
* [BASIC extensions](doc/Extended-BASIC.md)
|
||||
* [development guide](./doc/Development.md) for those interested in OpenROMs technical aspects
|
||||
* [license](./LICENSE) information and list of major contributors
|
||||
* [credits](./CREDITS.md) to people whose work was of great help to us
|
||||
|
||||
@@ -10,19 +10,21 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
|
||||
|
||||
* JiffyDOS and DolphinDOS protocols support
|
||||
* DOS wedge (direct mode only) - `@<drive_number>`, `@<command>`, `@$`, `@$<params>`, `@`
|
||||
* BASIC extensions, see the [documentation](doc/Extended-BASIC.md)
|
||||
|
||||
* turbo tape load support (as device 7, or using `←L`), quite sophisticated: up to 250 blocks (can store bytes under I/O), automatically adjusts for tape speed differences
|
||||
* normal tape load error log is limited by free stack space only (no artificial limitation like in original ROMs)
|
||||
* tape format autodetection; normal vs turbo is mostly transparent to user
|
||||
* improved support for tape adapters (for using regular casette players and other audio devices instead of Datasette) and emulators
|
||||
* built-in tape head align tool (only feasible to use on machines with extended memory, like Mega65)
|
||||
|
||||
* extended `LOAD` command
|
||||
* extended / tweaked `LOAD` / `VERIFY` commands
|
||||
* start/end addresses are displayed, in the Final cartridge style
|
||||
* command with just the file name tries to use the last device if it's number seems sane; otherwise uses 8
|
||||
* secondary address over 255 is considered a start address
|
||||
* command without parameters tries to load first file from drive chosen as above
|
||||
|
||||
* uses RAM under ROM and I/O: 61438 bytes free
|
||||
* cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses, configured addresses
|
||||
* uses RAM under ROM and I/O: 51199 bytes free (up to `$CFFF`) by default, but 61438 is also possible
|
||||
* cold/warm start silences multiple SID chips
|
||||
* warm start due to BRK prints out the instruction address
|
||||
|
||||
|
||||
@@ -40,8 +42,8 @@ The following ROM features are currently missing:
|
||||
|
||||
* most BASIC commands
|
||||
* BASIC variables
|
||||
* BASIC expression parsing
|
||||
* floating point routines
|
||||
* BASIC expression handling
|
||||
* most floating point routines
|
||||
* RS-232 support
|
||||
* NMI handling is incomplete
|
||||
|
||||
@@ -143,7 +145,7 @@ Status of the various APIs and variables from the original ROMs
|
||||
## Low memory locations (pages 0 - 3)
|
||||
|
||||
|
||||
For the current status of the low memory location implementation andd usage check [this file](c64/aliases/,aliases_ram_lowmem.s). NOTE: available vector to certain routine does not mean that this routine is fully implemented!
|
||||
For the current status of the low memory location implementation andd usage check [this file](src/aliases/,aliases_ram_lowmem.s). NOTE: available vector to certain routine does not mean that this routine is fully implemented!
|
||||
|
||||
|
||||
## BASIC
|
||||
@@ -282,7 +284,7 @@ Not all of them - only these we want to have implemented.
|
||||
| `$A68E` | `RUNC` | DONE | |
|
||||
| `$A7AE` | `NEWSTT` | PARTIAL | redirected to RUN command |
|
||||
| `$AB1E` | `STROUT` | DONE | |
|
||||
| `$AD9E` | `FRMEVL` | NOT DONE | |
|
||||
| `$AD9E` | `FRMEVL` | PARTIAL | |
|
||||
| `$BDCD` | `LINPRT` | DONE | temporary implementation |
|
||||
| `$E3BF` | `INIT` | NOT DONE | |
|
||||
| `$E422` | `INITMSG` | DONE | |
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,10 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
// XXX provide documentation and implementation
|
||||
|
||||
FRMEVL:
|
||||
STUB_IMPLEMENTATION()
|
||||
@@ -1,41 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
// Computes Mapping the 64 p93
|
||||
|
||||
basic_do_error:
|
||||
|
||||
// Save error number
|
||||
phx_trash_a
|
||||
|
||||
#if ROM_LAYOUT_M65
|
||||
// Restore normal memory map
|
||||
jsr map_NORMAL
|
||||
#endif
|
||||
|
||||
// Print ? at start
|
||||
jsr print_return
|
||||
lda #$3F
|
||||
jsr JCHROUT
|
||||
|
||||
// Print main part of error message
|
||||
plx_trash_a
|
||||
jsr print_packed_message
|
||||
|
||||
// Print ERROR at end
|
||||
jsr print_space
|
||||
ldx #33
|
||||
jsr print_packed_message
|
||||
|
||||
// XXX print IN if not in direct mode
|
||||
|
||||
// XXX print line number if not in direct mode
|
||||
|
||||
jsr print_return
|
||||
jsr print_return
|
||||
|
||||
// Reset stack, and go back to main loop
|
||||
ldx #$FE
|
||||
txs
|
||||
jmp basic_main_loop
|
||||
@@ -1,371 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
// Jump back into the BASIC execute line loop
|
||||
// after first checking that we have a colon
|
||||
// or $00 char
|
||||
|
||||
basic_end_of_statement_check:
|
||||
ldy #0
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<TXTPTR
|
||||
jsr peek_under_roms
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (TXTPTR),y
|
||||
#endif
|
||||
|
||||
// Consume any spaces
|
||||
cmp #$20
|
||||
bne no_space_to_skip
|
||||
jsr basic_consume_character
|
||||
jmp basic_end_of_statement_check
|
||||
|
||||
no_space_to_skip:
|
||||
cmp #$00
|
||||
beq !+
|
||||
cmp #$3a
|
||||
beq !+
|
||||
|
||||
// not end of statement
|
||||
clc
|
||||
rts
|
||||
!:
|
||||
sec
|
||||
rts
|
||||
|
||||
basic_execute_statement:
|
||||
|
||||
// Check for RUN/STOP
|
||||
lda STKEY
|
||||
bmi !+
|
||||
jmp cmd_stop
|
||||
!:
|
||||
// Skip over any white space and :
|
||||
ldy #0
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<TXTPTR
|
||||
jsr peek_under_roms
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (TXTPTR),y
|
||||
#endif
|
||||
|
||||
jsr basic_end_of_statement_check
|
||||
bcs basic_end_of_line
|
||||
|
||||
// jsr printf
|
||||
// .text "LINE PTR = $"
|
||||
// .byte $f1,<OLDTXT,>OLDTXT
|
||||
// .byte $f0,<OLDTXT,>OLDTXT
|
||||
// .text ", STATEMENT PTR = $"
|
||||
// .byte $f1,<TXTPTR,>TXTPTR
|
||||
// .byte $f0,<TXTPTR,>TXTPTR
|
||||
// .byte $d,0
|
||||
|
||||
// Go through the line until its end is reached.
|
||||
// If we reach the end are in direct mode, then
|
||||
// go back to reading input, else look for the
|
||||
// next line, and advance to that, or else
|
||||
// return to READY prompt because we have run out
|
||||
// of program.
|
||||
|
||||
// Get next char of program text, even if it is hiding under a ROM or the
|
||||
// IO area.
|
||||
|
||||
ldy #0
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<TXTPTR
|
||||
jsr peek_under_roms
|
||||
cmp #$00
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (TXTPTR),y
|
||||
#endif
|
||||
|
||||
beq basic_end_of_line
|
||||
|
||||
// The checks should be done in order of frequency, so that we are as
|
||||
// fast as possible.
|
||||
|
||||
cmp #$7f
|
||||
bcc not_a_token
|
||||
// It is a token: So get the jump table entry for it, push it on the stack
|
||||
// and then RTS to start it.
|
||||
asl
|
||||
tax
|
||||
lda basic_command_jump_table+1,x
|
||||
pha
|
||||
lda basic_command_jump_table+0,x
|
||||
pha
|
||||
|
||||
// Now consume the character
|
||||
jsr basic_consume_character
|
||||
|
||||
rts
|
||||
|
||||
not_a_token:
|
||||
// Space, which we can also just ignore
|
||||
cmp #$20
|
||||
beq basic_skip_char
|
||||
// End of line?
|
||||
cmp #$00
|
||||
beq basic_end_of_line
|
||||
// :, i.e., statement separator, which we can simply ignore
|
||||
cmp #$3a
|
||||
beq basic_skip_char
|
||||
|
||||
// If all else fails, it is a syntax error
|
||||
jmp do_SYNTAX_error
|
||||
|
||||
basic_skip_char:
|
||||
jsr basic_consume_character
|
||||
jmp basic_execute_statement
|
||||
|
||||
basic_fetch_and_consume_character:
|
||||
ldy #0
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<TXTPTR
|
||||
jsr peek_under_roms
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (TXTPTR),y
|
||||
#endif
|
||||
|
||||
// FALL THROUGH
|
||||
|
||||
basic_consume_character:
|
||||
// Advance basic text pointer
|
||||
inc TXTPTR+0
|
||||
bne !+
|
||||
inc TXTPTR+1
|
||||
!:
|
||||
rts
|
||||
|
||||
basic_unconsume_character:
|
||||
lda TXTPTR+0
|
||||
sec
|
||||
sbc #1
|
||||
sta TXTPTR+0
|
||||
lda TXTPTR+1
|
||||
sbc #0
|
||||
sta TXTPTR+1
|
||||
rts
|
||||
|
||||
basic_end_of_line:
|
||||
|
||||
// XXX - If not in direct mode, then advance to next line, if there is
|
||||
// one.
|
||||
|
||||
// Are we in direct mode
|
||||
lda CURLIN+1
|
||||
cmp #$ff
|
||||
bne basic_not_direct_mode
|
||||
|
||||
// Yes, we were in direct mode, so stop now
|
||||
jmp basic_main_loop
|
||||
|
||||
basic_not_direct_mode:
|
||||
// Copy line number to previous line number
|
||||
lda CURLIN+0
|
||||
sta OLDLIN+0
|
||||
lda CURLIN+1
|
||||
sta OLDLIN+1
|
||||
|
||||
// Advance the basic line pointer to the next line
|
||||
jsr basic_follow_link_to_next_line
|
||||
|
||||
// Are we at the end of the program?
|
||||
lda OLDTXT+0
|
||||
ora OLDTXT+1
|
||||
bne basic_execute_from_current_line
|
||||
|
||||
// End of program found
|
||||
jmp basic_main_loop
|
||||
|
||||
basic_execute_from_current_line:
|
||||
// Check if pointer is null, if so, we are at the end of
|
||||
// the program.
|
||||
ldy #0
|
||||
jsr peek_line_pointer_null_check
|
||||
bcs !+
|
||||
// End of program reached
|
||||
jmp basic_main_loop
|
||||
!:
|
||||
// Skip pointer and line number to get address of first statement
|
||||
lda OLDTXT+0
|
||||
clc
|
||||
adc #4
|
||||
sta TXTPTR+0
|
||||
lda OLDTXT+1
|
||||
adc #0
|
||||
sta TXTPTR+1
|
||||
|
||||
ldy #2
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<OLDTXT
|
||||
jsr peek_under_roms
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (OLDTXT),y
|
||||
#endif
|
||||
|
||||
sta CURLIN+0
|
||||
iny
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
jsr peek_under_roms
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (OLDTXT),y
|
||||
#endif
|
||||
|
||||
sta CURLIN+1
|
||||
|
||||
jmp basic_execute_statement
|
||||
|
||||
basic_command_jump_table:
|
||||
// $80 - $8F
|
||||
.word cmd_end-1
|
||||
.word cmd_for-1
|
||||
.word cmd_next-1
|
||||
.word cmd_data-1
|
||||
.word cmd_inputhash-1
|
||||
.word cmd_input-1
|
||||
.word cmd_dim-1
|
||||
.word cmd_read-1
|
||||
.word cmd_let-1
|
||||
.word cmd_goto-1
|
||||
.word cmd_run-1
|
||||
.word cmd_if-1
|
||||
.word cmd_restore-1
|
||||
.word cmd_gosub-1
|
||||
.word cmd_return-1
|
||||
.word cmd_rem-1
|
||||
|
||||
// $90-$9F
|
||||
.word cmd_stop-1
|
||||
.word cmd_on-1
|
||||
.word cmd_wait-1
|
||||
.word cmd_load-1
|
||||
.word cmd_save-1
|
||||
.word cmd_verify-1
|
||||
.word cmd_def-1
|
||||
.word cmd_poke-1
|
||||
.word cmd_printhash-1
|
||||
.word cmd_print-1
|
||||
.word cmd_cont-1
|
||||
.word cmd_list-1
|
||||
.word cmd_clr-1
|
||||
.word cmd_cmd-1
|
||||
.word cmd_sys-1
|
||||
.word cmd_open-1
|
||||
|
||||
// $A0-$AF
|
||||
.word cmd_close-1
|
||||
.word cmd_get-1
|
||||
.word cmd_new-1
|
||||
.word cmd_tab-1
|
||||
.word cmd_to-1
|
||||
.word cmd_fn-1
|
||||
.word cmd_spc-1
|
||||
.word cmd_then-1
|
||||
.word cmd_not-1
|
||||
.word cmd_step-1
|
||||
.word cmd_plus-1
|
||||
.word cmd_minus-1
|
||||
.word cmd_mult-1
|
||||
.word cmd_div-1
|
||||
.word cmd_exponent-1
|
||||
.word cmd_and-1
|
||||
|
||||
// $B0-$BF
|
||||
.word cmd_or-1
|
||||
.word cmd_greater-1
|
||||
.word cmd_equal-1
|
||||
.word cmd_less-1
|
||||
.word cmd_sgn-1
|
||||
.word cmd_int-1
|
||||
.word cmd_abs-1
|
||||
.word cmd_usr-1
|
||||
.word cmd_fre-1
|
||||
.word cmd_pos-1
|
||||
.word cmd_sqr-1
|
||||
.word cmd_rnd-1
|
||||
.word cmd_log-1
|
||||
.word cmd_exp-1
|
||||
.word cmd_cos-1
|
||||
.word cmd_sin-1
|
||||
|
||||
// $C0-$CF
|
||||
.word cmd_tan-1
|
||||
.word cmd_atn-1
|
||||
.word cmd_peek-1
|
||||
.word cmd_len-1
|
||||
.word cmd_str-1
|
||||
.word cmd_val-1
|
||||
.word cmd_asc-1
|
||||
.word cmd_chr-1
|
||||
.word cmd_left-1
|
||||
.word cmd_right-1
|
||||
.word cmd_mid-1
|
||||
.word cmd_go-1
|
||||
// Undefined tokens
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
|
||||
// $D0-$DF
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
|
||||
// $E0-$EF
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
|
||||
// $F0-$FF
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
.word cmd_unimplemented-1
|
||||
@@ -1,34 +0,0 @@
|
||||
// #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__INITMSG = $4000 + 2 * 0
|
||||
.label VB1__LINKPRG = $4000 + 2 * 1
|
||||
.label VB1__tokenise_line = $4000 + 2 * 2
|
||||
.label VB1__list_single_line = $4000 + 2 * 3
|
||||
.label VB1__print_packed_message = $4000 + 2 * 4
|
||||
.label VB1__basic_do_clr = $4000 + 2 * 5
|
||||
.label VB1__basic_do_new = $4000 + 2 * 6
|
||||
|
||||
#else
|
||||
|
||||
// Vector table (OpenROMs private!)
|
||||
|
||||
.word INITMSG
|
||||
.word LINKPRG
|
||||
.word tokenise_line
|
||||
.word list_single_line
|
||||
.word print_packed_message
|
||||
.word basic_do_clr
|
||||
.word basic_do_new
|
||||
|
||||
#endif
|
||||
@@ -1,162 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
cmd_load:
|
||||
|
||||
// Parse filename
|
||||
// (we can tell the KERNAL where it is in memory directly, since the
|
||||
// KERNAL will be able to peek under ROMs to read it, since it will have
|
||||
// to be able to peek under the ROMs for SAVE and VERIFY).
|
||||
// Parse optional device #
|
||||
// Parse optional secondary address
|
||||
|
||||
// XXX - C64 BASIC apparently does not clear variables after a LOAD in the
|
||||
// middle of a program. For safety, we do.
|
||||
jsr basic_do_clr
|
||||
|
||||
// Set filename and length
|
||||
lda #$00
|
||||
sta FNLEN
|
||||
|
||||
// Check for the file name
|
||||
jsr basic_end_of_statement_check
|
||||
bcc !+
|
||||
|
||||
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
|
||||
|
||||
// No file name given, just load the first file from tape
|
||||
|
||||
ldx #$00
|
||||
stx SA // secondary address
|
||||
#if CONFIG_TAPE_NORMAL
|
||||
inx // 1 - for normal tape format
|
||||
#else
|
||||
ldx #$07 // 7 - for turbo tape format
|
||||
#endif
|
||||
stx FA // device number
|
||||
bne cmd_load_got_secondaryaddress // branch always
|
||||
|
||||
#else
|
||||
|
||||
// Without tape support, try to load the first file from disk
|
||||
|
||||
lda #$01 // name length
|
||||
ldx #<cmd_load_default_filename
|
||||
ldy #>cmd_load_default_filename
|
||||
jsr JSETNAM
|
||||
jmp got_filename
|
||||
|
||||
cmd_load_default_filename:
|
||||
|
||||
.text "*"
|
||||
|
||||
#endif
|
||||
|
||||
!:
|
||||
jsr basic_fetch_and_consume_character
|
||||
cmp #$22
|
||||
beq !+
|
||||
jmp do_SYNTAX_error
|
||||
!:
|
||||
// Filename starts here so set pointer
|
||||
lda TXTPTR+0
|
||||
sta FNADDR+0
|
||||
lda TXTPTR+1
|
||||
sta FNADDR+1
|
||||
|
||||
// Now search for end of line or closing quote
|
||||
// so that we know the length of the filename
|
||||
getting_filename:
|
||||
jsr basic_fetch_and_consume_character
|
||||
cmp #$22
|
||||
beq got_filename
|
||||
cmp #$00
|
||||
bne !+
|
||||
jsr basic_unconsume_character
|
||||
|
||||
jmp got_filename
|
||||
!:
|
||||
inc FNLEN
|
||||
jmp getting_filename
|
||||
|
||||
got_filename:
|
||||
|
||||
// Now fetch the file number, start from the default one
|
||||
jsr select_device
|
||||
stx FA
|
||||
jsr injest_comma
|
||||
bcs got_devicenumber
|
||||
|
||||
jsr basic_parse_line_number
|
||||
lda LINNUM+1
|
||||
beq !+
|
||||
jmp do_ILLEGAL_QUANTITY_error
|
||||
!:
|
||||
lda LINNUM+0
|
||||
sta FA
|
||||
|
||||
got_devicenumber:
|
||||
|
||||
// Now fetch the secondary address
|
||||
lda #$00
|
||||
sta SA
|
||||
jsr injest_comma
|
||||
bcs cmd_load_got_secondaryaddress
|
||||
jsr basic_parse_line_number
|
||||
lda LINNUM+1
|
||||
bne !+
|
||||
lda LINNUM+0
|
||||
sta SA
|
||||
jmp cmd_load_got_secondaryaddress
|
||||
!:
|
||||
// Second parameter is above 255, this can not be a secondary address
|
||||
// Use it as load address instead
|
||||
// XXX temporary syntax, it would be better to use something
|
||||
// XXX like 'LOAD"FILE",8 TO 49152'
|
||||
ldx LINNUM+0
|
||||
ldy LINNUM+1
|
||||
bne got_loadaddress
|
||||
|
||||
cmd_load_got_secondaryaddress: // input for tape wedge
|
||||
ldy TXTTAB+1
|
||||
ldx TXTTAB+0
|
||||
|
||||
got_loadaddress:
|
||||
lda #$00 // LOAD not verify
|
||||
jsr JLOAD
|
||||
php
|
||||
pha
|
||||
jsr print_return
|
||||
pla
|
||||
plp
|
||||
bcc load_no_error
|
||||
|
||||
// A = KERNAL error code, which also almost match
|
||||
// basic ERROR codes
|
||||
tax
|
||||
dex
|
||||
bpl !+
|
||||
ldx #B_ERR_BREAK
|
||||
!:
|
||||
jmp do_basic_error
|
||||
|
||||
load_no_error:
|
||||
// $YYXX is the last loaded address, so store it
|
||||
stx VARTAB+0
|
||||
sty VARTAB+1
|
||||
|
||||
// Now relink the loaded program, as we cannot trust the line
|
||||
// links supplied. For example, the VICE virtual drive emulation
|
||||
// always supplies $0101 as the address of the next line.
|
||||
jsr LINKPRG
|
||||
|
||||
// After LOADing, we either start the program from the beginning,
|
||||
// or go back to the READY prompt if LOAD was called from direct mode.
|
||||
|
||||
// Reset to start of program
|
||||
jsr init_oldtxt
|
||||
|
||||
// XXX - should run program if LOAD was used in program mode
|
||||
jmp basic_main_loop
|
||||
@@ -1,160 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Default handler for all not-yet-implemented commands
|
||||
//
|
||||
// Note: NOPs are here just to make debugging easier!
|
||||
//
|
||||
|
||||
cmd_for:
|
||||
nop
|
||||
cmd_next:
|
||||
nop
|
||||
cmd_data:
|
||||
nop
|
||||
cmd_inputhash:
|
||||
nop
|
||||
cmd_input:
|
||||
nop
|
||||
cmd_dim:
|
||||
nop
|
||||
cmd_read:
|
||||
nop
|
||||
cmd_let:
|
||||
nop
|
||||
cmd_if:
|
||||
nop
|
||||
cmd_restore:
|
||||
nop
|
||||
cmd_gosub:
|
||||
nop
|
||||
cmd_return:
|
||||
nop
|
||||
|
||||
// $90-$9F
|
||||
|
||||
cmd_on:
|
||||
nop
|
||||
cmd_wait:
|
||||
nop
|
||||
cmd_save:
|
||||
nop
|
||||
cmd_verify:
|
||||
nop
|
||||
cmd_def:
|
||||
nop
|
||||
cmd_poke:
|
||||
nop
|
||||
cmd_printhash:
|
||||
nop
|
||||
cmd_print:
|
||||
nop
|
||||
cmd_cont:
|
||||
nop
|
||||
cmd_cmd:
|
||||
nop
|
||||
cmd_open:
|
||||
nop
|
||||
|
||||
// $A0-$AF
|
||||
|
||||
cmd_close:
|
||||
nop
|
||||
cmd_get:
|
||||
nop
|
||||
cmd_tab:
|
||||
nop
|
||||
cmd_to:
|
||||
nop
|
||||
cmd_fn:
|
||||
nop
|
||||
cmd_spc:
|
||||
nop
|
||||
cmd_then:
|
||||
nop
|
||||
cmd_not:
|
||||
nop
|
||||
cmd_step:
|
||||
nop
|
||||
cmd_plus:
|
||||
nop
|
||||
cmd_minus:
|
||||
nop
|
||||
cmd_mult:
|
||||
nop
|
||||
cmd_div:
|
||||
nop
|
||||
cmd_exponent:
|
||||
nop
|
||||
cmd_and:
|
||||
nop
|
||||
|
||||
// $B0-$BF
|
||||
|
||||
cmd_or:
|
||||
nop
|
||||
cmd_greater:
|
||||
nop
|
||||
cmd_equal:
|
||||
nop
|
||||
cmd_less:
|
||||
nop
|
||||
cmd_sgn:
|
||||
nop
|
||||
cmd_int:
|
||||
nop
|
||||
cmd_abs:
|
||||
nop
|
||||
cmd_usr:
|
||||
nop
|
||||
cmd_fre:
|
||||
nop
|
||||
cmd_pos:
|
||||
nop
|
||||
cmd_sqr:
|
||||
nop
|
||||
cmd_rnd:
|
||||
nop
|
||||
cmd_log:
|
||||
nop
|
||||
cmd_exp:
|
||||
nop
|
||||
cmd_cos:
|
||||
nop
|
||||
cmd_sin:
|
||||
nop
|
||||
|
||||
// $C0-$CF
|
||||
|
||||
cmd_tan:
|
||||
nop
|
||||
cmd_atn:
|
||||
nop
|
||||
cmd_peek:
|
||||
nop
|
||||
cmd_len:
|
||||
nop
|
||||
cmd_str:
|
||||
nop
|
||||
cmd_val:
|
||||
nop
|
||||
cmd_asc:
|
||||
nop
|
||||
cmd_chr:
|
||||
nop
|
||||
cmd_left:
|
||||
nop
|
||||
cmd_right:
|
||||
nop
|
||||
cmd_mid:
|
||||
nop
|
||||
cmd_go:
|
||||
nop
|
||||
|
||||
// Undefined tokens
|
||||
|
||||
cmd_unimplemented:
|
||||
|
||||
jmp do_NOT_IMPLEMENTED_error
|
||||
@@ -1,23 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
// Consummes a comma in a BASIC code, C set for no coma found
|
||||
|
||||
injest_comma:
|
||||
|
||||
jsr basic_fetch_and_consume_character
|
||||
cmp #$2C // comma character
|
||||
beq injest_comma_found
|
||||
cmp #$20 // space, can always be skipped
|
||||
beq injest_comma
|
||||
|
||||
// not found
|
||||
jsr basic_unconsume_character
|
||||
sec
|
||||
rts
|
||||
|
||||
injest_comma_found:
|
||||
clc
|
||||
rts
|
||||
@@ -1,260 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# M65 BASIC_1 #TAKE
|
||||
// #LAYOUT# X16 BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
// Pack a word using the simple compression scheme.
|
||||
// This has to be the same implementation as in compress_text.c
|
||||
// because we compress input lines of BASIC to do the tokenisation.
|
||||
// This allows us to search through the compressed tokens directly
|
||||
// using the compressed fragment of BASIC, and thus work out the
|
||||
// token for a given piece of string.
|
||||
// This also helps ensure that we have an implementation that is totally
|
||||
// different to that of the original C64 BASIC, as well as likely
|
||||
// saving a bit of space in the ROM, especially once we start implementing
|
||||
// larger keyword vocabs for BASIC 7 or BASIC 10 compatibility, since the
|
||||
// compression and decompression machinery is of fixed size.
|
||||
|
||||
pack_word:
|
||||
// Inputs:
|
||||
// X = offset of string to pack. Address is $0200 + X
|
||||
// __tokenise_work1 = number of bytes to pack
|
||||
// __tokenise_work2 = packed length of string
|
||||
|
||||
// Outputs:
|
||||
// Output is written to $0100 (bottom of stack).
|
||||
|
||||
// Memory modified:
|
||||
// __tokenise_work4 = temporary storage
|
||||
// __tokenise_work3 = flag for whether we have a nybl prepared or not.
|
||||
// (This can also be checked on exit, to know whether the last byte
|
||||
// is incomplete, which is important for searching for abbreviated
|
||||
// key words.)
|
||||
|
||||
|
||||
// Make sure we have a sane request
|
||||
lda __tokenise_work1
|
||||
bne !+
|
||||
sec
|
||||
rts
|
||||
!:
|
||||
// Initialise internal variables
|
||||
lda #$00
|
||||
sta __tokenise_work2
|
||||
sta __tokenise_work3
|
||||
|
||||
pack_char_loop:
|
||||
|
||||
// Get the next char
|
||||
lda $0200,x
|
||||
|
||||
// Work out what type of character we have, and thus
|
||||
// how we need to pack it.
|
||||
jsr get_packed_char_index
|
||||
|
||||
cmp #$00
|
||||
bne not_exception_char
|
||||
|
||||
// Char is an exception char.
|
||||
// We need to either finish the previous byte with $xF,
|
||||
// Or if there is no existing nybl, then we need to output
|
||||
// either $FE or $FF, depending on whether this is the last
|
||||
// byte or not
|
||||
|
||||
lda __tokenise_work3
|
||||
bne have_nybl_before_exception_char
|
||||
|
||||
// No nybl exists before the exception char, so prefix with $FE or $FF
|
||||
// based on whether we are at the end of the input string or not
|
||||
inx
|
||||
lda __tokenise_work1
|
||||
cmp #$01
|
||||
beq at_end
|
||||
lda #$FF
|
||||
.byte $2C
|
||||
at_end:
|
||||
lda #$FE
|
||||
dex
|
||||
jsr write_unpacked_char
|
||||
// Fall through
|
||||
|
||||
output_exception_byte:
|
||||
lda $0200,x
|
||||
jsr write_unpacked_char
|
||||
jmp consider_next_char
|
||||
|
||||
have_nybl_before_exception_char:
|
||||
// Or existing byte with #$0F, and clear nybl flag
|
||||
ldy __tokenise_work2
|
||||
lda $0100,y
|
||||
ora #$0f
|
||||
sta $0100,y
|
||||
inc __tokenise_work2
|
||||
|
||||
// FALL THROUGH
|
||||
|
||||
write_literal_and_terminate_if_required:
|
||||
|
||||
// Clear have nybl flag
|
||||
lda #$00
|
||||
sta __tokenise_work3
|
||||
|
||||
lda $0200,x
|
||||
jsr write_unpacked_char
|
||||
|
||||
jmp end_string_if_required
|
||||
|
||||
end_string_if_required:
|
||||
// Check if X points to last char of string to be packed
|
||||
inx
|
||||
lda __tokenise_work1
|
||||
cmp #$01
|
||||
beq !+
|
||||
dex
|
||||
jmp consider_next_char
|
||||
!:
|
||||
dex
|
||||
// Fall through
|
||||
|
||||
end_string:
|
||||
// Write end of string sequence if required
|
||||
lda #$00
|
||||
jsr write_unpacked_char
|
||||
rts
|
||||
|
||||
write_unpacked_char:
|
||||
ldy __tokenise_work2
|
||||
sta $0100,y
|
||||
iny
|
||||
sty __tokenise_work2
|
||||
rts
|
||||
|
||||
not_exception_char:
|
||||
// It wasn't an exception char, so write the symbol out
|
||||
cmp #$10
|
||||
bcs whole_byte_symbol
|
||||
|
||||
// Nybl encoded value: Put in upper half or lower half of a byte?
|
||||
ldy __tokenise_work3
|
||||
bne store_low_nybl
|
||||
|
||||
// Store in high nybl -- so shift it into the hi nybl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
ldy __tokenise_work2
|
||||
sta $0100,y
|
||||
bne stored_nybl // Must be taken, as A cannot be $00
|
||||
|
||||
store_low_nybl:
|
||||
// Low nybl gets added to high nybl already stored in the byte
|
||||
ldy __tokenise_work2
|
||||
ora $0100,y
|
||||
sta $0100,y
|
||||
|
||||
stored_nybl:
|
||||
// Now toggle the nybl flag
|
||||
lda __tokenise_work3
|
||||
eor #$ff
|
||||
sta __tokenise_work3
|
||||
// And advance the offset if we filled this byte up
|
||||
bne consider_next_char // Taken if byte has a nybl free, i.e., don't advance pointer while half byte remains free
|
||||
|
||||
// Count the filled up byte
|
||||
inc __tokenise_work2
|
||||
|
||||
// Add termination byte if required
|
||||
// (This re-writes the same byte again, which we don't care about)
|
||||
jmp end_string_if_required
|
||||
|
||||
whole_byte_symbol:
|
||||
// It's a $Fx symbol.
|
||||
// But if we have a nybl to flush, then we handle it like
|
||||
// a full exception character
|
||||
|
||||
ldy __tokenise_work3
|
||||
beq nothing_to_flush
|
||||
|
||||
// Set low nybl to $F to mark next byte as literal
|
||||
ldy __tokenise_work2
|
||||
lda $0100,y
|
||||
ora #$0f
|
||||
sta $0100,y
|
||||
inc __tokenise_work2
|
||||
|
||||
jmp write_literal_and_terminate_if_required
|
||||
|
||||
nothing_to_flush:
|
||||
// Write the symbol as it is, or the literal
|
||||
// if it has been passed to us via fall-through
|
||||
jsr write_unpacked_char
|
||||
|
||||
jmp end_string_if_required
|
||||
|
||||
consider_next_char:
|
||||
// Pack next char
|
||||
inx
|
||||
dec __tokenise_work1
|
||||
beq !+
|
||||
jmp pack_char_loop
|
||||
!:
|
||||
// Add 1 to length if nybl waiting to be flushed
|
||||
// (but leave flag set so the caller knows if the
|
||||
// bottom nybl might be different if the string were
|
||||
// longer).
|
||||
lda __tokenise_work3
|
||||
beq !+
|
||||
inc __tokenise_work2
|
||||
rts
|
||||
!:
|
||||
// Last byte was full, so we need at $00 on the end
|
||||
// (unless a $FE token was written 2 bytes ago)
|
||||
ldy __tokenise_work2
|
||||
iny
|
||||
lda #$00
|
||||
sta $0100,y
|
||||
inc __tokenise_work2
|
||||
|
||||
rts
|
||||
|
||||
get_packed_char_index:
|
||||
// Find char in A in the packed char list, and return
|
||||
// $1 - $E, $F1 - $FD if the charactar is abbreviable,
|
||||
// or else return $00 if the character has to be stored literally.
|
||||
|
||||
// Y register and A are modified, as are processor flags.
|
||||
|
||||
ldy #$00
|
||||
find_char_loop:
|
||||
cmp packed_message_chars,y
|
||||
bne not_a_match
|
||||
enumerate:
|
||||
// Is it a nybl abbreviable char?
|
||||
cpy #14
|
||||
bcs not_nybl_char
|
||||
// Yes, so add 1 and return it
|
||||
iny
|
||||
tya
|
||||
rts
|
||||
|
||||
not_nybl_char:
|
||||
cpy #27
|
||||
bcs not_a_match
|
||||
// It's a $Fx character.
|
||||
// Since the lowest index is $E, and it should be encoded as $F1
|
||||
// we need to add $E3
|
||||
tya
|
||||
clc
|
||||
adc #$E3
|
||||
rts
|
||||
|
||||
not_a_match:
|
||||
iny
|
||||
// Loop until we find it, or we discover it isn't
|
||||
// a character with a special encoding
|
||||
cpy #27
|
||||
bne find_char_loop
|
||||
// Not a char that we can pack, so return 0
|
||||
lda #$00
|
||||
rts
|
||||
@@ -1,134 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# M65 * #TAKE
|
||||
// #LAYOUT# X16 BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
list_single_line:
|
||||
|
||||
#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0)
|
||||
|
||||
jsr map_BASIC_1
|
||||
jsr_ind VB1__list_single_line
|
||||
jmp map_NORMAL
|
||||
|
||||
#else
|
||||
|
||||
// Print line number
|
||||
ldy #3
|
||||
|
||||
#if ROM_LAYOUT_M65
|
||||
jsr peek_via_OLDTXT
|
||||
#elif CONFIG_MEMORY_MODEL_60K
|
||||
jsr peek_under_roms
|
||||
#else
|
||||
lda (OLDTXT),y
|
||||
#endif
|
||||
|
||||
pha
|
||||
dey
|
||||
|
||||
#if ROM_LAYOUT_M65
|
||||
jsr peek_via_OLDTXT
|
||||
#elif CONFIG_MEMORY_MODEL_60K
|
||||
jsr peek_under_roms
|
||||
#else
|
||||
lda (OLDTXT),y
|
||||
#endif
|
||||
|
||||
tax
|
||||
pla
|
||||
jsr print_integer
|
||||
jsr print_space
|
||||
|
||||
// Iterate through printing out the line
|
||||
// contents
|
||||
lda #0
|
||||
sta QTSW
|
||||
|
||||
ldy #4
|
||||
|
||||
list_print_loop:
|
||||
|
||||
#if ROM_LAYOUT_M65
|
||||
jsr peek_via_OLDTXT
|
||||
#elif CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<OLDTXT
|
||||
jsr peek_under_roms
|
||||
cmp #$00
|
||||
#else
|
||||
lda (OLDTXT),y
|
||||
#endif
|
||||
|
||||
beq list_end_of_line
|
||||
cmp #$22
|
||||
bne list_not_quote
|
||||
lda QTSW
|
||||
eor #$FF
|
||||
sta QTSW
|
||||
lda #$22
|
||||
jmp list_is_literal
|
||||
|
||||
list_not_quote:
|
||||
// Check quote mode, and display as literal if required
|
||||
ldx QTSW
|
||||
bne list_is_literal
|
||||
|
||||
cmp #$FF
|
||||
beq list_is_pi
|
||||
|
||||
cmp #$7F
|
||||
bcc list_is_literal
|
||||
|
||||
// Display a token
|
||||
|
||||
// Save registers
|
||||
tax
|
||||
pha
|
||||
phy_trash_a
|
||||
|
||||
// Get pointer to compressed keyword list
|
||||
lda #<packed_keywords
|
||||
sta FRESPC+0
|
||||
lda #>packed_keywords
|
||||
sta FRESPC+1
|
||||
|
||||
// Subtract $80 from token to get offset in word
|
||||
// list
|
||||
txa
|
||||
and #$7f
|
||||
tax
|
||||
|
||||
// Now ask for it to be printed
|
||||
ldy #$ff
|
||||
jsr packed_word_search
|
||||
|
||||
ply_trash_a
|
||||
pla
|
||||
|
||||
cmp #$8f
|
||||
bne list_not_rem
|
||||
// REM command locks quote flag on until the end of the line, allowing
|
||||
// funny characters in REM statements without problem.
|
||||
sta QTSW // Any value other than $00 or $FF will lock quote mode on, so the token value of REM is fine here
|
||||
// FALL THROUGH
|
||||
list_not_rem:
|
||||
|
||||
iny
|
||||
bne list_print_loop // branch always
|
||||
|
||||
list_is_pi:
|
||||
lda #$7E
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
list_is_literal:
|
||||
jsr JCHROUT
|
||||
iny
|
||||
bne list_print_loop
|
||||
|
||||
list_end_of_line:
|
||||
// Print end of line
|
||||
jmp print_return
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,244 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# M65 * #TAKE
|
||||
// #LAYOUT# X16 BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
// This routine prints messages that have been packed
|
||||
// using the make_error_tables program.
|
||||
// The general idea is to save space in the ROM.
|
||||
|
||||
// The output of make_error_tables is written to packed_messages.s, and
|
||||
// contains the following:
|
||||
//
|
||||
// packed_message_words - List of nybl packed words.
|
||||
// packed_message_tokens - List of tokens that get joined to make messages
|
||||
// packed_message_chars - List of characters in messages sorted by frequency.
|
||||
|
||||
|
||||
print_packed_message:
|
||||
// .X = message number
|
||||
|
||||
#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0)
|
||||
|
||||
jsr map_BASIC_1
|
||||
jsr_ind VB1__print_packed_message
|
||||
jmp map_NORMAL
|
||||
|
||||
#else
|
||||
|
||||
lda #$ff
|
||||
ldy #$ff
|
||||
packed_message_search:
|
||||
iny
|
||||
cpx #$00
|
||||
beq found_message_in_token_stream
|
||||
lda packed_message_tokens,y
|
||||
cmp #$ff
|
||||
bne !+
|
||||
dex
|
||||
!:
|
||||
cpy #$ff
|
||||
bne packed_message_search
|
||||
// Could not find message
|
||||
sec
|
||||
rts
|
||||
|
||||
found_message_in_token_stream: // XXX size-optimize this
|
||||
// Now print each word in the message
|
||||
phy_trash_a
|
||||
lda packed_message_tokens,y
|
||||
cmp #$FF
|
||||
beq found_message_in_token_stream_done
|
||||
|
||||
jsr print_packed_word
|
||||
ply_trash_a
|
||||
iny
|
||||
beq found_message_in_token_stream_done
|
||||
!:
|
||||
phy_trash_a
|
||||
lda packed_message_tokens,y
|
||||
cmp #$FF
|
||||
beq found_message_in_token_stream_done
|
||||
|
||||
pha
|
||||
jsr print_space
|
||||
pla
|
||||
|
||||
jsr print_packed_word
|
||||
ply_trash_a
|
||||
iny
|
||||
bne !-
|
||||
|
||||
found_message_in_token_stream_done:
|
||||
pla
|
||||
rts
|
||||
|
||||
print_packed_word:
|
||||
// A = the word to print
|
||||
tax
|
||||
|
||||
// Setup pointer to packed words
|
||||
lda #<packed_message_words
|
||||
sta FRESPC+0
|
||||
lda #>packed_message_words
|
||||
sta FRESPC+1
|
||||
|
||||
// Find the word in the list
|
||||
ldy #$ff
|
||||
packed_word_search:
|
||||
iny
|
||||
cpx #$00
|
||||
beq found_packed_word
|
||||
|
||||
// $x0 is an end of work marker
|
||||
lda (FRESPC),y
|
||||
and #$0f
|
||||
cmp #$00
|
||||
bne !+
|
||||
dex
|
||||
!:
|
||||
// $FE $xx is an end of work marker
|
||||
lda (FRESPC),y
|
||||
cmp #$fe
|
||||
bne !+
|
||||
dex
|
||||
iny // skip next byte
|
||||
!:
|
||||
cmp #$ff
|
||||
bne !+
|
||||
iny // skip next byte
|
||||
!:
|
||||
|
||||
// Advance to next page if required
|
||||
cpy #$ff
|
||||
bne packed_word_search
|
||||
inc FRESPC+1
|
||||
jmp packed_word_search
|
||||
|
||||
found_packed_word:
|
||||
|
||||
// Get pointer to start of packed word
|
||||
// Make sure we do not wrap on a page boundary
|
||||
tya
|
||||
clc
|
||||
adc FRESPC+0
|
||||
sta FRESPC+0
|
||||
lda FRESPC+1
|
||||
adc #$00
|
||||
sta FRESPC+1
|
||||
|
||||
print_packed_string:
|
||||
ldy #$ff
|
||||
|
||||
next_packed_word_char:
|
||||
// .Y = offset into packed word data - 1
|
||||
iny
|
||||
|
||||
// Check for end of word
|
||||
lda (FRESPC),y
|
||||
cmp #$00
|
||||
beq end_of_packed_word
|
||||
cmp #$fe
|
||||
beq last_literal
|
||||
cmp #$ff
|
||||
beq next_is_literal_char
|
||||
and #$f0
|
||||
beq end_of_packed_word
|
||||
|
||||
// Check if it is an uncommon char
|
||||
lda (FRESPC),y
|
||||
and #$f0
|
||||
cmp #$f0
|
||||
beq is_uncommon_char
|
||||
|
||||
// Is not an uncommon char, so get char of upper nybl
|
||||
lda (FRESPC),y
|
||||
|
||||
// Put high nybl into low bits of X
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
tax
|
||||
|
||||
// X=1-14 = first 14 chars, so subtract one
|
||||
lda packed_message_chars-1,x
|
||||
jsr JCHROUT // preserves .Y
|
||||
|
||||
// See if there is a char in the low nybl to print
|
||||
lda (FRESPC),y
|
||||
and #$0f
|
||||
beq end_of_packed_word
|
||||
cmp #$0f
|
||||
beq no_lo_nybl_char
|
||||
|
||||
has_lo_nybl_char:
|
||||
// We need to print the low nybl char as well
|
||||
tax
|
||||
phy_trash_a
|
||||
|
||||
// Skip lower nybls of $F or $0 in nybl packed
|
||||
// bytes, as these do not encode characters
|
||||
cpx #$f
|
||||
beq !+
|
||||
has_nybl:
|
||||
cpx #0
|
||||
beq !+
|
||||
|
||||
// X=1-14 = first 14 chars, so subtract one
|
||||
lda packed_message_chars-1,x
|
||||
jsr JCHROUT
|
||||
!:
|
||||
ply_trash_a
|
||||
// FALLTHROUGH
|
||||
|
||||
no_lo_nybl_char:
|
||||
|
||||
// If current byte has $0F in low nybl, then the next
|
||||
// byte is a whole byte.
|
||||
lda (FRESPC),y
|
||||
and #$0f
|
||||
cmp #$0f
|
||||
beq next_is_literal_char
|
||||
|
||||
ready_for_next_char:
|
||||
cpy #$ff
|
||||
bne next_packed_word_char
|
||||
end_of_packed_word:
|
||||
// Hit end of packed data
|
||||
rts
|
||||
|
||||
last_literal:
|
||||
jsr unpack_literal_char
|
||||
rts
|
||||
|
||||
next_is_literal_char:
|
||||
jsr unpack_literal_char
|
||||
jmp ready_for_next_char
|
||||
|
||||
unpack_literal_char:
|
||||
// Output the literal char, and ready for next char
|
||||
iny
|
||||
phy_trash_a
|
||||
lda (FRESPC),y
|
||||
jsr JCHROUT
|
||||
pla
|
||||
tay
|
||||
rts
|
||||
|
||||
is_uncommon_char:
|
||||
// Lower nybl has offset into low-frequency part of the table
|
||||
|
||||
lda (FRESPC),y
|
||||
and #$0f
|
||||
clc
|
||||
adc #14
|
||||
|
||||
// We need to print the low nybl char as well
|
||||
tax
|
||||
phy_trash_a
|
||||
|
||||
jmp has_nybl
|
||||
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,283 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# M65 * #TAKE
|
||||
// #LAYOUT# X16 BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
// Tokenise a line of BASIC
|
||||
// Stored at $0200
|
||||
// Length in __tokenise_work1
|
||||
|
||||
tokenise_line:
|
||||
|
||||
#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0)
|
||||
|
||||
jsr map_BASIC_1
|
||||
jsr_ind VB1__tokenise_line
|
||||
jmp map_NORMAL
|
||||
|
||||
#else
|
||||
|
||||
// We need to consider each offset in the string to see if it matches
|
||||
// a token. No BASIC keyword is > 7 bytes, so we need to start with that
|
||||
// length (or remaining length of string) and count our way back down.
|
||||
// This means we need separate start and end points to keep track of.
|
||||
|
||||
// $0110 = offset into string
|
||||
// $0111 = number of bytes to pack
|
||||
// $0112 = offset into tokenised output
|
||||
// $0113 = length of raw string
|
||||
|
||||
lda #$00
|
||||
sta $0110
|
||||
sta $0112
|
||||
sta QTSW
|
||||
|
||||
lda __tokenise_work1
|
||||
sta $0113
|
||||
|
||||
tokenise_char:
|
||||
|
||||
// Check if we have reached end of the line?
|
||||
lda $0110
|
||||
cmp $0113
|
||||
bne !+
|
||||
|
||||
// End of line reached
|
||||
|
||||
// Finished tokenising line
|
||||
// Update __tokenise_work1 and terminate with null
|
||||
ldx $0112
|
||||
lda #$00
|
||||
sta $0200,x
|
||||
stx __tokenise_work1
|
||||
|
||||
// Clear quote mode flag that is also used by KERNAL for screen display
|
||||
lda #$00
|
||||
sta QTSW
|
||||
rts
|
||||
!:
|
||||
// More to do
|
||||
|
||||
// Maximum keyword length
|
||||
lda #7
|
||||
sta $0111
|
||||
|
||||
tokenise_char_loop:
|
||||
// Pack the word from the start (start = X, raw len = __tokenise_work1)
|
||||
// Returns packed length in __tokenise_work2 and writes the packed
|
||||
// word at $0100+
|
||||
|
||||
ldx $0110
|
||||
lda $0200,x
|
||||
cmp #$22
|
||||
bne tk_not_quote
|
||||
|
||||
// Quote
|
||||
lda QTSW
|
||||
eor #$ff
|
||||
sta QTSW
|
||||
jmp tk_literal_char
|
||||
|
||||
tk_not_quote:
|
||||
// Check for literal characters in various ranges
|
||||
// (This just speeds the tokeniser up, by avoiding the packed token search
|
||||
// for such characters).
|
||||
|
||||
// SPACE and punctuation before +,- and *
|
||||
cmp #$2a
|
||||
bcc tk_literal_char
|
||||
// Don't try to tokenise digits
|
||||
cmp #$30
|
||||
bcc tk_might_be_keyword
|
||||
cmp #$3a
|
||||
bcs tk_might_be_keyword
|
||||
jmp tk_literal_char
|
||||
|
||||
tk_might_be_keyword:
|
||||
// Don't tokenise in quote mode
|
||||
lda QTSW
|
||||
bne tk_literal_char
|
||||
|
||||
// Pack string
|
||||
ldx $0110
|
||||
lda $0111
|
||||
sta __tokenise_work1
|
||||
|
||||
// XXX - We should implement an optimisation where we
|
||||
// trim the last symbol of successively, instead of re-packing the word
|
||||
// again with one less char each time.
|
||||
// XXX - We should limit the word length to the length of interesting chars
|
||||
// that are available.
|
||||
|
||||
jsr pack_word
|
||||
lda __tokenise_work2
|
||||
cmp #$10
|
||||
bcc !+
|
||||
// Packed string too long
|
||||
jmp do_STRING_TOO_LONG_error
|
||||
!:
|
||||
|
||||
// Search for it in keywords
|
||||
jsr keyword_search
|
||||
|
||||
// Did we find a keyword?
|
||||
bcc found_token_in_line
|
||||
|
||||
// Nope, so try shorter
|
||||
dec $0111
|
||||
bne tokenise_char_loop
|
||||
|
||||
tk_literal_char:
|
||||
// Is not a token, so copy to output verbatim
|
||||
ldx $0110
|
||||
ldy $0112
|
||||
lda $0200,x
|
||||
sta $0200,y
|
||||
inc $0112
|
||||
inc $0110
|
||||
|
||||
// Tokenise next char
|
||||
jmp tokenise_char
|
||||
|
||||
found_token_in_line:
|
||||
|
||||
// Got a token, so write it out
|
||||
ldx $0112
|
||||
sta $0200,x
|
||||
inx
|
||||
stx $0112
|
||||
|
||||
// If it is REM, then lock us in quote mode to the end of the line
|
||||
cmp #$8f
|
||||
bne not_rem
|
||||
sta QTSW
|
||||
not_rem:
|
||||
|
||||
// Now skip over the length of the token
|
||||
lda $0110
|
||||
clc
|
||||
adc $0111
|
||||
sta $0110
|
||||
|
||||
// See if there is more of the line left to process
|
||||
jmp tokenise_char
|
||||
|
||||
|
||||
|
||||
|
||||
// Search for word in keyword list
|
||||
// The packed form is canonical, so we can search for the keyword while
|
||||
// it remains compressed. This also saves a little time.
|
||||
// Algorithm is simply to find matching first bytes, and then look for
|
||||
// the rest being a match.
|
||||
|
||||
keyword_search:
|
||||
// Search for the compressed keyword stored at $0100 in the list
|
||||
// of compressed keywords
|
||||
|
||||
// __tokenise_work1 = offset in line of input
|
||||
// __tokenise_work2 = length of token we are matching
|
||||
// __tokenise_work3 = offset in token list
|
||||
// __tokenise_work5 = temporary work space
|
||||
// X and Y registers used as temporary space.
|
||||
// returns C=1 if no matching token, else C=0 and A=token
|
||||
|
||||
lda #$00
|
||||
sta __tokenise_work1
|
||||
sta __tokenise_work3
|
||||
next_kw_offset:
|
||||
// Advance offset in compressed keyword list, to see if a match
|
||||
// BEGINS here
|
||||
|
||||
// Get count of bytes to compare
|
||||
lda __tokenise_work2
|
||||
sta __tokenise_work5
|
||||
|
||||
// Load current position
|
||||
ldy __tokenise_work3
|
||||
ldx __tokenise_work1
|
||||
|
||||
// Advance offset in compressed token list, and stop at the end
|
||||
inc __tokenise_work3
|
||||
lda __tokenise_work3
|
||||
cmp #packed_keyword_table_len
|
||||
bne next_in_match
|
||||
jmp done_searching_for_token
|
||||
next_in_match:
|
||||
lda $0100,x
|
||||
cmp packed_keywords,y
|
||||
bne next_kw_offset
|
||||
// Advance to next chars in source and target
|
||||
inx
|
||||
iny
|
||||
|
||||
dec __tokenise_work5 // Have we compared all bytes yet?
|
||||
|
||||
bne next_in_match
|
||||
|
||||
// Keyword matches!
|
||||
|
||||
// Now make sure we started on a keyword boundary
|
||||
// (we know we finished on one, because of the structure of the compressed
|
||||
// keyword data).
|
||||
// Offset 0
|
||||
// previous byte is $x0
|
||||
// two byte prior is $FE
|
||||
|
||||
// Get offset of first byte of this token
|
||||
ldx __tokenise_work3
|
||||
dex // pointer points one late, so rewind it
|
||||
|
||||
// At start of list?
|
||||
cpx #$00
|
||||
beq word_boundary
|
||||
dex
|
||||
// Previous byte is $x0 end token?
|
||||
lda packed_keywords,x
|
||||
and #$0f
|
||||
beq word_boundary
|
||||
dex
|
||||
// Uber-previouss byte is $FE final literal token?
|
||||
lda packed_keywords,x
|
||||
cmp #$fe
|
||||
beq word_boundary
|
||||
|
||||
// Not a word boundary, so ignore
|
||||
jmp next_kw_offset
|
||||
|
||||
word_boundary:
|
||||
// Found a token whose offset is in __tokenise_work3
|
||||
// Now trace back to the start of the compressed keyword list
|
||||
// to work out what keyword number we are, so that we can return
|
||||
// the token number.
|
||||
|
||||
ldy #$80
|
||||
|
||||
token_count_loop:
|
||||
lda packed_keywords,x
|
||||
cmp #$fe
|
||||
bne !+
|
||||
iny
|
||||
!:
|
||||
and #$0f
|
||||
cmp #$00
|
||||
bne !+
|
||||
iny
|
||||
!:
|
||||
cpx #$00
|
||||
beq !+
|
||||
dex
|
||||
jmp token_count_loop
|
||||
!:
|
||||
|
||||
tya
|
||||
clc
|
||||
rts
|
||||
|
||||
done_searching_for_token:
|
||||
// No token found
|
||||
sec
|
||||
lda #$00
|
||||
rts
|
||||
|
||||
#endif // ROM layout
|
||||
@@ -1,38 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
#if CONFIG_TAPE_WEDGE
|
||||
|
||||
|
||||
// .X has to contain size of the buffer
|
||||
|
||||
wedge_tape:
|
||||
|
||||
lda #$FF
|
||||
sta CURLIN+1 // in case of error do not print line number
|
||||
|
||||
cpx #$02
|
||||
bne_16 do_SYNTAX_error
|
||||
|
||||
lda BUF+1
|
||||
cmp #$4C // 'L'
|
||||
bne_16 do_SYNTAX_error
|
||||
|
||||
// Execute 'arrow + L'
|
||||
|
||||
lda #$00
|
||||
sta FNLEN
|
||||
|
||||
ldy #$01
|
||||
ldx #$07 // turbo tape device
|
||||
jsr JSETFLS
|
||||
|
||||
ldy TXTTAB+1
|
||||
ldx TXTTAB+0
|
||||
|
||||
jmp cmd_load_got_secondaryaddress
|
||||
|
||||
|
||||
#endif // CONFIG_TAPE_WEDGE
|
||||
@@ -1,24 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
hw_entry_nmi:
|
||||
|
||||
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
|
||||
#endif
|
||||
|
||||
// Call interrupt routine (only if initialised)
|
||||
pha
|
||||
lda NMINV
|
||||
ora NMINV+1
|
||||
beq !+
|
||||
pla
|
||||
jmp (NMINV)
|
||||
!:
|
||||
// Vector not initialized - call default interrupt routine
|
||||
pla
|
||||
jmp default_nmi_handler
|
||||
@@ -1,17 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Print configured features on startup banner
|
||||
//
|
||||
|
||||
#if CONFIG_SHOW_FEATURES
|
||||
|
||||
print_features:
|
||||
|
||||
ldx #__MSG_KERNAL_FEATURES
|
||||
!:
|
||||
jmp print_kernal_message
|
||||
|
||||
#endif // CONFIG_SHOW_FEATURES
|
||||
@@ -1,20 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Print video system on startup banner
|
||||
//
|
||||
|
||||
#if CONFIG_SHOW_PAL_NTSC
|
||||
|
||||
print_pal_ntsc:
|
||||
|
||||
ldx #__MSG_KERNAL_NTSC
|
||||
lda TVSFLG
|
||||
beq !+
|
||||
ldx #__MSG_KERNAL_PAL
|
||||
!:
|
||||
jmp print_kernal_message
|
||||
|
||||
#endif // CONFIG_SHOW_PAL_NTSC
|
||||
@@ -1,130 +0,0 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# X16 * #IGNORE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Jumptable for screen control codes support. To improve performance, should be sorted
|
||||
// starting from the least probable routine.
|
||||
//
|
||||
|
||||
|
||||
chrout_screen_jumptable_codes:
|
||||
|
||||
.byte KEY_CLR
|
||||
.byte KEY_HOME
|
||||
.byte KEY_SHIFT_OFF
|
||||
.byte KEY_SHIFT_ON
|
||||
.byte KEY_TXT
|
||||
.byte KEY_GFX
|
||||
.byte KEY_RVS_OFF
|
||||
.byte KEY_RVS_ON
|
||||
.byte KEY_CRSR_RIGHT
|
||||
.byte KEY_CRSR_LEFT
|
||||
.byte KEY_CRSR_DOWN
|
||||
.byte KEY_CRSR_UP
|
||||
.byte KEY_INS
|
||||
|
||||
__chrout_screen_jumptable_quote_guard:
|
||||
|
||||
#if CONFIG_EDIT_STOPQUOTE
|
||||
.byte KEY_STOP
|
||||
#endif
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.byte KEY_TAB_BW
|
||||
.byte KEY_TAB_FW
|
||||
#endif
|
||||
.byte KEY_DEL
|
||||
.byte KEY_RETURN
|
||||
|
||||
__chrout_screen_jumptable_codes_end:
|
||||
|
||||
|
||||
#if !HAS_OPCODES_65C02
|
||||
|
||||
chrout_screen_jumptable_lo:
|
||||
|
||||
.byte <(chrout_screen_CLR - 1)
|
||||
.byte <(chrout_screen_HOME - 1)
|
||||
.byte <(chrout_screen_SHIFT_OFF - 1)
|
||||
.byte <(chrout_screen_SHIFT_ON - 1)
|
||||
.byte <(chrout_screen_TXT - 1)
|
||||
.byte <(chrout_screen_GFX - 1)
|
||||
.byte <(chrout_screen_RVS_OFF - 1)
|
||||
.byte <(chrout_screen_RVS_ON - 1)
|
||||
.byte <(chrout_screen_CRSR_RIGHT - 1)
|
||||
.byte <(chrout_screen_CRSR_LEFT - 1)
|
||||
.byte <(chrout_screen_CRSR_DOWN - 1)
|
||||
.byte <(chrout_screen_CRSR_UP - 1)
|
||||
.byte <(chrout_screen_INS - 1)
|
||||
#if CONFIG_EDIT_STOPQUOTE
|
||||
.byte <(chrout_screen_STOP - 1)
|
||||
#endif
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.byte <(chrout_screen_TAB_BW - 1)
|
||||
.byte <(chrout_screen_TAB_FW - 1)
|
||||
#endif
|
||||
.byte <(chrout_screen_DEL - 1)
|
||||
.byte <(chrout_screen_RETURN - 1)
|
||||
|
||||
chrout_screen_jumptable_hi:
|
||||
|
||||
.byte >(chrout_screen_CLR - 1)
|
||||
.byte >(chrout_screen_HOME - 1)
|
||||
.byte >(chrout_screen_SHIFT_OFF - 1)
|
||||
.byte >(chrout_screen_SHIFT_ON - 1)
|
||||
.byte >(chrout_screen_TXT - 1)
|
||||
.byte >(chrout_screen_GFX - 1)
|
||||
.byte >(chrout_screen_RVS_OFF - 1)
|
||||
.byte >(chrout_screen_RVS_ON - 1)
|
||||
.byte >(chrout_screen_CRSR_RIGHT - 1)
|
||||
.byte >(chrout_screen_CRSR_LEFT - 1)
|
||||
.byte >(chrout_screen_CRSR_DOWN - 1)
|
||||
.byte >(chrout_screen_CRSR_UP - 1)
|
||||
.byte >(chrout_screen_INS - 1)
|
||||
#if CONFIG_EDIT_STOPQUOTE
|
||||
.byte >(chrout_screen_STOP - 1)
|
||||
#endif
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.byte >(chrout_screen_TAB_BW - 1)
|
||||
.byte >(chrout_screen_TAB_FW - 1)
|
||||
#endif
|
||||
.byte >(chrout_screen_DEL - 1)
|
||||
.byte >(chrout_screen_RETURN - 1)
|
||||
|
||||
#else
|
||||
|
||||
__before_chrout_screen_jumptable:
|
||||
|
||||
.if (mod(*, $2) == 1) { brk } // align code so that vector never crosses page boundary
|
||||
|
||||
chrout_screen_jumptable:
|
||||
|
||||
.word chrout_screen_CLR
|
||||
.word chrout_screen_HOME
|
||||
.word chrout_screen_SHIFT_OFF
|
||||
.word chrout_screen_SHIFT_ON
|
||||
.word chrout_screen_TXT
|
||||
.word chrout_screen_GFX
|
||||
.word chrout_screen_RVS_OFF
|
||||
.word chrout_screen_RVS_ON
|
||||
.word chrout_screen_CRSR_RIGHT
|
||||
.word chrout_screen_CRSR_LEFT
|
||||
.word chrout_screen_CRSR_DOWN
|
||||
.word chrout_screen_CRSR_UP
|
||||
.word chrout_screen_INS
|
||||
#if CONFIG_EDIT_STOPQUOTE
|
||||
.word chrout_screen_STOP
|
||||
#endif
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.word chrout_screen_TAB_BW
|
||||
.word chrout_screen_TAB_FW
|
||||
#endif
|
||||
.word chrout_screen_DEL
|
||||
.word chrout_screen_RETURN
|
||||
|
||||
// Make sure routine size is always the same - build system limitation
|
||||
|
||||
.if (__before_chrout_screen_jumptable == chrout_screen_jumptable) { brk }
|
||||
|
||||
#endif
|
||||
@@ -59,6 +59,10 @@ There is no official PETSCII code for `TAB` - we can't utilize the ones from C12
|
||||
|
||||
Bits 3 and 4 are extension to the original variable, compatible with the C128 ROMs API. There is no official way to retrieve `NO_SCRL` status as of yet. The `40/80` key status cannot be retrieved in C64 mode at all (C128 hardware limitation).
|
||||
|
||||
#### NMI vector modification
|
||||
|
||||
Before modifying NMI vector, set it's high byte to 0. The ROM routine considers such address invalid and won't try to call the custom code, thus preventing a crash if interrupt happens in the worst possible moment.
|
||||
|
||||
#### Mega65 native mode
|
||||
|
||||
Mega65 build starts in legacy mode, which is intended to be reasonably compatible with the C64 ROMs. However, a native Mega65 mode is planned too, to make it easier to utilise extra features of this machine. Soo far the following has been done:
|
||||
@@ -128,6 +132,7 @@ where:
|
||||
| `#IGNORE` | ignore the file completely |
|
||||
| `#TAKE` | compile the file normally |
|
||||
| `#TAKE-FLOAT` | compile the file, but force it to be floating |
|
||||
| `#TAKE-HIGH` | as above, but always place routine at `$E000` or above |
|
||||
| `#TAKE-OFFSET` | shifts the fixed-location address by hex offset given as parameter |
|
||||
|
||||
The first match counts, all the remaining ones are dropped. Examples:
|
||||
@@ -180,6 +185,8 @@ ROUTINE_NAME:
|
||||
#endif
|
||||
```
|
||||
|
||||
Last, but not least - the `#TAKE-HIGH` is intended to be used for BASIC routines, which should still be available after the main BASIC ROM is banked out.
|
||||
|
||||
### CPU-specific optimizations
|
||||
|
||||
TODO
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
# Extended BASIC
|
||||
|
||||
NOTE: Command syntax, behaviour details, and tokens are still subject to change! In the future most (if not all) extended commands will be available only on machines with extended ROM, like the Mega65.
|
||||
|
||||
## Additional commands
|
||||
|
||||
### `FAST`
|
||||
|
||||
Tries to switch the machine to turbo mode - details differ depending on the configured machine / motherboard.
|
||||
|
||||
### `SLOW`
|
||||
|
||||
Tries to switch the machine back to 1 MHz operation mode.
|
||||
|
||||
### `MERGE "file_name" [, device_number]`
|
||||
|
||||
Appends the BASIC program from a storage medium to the one currently present in memory. NOTE: due to bug in BASIC editor (improper VARTAB handling) it currently works only with programs loaded from the storage medium, not the ones typed in!
|
||||
|
||||
### `BLOAD "file_name", device_number, start_address`
|
||||
|
||||
Loads a binary file starting from the given memory location. Does not clear variables, does not perform BASIC program relinking, etc. NOTE: for now syntax differs from the BASIC V3.5+ - this will be changed once the necessary BASIC infrastructure is implemented.
|
||||
|
||||
### `BVERIFY "file_name", device_number, start_address`
|
||||
|
||||
Verify operation for the binary data starting from a given addres. NOTE: for now syntax differs from the BASIC V3.5+ - this will be changed once the necessary BASIC infrastructure is implemented.
|
||||
|
||||
### `BSAVE "file_name", device_number, start_address, end_address`
|
||||
|
||||
Saves the binary data from the given memory area. NOTE: for now syntax differs from the BASIC V3.5+ - this will be changed once the necessary BASIC infrastructure is implemented.
|
||||
@@ -39,7 +39,9 @@
|
||||
|
||||
// Memory model
|
||||
|
||||
#define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_46K
|
||||
#define CONFIG_MEMORY_MODEL_50K
|
||||
// #define CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
@@ -49,10 +51,10 @@
|
||||
#define CONFIG_IEC_DOLPHINDOS
|
||||
#define CONFIG_IEC_DOLPHINDOS_FAST
|
||||
#define CONFIG_IEC_JIFFYDOS
|
||||
#define CONFIG_IEC_JIFFYDOS_BLANK
|
||||
// #define CONFIG_IEC_JIFFYDOS_BLANK
|
||||
// #define CONFIG_IEC_BURST_CIA1 // please keep disabled for now
|
||||
// #define CONFIG_IEC_BURST_CIA2 // please keep disabled for now
|
||||
// #define CONFIG_IEC_BURST_SOFT // please keep disabled for now
|
||||
// #define CONFIG_IEC_BURST_MEGA_65 // please keep disabled for now
|
||||
|
||||
#define CONFIG_TAPE_NORMAL
|
||||
#define CONFIG_TAPE_TURBO
|
||||
@@ -87,8 +89,8 @@
|
||||
// #define CONFIG_KEY_REPEAT_DEFAULT
|
||||
// #define CONFIG_KEY_REPEAT_ALWAYS
|
||||
#define CONFIG_KEY_FAST_SCAN
|
||||
#define CONFIG_JOY1_CURSOR
|
||||
#define CONFIG_JOY2_CURSOR
|
||||
// #define CONFIG_JOY1_CURSOR
|
||||
// #define CONFIG_JOY2_CURSOR
|
||||
|
||||
#define CONFIG_PROGRAMMABLE_KEYS
|
||||
|
||||
@@ -124,9 +126,9 @@
|
||||
#define CONFIG_PANIC_SCREEN
|
||||
#define CONFIG_DOS_WEDGE
|
||||
#define CONFIG_TAPE_WEDGE
|
||||
// #define CONFIG_TAPE_HEAD_ALIGN
|
||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||
|
||||
|
||||
// Eye candy
|
||||
|
||||
// #define CONFIG_COLORS_BRAND
|
||||
@@ -134,10 +136,13 @@
|
||||
#define CONFIG_BANNER_FANCY
|
||||
// #define CONFIG_BANNER_BRAND
|
||||
#define CONFIG_SHOW_FEATURES
|
||||
#define CONFIG_SHOW_PAL_NTSC
|
||||
|
||||
|
||||
// Debug options
|
||||
|
||||
// #define CONFIG_DBG_STUBS_BRK
|
||||
// #define CONFIG_DBG_PRINTF
|
||||
|
||||
// Other
|
||||
|
||||
// #define CONFIG_COMPRESSION_LVL_2
|
||||
@@ -39,6 +39,8 @@
|
||||
// Memory model
|
||||
|
||||
#define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_46K
|
||||
// #define CONFIG_MEMORY_MODEL_50K
|
||||
// #define CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
@@ -117,6 +119,7 @@
|
||||
// #define CONFIG_PANIC_SCREEN
|
||||
// #define CONFIG_DOS_WEDGE
|
||||
// #define CONFIG_TAPE_WEDGE
|
||||
// #define CONFIG_TAPE_HEAD_ALIGN
|
||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||
|
||||
|
||||
@@ -127,10 +130,13 @@
|
||||
#define CONFIG_BANNER_FANCY
|
||||
// #define CONFIG_BANNER_BRAND
|
||||
// #define CONFIG_SHOW_FEATURES
|
||||
// #define CONFIG_SHOW_PAL_NTSC
|
||||
|
||||
|
||||
// Debug options
|
||||
|
||||
// #define CONFIG_DBG_STUBS_BRK
|
||||
// #define CONFIG_DBG_PRINTF
|
||||
|
||||
// Other
|
||||
|
||||
// #define CONFIG_COMPRESSION_LVL_2
|
||||
@@ -36,7 +36,9 @@
|
||||
|
||||
// Memory model
|
||||
|
||||
#define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_46K
|
||||
#define CONFIG_MEMORY_MODEL_50K
|
||||
// #define CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
@@ -115,6 +117,7 @@
|
||||
#define CONFIG_PANIC_SCREEN
|
||||
#define CONFIG_DOS_WEDGE
|
||||
#define CONFIG_TAPE_WEDGE
|
||||
// #define CONFIG_TAPE_HEAD_ALIGN
|
||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||
|
||||
|
||||
@@ -125,10 +128,13 @@
|
||||
#define CONFIG_BANNER_FANCY
|
||||
// #define CONFIG_BANNER_BRAND
|
||||
#define CONFIG_SHOW_FEATURES
|
||||
#define CONFIG_SHOW_PAL_NTSC
|
||||
|
||||
|
||||
// Debug options
|
||||
|
||||
// #define CONFIG_DBG_STUBS_BRK
|
||||
// #define CONFIG_DBG_PRINTF
|
||||
|
||||
// Other
|
||||
|
||||
// #define CONFIG_COMPRESSION_LVL_2
|
||||
@@ -36,7 +36,9 @@
|
||||
|
||||
// Memory model
|
||||
|
||||
#define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_46K
|
||||
#define CONFIG_MEMORY_MODEL_50K
|
||||
// #define CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
@@ -96,11 +98,11 @@
|
||||
|
||||
.const CONFIG_KEYCMD_HELP = @"LIST"
|
||||
|
||||
.const CONFIG_KEYCMD_F9 = @"REM F9"
|
||||
.const CONFIG_KEYCMD_F9 = @"BOOT"
|
||||
.const CONFIG_KEYCMD_F10 = @"REM F10"
|
||||
.const CONFIG_KEYCMD_F11 = @"REM F11"
|
||||
.const CONFIG_KEYCMD_F11 = @"MONITOR"
|
||||
.const CONFIG_KEYCMD_F12 = @"REM F12"
|
||||
.const CONFIG_KEYCMD_F13 = @"REM F13"
|
||||
.const CONFIG_KEYCMD_F13 = @"\$5FH"
|
||||
.const CONFIG_KEYCMD_F14 = @"REM F14"
|
||||
|
||||
|
||||
@@ -115,6 +117,7 @@
|
||||
#define CONFIG_PANIC_SCREEN
|
||||
#define CONFIG_DOS_WEDGE
|
||||
#define CONFIG_TAPE_WEDGE
|
||||
#define CONFIG_TAPE_HEAD_ALIGN
|
||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||
|
||||
|
||||
@@ -125,10 +128,13 @@
|
||||
// #define CONFIG_BANNER_FANCY
|
||||
#define CONFIG_BANNER_BRAND
|
||||
// #define CONFIG_SHOW_FEATURES
|
||||
// #define CONFIG_SHOW_PAL_NTSC
|
||||
|
||||
|
||||
// Debug options
|
||||
|
||||
// #define CONFIG_DBG_STUBS_BRK
|
||||
// #define CONFIG_DBG_PRINTF
|
||||
|
||||
// Other
|
||||
|
||||
// #define CONFIG_COMPRESSION_LVL_2
|
||||
@@ -37,6 +37,8 @@
|
||||
// Memory model
|
||||
|
||||
// #define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_46K
|
||||
// #define CONFIG_MEMORY_MODEL_50K
|
||||
#define CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
@@ -115,6 +117,7 @@
|
||||
#define CONFIG_PANIC_SCREEN
|
||||
#define CONFIG_DOS_WEDGE
|
||||
#define CONFIG_TAPE_WEDGE
|
||||
// #define CONFIG_TAPE_HEAD_ALIGN
|
||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||
|
||||
|
||||
@@ -125,10 +128,13 @@
|
||||
// #define CONFIG_BANNER_FANCY
|
||||
// #define CONFIG_BANNER_BRAND
|
||||
#define CONFIG_SHOW_FEATURES
|
||||
#define CONFIG_SHOW_PAL_NTSC
|
||||
|
||||
|
||||
// Debug options
|
||||
|
||||
// #define CONFIG_DBG_STUBS_BRK
|
||||
#define CONFIG_DBG_PRINTF
|
||||
|
||||
// Other
|
||||
|
||||
// #define CONFIG_COMPRESSION_LVL_2
|
||||
@@ -36,7 +36,9 @@
|
||||
|
||||
// Memory model
|
||||
|
||||
#define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_46K
|
||||
#define CONFIG_MEMORY_MODEL_50K
|
||||
// #define CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
@@ -115,6 +117,7 @@
|
||||
#define CONFIG_PANIC_SCREEN
|
||||
#define CONFIG_DOS_WEDGE
|
||||
#define CONFIG_TAPE_WEDGE
|
||||
// #define CONFIG_TAPE_HEAD_ALIGN
|
||||
#define CONFIG_BCD_SAFE_INTERRUPTS
|
||||
|
||||
|
||||
@@ -125,10 +128,13 @@
|
||||
#define CONFIG_BANNER_FANCY
|
||||
// #define CONFIG_BANNER_BRAND
|
||||
#define CONFIG_SHOW_FEATURES
|
||||
#define CONFIG_SHOW_PAL_NTSC
|
||||
|
||||
|
||||
// Debug options
|
||||
|
||||
// #define CONFIG_DBG_STUBS_BRK
|
||||
// #define CONFIG_DBG_PRINTF
|
||||
|
||||
// Other
|
||||
|
||||
// #define CONFIG_COMPRESSION_LVL_2
|
||||
@@ -121,6 +121,12 @@
|
||||
#if CONFIG_MEMORY_MODEL_38K
|
||||
.eval selected++
|
||||
#endif
|
||||
#if CONFIG_MEMORY_MODEL_46K
|
||||
.eval selected++
|
||||
#endif
|
||||
#if CONFIG_MEMORY_MODEL_50K
|
||||
.eval selected++
|
||||
#endif
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
.eval selected++
|
||||
#endif
|
||||
@@ -148,12 +154,12 @@
|
||||
.error "CONFIG_IEC_DOLPHINDOS_FAST requires CONFIG_IEC_DOLPHINDOS"
|
||||
#endif
|
||||
|
||||
#if (CONFIG_IEC_BURST_CIA1 || CONFIG_IEC_BURST_CIA1 || CONFIG_IEC_BURST_SOFT) && !CONFIG_IEC
|
||||
#if (CONFIG_IEC_BURST_CIA1 || CONFIG_IEC_BURST_CIA1 || CONFIG_IEC_BURST_MEGA_65) && !CONFIG_IEC
|
||||
.error "CONFIG_IEC_BURST_* requires CONFIG_IEC"
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEC_BURST_SOFT && !CONFIG_MB_MEGA_65
|
||||
.error "CONFIG_IEC_BURST_SOFT requires CONFIG_MB_MEGA_65"
|
||||
#if CONFIG_IEC_BURST_MEGA_65 && !CONFIG_MB_MEGA_65
|
||||
.error "CONFIG_IEC_BURST_MEGA_65 requires CONFIG_MB_MEGA_65"
|
||||
#endif
|
||||
|
||||
.var selected_iec_burst = 0;
|
||||
@@ -164,7 +170,7 @@
|
||||
#if CONFIG_IEC_BURST_CIA2
|
||||
.eval selected_iec_burst++
|
||||
#endif
|
||||
#if CONFIG_IEC_BURST_SOFT
|
||||
#if CONFIG_IEC_BURST_MEGA_65
|
||||
.eval selected_iec_burst++
|
||||
#endif
|
||||
|
||||
@@ -295,8 +301,11 @@
|
||||
|
||||
// Check that features are configured correctly
|
||||
{
|
||||
#if CONFIG_TAPE_WEDGE && !CONFIG_TAPE_TURBO
|
||||
.error "CONFIG_TAPE_WEDGE requires CONFIG_TAPE_TURBO"
|
||||
#if CONFIG_TAPE_WEDGE && !CONFIG_TAPE_TURBO && !CONFIG_TAPE_NORMAL
|
||||
.error "CONFIG_TAPE_WEDGE requires CONFIG_TAPE_TURBO or CONFIG_TAPE_NORMAL"
|
||||
#endif
|
||||
#if !CONFIG_TAPE_WEDGE && CONFIG_TAPE_HEAD_ALIGN
|
||||
.error "CONFIG_TAPE_HEAD_ALIGN requires CONFIG_TAPE_WEDGE"
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -341,84 +350,17 @@
|
||||
}
|
||||
|
||||
|
||||
// Function for printing out build features
|
||||
|
||||
.var feature_new_line = false
|
||||
// Setup colors
|
||||
|
||||
.function ADD_FEATURE(current_features, new_feature)
|
||||
{
|
||||
.var features_str = current_features
|
||||
#if CONFIG_COLORS_BRAND && CONFIG_BRAND_ULTIMATE_64
|
||||
|
||||
.if (!feature_new_line && features_str.size() > 0)
|
||||
{
|
||||
.eval features_str = features_str + ", "
|
||||
}
|
||||
.const CONFIG_COLOR_BG = $00
|
||||
.const CONFIG_COLOR_TXT = $01
|
||||
|
||||
.if (feature_new_line)
|
||||
{
|
||||
.eval feature_new_line = false
|
||||
.eval features_str = features_str + @"\r"
|
||||
}
|
||||
#else
|
||||
|
||||
.return features_str + new_feature
|
||||
}
|
||||
.const CONFIG_COLOR_BG = $06
|
||||
.const CONFIG_COLOR_TXT = $01
|
||||
|
||||
.function BUILD_FEATURES_STR()
|
||||
{
|
||||
.var features_str = ""
|
||||
|
||||
#if CONFIG_TAPE_NORMAL && !CONFIG_TAPE_TURBO
|
||||
.eval features_str = ADD_FEATURE(features_str, "TAPE LOAD NORMAL")
|
||||
#endif
|
||||
#if !CONFIG_TAPE_NORMAL && CONFIG_TAPE_TURBO
|
||||
.eval features_str = ADD_FEATURE(features_str, "TAPE LOAD TURBO")
|
||||
#endif
|
||||
#if CONFIG_TAPE_NORMAL && CONFIG_TAPE_TURBO
|
||||
.eval features_str = ADD_FEATURE(features_str, "TAPE LOAD NORMAL TURBO")
|
||||
#endif
|
||||
|
||||
.eval feature_new_line = true
|
||||
|
||||
#if CONFIG_IEC
|
||||
.var iec_features_str = "IEC"
|
||||
#if CONFIG_IEC_BURST_CIA1
|
||||
.eval iec_features_str = iec_features_str + " BURST1"
|
||||
#endif
|
||||
#if CONFIG_IEC_BURST_CIA2
|
||||
.eval iec_features_str = iec_features_str + " BURST2"
|
||||
#endif
|
||||
#if CONFIG_IEC_BURST_SOFT
|
||||
.eval iec_features_str = iec_features_str + " BURST"
|
||||
#endif
|
||||
#if CONFIG_IEC_DOLPHINDOS
|
||||
.eval iec_features_str = iec_features_str + " DOLPHIN"
|
||||
#endif
|
||||
#if CONFIG_IEC_JIFFYDOS
|
||||
.eval iec_features_str = iec_features_str + " JIFFY"
|
||||
#endif
|
||||
#if !CONFIG_IEC_BURST_CIA1 && !CONFIG_IEC_BURST_CIA2 && !CONFIG_IEC_BURST_SOFT && !CONFIG_IEC_DOLPHINDOS && !CONFIG_IEC_JIFFYDOS
|
||||
.eval iec_features_str = iec_features_str + " NORMAL"
|
||||
#endif
|
||||
.eval features_str = ADD_FEATURE(features_str, iec_features_str)
|
||||
#endif
|
||||
|
||||
.eval feature_new_line = true
|
||||
|
||||
#if CONFIG_RS232_UP2400
|
||||
.eval features_str = ADD_FEATURE(features_str, "UP2400")
|
||||
#endif
|
||||
|
||||
#if CONFIG_RS232_UP2400
|
||||
.eval features_str = ADD_FEATURE(features_str, "UP9600")
|
||||
#endif
|
||||
|
||||
#if CONFIG_KEYBOARD_C128
|
||||
.eval features_str = ADD_FEATURE(features_str, "KBD 128")
|
||||
#endif
|
||||
|
||||
#if CONFIG_KEYBOARD_C65
|
||||
.eval features_str = ADD_FEATURE(features_str, "KBD 65")
|
||||
#endif
|
||||
|
||||
.return features_str
|
||||
}
|
||||
@@ -42,6 +42,41 @@
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Macros for generating jumptables
|
||||
//
|
||||
|
||||
|
||||
.macro put_jumptable_lo(list)
|
||||
{
|
||||
.for (var i = 0; i < list.size(); i++)
|
||||
{
|
||||
.byte mod((list.get(i) - 1), $100)
|
||||
}
|
||||
}
|
||||
|
||||
.macro put_jumptable_hi(list)
|
||||
{
|
||||
.for (var i = 0; i < list.size(); i++)
|
||||
{
|
||||
.byte floor((list.get(i) - 1) / $100)
|
||||
}
|
||||
}
|
||||
|
||||
#if HAS_OPCODES_65C02
|
||||
|
||||
.macro put_jumptable(list)
|
||||
{
|
||||
.for (var i = 0; i < list.size(); i++)
|
||||
{
|
||||
.word list.get(i)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Trick to skip a 2-byte instruction
|
||||
//
|
||||
File renamed without changes.
@@ -125,6 +125,10 @@
|
||||
.label SID_RANDOM = $D41B
|
||||
.label SID_ENV3 = $D41C
|
||||
|
||||
// Color COLOR_RAM
|
||||
|
||||
.label COLOR_RAM = $D800
|
||||
|
||||
// CIA #1 registers
|
||||
|
||||
.label __CIA1_BASE = $DC00 // base address of the chip
|
||||
@@ -183,10 +187,17 @@
|
||||
|
||||
#if CONFIG_MB_MEGA_65
|
||||
|
||||
.const C65_EXTKEYS_PR = $D607
|
||||
.const C65_EXTKEYS_DDR = $D608
|
||||
.label C65_EXTKEYS_PR = $D607
|
||||
.label C65_EXTKEYS_DDR = $D608
|
||||
|
||||
.const M65_BADL_SLI = $D710
|
||||
.label M65_BADL_SLI = $D710
|
||||
|
||||
#else
|
||||
|
||||
// SuperCPU registers
|
||||
|
||||
.label SCPU_SPEED_NORMAL = $D07A
|
||||
.label SCPU_SPEED_TURBO = $D07B
|
||||
|
||||
#endif
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -17,10 +17,10 @@
|
||||
.label CHARAC = $07 // [!] our implementation might be different XXX give more details
|
||||
.label ENDCHR = $08 // [!] our implementation might be different XXX give more details
|
||||
.label TRMPOS = $09 // -- NOT IMPLEMENTED --
|
||||
.label VERCKB = $0A // -- NOT IMPLEMENTED --
|
||||
.label VERCKB = $0A // flag used by BASIC, 0 - LOAD, 1 - VERIFY
|
||||
.label COUNT = $0B // [!] our implementation might be different XXX give more details
|
||||
.label DIMFLG = $0C // [!] our implementation might be different XXX give more details
|
||||
.label VALTYP = $0D // -- NOT IMPLEMENTED --
|
||||
.label VALTYP = $0D // expression eveluation result; $00 - float, $FF - string
|
||||
.label INTFLG = $0E // -- NOT IMPLEMENTED --
|
||||
.label GARBFL = $0F // [!] our implementation might be different XXX give more details
|
||||
.label SUBFLG = $10 // -- NOT IMPLEMENTED --
|
||||
@@ -28,9 +28,9 @@
|
||||
.label TANSGN = $12 // -- NOT IMPLEMENTED --
|
||||
.label CHANNL = $13 // -- NOT IMPLEMENTED --
|
||||
.label LINNUM = $14 // $14-$15 BASIC line number, [!] also used by DOS Wedge
|
||||
.label TEMPPT = $16 // -- NOT IMPLEMENTED --
|
||||
.label LASTPT = $17 // $17-$18 -- NOT IMPLEMENTED --
|
||||
.label TEMPST = $19 // $19-$21 -- NOT IMPLEMENTED --
|
||||
.label TEMPPT = $16 // pointer to the first available slot in the temporary string descriptor stack
|
||||
.label LASTPT = $17 // $17-$18 pointer to the last used slot in the temporary string descriptor
|
||||
.label TEMPST = $19 // $19-$21 temporary string stack descriptors
|
||||
.label INDEX = $22 // $22-$25 temporary variables, [!] our usage might be different
|
||||
.label RESHO = $26 // $26-$2A -- NOT IMPLEMENTED --
|
||||
.label TXTTAB = $2B // $2B-$2C start of BASIC code
|
||||
@@ -49,7 +49,7 @@
|
||||
.label VARNAM = $45 // $45-$46 -- NOT IMPLEMENTED --
|
||||
.label VARPNT = $47 // $47-$48 -- NOT IMPLEMENTED --
|
||||
.label FORPNT = $49 // $49-$4A -- NOT IMPLEMENTED --
|
||||
.label OPPTR = $4B // $4B-$4C -- NOT IMPLEMENTED --
|
||||
.label OPPTR = $4B // $4B-$4C helper variable for expression computation, [!] our usage details are different
|
||||
.label OPMASK = $4D // -- NOT IMPLEMENTED --
|
||||
.label DEFPNT = $4E // $4E-$4F -- NOT IMPLEMENTED --
|
||||
.label DSCPNT = $50 // $50-$52 -- NOT IMPLEMENTED --
|
||||
@@ -103,7 +103,7 @@
|
||||
.label PTR1 = $9E // for tape support, counter of errorneous bytes
|
||||
.label PTR2 = $9F // for tape support, counter for errorneous bytes correction
|
||||
.label TIME = $A0 // $A0-$A2 jiffy clock
|
||||
#if !CONFIG_IEC_JIFFYDOS && !CONFIG_IEC_DOLPHINDOS && !CONFIG_IEC_BURST_CIA1 && !CONFIG_IEC_BURST_CIA2 && !CONFIG_IEC_BURST_SOFT
|
||||
#if !CONFIG_IEC_JIFFYDOS && !CONFIG_IEC_DOLPHINDOS && !CONFIG_IEC_BURST_CIA1 && !CONFIG_IEC_BURST_CIA2 && !CONFIG_IEC_BURST_MEGA_65
|
||||
.label TSFCNT = $A3 // temporary variable for tape and IEC, [!] our usage differs
|
||||
#else
|
||||
.label IECPROTO = $A3 // -- WIP -- [!] 0 = normal, 1 = JiffyDOS, >= $80 for unknown
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -43,10 +43,8 @@
|
||||
.label print_return = KERNAL().print_return
|
||||
.label print_space = KERNAL().print_space
|
||||
|
||||
#if CONFIG_SHOW_FEATURES
|
||||
.label print_features = KERNAL().print_features
|
||||
#if CONFIG_TAPE_HEAD_ALIGN
|
||||
.label tape_head_align = KERNAL().tape_head_align
|
||||
#endif
|
||||
|
||||
#if CONFIG_SHOW_PAL_NTSC
|
||||
.label print_pal_ntsc = KERNAL().print_pal_ntsc
|
||||
#endif
|
||||
.label filename_any = KERNAL().filename_any
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 771 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user