From ed51a62f32e2970a2a9d7edd3caa7913b6a9b7b9 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 11 Sep 2019 19:21:02 +0200 Subject: [PATCH 01/40] several features are now optional, added legacy BASIC memory model --- CONFIG.md | 58 ++++++++++++++++++++++ Makefile | 36 ++++++++++---- STATUS.md | 2 +- c64/,,config_generic.s | 19 +++++++ c64/,,config_mega65.s | 19 +++++++ c64/,,config_ultimate64.s | 19 +++++++ c64/aliases/,aliases_hardware.s | 8 +++ c64/basic/,aliases.s | 4 ++ c64/basic/basic_delete_line.s | 14 +++++- c64/basic/basic_execute_line.s | 53 ++++++++++++++++---- c64/basic/basic_find_line.s | 31 ++++++++++-- c64/basic/basic_find_next_line.s | 14 +++++- c64/basic/basic_follow_link_to_next_line.s | 14 +++++- c64/basic/basic_insert_line.s | 22 ++++++-- c64/basic/basic_shift_mem_down.s | 31 ++++++++++-- c64/basic/basic_shift_mem_up.s | 44 ++++++++++++++-- c64/basic/basic_warm_start.s | 4 ++ c64/basic/cmd_list.s | 29 ++++++++++- c64/basic/cmd_load.s | 24 +++++++++ c64/basic/cmd_new.s | 19 +++++-- c64/basic/peek_line_pointer_null_check.s | 34 +++++++++++++ c64/basic/peek_pointer_null_check.s | 20 -------- c64/basic/under_rom_routines.s | 46 +++++++++++++++++ c64/basic/wedge_dos.s | 4 +- c64/kernal/,aliases.s | 3 ++ c64/kernal/f34a.open.s | 2 + c64/kernal/f4a5.load.s | 2 + c64/kernal/fda3.ioinit.s | 32 +++++++++++- c64/kernal/lvs_helpers.s | 16 +++++- c64/kernal/under_rom_routines.s | 4 ++ 30 files changed, 555 insertions(+), 72 deletions(-) create mode 100644 CONFIG.md create mode 100644 c64/,,config_generic.s create mode 100644 c64/,,config_mega65.s create mode 100644 c64/,,config_ultimate64.s create mode 100644 c64/basic/peek_line_pointer_null_check.s delete mode 100644 c64/basic/peek_pointer_null_check.s diff --git a/CONFIG.md b/CONFIG.md new file mode 100644 index 00000000..8975dc56 --- /dev/null +++ b/CONFIG.md @@ -0,0 +1,58 @@ + +# Configuring the build + +It's not possible to provide ROM builds that suit everyone needs - therefore configuration files were introduced, separately for each of the hardware targets: + +* [`c64/,,config_generic.s`](c64/,,config_generic.s) +* [`c64/,,config_mega65.s`](c64/,,config_mega65.s) +* [`c64/,,config_ultimate64.s`](c64/,,config_ultimate64.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. + +Note however, that features do not came for free - enabling them needs some additional ROM space (in BASIC segment, in KERNAL segment, or in both), which is VERY limited on the target machines. Some options might be unavailable for speecific targets - read the comments in the configuration files. Some options might also carry compatibility and/or performance hit - so choose wisely. + +Sane defaults are already present - different for each target. + +## Memory models + +Different layouts of memory are possible - but they can be selected at compile time only. + +### `CONFIG_MEMORY_MODEL_38K` + +Memory model the original machine uses - memory available for BASIC ends at `$9FFF`, just before the first block of ROM. The fastest and the most compatible, but gives the least memory for BASIC. If unsure - select this one. + +### `CONFIG_MEMORY_MODEL_46K` and `CONFIG_MEMORY_MODEL_50K` + +Planned for the future - not available yet. + +### `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 and the least compatible model. + +TODO: ROM memory consumption + +## Multiple SID support + +The SID is a sound chip - original machine had one installed. However, mods exists to add more of them for improved sound capabilitiee. Emulators and FPGA machines typically allow to simulate more than one too. Unfortunately, there is no standard regarding how these additional chips are visible in the processor address space, and there is no sane way to detect it - thus, it has to be configurable. + +The SID support in the ROM is very limited - it only disables the sound during startup or warm restart (when STOP+RESTORE is pressed or BRK assembler instruction is executed). + +### `CONFIG_SID_2ND` and `CONFIG_SID_3RD` + +Each of them add support for one additional SID - addresses should be given in `CONFIG_SID_2ND_ADDRESS` and `CONFIG_SID_3RD_ADDRESS`, respectively. + +Each of these options needs 8 bytes in KERNAL segment. + +### `CONFIG_SID_D4XX` and `CONFIG_SID_D5XX` + +Cause the system to support SIDs in `$D4xx` and `$D5xx` ranges, respectively. + +Each of them needs a couple of bytes in KERNAL segment - but they can share some code, and `$D4xx` range support replaces the standard `$D400` address handling, so exact amount depends on the exact configuration. + +## Miscelaneous features + +### `CONFIG_DOS_WEDGE` + +If enabled, a simple DOS wedge is available from the direct mode - supports `@`, `@`, `@$`, `@$` and `@` commands. + +Feature needs about 330 bytes in BASIC segment. diff --git a/Makefile b/Makefile index 5f770905..7fcf6975 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,11 @@ SRCDIR_KERNAL_ultimate64 = $(SRCDIR_KERNAL_COMMON) c64/kernal/,target_ultimate64 SRC_TOOLS = $(wildcard src/tools/*.c,src/tools/*.cc) +# Generated files + +GEN_BASIC = build/,generated/packed_messages.s +GEN_KERNAL = + # List of tools TOOL_COLLECT_DATA = build/tools/collect_data @@ -84,13 +89,13 @@ build/chargen.rom: $(TOOL_PNGPREPARE) assets/8x8font.png # Dependencies - BASIC and KERNAL -build/target_generic/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(SRCDIR_BASIC_generic) $(foreach dir,$(SRCDIR_BASIC_generic),$(wildcard $(dir)/*.s)) build/,generated/packed_messages.s -build/target_mega65/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(SRCDIR_BASIC_mega65) $(foreach dir,$(SRCDIR_BASIC_mega65),$(wildcard $(dir)/*.s)) build/,generated/packed_messages.s -build/target_ultimate64/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(SRCDIR_BASIC_ultimate64) $(foreach dir,$(SRCDIR_BASIC_ultimate64),$(wildcard $(dir)/*.s)) build/,generated/packed_messages.s +build/target_generic/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_generic) c64/,,config_generic.s $(foreach dir,$(SRCDIR_BASIC_generic),$(wildcard $(dir)/*.s)) +build/target_mega65/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_mega65) c64/,,config_mega65.s $(foreach dir,$(SRCDIR_BASIC_mega65),$(wildcard $(dir)/*.s)) +build/target_ultimate64/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_ultimate64) c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_BASIC_ultimate64),$(wildcard $(dir)/*.s)) -build/target_generic/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(SRCDIR_KERNAL_generic) $(foreach dir,$(SRCDIR_KERNAL_generic),$(wildcard $(dir)/*.s)) -build/target_mega65/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(SRCDIR_KERNAL_mega65) $(foreach dir,$(SRCDIR_KERNAL_mega65),$(wildcard $(dir)/*.s)) -build/target_ultimate64/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(SRCDIR_KERNAL_ultimate64) $(foreach dir,$(SRCDIR_KERNAL_ultimate64),$(wildcard $(dir)/*.s)) +build/target_generic/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_generic) c64/,,config_generic.s $(foreach dir,$(SRCDIR_KERNAL_generic),$(wildcard $(dir)/*.s)) +build/target_mega65/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_mega65) c64/,,config_mega65.s $(foreach dir,$(SRCDIR_KERNAL_mega65),$(wildcard $(dir)/*.s)) +build/target_ultimate64/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_ultimate64) c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_KERNAL_ultimate64),$(wildcard $(dir)/*.s)) build/target_generic/newrom: build/target_generic/OUTB.BIN build/target_generic/OUTK.BIN build/target_mega65/newrom: build/target_mega65/OUTB.BIN build/target_mega65/OUTK.BIN @@ -114,13 +119,13 @@ build/,generated/packed_messages.s: $(TOOL_COMPRESS_TEXT) build/target_%/OUTB.BIN: @mkdir -p build/target_$* @rm -f $@* build/target_$*/BASIC* - @$(TOOL_BUILD_SEGMENT) -s BASIC -i BASIC-$* -o OUTB.BIN -t build/target_$* -l a000 -h e4d2 $(SRCDIR_BASIC_$*) build/,generated/packed_messages.s + @$(TOOL_BUILD_SEGMENT) -s BASIC -i BASIC-$* -o OUTB.BIN -t build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC_$*) $(GEN_BASIC) .PRECIOUS: build/target_%/OUTK.BIN build/target_%/OUTK.BIN: @mkdir -p build/target_$* @rm -f $@* build/target_$*/KERNAL* - @$(TOOL_BUILD_SEGMENT) -s KERNAL -i KERNAL-$* -o OUTK.BIN -t build/target_$* -l e4d3 -h ffff $(SRCDIR_KERNAL_$*) + @$(TOOL_BUILD_SEGMENT) -s KERNAL -i KERNAL-$* -o OUTK.BIN -t build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL_$*) $(GEN_KERNAL) .PRECIOUS: build/target_%/newrom build/target_%/newrom: @@ -148,12 +153,21 @@ build/newc65.rom: build/kernal_mega65.rom build/basic_mega65.rom build/chargen.r test: build/kernal_generic.rom build/basic_generic.rom x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -8 empty.d64 +test_generic: build/kernal_generic.rom build/basic_generic.rom + x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -8 empty.d64 + +test_mega65: build/kernal_mega65.rom build/basic_mega65.rom + x64 -kernal build/kernal_mega65.rom -basic build/basic_mega65.rom -8 empty.d64 + +test_ultimate64: build/kernal_ultimate64.rom build/basic_ultimate64.rom + x64 -kernal build/kernal_ultimate64.rom -basic build/basic_ultimate64.rom -8 empty.d64 + +test_m65: build/newc65 + m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65.rom -4 + testremote: build/kernal_generic.rom build/basic_generic.rom x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -remotemonitor -testm65: build/newc65 - m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65.rom -4 - testsimilarity: build/target_generic/newrom $(TOOL_SIMILARITY) $(TOOL_SIMILARITY) kernal build/target_generic/newrom $(TOOL_SIMILARITY) basic build/target_generic/newrom diff --git a/STATUS.md b/STATUS.md index 3759a299..e1f308af 100644 --- a/STATUS.md +++ b/STATUS.md @@ -1,7 +1,7 @@ # New features -Here are the features of the Open ROMs not found in the original ROMs from the 80s: +Here are the features of the Open ROMs not found in the original ROMs from the 80s (many of them are [configurable](CONFIG.md)): * improved keyboard scanning, supports multi-key roll-over and rejection of spurious joystick input * joystick (port 1) can be used to move text cursor diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s new file mode 100644 index 00000000..7f57226d --- /dev/null +++ b/c64/,,config_generic.s @@ -0,0 +1,19 @@ + +// +// Please read CONFIG.md before modifying this file! +// + + +#define CONFIG_MEMORY_MODEL_38K +// #define CONFIG_MEMORY_MODEL_60K + +// #define CONFIG_SID_2ND +.const CONFIG_SID_2ND_ADDRESS = $D420 + +// #define CONFIG_SID_3RD +.const CONFIG_SID_3RD_ADDRESS = $D440 + +// #define CONFIG_SID_D4XX +// #define CONFIG_SID_D5XX + +#define CONFIG_DOS_WEDGE diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s new file mode 100644 index 00000000..14782cd8 --- /dev/null +++ b/c64/,,config_mega65.s @@ -0,0 +1,19 @@ + +// +// Please read CONFIG.md before modifying this file! +// + + +// #define CONFIG_MEMORY_MODEL_38K +#define CONFIG_MEMORY_MODEL_60K + +#define CONFIG_SID_2ND +.const CONFIG_SID_2ND_ADDRESS = $D420 + +// #define CONFIG_SID_3RD +.const CONFIG_SID_3RD_ADDRESS = $D440 + +// #define CONFIG_SID_D4XX +// #define CONFIG_SID_D5XX + +#define CONFIG_DOS_WEDGE diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s new file mode 100644 index 00000000..5fa131a9 --- /dev/null +++ b/c64/,,config_ultimate64.s @@ -0,0 +1,19 @@ + +// +// Please read CONFIG.md before modifying this file! +// + + +#define CONFIG_MEMORY_MODEL_38K +// #define CONFIG_MEMORY_MODEL_60K + +// #define CONFIG_SID_2ND +.const CONFIG_SID_2ND_ADDRESS = $D420 + +// #define CONFIG_SID_3RD +.const CONFIG_SID_3RD_ADDRESS = $D440 + +#define CONFIG_SID_D4XX +#define CONFIG_SID_D5XX + +#define CONFIG_DOS_WEDGE diff --git a/c64/aliases/,aliases_hardware.s b/c64/aliases/,aliases_hardware.s index 2eee3541..343fb5db 100644 --- a/c64/aliases/,aliases_hardware.s +++ b/c64/aliases/,aliases_hardware.s @@ -10,6 +10,8 @@ // VIC-II registers + .label VIC_BASE = $D000 // base address of the chip + .label VIC_SP0X = $D000 .label VIC_SP0Y = $D001 .label VIC_SP1X = $D002 @@ -62,6 +64,8 @@ // SID registers + .label SID_BASE = $D400 // base address of the chip + .label SID_FRELO1 = $D400 .label SID_FREHI1 = $D401 .label SID_PWLO1 = $D402 @@ -97,6 +101,8 @@ // CIA #1 registers + .label CIA1_BASE = $DC00 // base address of the chip + .label CIA1_PRA = $DC00 .label CIA1_PRB = $DC01 .label CIA1_DDRA = $DC02 @@ -119,6 +125,8 @@ // CIA #2 registers + .label CIA2_BASE = $DD00 // base address of the chip + .label CIA2_PRA = $DD00 // VIC bank switching and IEC port .label CIA2_PRB = $DD01 .label CIA2_DDRA = $DD02 diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index 2cd8b229..e2a02afb 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -113,6 +113,8 @@ .label enable_case_switch = $0291 .label screen_scroll_disable = $0292 +#if CONFIG_MEMORY_MODEL_60K + // BASIC uses some extra bytes for memory access under ROMs located at $2A7 onwards // IRQs are disabled when doing such accesses, and a default NMI handler only increments // a counter, so that if an NMI occurs, it doesn't crash the machine, but can be captured. @@ -124,3 +126,5 @@ .label poke_under_roms = tiny_nmi_handler+poke_under_roms_routine-tiny_nmi_handler_routine .label memmap_allram = tiny_nmi_handler+memmap_allram_routine-tiny_nmi_handler_routine .label memmap_normal = tiny_nmi_handler+memmap_normal_routine-tiny_nmi_handler_routine + +#endif // CONFIG_MEMORY_MODEL_60K diff --git a/c64/basic/basic_delete_line.s b/c64/basic/basic_delete_line.s index 4b4867fd..922cc46b 100644 --- a/c64/basic/basic_delete_line.s +++ b/c64/basic/basic_delete_line.s @@ -14,12 +14,24 @@ basic_delete_line: // .byte $0d,0 // Get address of next line - ldx #$f7ff +#if CONFIG_MEMORY_MODEL_60K + lda #>$F7FF +#else // CONFIG_MEMORY_MODEL_38K + lda #>$9FFF +#endif .byte $2C -!: lda #>$7FFF +!: +#if CONFIG_MEMORY_MODEL_60K + lda #>$F7FF +#else // CONFIG_MEMORY_MODEL_38K + lda #>$9FFF +#endif sta basic_top_of_memory_ptr+1 sta basic_start_of_strings_ptr+1 - lda #<$f7ff +#if CONFIG_MEMORY_MODEL_60K + lda #<$F7FF +#else // CONFIG_MEMORY_MODEL_38K + lda #<$9FFF +#endif sta basic_top_of_memory_ptr+0 sta basic_start_of_strings_ptr+0 diff --git a/c64/basic/peek_line_pointer_null_check.s b/c64/basic/peek_line_pointer_null_check.s new file mode 100644 index 00000000..e7a8fb38 --- /dev/null +++ b/c64/basic/peek_line_pointer_null_check.s @@ -0,0 +1,34 @@ +// Return C=1 if a pointer in BASIC memory space is NULL, else C=0 +// X = ZP pointer to check + +peek_line_pointer_null_check: + + ldy #$00 + +#if CONFIG_MEMORY_MODEL_60K + ldx # memmove_src + // This means we have to copy from the back end down. + // This routine assumes the pointers are already pointed + // to the end of the areas, and that Y is correctly initialised + // to allow the copy to begin. + php +smu1: + lda (memmove_src),y + sta (memmove_dst),y + dey + bne smu1 + dec memmove_src+1 + dec memmove_dst+1 + dec memmove_size+1 + bne smu1 + plp + rts + +shift_mem_down: + // Move memmove_size bytes from memmove_src to memmove_dst, + // where memmove_dst > memmove_src + // This means we have to copy from the back end down. + // This routine assumes the pointers are already pointed + // to the end of the areas, and that Y is correctly initialised + // to allow the copy to begin. + php +smd1: + lda (memmove_src),y + sta (memmove_dst),y + iny + bne smd1 + inc memmove_src+1 + inc memmove_dst+1 + dec memmove_size+1 + bne smd1 + plp + rts + +#endif diff --git a/c64/basic/wedge_dos.s b/c64/basic/wedge_dos.s index 7259d131..28785111 100644 --- a/c64/basic/wedge_dos.s +++ b/c64/basic/wedge_dos.s @@ -1,5 +1,5 @@ -// START wedge support +#if CONFIG_DOS_WEDGE wedge_dos: @@ -235,4 +235,4 @@ wedge_dos_setnam: ldy basic_current_statement_ptr+1 jmp JSETNAM -// END wedge support +#endif // CONFIG_DOS_WEDGE diff --git a/c64/kernal/,aliases.s b/c64/kernal/,aliases.s index 0d133ed5..00578fd7 100644 --- a/c64/kernal/,aliases.s +++ b/c64/kernal/,aliases.s @@ -62,6 +62,8 @@ .label enable_case_switch = $0291 .label screen_scroll_disable = $0292 +#if CONFIG_MEMORY_MODEL_60K + // Under-ROM routines // (BASIC also includes them. XXX - We should de-duplicate them in a safe manner) .label missed_nmi_flag = $2A7 @@ -71,3 +73,4 @@ .label memmap_allram = tiny_nmi_handler+memmap_allram_routine-tiny_nmi_handler_routine .label memmap_normal = tiny_nmi_handler+memmap_normal_routine-tiny_nmi_handler_routine +#endif // CONFIG_MEMORY_MODEL_60K diff --git a/c64/kernal/f34a.open.s b/c64/kernal/f34a.open.s index a669d960..65b03974 100644 --- a/c64/kernal/f34a.open.s +++ b/c64/kernal/f34a.open.s @@ -81,8 +81,10 @@ open_iec: jmp kernalerror_DEVICE_NOT_FOUND !: +#if CONFIG_MEMORY_MODEL_60K // We need our helpers to get to filenames under ROMs or IO area jsr install_ram_routines +#endif // Send command ('file name') jsr lvs_send_file_name diff --git a/c64/kernal/f4a5.load.s b/c64/kernal/f4a5.load.s index bb43f88f..1cfc2d3b 100644 --- a/c64/kernal/f4a5.load.s +++ b/c64/kernal/f4a5.load.s @@ -31,8 +31,10 @@ LOAD: // Reset status jsr kernalstatus_reset +#if CONFIG_MEMORY_MODEL_60K // We need our helpers to get to filenames under ROMs or IO area jsr install_ram_routines +#endif // Allow platform-specific routine to takeover the flow TARGET_HOOK_LOAD() diff --git a/c64/kernal/fda3.ioinit.s b/c64/kernal/fda3.ioinit.s index c9fef15b..a64b1fc4 100644 --- a/c64/kernal/fda3.ioinit.s +++ b/c64/kernal/fda3.ioinit.s @@ -20,23 +20,51 @@ IOINIT: sta CPU_R6510 stx CPU_D6510 - // Silence the SID chips under common addresses + // Silence the SID chips, depending on the configuration +#if !CONFIG_SID_D4XX + lda SID_SIGVOL + and #$F0 + sta SID_SIGVOL +#endif // !CONFIG_SID_D4XX + +#if CONFIG_SID_D4XX || CONFIG_SID_D5XX ldy #$00 !: - // SIDs under $D4xx + +#if CONFIG_SID_D4XX lda SID_SIGVOL, Y and #$F0 sta SID_SIGVOL, Y +#endif // CONFIG_SID_D4XX + +#if CONFIG_SID_D5XX // SIDs under $D5xx lda SID_SIGVOL + $100, Y and #$F0 sta SID_SIGVOL + $100, Y +#endif // CONFIG_SID_D4XX + tya clc adc #$20 tay bne !- +#endif // CONFIG_SID_D4XX || CONFIG_SID_D5XX + +#if CONFIG_SID_2ND + lda SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS + and #$F0 + sta SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS +#endif // CONFIG_SID_2ND + +#if CONFIG_SID_3RD + lda SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS + and #$F0 + sta SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS +#endif // CONFIG_SID_3RD + + // Initialize CIAs // XXX: calibrate TOD for both CIA's, see here: https://codebase64.org/doku.php?id=base:efficient_tod_initialisation diff --git a/c64/kernal/lvs_helpers.s b/c64/kernal/lvs_helpers.s index b4e20e98..c74295a2 100644 --- a/c64/kernal/lvs_helpers.s +++ b/c64/kernal/lvs_helpers.s @@ -8,8 +8,14 @@ lvs_send_file_name: lvs_send_file_name_loop: cpy FNLEN beq lvs_send_file_name_done - ldx # Date: Wed, 11 Sep 2019 19:27:34 +0200 Subject: [PATCH 02/40] documentation update --- CONFIG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONFIG.md b/CONFIG.md index 8975dc56..f8c11248 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -29,7 +29,7 @@ Planned for the future - not available yet. 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 and the least compatible model. -TODO: ROM memory consumption +Comparing to standard memoryy 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. ## Multiple SID support From 021c9b3189ced35a1dde1be4a6c297bc781bfa58 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 11 Sep 2019 21:50:48 +0200 Subject: [PATCH 03/40] size-optimized cartridge check --- c64/kernal/cartridge_check.s | 10 ++++------ c64/kernal/interrupts/fe47.default_nmi_handler.s | 2 +- c64/kernal/reset_entry.s | 5 +++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/c64/kernal/cartridge_check.s b/c64/kernal/cartridge_check.s index 09a58216..f74cfeaa 100644 --- a/c64/kernal/cartridge_check.s +++ b/c64/kernal/cartridge_check.s @@ -1,15 +1,13 @@ // c64 prg p263 cartridge_check: - ldx #$04 + ldx #$05 cartridge_check_l1: - lda CART_SIG,x - cmp cartridge_signature,x + lda CART_SIG-1,x + cmp cartridge_signature-1,x bne no_cartridge dex - bpl cartridge_check_l1 - sec + bne cartridge_check_l1 rts no_cartridge: - clc rts diff --git a/c64/kernal/interrupts/fe47.default_nmi_handler.s b/c64/kernal/interrupts/fe47.default_nmi_handler.s index fdf3115c..2c89e4a0 100644 --- a/c64/kernal/interrupts/fe47.default_nmi_handler.s +++ b/c64/kernal/interrupts/fe47.default_nmi_handler.s @@ -16,7 +16,7 @@ default_nmi_handler: // XXX confirm NMIs from CIA, or no other NMI will arrive! jsr cartridge_check - bcc !+ + bne !+ jmp (ICART_WARM_START) !: diff --git a/c64/kernal/reset_entry.s b/c64/kernal/reset_entry.s index 9eb9eca7..626e6d72 100644 --- a/c64/kernal/reset_entry.s +++ b/c64/kernal/reset_entry.s @@ -3,11 +3,12 @@ reset_entry: + // The GPL program at https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_functional_test.a65 // uses the following initial reset sequence // affirmed by c64 PRG p269 cld - ldx #$ff + ldx #$FF txs sei @@ -18,7 +19,7 @@ reset_entry: // C64 PRG p269 jsr cartridge_check - bcc !+ + bne !+ jmp (ICART_COLD_START) !: // Initialising IO is obviously required. Also indicated by c64 prg p269. From 48ca32a5cf61815b637363435c715b279e510442 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 11 Sep 2019 22:46:51 +0200 Subject: [PATCH 04/40] further startup fixes, size-optimized RAMTAS --- c64/kernal/,aliases.s | 1 - c64/kernal/cartridge_check.s | 2 +- c64/kernal/fd50.interop | 3 ++ c64/kernal/fd50.ramtas.jmp.s | 6 ++++ c64/kernal/fda3.ioinit.s | 3 ++ c64/kernal/{ramtas.s => ramtas_real.s} | 44 ++++++++++++-------------- c64/kernal/reset_entry.s | 2 +- 7 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 c64/kernal/fd50.interop create mode 100644 c64/kernal/fd50.ramtas.jmp.s rename c64/kernal/{ramtas.s => ramtas_real.s} (84%) diff --git a/c64/kernal/,aliases.s b/c64/kernal/,aliases.s index 00578fd7..da75162a 100644 --- a/c64/kernal/,aliases.s +++ b/c64/kernal/,aliases.s @@ -12,7 +12,6 @@ .label load_or_scroll_temp_pointer = $AC // We also use the following for temp colour pointer when scrolling .label load_save_verify_end_address = $AE - .label cassette_buffer_ptr = $B2 .label current_logical_filenum = $B8 .label current_secondary_address = $B9 .label current_device_number = $BA diff --git a/c64/kernal/cartridge_check.s b/c64/kernal/cartridge_check.s index f74cfeaa..00221fb4 100644 --- a/c64/kernal/cartridge_check.s +++ b/c64/kernal/cartridge_check.s @@ -8,6 +8,6 @@ cartridge_check_l1: bne no_cartridge dex bne cartridge_check_l1 - rts + // FALLTROUGH no_cartridge: rts diff --git a/c64/kernal/fd50.interop b/c64/kernal/fd50.interop new file mode 100644 index 00000000..7e314936 --- /dev/null +++ b/c64/kernal/fd50.interop @@ -0,0 +1,3 @@ +RRAMTAS is an important startup routine, frequentl called b cartridges - unfortunately, we can't count on them calling it +via the jumptable, as even some tutorials on the web advise to call it directly - see for example here: +https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image diff --git a/c64/kernal/fd50.ramtas.jmp.s b/c64/kernal/fd50.ramtas.jmp.s new file mode 100644 index 00000000..b20ed77e --- /dev/null +++ b/c64/kernal/fd50.ramtas.jmp.s @@ -0,0 +1,6 @@ + +// Our implementation is longer than the original one, +// placing it here would cause a collision with OPEN + +RAMTAS: + jmp ramtas_real diff --git a/c64/kernal/fda3.ioinit.s b/c64/kernal/fda3.ioinit.s index a64b1fc4..bdffec29 100644 --- a/c64/kernal/fda3.ioinit.s +++ b/c64/kernal/fda3.ioinit.s @@ -71,6 +71,9 @@ IOINIT: // Enable CIA1 IRQ and ~50Hz timer (https://csdb.dk/forums/?roomid=11&topicid=69037) lda #$7F sta CIA1_ICR // disable all + + // Same for CIA2 - it can generate IRQs too, we definitely don't want this + sta CIA2_ICR // Set timer interval to ~1/60th of a second diff --git a/c64/kernal/ramtas.s b/c64/kernal/ramtas_real.s similarity index 84% rename from c64/kernal/ramtas.s rename to c64/kernal/ramtas_real.s index e5feb561..d632102c 100644 --- a/c64/kernal/ramtas.s +++ b/c64/kernal/ramtas_real.s @@ -8,17 +8,18 @@ // CPU registers that has to be preserved (see [RG64]): none // -RAMTAS: +ramtas_real: // C64 Programmer's Reference guide p291: // Clear $0000-$0101, $0200-$03ff // PGS: $0000, $0001 are CPU IO ports, so shouldn't get written to ldy #$02 lda #$00 -ramtas_l1: - sta $00,Y +!: + sta $00,y iny - bne ramtas_l1 -ramtas_l2: + bne !- + +!: // How many ways are there to efficiently erase these two pages // of RAM? We would like to avoid any unnecessary byte similarity // with the C64 KERNAL. Thus we do $0300 before $0200, even though @@ -28,14 +29,14 @@ ramtas_l2: sta $0300,Y sta $0200,Y iny - bne ramtas_l2 + bne !- - // allocate cassette buffer - // "Mapping the C128", p61 + // Allocate cassette buffer + // "Mapping the C64", p237 lda #<$033C - sta cassette_buffer_ptr+0 + sta TAPE1+0 lda #>$033C - sta cassette_buffer_ptr+1 + sta TAPE1+1 // set screen address to $0400 // https://www.c64-wiki.com/wiki/Screen_RAM @@ -60,7 +61,7 @@ ramtas_l2: // and several following ldx #>$0400 stx HIBASE - + // Work out RAM size and put in MEMSTR and MEMSIZK // "Compute's Mapping the 64", p54 // http://unusedino.de/ec64/technical/project64/mapping_c64.html @@ -70,22 +71,19 @@ ramtas_l2: stx MEMSTR+0 stx MEMSIZK+0 // Try to modify $8000, if it fails then RAM ends at $7FFF, else $9FFF - lda $8000 - eor #$FF - tax - eor #$FF + ldx $8000 + inx + stx $8000 + cpx $8000 + bne ramtas_32K_RAM + dex stx $8000 - cmp $8000 - beq ramtas_32K_RAM - sta $8000 ldx #$A0 stx MEMSIZK+1 - jmp ramtas_RAM_sized + bne !+ // always non-zero, saves one byte + ramtas_32K_RAM: - sta $8000 // in case RAM is hiding beneath a ROM ldx #$80 stx MEMSIZK+1 - // Fall through -ramtas_RAM_sized: - +!: rts diff --git a/c64/kernal/reset_entry.s b/c64/kernal/reset_entry.s index 626e6d72..17b021ad 100644 --- a/c64/kernal/reset_entry.s +++ b/c64/kernal/reset_entry.s @@ -37,7 +37,7 @@ reset_entry: jsr JCINT // What do we do when finished? A C64 jumps into the BASIC ROM - cli // Allow interrupts to happen + cli // allow interrupts to happen // c64 prg p269 jmp (IBASIC_COLD_START) From ef1354f7b2c7d8568cf32e33fe3fff94f0bfeffb Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 11 Sep 2019 23:48:09 +0200 Subject: [PATCH 05/40] more init adjustments --- c64/basic/basic_cold_start.s | 29 ++--------------------------- c64/kernal/ramtas_real.s | 2 ++ 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index d3aab8fd..2107d6ca 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -2,19 +2,9 @@ // Compute's Mapping the 64 p211 basic_cold_start: - // Setup BASIC vectors at $0300 - // Initialise interpretor - // Print start up message - - // Print coloured part of the message - // ldy #>startup_message - // lda #MEGABASIC\r\r - .byte $12,$05,$4D,$45,$47,$41,$92 - .byte $42,$41,$53,$49,$43 - .byte $20,$56,$32,$2e,$30,$2e,$30 - .byte $0D,$0D - - .byte 0 diff --git a/c64/kernal/ramtas_real.s b/c64/kernal/ramtas_real.s index d632102c..3838b2d2 100644 --- a/c64/kernal/ramtas_real.s +++ b/c64/kernal/ramtas_real.s @@ -83,6 +83,8 @@ ramtas_real: bne !+ // always non-zero, saves one byte ramtas_32K_RAM: + dex + stx $8000 // case there is RAM under the ROM ldx #$80 stx MEMSIZK+1 !: From 123e5e46c37009f6deda0d83a4a29fe530b896dd Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 12 Sep 2019 20:28:53 +0200 Subject: [PATCH 06/40] added stubs for official BASIC routines --- STATUS.md | 25 ++++++++++++++++++++++--- c64/basic/a483.interop | 9 +++++++++ c64/basic/a483.main.s | 13 +++++++++++++ c64/basic/a57c.chrnch.s | 13 +++++++++++++ c64/basic/a57c.interop | 9 +++++++++ c64/basic/a71a.interop | 9 +++++++++ c64/basic/a71a.qplop.s | 13 +++++++++++++ c64/basic/a7e4.gone.s | 13 +++++++++++++ c64/basic/a7e4.interop | 9 +++++++++ c64/basic/ae86.eval.s | 13 +++++++++++++ c64/basic/ae86.interop | 9 +++++++++ c64/basic/e38b.error.s | 13 +++++++++++++ c64/basic/e38b.interop | 9 +++++++++ 13 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 c64/basic/a483.interop create mode 100644 c64/basic/a483.main.s create mode 100644 c64/basic/a57c.chrnch.s create mode 100644 c64/basic/a57c.interop create mode 100644 c64/basic/a71a.interop create mode 100644 c64/basic/a71a.qplop.s create mode 100644 c64/basic/a7e4.gone.s create mode 100644 c64/basic/a7e4.interop create mode 100644 c64/basic/ae86.eval.s create mode 100644 c64/basic/ae86.interop create mode 100644 c64/basic/e38b.error.s create mode 100644 c64/basic/e38b.interop diff --git a/STATUS.md b/STATUS.md index e1f308af..d97aed3d 100644 --- a/STATUS.md +++ b/STATUS.md @@ -46,14 +46,29 @@ For the current status of the low memory location implementation andd usage chec ## BASIC +### Official BASIC routines -TODO +Note: vectors at `$0300` are not supported yet - for now only the locations below can be used! +
+ +| Address | Name | Status | Remarks | +| :-------: | :---------------- | :------: | :------------------------------------------------: | +| `($A000)` | cold start vector | PARTIAL | | +| `($A002)` | warm start vector | PARTIAL | | +| `$A483` | `MAIN` | NOT DONE | some implementation exists, but not connected here | +| `$A57C` | `CHRNCH` | NOT DONE | | +| `$A71A` | `QPLOP` | NOT DONE | some implementation exists, but not connected here | +| `$A7E4` | `GONE` | NOT DONE | some implementation exists, but not connected here | +| `$AE86` | `EVAL` | NOT DONE | some implementation exists, but not connected here | +| `$E38B` | `ERROR` | NOT DONE | | + +
## Kernal -Note: only the jump table addresses are currently supported, real routine addresses are different! +Note: only the jump table addresses are fully supported, real routine addresses are sometimes different! ### Official Kernal routines @@ -63,7 +78,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on
| Address | Name | Status | Remarks | -| --------- | :------- | :------: | :------------------------------------------------: | +| :-------: | :------- | :------: | :------------------------------------------------: | | `$FF81` | `CINT` | DONE | | | `$FF84` | `IOINIT` | PARTIAL | CIA initialization incomplete | | `$FF87` | `RAMTAS` | DONE | | @@ -103,6 +118,10 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFED` | `SCREEN` | DONE | | | `$FFF0` | `PLOT` | PARTIAL | cursor blink not handled | | `$FFF3` | `IOBASE` | DONE | | +| `($FFFA)` | NMI vector | PARTIAL | | +| `($FFFC)` | RESET vector | PARTIAL | | +| `($FFFE)` | IRQ/BRK vector | PARTIAL | | +
diff --git a/c64/basic/a483.interop b/c64/basic/a483.interop new file mode 100644 index 00000000..ac77e1bd --- /dev/null +++ b/c64/basic/a483.interop @@ -0,0 +1,9 @@ +All the BASIC routines, for which there are vectors in $0300-$030B, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (usually Kernal related), while others points the original BASIC routines. Different techniques modify different vectors +(while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 BASIC addresses there. + +For various cartridges this just means disabling their extensions (like new commands); for us that would mean improperly functionning BASIC. + diff --git a/c64/basic/a483.main.s b/c64/basic/a483.main.s new file mode 100644 index 00000000..680e34f8 --- /dev/null +++ b/c64/basic/a483.main.s @@ -0,0 +1,13 @@ + +// +// Official BASIC routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - XXX +// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// +// CPU registers that has to be preserved (see [RG64]): XXX +// + + +MAIN: + rts // XXX implement this diff --git a/c64/basic/a57c.chrnch.s b/c64/basic/a57c.chrnch.s new file mode 100644 index 00000000..bc797250 --- /dev/null +++ b/c64/basic/a57c.chrnch.s @@ -0,0 +1,13 @@ + +// +// Official BASIC routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - XXX +// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// +// CPU registers that has to be preserved (see [RG64]): XXX +// + + +CHRNCH: + rts // XXX implement this diff --git a/c64/basic/a57c.interop b/c64/basic/a57c.interop new file mode 100644 index 00000000..ac77e1bd --- /dev/null +++ b/c64/basic/a57c.interop @@ -0,0 +1,9 @@ +All the BASIC routines, for which there are vectors in $0300-$030B, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (usually Kernal related), while others points the original BASIC routines. Different techniques modify different vectors +(while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 BASIC addresses there. + +For various cartridges this just means disabling their extensions (like new commands); for us that would mean improperly functionning BASIC. + diff --git a/c64/basic/a71a.interop b/c64/basic/a71a.interop new file mode 100644 index 00000000..ac77e1bd --- /dev/null +++ b/c64/basic/a71a.interop @@ -0,0 +1,9 @@ +All the BASIC routines, for which there are vectors in $0300-$030B, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (usually Kernal related), while others points the original BASIC routines. Different techniques modify different vectors +(while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 BASIC addresses there. + +For various cartridges this just means disabling their extensions (like new commands); for us that would mean improperly functionning BASIC. + diff --git a/c64/basic/a71a.qplop.s b/c64/basic/a71a.qplop.s new file mode 100644 index 00000000..a6a8572e --- /dev/null +++ b/c64/basic/a71a.qplop.s @@ -0,0 +1,13 @@ + +// +// Official BASIC routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - XXX +// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// +// CPU registers that has to be preserved (see [RG64]): XXX +// + + +QPLOP: + rts // XXX implement this diff --git a/c64/basic/a7e4.gone.s b/c64/basic/a7e4.gone.s new file mode 100644 index 00000000..00cc0d6e --- /dev/null +++ b/c64/basic/a7e4.gone.s @@ -0,0 +1,13 @@ + +// +// Official BASIC routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - XXX +// - [CM64] Compute's Mapping the Commodore 64 - page 70, XXX +// +// CPU registers that has to be preserved (see [RG64]): XXX +// + + +GONE: + rts // XXX implement this diff --git a/c64/basic/a7e4.interop b/c64/basic/a7e4.interop new file mode 100644 index 00000000..ac77e1bd --- /dev/null +++ b/c64/basic/a7e4.interop @@ -0,0 +1,9 @@ +All the BASIC routines, for which there are vectors in $0300-$030B, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (usually Kernal related), while others points the original BASIC routines. Different techniques modify different vectors +(while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 BASIC addresses there. + +For various cartridges this just means disabling their extensions (like new commands); for us that would mean improperly functionning BASIC. + diff --git a/c64/basic/ae86.eval.s b/c64/basic/ae86.eval.s new file mode 100644 index 00000000..3d8b0116 --- /dev/null +++ b/c64/basic/ae86.eval.s @@ -0,0 +1,13 @@ + +// +// Official BASIC routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - XXX +// - [CM64] Compute's Mapping the Commodore 64 - page 70, XXX +// +// CPU registers that has to be preserved (see [RG64]): XXX +// + + +EVAL: + rts // XXX implement this diff --git a/c64/basic/ae86.interop b/c64/basic/ae86.interop new file mode 100644 index 00000000..ac77e1bd --- /dev/null +++ b/c64/basic/ae86.interop @@ -0,0 +1,9 @@ +All the BASIC routines, for which there are vectors in $0300-$030B, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (usually Kernal related), while others points the original BASIC routines. Different techniques modify different vectors +(while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 BASIC addresses there. + +For various cartridges this just means disabling their extensions (like new commands); for us that would mean improperly functionning BASIC. + diff --git a/c64/basic/e38b.error.s b/c64/basic/e38b.error.s new file mode 100644 index 00000000..eb0fe611 --- /dev/null +++ b/c64/basic/e38b.error.s @@ -0,0 +1,13 @@ + +// +// Official BASIC routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - XXX +// - [CM64] Compute's Mapping the Commodore 64 - page 69, XXX +// +// CPU registers that has to be preserved (see [RG64]): XXX +// + + +ERROR: + rts // XXX implement this diff --git a/c64/basic/e38b.interop b/c64/basic/e38b.interop new file mode 100644 index 00000000..ac77e1bd --- /dev/null +++ b/c64/basic/e38b.interop @@ -0,0 +1,9 @@ +All the BASIC routines, for which there are vectors in $0300-$030B, have to be available at their original addresses. + +Reason: some autostart software (https://codebase64.org/doku.php?id=base:autostarting_disk_files) override these vectors, so that some point +to new locations (usually Kernal related), while others points the original BASIC routines. Different techniques modify different vectors +(while resetting others to original C64 locations), some don't change the vectors at all, but might still put the original +C64 BASIC addresses there. + +For various cartridges this just means disabling their extensions (like new commands); for us that would mean improperly functionning BASIC. + From 8fce9681bead70bce50828a73b0c588040f794fb Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 13 Sep 2019 21:39:12 +0200 Subject: [PATCH 07/40] added more stubs, updated documentation --- STATUS.md | 152 +++++++++++------- c64/basic/a68e.interop | 3 + c64/basic/a68e.runc.s | 5 + c64/basic/a7ae.interop | 3 + c64/basic/a7ae.newstt.s | 5 + .../{ab1e.print_string.s => ab1e.strout.s} | 15 +- c64/basic/bdcd.interop | 1 + c64/basic/bdcd.linprt.s | 10 ++ c64/basic/e3bf.init.s | 5 + c64/basic/e3bf.interop | 3 + c64/basic/e422.initmsg.s | 5 + c64/basic/e422.interop | 3 + c64/basic/e453.interop | 3 + c64/basic/e453.rvect.s | 5 + 14 files changed, 149 insertions(+), 69 deletions(-) create mode 100644 c64/basic/a68e.interop create mode 100644 c64/basic/a68e.runc.s create mode 100644 c64/basic/a7ae.interop create mode 100644 c64/basic/a7ae.newstt.s rename c64/basic/{ab1e.print_string.s => ab1e.strout.s} (75%) create mode 100644 c64/basic/bdcd.interop create mode 100644 c64/basic/bdcd.linprt.s create mode 100644 c64/basic/e3bf.init.s create mode 100644 c64/basic/e3bf.interop create mode 100644 c64/basic/e422.initmsg.s create mode 100644 c64/basic/e422.interop create mode 100644 c64/basic/e453.interop create mode 100644 c64/basic/e453.rvect.s diff --git a/STATUS.md b/STATUS.md index d97aed3d..c23d642d 100644 --- a/STATUS.md +++ b/STATUS.md @@ -52,79 +52,109 @@ Note: vectors at `$0300` are not supported yet - for now only the locations belo
-| Address | Name | Status | Remarks | -| :-------: | :---------------- | :------: | :------------------------------------------------: | -| `($A000)` | cold start vector | PARTIAL | | -| `($A002)` | warm start vector | PARTIAL | | -| `$A483` | `MAIN` | NOT DONE | some implementation exists, but not connected here | -| `$A57C` | `CHRNCH` | NOT DONE | | -| `$A71A` | `QPLOP` | NOT DONE | some implementation exists, but not connected here | -| `$A7E4` | `GONE` | NOT DONE | some implementation exists, but not connected here | -| `$AE86` | `EVAL` | NOT DONE | some implementation exists, but not connected here | -| `$E38B` | `ERROR` | NOT DONE | | +| Entry | Unofficial | Name | Status | Remarks | +| :-------: | :--------: | :--------- | :------: | :------------------------------------------------: | +| | `$E38B` | `ERROR` | NOT DONE | | +| | `$A483` | `MAIN` | NOT DONE | some implementation exists, but not connected here | +| | `$A57C` | `CHRNCH` | NOT DONE | | +| | `$A71A` | `QPLOP` | NOT DONE | some implementation exists, but not connected here | +| | `$A7E4` | `GONE` | NOT DONE | some implementation exists, but not connected here | +| | `$AE86` | `EVAL` | NOT DONE | some implementation exists, but not connected here | +| `($A000)` | | cold start | PARTIAL | | +| `($A002)` | | warm start | PARTIAL | | + + +
+ +### Unofficial BASIC routines/locations + +Not all of them - only these we want to have implemented. + +
+ +| Address | Name | Status | Remarks | +| :-------: | :----------- | :------: | :------------------------------------------------: | +| `$A004` | revision str | DONE | | +| `$A68E` | RUNC | NOT DONE | | +| `$A7AE` | NEWSTT | NOT DONE | | +| `$AB1E` | STROUT | DONE | | +| `$BDCD` | LINPRT | NOT DONE | | +| `$E3BF` | INIT | NOT DONE | | +| `$E422` | INITMSG | NOT DONE | | +| `$E453` | RVECT | NOT DONE | |
## Kernal - -Note: only the jump table addresses are fully supported, real routine addresses are sometimes different! - - ### Official Kernal routines NOTE: Even the 'DONE' routines won't support features described as missing in one of the previous chapters!
-| Address | Name | Status | Remarks | -| :-------: | :------- | :------: | :------------------------------------------------: | -| `$FF81` | `CINT` | DONE | | -| `$FF84` | `IOINIT` | PARTIAL | CIA initialization incomplete | -| `$FF87` | `RAMTAS` | DONE | | -| `$FF8A` | `RESTOR` | DONE | | -| `$FF8D` | `VECTOR` | DONE | | -| `$FF90` | `SETMSG` | DONE | | -| `$FF93` | `SECOND` | DONE | | -| `$FF96` | `TKSA` | DONE | | -| `$FF99` | `MEMTOP` | DONE | | -| `$FF9C` | `MEMBOT` | DONE | | -| `$FF9F` | `SCNKEY` | DONE | could be better integrated with ROM (aliases) | -| `$FFA2` | `SETTMO` | DONE | | -| `$FFA5` | `ACPTR` | DONE | | -| `$FFA8` | `CIOUT` | DONE | | -| `$FFAB` | `UNTLK` | DONE | | -| `$FFAE` | `UNLSN` | DONE | | -| `$FFB1` | `LISTEN` | DONE | | -| `$FFB4` | `TALK` | DONE | | -| `$FFB7` | `READST` | DONE | | -| `$FFBA` | `SETFLS` | DONE | | -| `$FFBD` | `SETNAM` | DONE | | -| `$FFC0` | `OPEN` | DONE | | -| `$FFC3` | `CLOSE` | DONE | | -| `$FFC6` | `CHKIN` | DONE | | -| `$FFC9` | `CHKOUT` | PARTIAL | | -| `$FFCC` | `CLRCHN` | DONE | | -| `$FFCF` | `CHRIN` | PARTIAL | | -| `$FFD2` | `CHROUT` | PARTIAL | | -| `$FFD5` | `LOAD` | PARTIAL | no VERIFY support yet, no STOP key support | -| `$FFD8` | `SAVE` | NOT DONE | | -| `$FFDB` | `SETTIM` | DONE | | -| `$FFDE` | `RDTIM` | DONE | | -| `$FFE1` | `STOP` | DONE | | -| `$FFE4` | `GETIN` | PARTIAL | only some devices supported | -| `$FFE7` | `CLALL` | DONE | | -| `$FFEA` | `UDTIM` | DONE | | -| `$FFED` | `SCREEN` | DONE | | -| `$FFF0` | `PLOT` | PARTIAL | cursor blink not handled | -| `$FFF3` | `IOBASE` | DONE | | -| `($FFFA)` | NMI vector | PARTIAL | | -| `($FFFC)` | RESET vector | PARTIAL | | -| `($FFFE)` | IRQ/BRK vector | PARTIAL | | - +| Address | Unofficial | Name | Status | Remarks | +| :-------: | :--------: | :---------- | :------: | :------------------------------------------------: | +| `$FF81` | `$FF5B` | `CINT` | DONE | | +| `$FF84` | `$FDA3` | `IOINIT` | PARTIAL | CIA initialization incomplete | +| `$FF87` | `$FD50` | `RAMTAS` | DONE | | +| `$FF8A` | | `RESTOR` | DONE | | +| `$FF8D` | `$FD15` | `VECTOR` | PARTIAL | wrong address, code starts from RESTOR | +| `$FF90` | | `SETMSG` | DONE | | +| `$FF93` | | `SECOND` | DONE | | +| `$FF96` | | `TKSA` | DONE | | +| `$FF99` | | `MEMTOP` | DONE | | +| `$FF9C` | | `MEMBOT` | DONE | | +| `$FF9F` | | `SCNKEY` | DONE | could be better integrated with ROM (aliases) | +| `$FFA2` | | `SETTMO` | DONE | | +| `$FFA5` | | `ACPTR` | DONE | | +| `$FFA8` | | `CIOUT` | DONE | | +| `$FFAB` | | `UNTLK` | DONE | | +| `$FFAE` | | `UNLSN` | DONE | | +| `$FFB1` | | `LISTEN` | DONE | | +| `$FFB4` | | `TALK` | DONE | | +| `$FFB7` | | `READST` | DONE | | +| `$FFBA` | | `SETFLS` | DONE | | +| `$FFBD` | | `SETNAM` | DONE | | +| `$FFC0` | `$F34A` | `OPEN` | DONE | | +| `$FFC3` | `$F291` | `CLOSE` | DONE | | +| `$FFC6` | `$F20E` | `CHKIN` | DONE | | +| `$FFC9` | `$F250` | `CKOUT` | PARTIAL | | +| `$FFCC` | `$F333` | `CLRCHN` | DONE | | +| `$FFCF` | `$F157` | `CHRIN` | PARTIAL | | +| `$FFD2` | `$F1CA` | `CHROUT` | PARTIAL | | +| `$FFD5` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support, no STOP key, check $F49E addr | +| `$FFD8` | `$F5ED` | `SAVE` | NOT DONE | check $F5DD location | +| `$FFDB` | | `SETTIM` | DONE | | +| `$FFDE` | | `RDTIM` | DONE | | +| `$FFE1` | `$F6ED` | `STOP` | DONE | | +| `$FFE4` | `$F13E` | `GETIN` | PARTIAL | only some devices supported | +| `$FFE7` | `$F32F` | `CLALL` | DONE | | +| `$FFEA` | | `UDTIM` | DONE | | +| `$FFED` | | `SCREEN` | DONE | | +| `$FFF0` | | `PLOT` | PARTIAL | cursor blink not handled | +| `$FFF3` | | `IOBASE` | DONE | | +| `($FFFA)` | | NMI vec | PARTIAL | | +| `($FFFC)` | | RESET vec | PARTIAL | | +| `($FFFE)` | | IRQ/BRK vec | PARTIAL | |
-### Unofficial Kernal locations +### Unofficial Kernal routines/locations -TODO +Not all of them - only these we want to have implemented. + +
+ +| Address | Name | Status | Remarks | +| :-------: | :--------------- | :------: | :------------------------------------------------: | +| `$E544` | clear screen | DONE | | +| `$E5A0` | setup VIC II | DONE | | +| `$EA31` | default IRQ | PARTIAL | | +| `$EA7E` | ack CIA1 + below | DONE | | +| `$EA81` | ret from IRQ/NMI | DONE | | +| `$FE47` | default NMI | PARTIAL | | +| `$FE66` | default BRK | DONE | | +| `$FF80` | revision byte | DONE | | + +
diff --git a/c64/basic/a68e.interop b/c64/basic/a68e.interop new file mode 100644 index 00000000..f5ae9e65 --- /dev/null +++ b/c64/basic/a68e.interop @@ -0,0 +1,3 @@ +This routine is mentionned in the cartridge writing tutorial here: https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image + +We have to implement (or at least provide stub), otherwise cartridges will crash. diff --git a/c64/basic/a68e.runc.s b/c64/basic/a68e.runc.s new file mode 100644 index 00000000..e94d6a94 --- /dev/null +++ b/c64/basic/a68e.runc.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +RUNC: + rts diff --git a/c64/basic/a7ae.interop b/c64/basic/a7ae.interop new file mode 100644 index 00000000..f5ae9e65 --- /dev/null +++ b/c64/basic/a7ae.interop @@ -0,0 +1,3 @@ +This routine is mentionned in the cartridge writing tutorial here: https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image + +We have to implement (or at least provide stub), otherwise cartridges will crash. diff --git a/c64/basic/a7ae.newstt.s b/c64/basic/a7ae.newstt.s new file mode 100644 index 00000000..0d01b930 --- /dev/null +++ b/c64/basic/a7ae.newstt.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +NEWSTT: + rts diff --git a/c64/basic/ab1e.print_string.s b/c64/basic/ab1e.strout.s similarity index 75% rename from c64/basic/ab1e.print_string.s rename to c64/basic/ab1e.strout.s index 360e95c5..89079894 100644 --- a/c64/basic/ab1e.print_string.s +++ b/c64/basic/ab1e.strout.s @@ -1,7 +1,9 @@ // Print string at $YYAA // Compute's Mapping the 64 p101 -print_string: +// print string routine + +STROUT: // Setup pointer sty temp_string_ptr+1 sta temp_string_ptr+0 @@ -11,14 +13,13 @@ print_string: // Get offset ready ldy #$00 - -print_string_loop: +!: // Save Y in X, since X is preserved by chrout, but Y is not tya tax lda (temp_string_ptr),y - beq print_string_end + beq !+ jsr JCHROUT @@ -26,10 +27,8 @@ print_string_loop: tay iny - bne print_string_loop - -print_string_end: - + bne !- +!: pla tax rts diff --git a/c64/basic/bdcd.interop b/c64/basic/bdcd.interop new file mode 100644 index 00000000..662be2c4 --- /dev/null +++ b/c64/basic/bdcd.interop @@ -0,0 +1 @@ +At least the FB64 (a file browser) uses this routine - but outputting number as ASCI is defintelyy useful routine, certainly much more programs use it. diff --git a/c64/basic/bdcd.linprt.s b/c64/basic/bdcd.linprt.s new file mode 100644 index 00000000..11e0c756 --- /dev/null +++ b/c64/basic/bdcd.linprt.s @@ -0,0 +1,10 @@ + +// +// Well-known BASIC routine, described in: +// +// - [CM64] Compute's Mapping the Commodore 64 - page 116, XXX +// + + +LINPRT: + rts // XXX implement this diff --git a/c64/basic/e3bf.init.s b/c64/basic/e3bf.init.s new file mode 100644 index 00000000..efb07b70 --- /dev/null +++ b/c64/basic/e3bf.init.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +INIT: + rts diff --git a/c64/basic/e3bf.interop b/c64/basic/e3bf.interop new file mode 100644 index 00000000..f5ae9e65 --- /dev/null +++ b/c64/basic/e3bf.interop @@ -0,0 +1,3 @@ +This routine is mentionned in the cartridge writing tutorial here: https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image + +We have to implement (or at least provide stub), otherwise cartridges will crash. diff --git a/c64/basic/e422.initmsg.s b/c64/basic/e422.initmsg.s new file mode 100644 index 00000000..15f60407 --- /dev/null +++ b/c64/basic/e422.initmsg.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +INITMSG: + rts \ No newline at end of file diff --git a/c64/basic/e422.interop b/c64/basic/e422.interop new file mode 100644 index 00000000..f5ae9e65 --- /dev/null +++ b/c64/basic/e422.interop @@ -0,0 +1,3 @@ +This routine is mentionned in the cartridge writing tutorial here: https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image + +We have to implement (or at least provide stub), otherwise cartridges will crash. diff --git a/c64/basic/e453.interop b/c64/basic/e453.interop new file mode 100644 index 00000000..f5ae9e65 --- /dev/null +++ b/c64/basic/e453.interop @@ -0,0 +1,3 @@ +This routine is mentionned in the cartridge writing tutorial here: https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image + +We have to implement (or at least provide stub), otherwise cartridges will crash. diff --git a/c64/basic/e453.rvect.s b/c64/basic/e453.rvect.s new file mode 100644 index 00000000..5fe5ea3f --- /dev/null +++ b/c64/basic/e453.rvect.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +RVECT: + rts From 2dbb696628ecce9b61f214d047a106d14e898f56 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 13 Sep 2019 23:04:45 +0200 Subject: [PATCH 08/40] slightlyy safer interrupts, they disable BCD mode now --- c64/kernal/interrupts/irq_handler.s | 2 ++ c64/kernal/interrupts/nmi_handler.s | 1 + 2 files changed, 3 insertions(+) diff --git a/c64/kernal/interrupts/irq_handler.s b/c64/kernal/interrupts/irq_handler.s index aec36752..0d7d6de9 100644 --- a/c64/kernal/interrupts/irq_handler.s +++ b/c64/kernal/interrupts/irq_handler.s @@ -15,6 +15,8 @@ irq_handler: tya pha + cld // clear decimal flag, to prevent possible problems + // Check if caused by BRK tsx lda $0104, x // get the pre-interrupt processor state diff --git a/c64/kernal/interrupts/nmi_handler.s b/c64/kernal/interrupts/nmi_handler.s index 77a7a948..6c1275a0 100644 --- a/c64/kernal/interrupts/nmi_handler.s +++ b/c64/kernal/interrupts/nmi_handler.s @@ -2,6 +2,7 @@ nmi_handler: sei // don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt + cld // clear decimal flag, to prevent possible problems // Call interrupt routine (only if initialised) pha From 5b2c28b28155afd58a1a125e9ac15aad5c31b4ed Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sat, 14 Sep 2019 15:06:48 +0200 Subject: [PATCH 09/40] small build system improvements --- src/build_segment.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/build_segment.cc b/src/build_segment.cc index 3453d458..06ab9816 100644 --- a/src/build_segment.cc +++ b/src/build_segment.cc @@ -337,7 +337,7 @@ void calcRoutineSizes() // All written - now launch the assembler const std::string cmd = ASM_CMD + outFileName + " -symbolfile -o /dev/null"; - std::cout << std::flush; + std::cout << "command: " << cmd << "\n" << std::flush; if (0 != system(cmd.c_str())) { ERROR("assembler running failed"); @@ -547,7 +547,7 @@ void compileSegment() // All written - now launch the assembler const std::string cmd = ASM_CMD + outFileName + " -symbolfile -o " + CMD_outFile; - std::cout << std::flush; + std::cout << "command: " << cmd << "\n" << std::flush; if (0 != system(cmd.c_str())) { ERROR("assembler running failed"); @@ -852,7 +852,7 @@ void Solver::run() { // Prepare the log file - const std::string logFileName = CMD_tmpDir + DIR_SEPARATOR + CMD_segName + "_solver.log"; + const std::string logFileName = CMD_tmpDir + DIR_SEPARATOR + CMD_segName + "_binsolution.log"; unlink(logFileName.c_str()); logFile.open(logFileName, std::fstream::out | std::fstream::trunc); From 55e2512fe2b74dc5dc7f410ef759e1317ff57d66 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Tue, 24 Sep 2019 17:24:32 +0200 Subject: [PATCH 10/40] added first CPU specific optimizations --- CONFIG.md | 37 +++++++++++ c64/,,config_generic.s | 5 ++ c64/,,config_mega65.s | 5 ++ c64/,,config_ultimate64.s | 5 ++ c64/aliases/,aliases_config.s | 61 +++++++++++++++++++ c64/basic/printf.s | 30 ++++++++- .../interrupts/ea81.return_from_interrupt.s | 6 ++ .../interrupts/fe47.default_nmi_handler.s | 5 ++ c64/kernal/interrupts/irq_handler.s | 9 ++- c64/kernal/interrupts/nmi_handler.s | 5 +- c64/kernal/printf.s | 30 ++++++++- c64/kernal/reset_entry.s | 7 ++- 12 files changed, 198 insertions(+), 7 deletions(-) create mode 100644 c64/aliases/,aliases_config.s diff --git a/CONFIG.md b/CONFIG.md index f8c11248..027794e8 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -13,6 +13,37 @@ Note however, that features do not came for free - enabling them needs some addi Sane defaults are already present - different for each target. +## Processor instruction set + +### `CONFIG_CPU_MOS_6502` + +Choose if your CPU only supports the original MOS Technology 6502 instruction set, like: + +* MOS 6510 - used in the Commodore 64 +* MOS 8500 - used in the Commodore 64C +* MOS 8502 - used in the Commodore 128 + +If unsure - select this one. + +### `CONFIG_CPU_WDC_65C02` + +Choose if your CPU supports the Western Design Center 65C02 instruction set, like: + +* WDC 65C02 - used in the Turbo Master accelerator +* CSG 65CE02 +* CSG 4510 - used in the Commodore 65 prototypes + +It enables some speed/size code optimizations. Warning - this is untested! + +### `#define CONFIG_CPU_WDC_65816` + +Choose if your CPU supports the 16-bit Western Design Center 65816 instruction set, like: + +* WDC 65C816 - used in the Flash 8 accelerator +* WDC 65C816S - used in the SuperCPU accelerator + +It enables some speed/size code optimizations. Warning - this is untested! + ## Memory models Different layouts of memory are possible - but they can be selected at compile time only. @@ -56,3 +87,9 @@ Each of them needs a couple of bytes in KERNAL segment - but they can share some If enabled, a simple DOS wedge is available from the direct mode - supports `@`, `@`, `@$`, `@$` and `@` commands. Feature needs about 330 bytes in BASIC segment. + +### `CONFIG_BCD_SAFE_INTERRUPTS` + +On the most widespread CPUs the D flag is not cleared upon entering interrupts. Since the original Kernal does not clear it either, it's not safe to use BCD processor mode without disabling the interrupts first. This option makes sure the D flag is disabled at the start of the interrupt - this allows some optimizations in the code. + +Feature needs 2 bytes in KERNAL segmment (for CPUs needing the patch), but at the same time allows optimizations allowing to gain some more bytes. If unsure - enable. diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 7f57226d..74d3ac34 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -4,6 +4,10 @@ // +#define CONFIG_CPU_MOS_6502 +// #define CONFIG_CPU_WDC_65C02 +// #define CONFIG_CPU_WDC_65816 + #define CONFIG_MEMORY_MODEL_38K // #define CONFIG_MEMORY_MODEL_60K @@ -17,3 +21,4 @@ // #define CONFIG_SID_D5XX #define CONFIG_DOS_WEDGE +#define CONFIG_BCD_SAFE_INTERRUPTS diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index 14782cd8..33cf79eb 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -4,6 +4,10 @@ // +#define CONFIG_CPU_MOS_6502 +// #define CONFIG_CPU_WDC_65C02 +// #define CONFIG_CPU_WDC_65816 + // #define CONFIG_MEMORY_MODEL_38K #define CONFIG_MEMORY_MODEL_60K @@ -17,3 +21,4 @@ // #define CONFIG_SID_D5XX #define CONFIG_DOS_WEDGE +#define CONFIG_BCD_SAFE_INTERRUPTS diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index 5fa131a9..e5e4372c 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -4,6 +4,10 @@ // +#define CONFIG_CPU_MOS_6502 +// #define CONFIG_CPU_WDC_65C02 +// #define CONFIG_CPU_WDC_65816 + #define CONFIG_MEMORY_MODEL_38K // #define CONFIG_MEMORY_MODEL_60K @@ -17,3 +21,4 @@ #define CONFIG_SID_D5XX #define CONFIG_DOS_WEDGE +#define CONFIG_BCD_SAFE_INTERRUPTS diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s new file mode 100644 index 00000000..58738507 --- /dev/null +++ b/c64/aliases/,aliases_config.s @@ -0,0 +1,61 @@ + + // Various configuration dependent aliases/macros/checks + + + + // Check that memory model configuration is correct + +{ + .var selected = 0; + +#if CONFIG_MEMORY_MODEL_38K + .eval selected++ +#endif +#if CONFIG_MEMORY_MODEL_60K + .eval selected++ +#endif + + .if (selected != 1) .error "Please select exactly one CONFIG_MEMORY_MODEL_* option" +} + + + + // Check that processor configuration is correct + +{ + .var selected = 0; + +#if CONFIG_CPU_MOS_6502 + .eval selected++ +#endif +#if CONFIG_CPU_WDC_65C02 + .eval selected++ +#endif +#if CONFIG_CPU_WDC_65816 + .eval selected++ +#endif + + .if (selected != 1) .error "Please select exactly one CONFIG_CPU_* option" +} + + + + // Handle processor configuration + +#if CONFIG_CPU_WDC_65C02 || CONFIG_CPU_WDC_65816 + +#define HAS_BCD_SAFE_INTERRUPTS +#define HAS_BCD_SAFE_RESET + + .pseudocommand phx { .byte $DA } + .pseudocommand phy { .byte $5A } + .pseudocommand plx { .byte $FA } + .pseudocommand ply { .byte $7A } + +#endif + + // Handle misc configuration entrues + +#if CONFIG_BCD_SAFE_INTERRUPTS +#define HAS_BCD_SAFE_INTERRUPTS +#endif \ No newline at end of file diff --git a/c64/basic/printf.s b/c64/basic/printf.s index 3266710f..efa6a4c7 100644 --- a/c64/basic/printf.s +++ b/c64/basic/printf.s @@ -139,7 +139,13 @@ printf_retreat: rts printf_printhexbyte: - // Print the hex value in .A as two digits, idea by Haubitze + + // Print the hex value in .A as two digits + +#if HAS_BCD_SAFE_INTERRUPTS + + // Idea by Haubitze + sed pha lsr @@ -155,3 +161,25 @@ printf_printhexbyte: adc #$30 cld jmp JCHROUT + +#else + + pha + lsr + lsr + lsr + lsr + ora #$30 + cmp #$3A + bcc !+ + adc #6 +!: jsr JCHROUT + pla + and #$0f + ora #$30 + cmp #$3A + bcc !+ + adc #6 +!: jmp JCHROUT + +#endif diff --git a/c64/kernal/interrupts/ea81.return_from_interrupt.s b/c64/kernal/interrupts/ea81.return_from_interrupt.s index fa799bff..4908b8ed 100644 --- a/c64/kernal/interrupts/ea81.return_from_interrupt.s +++ b/c64/kernal/interrupts/ea81.return_from_interrupt.s @@ -11,10 +11,16 @@ return_from_interrupt: // Restore registers and return // Sequence according to Compute's Mapping the 64 p73 + +#if CONFIG_CPU_MOS_6502 pla tay pla tax +#else + ply + plx +#endif pla rti diff --git a/c64/kernal/interrupts/fe47.default_nmi_handler.s b/c64/kernal/interrupts/fe47.default_nmi_handler.s index 2c89e4a0..97cdb1d6 100644 --- a/c64/kernal/interrupts/fe47.default_nmi_handler.s +++ b/c64/kernal/interrupts/fe47.default_nmi_handler.s @@ -6,10 +6,15 @@ default_nmi_handler: // Save registers, sequence according to Compute's Mapping the Commodore 64, page 73 pha +#if CONFIG_CPU_MOS_6502 txa pha tya pha +#else + phx + phy +#endif // XXX: RS-232 support is not implemented diff --git a/c64/kernal/interrupts/irq_handler.s b/c64/kernal/interrupts/irq_handler.s index 0d7d6de9..aad1fb9d 100644 --- a/c64/kernal/interrupts/irq_handler.s +++ b/c64/kernal/interrupts/irq_handler.s @@ -10,12 +10,19 @@ irq_handler: // Save registers, sequence according to Compute's Mapping the Commodore 64, page 73 pha +#if CONFIG_CPU_MOS_6502 txa pha tya pha +#else + phx + phy +#endif - cld // clear decimal flag, to prevent possible problems +#if CONFIG_CPU_MOS_6502 && CONFIG_BCD_SAFE_INTERRUPTS + cld // clear decimal flag to allow using it without disabling interrupts +#endif // Check if caused by BRK tsx diff --git a/c64/kernal/interrupts/nmi_handler.s b/c64/kernal/interrupts/nmi_handler.s index 6c1275a0..9c0b668d 100644 --- a/c64/kernal/interrupts/nmi_handler.s +++ b/c64/kernal/interrupts/nmi_handler.s @@ -2,7 +2,10 @@ nmi_handler: sei // don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt - cld // clear decimal flag, to prevent possible problems + +#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 diff --git a/c64/kernal/printf.s b/c64/kernal/printf.s index cb87548a..599e4e15 100644 --- a/c64/kernal/printf.s +++ b/c64/kernal/printf.s @@ -139,7 +139,13 @@ printf_retreat: rts printf_printhexbyte: - // Print the hex value in .A as two digits, idea by Haubitze + + // Print the hex value in .A as two digits + +#if HAS_BCD_SAFE_INTERRUPTS + + // Idea by Haubitze + sed pha lsr @@ -155,3 +161,25 @@ printf_printhexbyte: adc #$30 cld jmp JCHROUT + +#else + + pha + lsr + lsr + lsr + lsr + ora #$30 + cmp #$3A + bcc !+ + adc #6 +!: jsr JCHROUT + pla + and #$0f + ora #$30 + cmp #$3A + bcc !+ + adc #6 +!: jmp JCHROUT + +#endif diff --git a/c64/kernal/reset_entry.s b/c64/kernal/reset_entry.s index 17b021ad..89382905 100644 --- a/c64/kernal/reset_entry.s +++ b/c64/kernal/reset_entry.s @@ -5,9 +5,10 @@ reset_entry: // The GPL program at https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_functional_test.a65 - // uses the following initial reset sequence - // affirmed by c64 PRG p269 - cld + // uses the following initial reset sequence, affirmed by c64 PRG p269 +#if !HAS_BCD_SAFE_RESET + cld // for CPUs having undefined D flag after reset +#endif ldx #$FF txs sei From 6949bd3f48e2f822cc38fa605a4d1a0835cbcd09 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Tue, 24 Sep 2019 17:59:46 +0200 Subject: [PATCH 11/40] small startup/interrupt cleanup --- CONFIG.md | 2 +- c64/kernal/{fffa.s => fffa.vector_nmi.s} | 2 +- c64/kernal/{fffc.s => fffc.vector_reset.s} | 2 +- c64/kernal/{fffe.s => fffe.vector_irq.s} | 2 +- c64/kernal/interrupts/{irq_handler.s => hw_entry_irq.s} | 4 ++-- c64/kernal/interrupts/{nmi_handler.s => hw_entry_nmi.s} | 4 +--- c64/kernal/{reset_entry.s => interrupts/hw_entry_reset.s} | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) rename c64/kernal/{fffa.s => fffa.vector_nmi.s} (80%) rename c64/kernal/{fffc.s => fffc.vector_reset.s} (81%) rename c64/kernal/{fffe.s => fffe.vector_irq.s} (88%) rename c64/kernal/interrupts/{irq_handler.s => hw_entry_irq.s} (98%) rename c64/kernal/interrupts/{nmi_handler.s => hw_entry_nmi.s} (96%) rename c64/kernal/{reset_entry.s => interrupts/hw_entry_reset.s} (98%) diff --git a/CONFIG.md b/CONFIG.md index 027794e8..35e6570a 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -35,7 +35,7 @@ Choose if your CPU supports the Western Design Center 65C02 instruction set, lik It enables some speed/size code optimizations. Warning - this is untested! -### `#define CONFIG_CPU_WDC_65816` +### `CONFIG_CPU_WDC_65816` Choose if your CPU supports the 16-bit Western Design Center 65816 instruction set, like: diff --git a/c64/kernal/fffa.s b/c64/kernal/fffa.vector_nmi.s similarity index 80% rename from c64/kernal/fffa.s rename to c64/kernal/fffa.vector_nmi.s index d39f0f53..19ee0ad8 100644 --- a/c64/kernal/fffa.s +++ b/c64/kernal/fffa.vector_nmi.s @@ -1,4 +1,4 @@ // $FFFA - CPU NMI Hanlder // Uncontrovertial as this is also a CPU requirement. - .word nmi_handler + .word hw_entry_nmi diff --git a/c64/kernal/fffc.s b/c64/kernal/fffc.vector_reset.s similarity index 81% rename from c64/kernal/fffc.s rename to c64/kernal/fffc.vector_reset.s index eb4f1ba8..20545b6c 100644 --- a/c64/kernal/fffc.s +++ b/c64/kernal/fffc.vector_reset.s @@ -1,4 +1,4 @@ // $FFFC - CPU Reset Vector // Uncontrovertial, as it is a CPU requirement, and nothing else. - .word reset_entry + .word hw_entry_reset diff --git a/c64/kernal/fffe.s b/c64/kernal/fffe.vector_irq.s similarity index 88% rename from c64/kernal/fffe.s rename to c64/kernal/fffe.vector_irq.s index 2a892889..fd3e136d 100644 --- a/c64/kernal/fffe.s +++ b/c64/kernal/fffe.vector_irq.s @@ -2,4 +2,4 @@ // This is non-controvertial, as it is a 6502 CPU requirement, and we just have to point // it to whatever IRQ routine we make. - .word irq_handler + .word hw_entry_irq diff --git a/c64/kernal/interrupts/irq_handler.s b/c64/kernal/interrupts/hw_entry_irq.s similarity index 98% rename from c64/kernal/interrupts/irq_handler.s rename to c64/kernal/interrupts/hw_entry_irq.s index aad1fb9d..517100c4 100644 --- a/c64/kernal/interrupts/irq_handler.s +++ b/c64/kernal/interrupts/hw_entry_irq.s @@ -1,5 +1,6 @@ -irq_handler: +hw_entry_irq: + // The IRQ is a commonly messed with thing on the C64, // so we need to handle entry points that are commonly // relied upon, including: @@ -52,4 +53,3 @@ irq_handler_brk: // Interrupt caused by BRK jmp (CBINV) - diff --git a/c64/kernal/interrupts/nmi_handler.s b/c64/kernal/interrupts/hw_entry_nmi.s similarity index 96% rename from c64/kernal/interrupts/nmi_handler.s rename to c64/kernal/interrupts/hw_entry_nmi.s index 9c0b668d..ca41e1d0 100644 --- a/c64/kernal/interrupts/nmi_handler.s +++ b/c64/kernal/interrupts/hw_entry_nmi.s @@ -1,5 +1,5 @@ -nmi_handler: +hw_entry_nmi: sei // don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt @@ -18,5 +18,3 @@ nmi_handler: // Vector not initialized - call default interrupt routine pla jmp default_nmi_handler - - diff --git a/c64/kernal/reset_entry.s b/c64/kernal/interrupts/hw_entry_reset.s similarity index 98% rename from c64/kernal/reset_entry.s rename to c64/kernal/interrupts/hw_entry_reset.s index 89382905..ed498dfc 100644 --- a/c64/kernal/reset_entry.s +++ b/c64/kernal/interrupts/hw_entry_reset.s @@ -2,7 +2,7 @@ // https://www.c64-wiki.com/wiki/Reset_(Process) -reset_entry: +hw_entry_reset: // The GPL program at https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_functional_test.a65 // uses the following initial reset sequence, affirmed by c64 PRG p269 From 571efdd03d1e80c14f5cc98ffbe42de3c503c515 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Tue, 24 Sep 2019 18:52:48 +0200 Subject: [PATCH 12/40] fixed VECTOR defaults location, needed by GEOS --- STATUS.md | 5 ++-- c64/kernal/fd15.restor.s | 24 +++++++++++++++ c64/kernal/fd30.interop | 3 ++ ...ctor_defaults.s => fd30.vector_defaults.s} | 0 c64/kernal/{fd15.vector.s => vector_real.s} | 30 ++----------------- 5 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 c64/kernal/fd15.restor.s create mode 100644 c64/kernal/fd30.interop rename c64/kernal/{vector_defaults.s => fd30.vector_defaults.s} (100%) rename c64/kernal/{fd15.vector.s => vector_real.s} (68%) diff --git a/STATUS.md b/STATUS.md index c23d642d..d5d73c1f 100644 --- a/STATUS.md +++ b/STATUS.md @@ -98,8 +98,8 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FF81` | `$FF5B` | `CINT` | DONE | | | `$FF84` | `$FDA3` | `IOINIT` | PARTIAL | CIA initialization incomplete | | `$FF87` | `$FD50` | `RAMTAS` | DONE | | -| `$FF8A` | | `RESTOR` | DONE | | -| `$FF8D` | `$FD15` | `VECTOR` | PARTIAL | wrong address, code starts from RESTOR | +| `$FF8A` | `$FD15` | `RESTOR` | DONE | | +| `$FF8D` | `$FD1A` | `VECTOR` | DONE | | | `$FF90` | | `SETMSG` | DONE | | | `$FF93` | | `SECOND` | DONE | | | `$FF96` | | `TKSA` | DONE | | @@ -153,6 +153,7 @@ Not all of them - only these we want to have implemented. | `$EA31` | default IRQ | PARTIAL | | | `$EA7E` | ack CIA1 + below | DONE | | | `$EA81` | ret from IRQ/NMI | DONE | | +| `$FD30` | default vectors | DONE | | | `$FE47` | default NMI | PARTIAL | | | `$FE66` | default BRK | DONE | | | `$FF80` | revision byte | DONE | | diff --git a/c64/kernal/fd15.restor.s b/c64/kernal/fd15.restor.s new file mode 100644 index 00000000..c71fe1c4 --- /dev/null +++ b/c64/kernal/fd15.restor.s @@ -0,0 +1,24 @@ + +// +// Official Kernal routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - page 293 (RESTOR), 304 (VECTOR) +// - [CM64] Compute's Mapping the Commodore 64 - page 237 +// +// CPU registers that has to be preserved (see [RG64]): none +// + +RESTOR: + + clc // clear carry - for writing to system table + ldx #vector_defaults + + // FALLTHROUGH + +VECTOR: + +// Our implementation is longer than the original one, +// placing it here would cause a collision with VECTOR defaults + + jmp vector_real diff --git a/c64/kernal/fd30.interop b/c64/kernal/fd30.interop new file mode 100644 index 00000000..13c67365 --- /dev/null +++ b/c64/kernal/fd30.interop @@ -0,0 +1,3 @@ +Location of the default Kernal vector values, described in Compute's Mapping the Commodore 64, page 237 + +It is referenced by GEOS - see https://github.com/mist64/geos/blob/master/inc/c64.inc diff --git a/c64/kernal/vector_defaults.s b/c64/kernal/fd30.vector_defaults.s similarity index 100% rename from c64/kernal/vector_defaults.s rename to c64/kernal/fd30.vector_defaults.s diff --git a/c64/kernal/fd15.vector.s b/c64/kernal/vector_real.s similarity index 68% rename from c64/kernal/fd15.vector.s rename to c64/kernal/vector_real.s index 7b7fd00d..0f16c325 100644 --- a/c64/kernal/fd15.vector.s +++ b/c64/kernal/vector_real.s @@ -1,22 +1,5 @@ -// -// Official Kernal routine, described in: -// -// - [RG64] C64 Programmer's Reference Guide - page 293 (RESTOR), 304 (VECTOR) -// - [CM64] Compute's Mapping the Commodore 64 - page 237 -// -// CPU registers that has to be preserved (see [RG64]): none -// - -RESTOR: - - clc // clear carry - for writing to system table - ldx #vector_defaults - - // FALLTHROUGH - -VECTOR: +vector_real: // Temporary storage location - checked on real C64 that this is the // address originally used; after calling VECTOR and checking zero page @@ -41,17 +24,10 @@ VECTOR: ldy #$1F bcc vector_restore - // FALLTHROUGH - -vector_store: lda CINV, y sta (_caller_arr_ptr), y - dey - bpl vector_store - - // Restore status register (IRQ) before return - plp - rts + + // FALLTHROUGH vector_restore: lda (_caller_arr_ptr), y From 49f48eb6154b895bcf745da524f59135070a3b5f Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Tue, 24 Sep 2019 21:47:03 +0200 Subject: [PATCH 13/40] fixed VECTOR bug (too aggressive optimization) --- c64/kernal/vector_real.s | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/c64/kernal/vector_real.s b/c64/kernal/vector_real.s index 0f16c325..ed6640fa 100644 --- a/c64/kernal/vector_real.s +++ b/c64/kernal/vector_real.s @@ -27,11 +27,15 @@ vector_real: lda CINV, y sta (_caller_arr_ptr), y - // FALLTHROUGH + bcs vector_end_loop // branch always vector_restore: lda (_caller_arr_ptr), y sta CINV, y + + // FALLTROUGH + +vector_end_loop: dey bpl vector_restore From 33b6b36fcbfb20ff465aa09f1a077bb9c0982e68 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Tue, 24 Sep 2019 22:10:48 +0200 Subject: [PATCH 14/40] stub behaviour is now configurable --- CONFIG.md | 6 ++++++ c64/,,config_generic.s | 2 ++ c64/,,config_mega65.s | 2 ++ c64/,,config_ultimate64.s | 2 ++ c64/aliases/,aliases_config.s | 24 +++++++++++++++++++++++- c64/basic/a483.main.s | 2 +- c64/basic/a57c.chrnch.s | 2 +- c64/basic/a68e.runc.s | 2 +- c64/basic/a71a.qplop.s | 2 +- c64/basic/a7ae.newstt.s | 2 +- c64/basic/a7e4.gone.s | 2 +- c64/basic/ae86.eval.s | 2 +- c64/basic/bdcd.linprt.s | 2 +- c64/basic/e38b.error.s | 2 +- c64/basic/e3bf.init.s | 2 +- c64/basic/e422.initmsg.s | 2 +- c64/basic/e453.rvect.s | 2 +- c64/kernal/f5ed.save.s | 2 +- 18 files changed, 48 insertions(+), 14 deletions(-) diff --git a/CONFIG.md b/CONFIG.md index 35e6570a..199220f2 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -93,3 +93,9 @@ Feature needs about 330 bytes in BASIC segment. On the most widespread CPUs the D flag is not cleared upon entering interrupts. Since the original Kernal does not clear it either, it's not safe to use BCD processor mode without disabling the interrupts first. This option makes sure the D flag is disabled at the start of the interrupt - this allows some optimizations in the code. Feature needs 2 bytes in KERNAL segmment (for CPUs needing the patch), but at the same time allows optimizations allowing to gain some more bytes. If unsure - enable. + +### `CONFIG_STUBS_BRK` + +Option just for debugging purposes - replaces `RTS` stubbed routines implementation with one causing a break. + +If unsure - disable. diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 74d3ac34..d9cfb900 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -22,3 +22,5 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS + +// #define CONFIG_STUBS_BRK diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index 33cf79eb..4a54f292 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -22,3 +22,5 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS + +// #define CONFIG_STUBS_BRK diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index e5e4372c..2351e37a 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -22,3 +22,5 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS + +// #define CONFIG_STUBS_BRK diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s index 58738507..f7a70eda 100644 --- a/c64/aliases/,aliases_config.s +++ b/c64/aliases/,aliases_config.s @@ -58,4 +58,26 @@ #if CONFIG_BCD_SAFE_INTERRUPTS #define HAS_BCD_SAFE_INTERRUPTS -#endif \ No newline at end of file +#endif + + // Stub configuration + +.macro STUB_IMPLEMENTATION_RTS() { + rts +} + +.macro STUB_IMPLEMENTATION_BRK() { + .break + brk + brk + jmp *-2 +} + +.macro STUB_IMPLEMENTATION() +{ +#if CONFIG_STUBS_BRK + STUB_IMPLEMENTATION_BRK() +#else + STUB_IMPLEMENTATION_RTS() +#endif +} diff --git a/c64/basic/a483.main.s b/c64/basic/a483.main.s index 680e34f8..40415b24 100644 --- a/c64/basic/a483.main.s +++ b/c64/basic/a483.main.s @@ -10,4 +10,4 @@ MAIN: - rts // XXX implement this + STUB_IMPLEMENTATION() diff --git a/c64/basic/a57c.chrnch.s b/c64/basic/a57c.chrnch.s index bc797250..4f462ff6 100644 --- a/c64/basic/a57c.chrnch.s +++ b/c64/basic/a57c.chrnch.s @@ -10,4 +10,4 @@ CHRNCH: - rts // XXX implement this + STUB_IMPLEMENTATION() diff --git a/c64/basic/a68e.runc.s b/c64/basic/a68e.runc.s index e94d6a94..dfec0e32 100644 --- a/c64/basic/a68e.runc.s +++ b/c64/basic/a68e.runc.s @@ -2,4 +2,4 @@ // XXX provide documentation and implementation RUNC: - rts + STUB_IMPLEMENTATION() diff --git a/c64/basic/a71a.qplop.s b/c64/basic/a71a.qplop.s index a6a8572e..efa99f31 100644 --- a/c64/basic/a71a.qplop.s +++ b/c64/basic/a71a.qplop.s @@ -10,4 +10,4 @@ QPLOP: - rts // XXX implement this + STUB_IMPLEMENTATION() diff --git a/c64/basic/a7ae.newstt.s b/c64/basic/a7ae.newstt.s index 0d01b930..55b97764 100644 --- a/c64/basic/a7ae.newstt.s +++ b/c64/basic/a7ae.newstt.s @@ -2,4 +2,4 @@ // XXX provide documentation and implementation NEWSTT: - rts + STUB_IMPLEMENTATION() diff --git a/c64/basic/a7e4.gone.s b/c64/basic/a7e4.gone.s index 00cc0d6e..547f648a 100644 --- a/c64/basic/a7e4.gone.s +++ b/c64/basic/a7e4.gone.s @@ -10,4 +10,4 @@ GONE: - rts // XXX implement this + STUB_IMPLEMENTATION() diff --git a/c64/basic/ae86.eval.s b/c64/basic/ae86.eval.s index 3d8b0116..423eb01a 100644 --- a/c64/basic/ae86.eval.s +++ b/c64/basic/ae86.eval.s @@ -10,4 +10,4 @@ EVAL: - rts // XXX implement this + STUB_IMPLEMENTATION() diff --git a/c64/basic/bdcd.linprt.s b/c64/basic/bdcd.linprt.s index 11e0c756..32afbf1b 100644 --- a/c64/basic/bdcd.linprt.s +++ b/c64/basic/bdcd.linprt.s @@ -7,4 +7,4 @@ LINPRT: - rts // XXX implement this + STUB_IMPLEMENTATION() diff --git a/c64/basic/e38b.error.s b/c64/basic/e38b.error.s index eb0fe611..43954f1d 100644 --- a/c64/basic/e38b.error.s +++ b/c64/basic/e38b.error.s @@ -10,4 +10,4 @@ ERROR: - rts // XXX implement this + STUB_IMPLEMENTATION() diff --git a/c64/basic/e3bf.init.s b/c64/basic/e3bf.init.s index efb07b70..884154f6 100644 --- a/c64/basic/e3bf.init.s +++ b/c64/basic/e3bf.init.s @@ -2,4 +2,4 @@ // XXX provide documentation and implementation INIT: - rts + STUB_IMPLEMENTATION() diff --git a/c64/basic/e422.initmsg.s b/c64/basic/e422.initmsg.s index 15f60407..a3e07d4a 100644 --- a/c64/basic/e422.initmsg.s +++ b/c64/basic/e422.initmsg.s @@ -2,4 +2,4 @@ // XXX provide documentation and implementation INITMSG: - rts \ No newline at end of file + STUB_IMPLEMENTATION() diff --git a/c64/basic/e453.rvect.s b/c64/basic/e453.rvect.s index 5fe5ea3f..916e26fd 100644 --- a/c64/basic/e453.rvect.s +++ b/c64/basic/e453.rvect.s @@ -2,4 +2,4 @@ // XXX provide documentation and implementation RVECT: - rts + STUB_IMPLEMENTATION() diff --git a/c64/kernal/f5ed.save.s b/c64/kernal/f5ed.save.s index 44c6eb15..79ea33d6 100644 --- a/c64/kernal/f5ed.save.s +++ b/c64/kernal/f5ed.save.s @@ -10,4 +10,4 @@ // SAVE: - rts + STUB_IMPLEMENTATION() From 041a4750dd1afcaed54bdffd91bb841f46c792ce Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 25 Sep 2019 22:54:04 +0200 Subject: [PATCH 15/40] pass symbols to VICE emulator --- Makefile | 67 ++++++++++++++++++++++------------ src/build_segment.cc | 86 ++++++++++++++++++++++++-------------------- 2 files changed, 91 insertions(+), 62 deletions(-) diff --git a/Makefile b/Makefile index 7fcf6975..bc206ae3 100644 --- a/Makefile +++ b/Makefile @@ -89,13 +89,25 @@ build/chargen.rom: $(TOOL_PNGPREPARE) assets/8x8font.png # Dependencies - BASIC and KERNAL -build/target_generic/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_generic) c64/,,config_generic.s $(foreach dir,$(SRCDIR_BASIC_generic),$(wildcard $(dir)/*.s)) -build/target_mega65/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_mega65) c64/,,config_mega65.s $(foreach dir,$(SRCDIR_BASIC_mega65),$(wildcard $(dir)/*.s)) -build/target_ultimate64/OUTB.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_ultimate64) c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_BASIC_ultimate64),$(wildcard $(dir)/*.s)) +build/target_generic/OUTB.BIN build/target_generic/BASIC_combined.vs: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_generic) \ + c64/,,config_generic.s $(foreach dir,$(SRCDIR_BASIC_generic),$(wildcard $(dir)/*.s)) +build/target_mega65/OUTB.BIN build/target_mega65/BASIC_combined.vs: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_mega65) \ + c64/,,config_mega65.s $(foreach dir,$(SRCDIR_BASIC_mega65),$(wildcard $(dir)/*.s)) +build/target_ultimate64/OUTB.BIN build/target_ultimate64/BASIC_combined.vs: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_ultimate64) \ + c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_BASIC_ultimate64),$(wildcard $(dir)/*.s)) -build/target_generic/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_generic) c64/,,config_generic.s $(foreach dir,$(SRCDIR_KERNAL_generic),$(wildcard $(dir)/*.s)) -build/target_mega65/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_mega65) c64/,,config_mega65.s $(foreach dir,$(SRCDIR_KERNAL_mega65),$(wildcard $(dir)/*.s)) -build/target_ultimate64/OUTK.BIN: $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_ultimate64) c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_KERNAL_ultimate64),$(wildcard $(dir)/*.s)) +build/target_generic/OUTK.BIN build/target_generic/KERNAL_combined.vs: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_generic) \ + c64/,,config_generic.s $(foreach dir,$(SRCDIR_KERNAL_generic),$(wildcard $(dir)/*.s)) +build/target_mega65/OUTK.BIN build/target_mega65/KERNAL_combined.vs: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_mega65) \ + c64/,,config_mega65.s $(foreach dir,$(SRCDIR_KERNAL_mega65),$(wildcard $(dir)/*.s)) +build/target_ultimate64/OUTK.BIN build/target_ultimate64/KERNAL_combined.vs: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_ultimate64) \ + c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_KERNAL_ultimate64),$(wildcard $(dir)/*.s)) build/target_generic/newrom: build/target_generic/OUTB.BIN build/target_generic/OUTK.BIN build/target_mega65/newrom: build/target_mega65/OUTB.BIN build/target_mega65/OUTK.BIN @@ -109,27 +121,31 @@ build/basic_generic.rom: build/target_generic/newrom build/basic_mega65.rom: build/target_mega65/newrom build/basic_ultimate64.rom: build/target_ultimate64/newrom +build/symbols_generic.vs: build/target_generic/BASIC_combined.vs build/target_generic/KERNAL_combined.vs +build/symbols_mega65.vs: build/target_generic/BASIC_mega65.vs build/target_generic/KERNAL_mega65.vs +build/symbols_ultimate64.vs: build/target_ultimate64/BASIC_combined.vs build/target_ultimate64/KERNAL_combined.vs + # Rules - BASIC and KERNAL build/,generated/packed_messages.s: $(TOOL_COMPRESS_TEXT) @mkdir -p build/,generated $(TOOL_COMPRESS_TEXT) > build/,generated/packed_messages.s -.PRECIOUS: build/target_%/OUTB.BIN -build/target_%/OUTB.BIN: +.PRECIOUS: build/target_%/OUTB.BIN build/target_%/BASIC_combined.vs +build/target_%/OUTB.BIN build/target_%/BASIC_combined.vs: @mkdir -p build/target_$* @rm -f $@* build/target_$*/BASIC* - @$(TOOL_BUILD_SEGMENT) -s BASIC -i BASIC-$* -o OUTB.BIN -t build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC_$*) $(GEN_BASIC) + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s BASIC -i BASIC-$* -o OUTB.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC_$*) $(GEN_BASIC) -.PRECIOUS: build/target_%/OUTK.BIN -build/target_%/OUTK.BIN: +.PRECIOUS: build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs +build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs: @mkdir -p build/target_$* @rm -f $@* build/target_$*/KERNAL* - @$(TOOL_BUILD_SEGMENT) -s KERNAL -i KERNAL-$* -o OUTK.BIN -t build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL_$*) $(GEN_KERNAL) + @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s KERNAL -i KERNAL-$* -o OUTK.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL_$*) $(GEN_KERNAL) .PRECIOUS: build/target_%/newrom build/target_%/newrom: - cat build/target_$*/OUTB.BIN build/target_$*/OUTK.BIN > $@ + cat build/target_$*/OUTB.BIN build/target_$*/OUTK.BIN > $@ .PRECIOUS: build/kernal_%.rom build/kernal_%.rom: @@ -139,6 +155,10 @@ build/kernal_%.rom: build/basic_%.rom: dd if=build/target_$*/newrom bs=8192 count=1 skip=0 of=$@ +.PRECIOUS: build/symbols_%.vs +build/symbols_%.vs: + sort build/target_$*/BASIC_combined.vs build/target_$*/KERNAL_combined.vs | uniq > $@ + # Rules - platform 'Mega 65' specific build/newc65.rom: build/kernal_mega65.rom build/basic_mega65.rom build/chargen.rom Makefile @@ -150,23 +170,24 @@ build/newc65.rom: build/kernal_mega65.rom build/basic_mega65.rom build/chargen.r # Rules - tests -test: build/kernal_generic.rom build/basic_generic.rom - x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -8 empty.d64 +.PHONY: test test_generic test_mega65 test_ultimate64 test_m65 testremote testsimilarity -test_generic: build/kernal_generic.rom build/basic_generic.rom - x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -8 empty.d64 +test: test_generic -test_mega65: build/kernal_mega65.rom build/basic_mega65.rom - x64 -kernal build/kernal_mega65.rom -basic build/basic_mega65.rom -8 empty.d64 +test_generic: build/kernal_generic.rom build/basic_generic.rom build/symbols_generic.vs + x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -moncommands build/symbols_generic.vs -8 empty.d64 -test_ultimate64: build/kernal_ultimate64.rom build/basic_ultimate64.rom - x64 -kernal build/kernal_ultimate64.rom -basic build/basic_ultimate64.rom -8 empty.d64 +test_mega65: build/kernal_mega65.rom build/basic_mega65.rom build/symbols_mega65.vs + x64 -kernal build/kernal_mega65.rom -basic build/basic_mega65.rom -moncommands build/symbols_mega65.vs -8 empty.d64 + +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 -8 empty.d64 test_m65: build/newc65 m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65.rom -4 -testremote: build/kernal_generic.rom build/basic_generic.rom - x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -remotemonitor +testremote: build/kernal_generic.rom build/basic_generic.rom build/symbols_generic.vs + x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -moncommands build/symbols_generic.vs -remotemonitor testsimilarity: build/target_generic/newrom $(TOOL_SIMILARITY) $(TOOL_SIMILARITY) kernal build/target_generic/newrom diff --git a/src/build_segment.cc b/src/build_segment.cc index 06ab9816..1def3655 100644 --- a/src/build_segment.cc +++ b/src/build_segment.cc @@ -26,7 +26,7 @@ #define DIR_SEPARATOR "/" #endif -const std::string ASM_CMD = "java -jar assembler/KickAss.jar "; +const std::string ASM_CMD = "java -jar "; const std::string LAB_OUT_START = "__routine_START_"; const std::string LAB_OUT_END = "__routine_END_"; @@ -39,8 +39,9 @@ const std::string BANNER_LINE = "//------------------------------------------- // Command line settings // +std::string CMD_assFile = "KickAss.jar"; std::string CMD_outFile = "OUT.BIN"; -std::string CMD_tmpDir = "./out"; +std::string CMD_outDir = "./out"; std::string CMD_segName = "MAIN"; std::string CMD_segInfo = "(unnamed)"; int CMD_loAddress = 0xC000; @@ -66,10 +67,10 @@ void ERROR(const std::string &message) void printUsage() { std::cout << "\n" << - "usage: build_segment [-o ] [-d ] [-t ]" << "\n" << + "usage: build_segment [-a ] [-o ] [-d ]" << "\n" << " [-l ] [-h ]" << "\n" << - " [-s ] [-i ] " << - "\n\n"; + " [-s ] [-i ]" << "\n" << + " " << "\n\n"; } void printBannerLineTop() @@ -195,16 +196,17 @@ void parseCommandLine(int argc, char **argv) // Retrieve command line options - while ((opt = getopt(argc, argv, "o:d:t:l:h:s:i:")) != -1) + while ((opt = getopt(argc, argv, "a:o:d:s:i:l:h:")) != -1) { switch(opt) { - case 'o': CMD_outFile = optarg; break; - case 't': CMD_tmpDir = optarg; break; - case 's': CMD_segName = optarg; break; - case 'i': CMD_segInfo = optarg; break; - case 'l': CMD_loAddress = strtol(optarg, nullptr ,16); break; - case 'h': CMD_hiAddress = strtol(optarg, nullptr ,16); break; + case 'a': CMD_assFile = optarg; break; + case 'o': CMD_outFile = optarg; break; + case 'd': CMD_outDir = optarg; break; + case 's': CMD_segName = optarg; break; + case 'i': CMD_segInfo = optarg; break; + case 'l': CMD_loAddress = strtol(optarg, nullptr ,16); break; + case 'h': CMD_hiAddress = strtol(optarg, nullptr ,16); break; default: printUsage(); ERROR(); } } @@ -297,23 +299,25 @@ void checkInputFileLabels() void calcRoutineSizes() { - const std::string nameBase = CMD_tmpDir + DIR_SEPARATOR + CMD_segName + "_sizetest"; + const std::string nameBase = CMD_segName + "_sizetest"; + const std::string filePath = CMD_outDir + DIR_SEPARATOR; - const std::string outFileName = nameBase + ".s"; - const std::string symFileName = nameBase + ".sym"; + const std::string outFileNameBare = nameBase + ".s"; + const std::string outFileNamePath = filePath + outFileNameBare; + const std::string symFileNamePath = filePath + nameBase + ".sym"; // Remove old files - unlink(outFileName.c_str()); - unlink(symFileName.c_str()); + unlink(outFileNamePath.c_str()); + unlink(symFileNamePath.c_str()); // Write test file to determine routine sizes - std::ofstream outFile(outFileName, std::fstream::out | std::fstream::trunc); - if (!outFile.good()) ERROR(std::string("can't open temporary file '") + outFileName + "'"); + std::ofstream outFile(outFileNamePath, std::fstream::out | std::fstream::trunc); + if (!outFile.good()) ERROR(std::string("can't open temporary file '") + outFileNamePath + "'"); // Start at $100, so that no local data gets accesses using ZP addressing modes - // during this pass, which would otherwise upset things later + // during this pass, which would otherwise upset things later outFile << "\n" << ".segment " << CMD_segName << " [start=$100, min=$100, max=$FFFF]" << "\n"; outFile << "#define SEGMENT_" << CMD_segName << "\n"; @@ -331,12 +335,13 @@ void calcRoutineSizes() outFile << LAB_OUT_END << sourceFile.label << ":" << "\n"; } - if (!outFile.good()) ERROR(std::string("error writing temporary file '") + outFileName + "'"); + if (!outFile.good()) ERROR(std::string("error writing temporary file '") + outFileNamePath + "'"); outFile.close(); // All written - now launch the assembler - const std::string cmd = ASM_CMD + outFileName + " -symbolfile -o /dev/null"; + const std::string cmd = "cd " + filePath + " && " + ASM_CMD + CMD_assFile + " " + + outFileNameBare + " -symbolfile -o /dev/null"; std::cout << "command: " << cmd << "\n" << std::flush; if (0 != system(cmd.c_str())) { @@ -346,8 +351,8 @@ void calcRoutineSizes() // Read addresses std::ifstream symFile; - symFile.open(symFileName); - if (!symFile.good()) ERROR(std::string("unable to open results file '") + symFileName + "'"); + symFile.open(symFileNamePath); + if (!symFile.good()) ERROR(std::string("unable to open results file '") + symFileNamePath + "'"); std::string line; while (std::getline(symFile, line)) @@ -429,9 +434,9 @@ void prepareBinningProblem() { // Prepare the log file - const std::string logFileName = CMD_tmpDir + DIR_SEPARATOR + CMD_segName + "_binproblem.log"; - unlink(logFileName.c_str()); - std::ofstream logFile(logFileName, std::fstream::out | std::fstream::trunc); + const std::string logFileNamePath = CMD_outDir + DIR_SEPARATOR + CMD_segName + "_binproblem.log"; + unlink(logFileNamePath.c_str()); + std::ofstream logFile(logFileNamePath, std::fstream::out | std::fstream::trunc); DualStream logOutput(logFile, std::cout); // Print out code length information @@ -477,7 +482,7 @@ void prepareBinningProblem() // Close the log file - if (!logFile.good()) ERROR(std::string("error writing log file '") + logFileName + "'"); + if (!logFile.good()) ERROR(std::string("error writing log file '") + logFileNamePath + "'"); logFile.close(); } @@ -502,10 +507,12 @@ void compileSegment() { // First combine everything into one assembler file - const std::string outFileName = CMD_tmpDir + DIR_SEPARATOR + CMD_segName + "_combined.s"; - unlink(outFileName.c_str()); - std::ofstream outFile(outFileName, std::fstream::out | std::fstream::trunc); - if (!outFile.good()) ERROR(std::string("can't open temporary file '") + outFileName + "'"); + const std::string outFileNameBare = CMD_segName + "_combined.s"; + const std::string filePath = CMD_outDir + DIR_SEPARATOR; + const std::string outFileNamePath = filePath + outFileNameBare; + unlink(outFileNamePath.c_str()); + std::ofstream outFile(outFileNamePath, std::fstream::out | std::fstream::trunc); + if (!outFile.good()) ERROR(std::string("can't open temporary file '") + outFileNamePath + "'"); // Write the header @@ -541,12 +548,13 @@ void compileSegment() outFile << "\n"; } - if (!outFile.good()) ERROR(std::string("error writing temporary file '") + outFileName + "'"); + if (!outFile.good()) ERROR(std::string("error writing temporary file '") + outFileNamePath + "'"); outFile.close(); // All written - now launch the assembler - const std::string cmd = ASM_CMD + outFileName + " -symbolfile -o " + CMD_outFile; + const std::string cmd = "cd " + filePath + " && " + ASM_CMD + CMD_assFile + " " + + outFileNameBare + " -symbolfile -vicesymbols -o " + CMD_outFile; std::cout << "command: " << cmd << "\n" << std::flush; if (0 != system(cmd.c_str())) { @@ -852,9 +860,9 @@ void Solver::run() { // Prepare the log file - const std::string logFileName = CMD_tmpDir + DIR_SEPARATOR + CMD_segName + "_binsolution.log"; - unlink(logFileName.c_str()); - logFile.open(logFileName, std::fstream::out | std::fstream::trunc); + const std::string logFileNamePath = CMD_outDir + DIR_SEPARATOR + CMD_segName + "_binsolution.log"; + unlink(logFileNamePath.c_str()); + logFile.open(logFileNamePath, std::fstream::out | std::fstream::trunc); // Sort the floating routines, just to be extra sure @@ -887,7 +895,7 @@ void Solver::run() // Close the log file - if (!logFile.good()) ERROR(std::string("error writing log file '") + logFileName + "'"); + if (!logFile.good()) ERROR(std::string("error writing log file '") + logFileNamePath + "'"); logFile.close(); } @@ -945,7 +953,7 @@ int KS(const std::vector &routines, auto &cachedS = cacheS[n - 1][C - 1]; if (cachedV >= 0) { - // We already hold the solution in out cache - return it + // We already hold the solution in our cache - return it solution = cachedS; return cachedV; } From 94b8e0dc29265577f6721a583b5d686146027c1b Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 26 Sep 2019 15:38:49 +0200 Subject: [PATCH 16/40] fix possible crash in VIC II setup routine --- STATUS.md | 22 +++++++++---------- c64/kernal/e5a0.setup_vicii.s | 4 +++- .../interrupts/fe66.default_brk_handler.s | 1 - 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/STATUS.md b/STATUS.md index d5d73c1f..10c353e2 100644 --- a/STATUS.md +++ b/STATUS.md @@ -146,16 +146,16 @@ Not all of them - only these we want to have implemented.
-| Address | Name | Status | Remarks | -| :-------: | :--------------- | :------: | :------------------------------------------------: | -| `$E544` | clear screen | DONE | | -| `$E5A0` | setup VIC II | DONE | | -| `$EA31` | default IRQ | PARTIAL | | -| `$EA7E` | ack CIA1 + below | DONE | | -| `$EA81` | ret from IRQ/NMI | DONE | | -| `$FD30` | default vectors | DONE | | -| `$FE47` | default NMI | PARTIAL | | -| `$FE66` | default BRK | DONE | | -| `$FF80` | revision byte | DONE | | +| Address | Name | Status | Remarks | +| :-------: | :---------------- | :------: | :------------------------------------------------: | +| `$E544` | clear screen | DONE | | +| `$E5A0` | setup VIC II & IO | PARTIAL | | +| `$EA31` | default IRQ | PARTIAL | | +| `$EA7E` | ack CIA1 + below | DONE | | +| `$EA81` | ret from IRQ/NMI | DONE | | +| `$FD30` | default vectors | DONE | | +| `$FE47` | default NMI | PARTIAL | | +| `$FE66` | default BRK | DONE | | +| `$FF80` | revision byte | DONE | |
diff --git a/c64/kernal/e5a0.setup_vicii.s b/c64/kernal/e5a0.setup_vicii.s index 4fb95bc8..7345dbc4 100644 --- a/c64/kernal/e5a0.setup_vicii.s +++ b/c64/kernal/e5a0.setup_vicii.s @@ -1,6 +1,8 @@ setup_vicii: + // XXX there is more to setup within this routine + // Set up default IO values (Compute's Mapping the 64 p215) lda #$1B // Enable text mode sta VIC_SCROLY @@ -17,4 +19,4 @@ setup_vicii: lda #$00 sta VIC_SPENA - // FALLTROUGH + rts diff --git a/c64/kernal/interrupts/fe66.default_brk_handler.s b/c64/kernal/interrupts/fe66.default_brk_handler.s index 9e8adccb..75d1b4f4 100644 --- a/c64/kernal/interrupts/fe66.default_brk_handler.s +++ b/c64/kernal/interrupts/fe66.default_brk_handler.s @@ -12,4 +12,3 @@ default_brk_handler: cli jmp (IBASIC_WARM_START) - From 332438145c0790f91ce9401c9acb4bebaff31291 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 26 Sep 2019 20:50:46 +0200 Subject: [PATCH 17/40] deduplicated 'printf.s', over 200 bytes saved in BASIC segment --- Makefile | 38 +++++---- c64/basic/,imports.s | 7 ++ c64/basic/printf.s | 185 ------------------------------------------- src/build_segment.cc | 3 + 4 files changed, 32 insertions(+), 201 deletions(-) create mode 100644 c64/basic/,imports.s delete mode 100644 c64/basic/printf.s diff --git a/Makefile b/Makefile index bc206ae3..f48d2564 100644 --- a/Makefile +++ b/Makefile @@ -89,25 +89,31 @@ build/chargen.rom: $(TOOL_PNGPREPARE) assets/8x8font.png # Dependencies - BASIC and KERNAL -build/target_generic/OUTB.BIN build/target_generic/BASIC_combined.vs: \ - $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_generic) \ - c64/,,config_generic.s $(foreach dir,$(SRCDIR_BASIC_generic),$(wildcard $(dir)/*.s)) -build/target_mega65/OUTB.BIN build/target_mega65/BASIC_combined.vs: \ +build/target_generic/OUTB.BIN build/target_generic/BASIC_combined.vs: \ + $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_generic) \ + c64/,,config_generic.s build/target_generic/KERNAL_combined.sym \ + $(foreach dir,$(SRCDIR_BASIC_generic),$(wildcard $(dir)/*.s)) +build/target_mega65/OUTB.BIN build/target_mega65/BASIC_combined.vs: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_mega65) \ - c64/,,config_mega65.s $(foreach dir,$(SRCDIR_BASIC_mega65),$(wildcard $(dir)/*.s)) -build/target_ultimate64/OUTB.BIN build/target_ultimate64/BASIC_combined.vs: \ + c64/,,config_mega65.s build/target_mega65/KERNAL_combined.sym \ + $(foreach dir,$(SRCDIR_BASIC_mega65),$(wildcard $(dir)/*.s)) +build/target_ultimate64/OUTB.BIN build/target_ultimate64/BASIC_combined.vs: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC_ultimate64) \ - c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_BASIC_ultimate64),$(wildcard $(dir)/*.s)) + c64/,,config_ultimate64.s build/target_ultimate64/KERNAL_combined.sym \ + $(foreach dir,$(SRCDIR_BASIC_ultimate64),$(wildcard $(dir)/*.s)) -build/target_generic/OUTK.BIN build/target_generic/KERNAL_combined.vs: \ +build/target_generic/OUTK.BIN build/target_generic/KERNAL_combined.vs build/target_generic/KERNAL_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_generic) \ - c64/,,config_generic.s $(foreach dir,$(SRCDIR_KERNAL_generic),$(wildcard $(dir)/*.s)) -build/target_mega65/OUTK.BIN build/target_mega65/KERNAL_combined.vs: \ + c64/,,config_generic.s \ + $(foreach dir,$(SRCDIR_KERNAL_generic),$(wildcard $(dir)/*.s)) +build/target_mega65/OUTK.BIN build/target_mega65/KERNAL_combined.vs build/target_mega65/KERNAL_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_mega65) \ - c64/,,config_mega65.s $(foreach dir,$(SRCDIR_KERNAL_mega65),$(wildcard $(dir)/*.s)) -build/target_ultimate64/OUTK.BIN build/target_ultimate64/KERNAL_combined.vs: \ + c64/,,config_mega65.s \ + $(foreach dir,$(SRCDIR_KERNAL_mega65),$(wildcard $(dir)/*.s)) +build/target_ultimate64/OUTK.BIN build/target_ultimate64/KERNAL_combined.vs build/target_ultimate64/KERNAL_combined.sym: \ $(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL_ultimate64) \ - c64/,,config_ultimate64.s $(foreach dir,$(SRCDIR_KERNAL_ultimate64),$(wildcard $(dir)/*.s)) + c64/,,config_ultimate64.s \ + $(foreach dir,$(SRCDIR_KERNAL_ultimate64),$(wildcard $(dir)/*.s)) build/target_generic/newrom: build/target_generic/OUTB.BIN build/target_generic/OUTK.BIN build/target_mega65/newrom: build/target_mega65/OUTB.BIN build/target_mega65/OUTK.BIN @@ -137,8 +143,8 @@ build/target_%/OUTB.BIN build/target_%/BASIC_combined.vs: @rm -f $@* build/target_$*/BASIC* @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s BASIC -i BASIC-$* -o OUTB.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC_$*) $(GEN_BASIC) -.PRECIOUS: build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs -build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs: +.PRECIOUS: build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym +build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym: @mkdir -p build/target_$* @rm -f $@* build/target_$*/KERNAL* @$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -s KERNAL -i KERNAL-$* -o OUTK.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL_$*) $(GEN_KERNAL) @@ -157,7 +163,7 @@ build/basic_%.rom: .PRECIOUS: build/symbols_%.vs build/symbols_%.vs: - sort build/target_$*/BASIC_combined.vs build/target_$*/KERNAL_combined.vs | uniq > $@ + sort build/target_$*/BASIC_combined.vs build/target_$*/KERNAL_combined.vs | uniq | grep -v "__" > $@ # Rules - platform 'Mega 65' specific diff --git a/c64/basic/,imports.s b/c64/basic/,imports.s new file mode 100644 index 00000000..81d75baf --- /dev/null +++ b/c64/basic/,imports.s @@ -0,0 +1,7 @@ + +// Routines imported from Kernal - our private API + +#import "KERNAL_combined.sym" + +.label printf = KERNAL.printf +.label printf_printhexbyte = KERNAL.printf_printhexbyte diff --git a/c64/basic/printf.s b/c64/basic/printf.s deleted file mode 100644 index efa6a4c7..00000000 --- a/c64/basic/printf.s +++ /dev/null @@ -1,185 +0,0 @@ -// printf()-like routine for simplifying debugging - -// Prints the literal zero-terminated string that follows, -// which may also include special tokens that allow -// printing of hex byte and word values stored at the indicated -// addresses. - -// .byte 1,$byte = display byte as hex -// .byte 2,$low,$hi = display word as hex -// .byte $f0+n,$low,$hi = display byte at $hi$lo+n as hex - -printf: - // Temporary storage is between end of screen at $0400 - // and the sprite pointers at $7f8 - sta $7f0 - stx $7f1 - sty $7f2 - php - pla - sta $7f3 - - // Set up read routine - lda #$ad // LDA $nnnn - sta $7f4 - lda #$60 - sta $7f7 // RTS - - // Get PC of caller from the stack, so that - // we can parse through it - pla - clc - adc #$01 - sta $7f5 - pla - adc #$00 - sta $7f6 - -printf_loop: - jsr $7f4 - cmp #$00 - bne printf_continues - // Put return address on stack and restore - // registers - lda $7f6 - pha - lda $7f5 - pha - lda $7f3 - pha - lda $7f0 - ldx $7f1 - ldy $7f2 - plp - rts - -printf_continues: - cmp #$01 - bne not_hexbyte - // Print a hex byte - - // Skip the token - jsr printf_advance - // Read the low byte - jsr $7f4 - // Print as hex - jsr printf_printhexbyte - jmp printf_nextchar - -not_hexbyte: - cmp #$02 - bne not_hexword - // Print a hex word - - // Skip the token - jsr printf_advance - jsr printf_advance - // Read the high byte - jsr $7f4 - // Print as hex - jsr printf_printhexbyte - // Skip the token - jsr printf_retreat - // Read the low byte - jsr $7f4 - // Print as hex - jsr printf_printhexbyte - jsr printf_advance - jmp printf_nextchar - -not_hexword: - cmp #$f0 - bcc not_pointer - - // Treat two-byte arg as base address - // and lower 4 bits of token as offset from - // that location. - - // Get offset - and #$0f - tay - - jsr printf_advance - jsr $7f4 - sta $fd - jsr printf_advance - jsr $7f4 - sta $fe - - lda ($fd),y - jsr printf_printhexbyte - jmp printf_nextchar - -not_pointer: - // Print character - jsr JCHROUT - -printf_nextchar: - jsr printf_advance - - jmp printf_loop - -printf_advance: - // Advance pointer to next character - inc $7f5 - bne !+ - inc $7f6 -!: - rts - -printf_retreat: - // Retreat pointer to previous char - lda $7f5 - sec - sbc #1 - sta $7f5 - lda $7f6 - sbc #0 - sta $7f6 - rts - -printf_printhexbyte: - - // Print the hex value in .A as two digits - -#if HAS_BCD_SAFE_INTERRUPTS - - // Idea by Haubitze - - sed - pha - lsr - lsr - lsr - lsr - cmp #$0A - adc #$30 - jsr JCHROUT - pla - and #$0F - cmp #$0A - adc #$30 - cld - jmp JCHROUT - -#else - - pha - lsr - lsr - lsr - lsr - ora #$30 - cmp #$3A - bcc !+ - adc #6 -!: jsr JCHROUT - pla - and #$0f - ora #$30 - cmp #$3A - bcc !+ - adc #6 -!: jmp JCHROUT - -#endif diff --git a/src/build_segment.cc b/src/build_segment.cc index 1def3655..9c55842e 100644 --- a/src/build_segment.cc +++ b/src/build_segment.cc @@ -524,6 +524,7 @@ void compileSegment() ", outBin=\"" << CMD_outFile << "\", fill]" << "\n"; outFile << "#define SEGMENT_" << CMD_segName << "\n"; + outFile << ".namespace " << CMD_segName << " {" << "\n\n"; // Write files which only contain definitions (no routines) @@ -548,6 +549,8 @@ void compileSegment() outFile << "\n"; } + outFile << "\n\n" << "} // namespace" << "\n"; + if (!outFile.good()) ERROR(std::string("error writing temporary file '") + outFileNamePath + "'"); outFile.close(); From 72a60958e982c9c667df6fcf9edb268bf4be0b63 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 27 Sep 2019 16:40:58 +0200 Subject: [PATCH 18/40] reduced amount of VICE label conflicts --- bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/basic_mega65.rom | Bin 8192 -> 8192 bytes bin/basic_ultimate64.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/aliases/,aliases_hardware.s | 8 ++--- c64/aliases/,aliases_ram_lowmem.s | 6 ++-- c64/basic/,aliases.s | 24 ------------- c64/basic/basic_main_loop.s | 2 +- c64/basic/cmd_list.s | 10 +++--- c64/basic/tokenise_line.s | 16 ++++----- c64/kernal/,aliases.s | 22 ------------ c64/kernal/blink_cursor.s | 8 ++--- c64/kernal/chrin_real.s | 10 +++--- c64/kernal/chrout_real.s | 16 ++++----- c64/kernal/cint_real.s | 10 +++--- c64/kernal/e544.clear_screen.s | 2 +- c64/kernal/f13e.getin.s | 2 +- c64/kernal/fda3.ioinit.s | 8 ++--- c64/kernal/scnkey.s | 56 +++++++++++++++--------------- 21 files changed, 77 insertions(+), 123 deletions(-) diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 966d794a1402a3a82ca753a7d6d084d97a429ce9..826cc63b74271c7c7984edff63250f4ca1365257 100644 GIT binary patch literal 8192 zcmeHMeQZA==jG5W*O%@6LUJ zwVG6Ee^sjF=e+msx%ZrN@BN)~?u*U|3@iz4Shv2Wwr2BcNMC6L(g>sx_+}CClI#h( zN)l+H|umKw#;Spiwgha>(r?WNMt= zTRvG7rsb2x1jdm2EDJ2h5phX~z# zM7=p+7zX3Z%rG@!Q7@mis8dQ7DxntbZ4$n~c}o4&@rpM>2Jb3GQ^3$8t4B0ry?mQz;EME*7`{&nDn488@)tuU!l+^2Zs#j1_k;!HC- zy*OeMr>WCRk`%{nG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C->B4jIYYLAo0Xe0SD`3h|!&18%A EAI5>Em;e9( diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 32bd602ec614b975f2cfc92d4dbc92222ff89903..1765f7d2d3978d643e4d735dde15639fefdec66b 100644 GIT binary patch delta 3205 zcmZ8j4{#G@7T-VlvuXM#DU_zv(hp9Lgtk~kF`QOV5W?N3#o{^Oow}prT;S@>cypt5 z#xdpW){3N;&T?nV&>`fq$TCeQ49;k)MG8zOo3pxe6hSRVTS*2x>TMI-rEtmK+obiJ z%VfUqeeb>ReeZkk_ujXyn_4&dJo`N&5j6G?WQXmhH&`zD0%e{Mqd=^!yckg_p$#vsoDW%1Rce`>KaMmfzA1W6DSK^O>vAxINJQ-sMtQVcMSCW0`M z6ev&zP%$u|WHAv8X`x6H%@}CPY+?knOu1Q+;26$2L{RAMNr{jj7p!u{b-^r=3N322 zVm6LePwLXullY~{FyqsmD1qB28Q7WI2a>YM{1!tTl;R=*+H9BstymkwO19|jVXJH{ zfM1R&GhwEJAVDlxw`-hLUXf(LMA)j7gqeXK?PF$AKNW0`m=zjdoDi%E?MpIXIVKXY z8^|E>MRA{OJ5wB`W8LhT%BZp1vFB?xcBWEJiUeHFZzKJsBsV6Q{Y%J*jT~J<$|e1! zq)7Atj z9532Q@C=0DfSI!j3|APo9y2Gcf>ruTrt$G9z{(e5L{40fjTFkMW7hZtp)83H-6cj` zC5kmZBu1nxMCI|RU~7(+$(XAI5=h2C5%SPE)$L&25Cgue;HnP-b+SP=$6%m<%`zwV zbp5_Vo*&se(me79dB&ON#N_$p-sA!&x5oopxCgyl!~d<&^{?@G7?oYae-cHKs}UKl zmRl>*TwRdp?y8A()wofQHqiPN=s&gl-T%EA?8-iQwfRZE71G5OJaNu0ZvWW}hEz|ow-5#a|eVIbf zsOZZ~$Q~iCtg)5EWfiSVBXt&Ob5;|psV#!a_< zKkMfxcEMP=nlqL{J5(pWIKu~x>ed zVNjxEL*yNb6$1PNRhxbNMC8XcnWO}PpV#>HO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_LPn|zy%v`%t$!9e>v64X#9U}=K5gfe->r&N4B$px4TXXPUC&oHAdUN~!u8Ok6i zx8o#Vp;B|5xVF&{U|Pu#xl49eelh!A&Z#HlDw&$z2xTpAQzn8h#d`tLpng>RLt_DC&OV@QK{A;fSHRB}5VupG0dX}LLP=!_ZW zuaK`MBF2U*jl;n!?Zb2?$i_0bqg$^@tK%wEWtOCqgSMgGI~)}I94(W7sP}tz1O!rF z6vd2T&s&I-{26On+`0oe`+*sx7rHa|?|V^fioRd^_<^xfO2-P6^@Ht-$%>>uxBCd{ z`YqyoN01K|e{NR;>i!+#-fTcVSZE)03_M0U>X8>C!IhI56U z;|*@E&J{A!wP%@ap&@T(T6#~;3oyNJAuI@+iWe=bneObbnUWW@fAr7aBiVHFS19oj z7s#!F7Puh%tayXrn$T6etm>=j5Yya@!iF0THfo5O#9Vw~8X{>C4ZdcS;aDiKO*2$w zLDUE;h^m<9R44~xp4qB;CBl35ItHT+VRvV~vFQaHRjOWDKKS;`sy zewHc=zo1jX-6bX9F@Nd0;)64;@Egd9V)NnF&2J#Lo4hpRCI@GFS}Zk&)i!wA$IW{h zE;ODGl=v;ZMQqFYW7a7YBEX1rBeXO-q-yq6fSJinRoiUD5( zB4V17ULZN)-Q`aTe_6iVS*m8|AG~nz_5@R60n}2dH6NxRUYUYd2_7ksh`Axg1<#;> zavopYnR46tAbo43ppDZ*X>L?<%mhs{S4IkBTlZKCIduo}0On#`5chh8Jnk-C{C28_(id3kC zsN}CI8BodLY0?-c(+U}mlUpjeo+RBWDM*r^sN~Xw&|gxr>IW0#&Sb5ftu1A1pJK`W XBq>XiA~kSBWH^TT_3Q!d@#KF1c1$5{ diff --git a/c64/aliases/,aliases_hardware.s b/c64/aliases/,aliases_hardware.s index 343fb5db..73abfd8c 100644 --- a/c64/aliases/,aliases_hardware.s +++ b/c64/aliases/,aliases_hardware.s @@ -10,7 +10,7 @@ // VIC-II registers - .label VIC_BASE = $D000 // base address of the chip + .label __VIC_BASE = $D000 // base address of the chip .label VIC_SP0X = $D000 .label VIC_SP0Y = $D001 @@ -64,7 +64,7 @@ // SID registers - .label SID_BASE = $D400 // base address of the chip + .label __SID_BASE = $D400 // base address of the chip .label SID_FRELO1 = $D400 .label SID_FREHI1 = $D401 @@ -101,7 +101,7 @@ // CIA #1 registers - .label CIA1_BASE = $DC00 // base address of the chip + .label __CIA1_BASE = $DC00 // base address of the chip .label CIA1_PRA = $DC00 .label CIA1_PRB = $DC01 @@ -125,7 +125,7 @@ // CIA #2 registers - .label CIA2_BASE = $DD00 // base address of the chip + .label __CIA2_BASE = $DD00 // base address of the chip .label CIA2_PRA = $DD00 // VIC bank switching and IEC port .label CIA2_PRB = $DD01 diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 8a18c4af..0c63eaa0 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -166,13 +166,13 @@ .label HIBASE = $288 // high byte of start of screen .label XMAX = $289 // max keyboard buffer size .label RPTFLG = $28A // -- NOT IMPLEMENTED -- - .label KOUNT = $28B // -- NOT IMPLEMENTED -- + .label KOUNT = $28B // key repeat counter .label DELAY = $28C // -- NOT IMPLEMENTED -- .label SHFLAG = $28D // bucky keys (SHIFT/CTRL/C=) flags .label LSTSHF = $28E // last bucky key flags - .label KEYLOG = $28F // $28F-$290 -- NOT IMPLEMENTED -- + .label KEYLOG = $28F // $28F-$290 -- NOT IMPLEMENTED -- keyboard decoding pointer .label MODE = $291 // flag, is case switch allowed - .label AUTODN = $292 // -- NOT IMPLEMENTED -- + .label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 .label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551 .label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551 diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index e2a02afb..ef91afa0 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -60,7 +60,6 @@ // We also use the following for temp colour pointer when scrolling .label load_save_verify_end_address = $AE - .label cassette_buffer_ptr = $B2 .label current_logical_filenum = $B8 .label current_secondary_address = $B9 .label current_device_number = $BA @@ -80,7 +79,6 @@ .label keyboard_input_ready = $D0 .label current_screen_line_ptr = $D1 .label current_screen_x = $D3 - .label quote_mode_flag = $D4 .label logical_line_length = $D5 .label current_screen_y = $D6 .label last_printed_character_ascii = $D7 @@ -91,28 +89,6 @@ .label current_screen_line_colour_ptr = $F3 .label keyboard_decoding_table_ptr = $F5 - .label basic_input_buffer = BUF - - // "Compute's Mapping the 64" book - .label keyboard_buffer = $0277 - .label text_colour = $0286 // p55 - .label colour_under_cursor = $0287 // p56 - .label key_buffer_size = $0289 // p57 - - // 0 = cursor keys, insert, delete and space repeat, but nothing else - // 128 = all keys repeat - // 64 = no keys repeat - .label key_repeat_flags = $028A // p58 - // https://www.c64-wiki.com/wiki/Page_2 - .label key_repeat_counter = $028B - .label key_first_repeat_delay = $028C - // bit 0 = shift, 1 = Vendor Key, 2 = Control - .label key_bucky_state = $028D - .label key_last_bucky_state = $028E - .label keyboard_decoding_ptr = $028F - .label enable_case_switch = $0291 - .label screen_scroll_disable = $0292 - #if CONFIG_MEMORY_MODEL_60K // BASIC uses some extra bytes for memory access under ROMs located at $2A7 onwards diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index ef5c56dd..bfee34e6 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -24,7 +24,7 @@ read_line_loop: ldx #22 jmp basic_do_error !: - sta basic_input_buffer,x + sta BUF,x inx jmp read_line_loop diff --git a/c64/basic/cmd_list.s b/c64/basic/cmd_list.s index 7c56e38e..b2e6e2a6 100644 --- a/c64/basic/cmd_list.s +++ b/c64/basic/cmd_list.s @@ -66,7 +66,7 @@ list_single_line: // entry point needed by DOS wedge // Iterate through printing out the line // contents lda #0 - sta quote_mode_flag + sta QTSW ldy #4 list_print_loop: @@ -82,14 +82,14 @@ list_print_loop: beq list_end_of_line cmp #$22 bne list_not_quote - lda quote_mode_flag + lda QTSW eor #$ff - sta quote_mode_flag + sta QTSW lda #$22 jmp list_is_literal list_not_quote: // Check quote mode, and display as literal if required - ldx quote_mode_flag + ldx QTSW bne list_is_literal cmp #$7f @@ -128,7 +128,7 @@ list_not_quote: // REM command locks quote flag on until the end of the line, allowing // funny characters in REM statements without problem. inc $0427 - sta quote_mode_flag // Any value other than $00 or $FF will lock quote mode on, so the token value of REM is fine here + 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: diff --git a/c64/basic/tokenise_line.s b/c64/basic/tokenise_line.s index 38e412b0..df2314af 100644 --- a/c64/basic/tokenise_line.s +++ b/c64/basic/tokenise_line.s @@ -17,7 +17,7 @@ tokenise_line: lda #$00 sta $0110 sta $0112 - sta quote_mode_flag + sta QTSW lda tokenise_work1 sta $0113 @@ -40,7 +40,7 @@ tokenise_char: // Clear quote mode flag that is also used by KERNAL for screen display lda #$00 - sta quote_mode_flag + sta QTSW rts !: // More to do @@ -60,9 +60,9 @@ tokenise_char_loop: bne tk_not_quote // Quote - lda quote_mode_flag + lda QTSW eor #$ff - sta quote_mode_flag + sta QTSW jmp tk_literal_char tk_not_quote: @@ -82,7 +82,7 @@ tk_not_quote: tk_might_be_keyword: // Don't tokenise in quote mode - lda quote_mode_flag + lda QTSW bne tk_literal_char // Pack string @@ -137,9 +137,9 @@ found_token_in_line: // If it is REM, then lock us in quote mode to the end of the line cmp #$8f bne not_rem - sta quote_mode_flag -not_rem: - + sta QTSW +not_rem: + // Now skip over the length of the token lda $0110 clc diff --git a/c64/kernal/,aliases.s b/c64/kernal/,aliases.s index da75162a..286d92da 100644 --- a/c64/kernal/,aliases.s +++ b/c64/kernal/,aliases.s @@ -5,7 +5,6 @@ // XXX get rid of this file, use ,aliases_ram_lowmem.s instead - .label kernal_load_or_verify_flag = $93 .label current_file_num = $98 .label input_device_number = DFLTN .label cassette_buffer_bytes_used = $A6 @@ -30,7 +29,6 @@ .label keyboard_input_ready = $D0 .label current_screen_line_ptr = $D1 .label current_screen_x = $D3 - .label quote_mode_flag = $D4 .label logical_line_length = $D5 .label current_screen_y = $D6 .label last_printed_character_ascii = $D7 @@ -40,26 +38,6 @@ .label screen_line_link_table = $D9 .label current_screen_line_colour_ptr = $F3 .label keyboard_decoding_table_ptr = $F5 - - // "Compute's Mapping the 64" book - .label keyboard_buffer = $0277 - .label text_colour = $0286 // p55 - .label colour_under_cursor = $0287 // p56 - .label key_buffer_size = $0289 // p57 - - // 0 = cursor keys, insert, delete and space repeat, but nothing else - // 128 = all keys repeat - // 64 = no keys repeat - .label key_repeat_flags = $028A // p58 - // https://www.c64-wiki.com/wiki/Page_2 - .label key_repeat_counter = $028B - .label key_first_repeat_delay = $028C - // bit 0 = shift, 1 = Vendor Key, 2 = Control - .label key_bucky_state = $028D - .label key_last_bucky_state = $028E - .label keyboard_decoding_ptr = $028F - .label enable_case_switch = $0291 - .label screen_scroll_disable = $0292 #if CONFIG_MEMORY_MODEL_60K diff --git a/c64/kernal/blink_cursor.s b/c64/kernal/blink_cursor.s index 3135b4bd..1f64e898 100644 --- a/c64/kernal/blink_cursor.s +++ b/c64/kernal/blink_cursor.s @@ -3,7 +3,7 @@ // cursor_blink_countdown // cursor_saved_character // cursor_is_visible -// colour_under_cursor +// GDCOL (colour under cursor) show_cursor_if_enabled: lda cursor_blink_disable @@ -48,8 +48,8 @@ draw_cursor: sta (current_screen_line_ptr),y // Also set cursor colour lda (current_screen_line_colour_ptr),y - sta colour_under_cursor - lda text_colour + sta GDCOL + lda COLOR sta (current_screen_line_colour_ptr),y lda #1 @@ -63,7 +63,7 @@ undraw_cursor: lda cursor_saved_character ldy current_screen_x sta (current_screen_line_ptr),y - lda colour_under_cursor + lda GDCOL sta (current_screen_line_colour_ptr),y lda #0 diff --git a/c64/kernal/chrin_real.s b/c64/kernal/chrin_real.s index fed6552d..741534e5 100644 --- a/c64/kernal/chrin_real.s +++ b/c64/kernal/chrin_real.s @@ -90,7 +90,7 @@ read_from_keyboard: lda keys_in_key_buffer beq chrin_repeat - lda keyboard_buffer + lda KEYD cmp #$0d bne not_enter @@ -145,7 +145,7 @@ empty_line: not_enter: // Print character - lda keyboard_buffer + lda KEYD jsr CHROUT jsr pop_keyboard_buffer @@ -160,11 +160,11 @@ pop_keyboard_buffer: sei ldx #$00 ldy #$01 -!: lda keyboard_buffer,y - sta keyboard_buffer,x +!: lda KEYD,y + sta KEYD,x inx iny - cpy key_buffer_size + cpy XMAX bne !- dec keys_in_key_buffer cli diff --git a/c64/kernal/chrout_real.s b/c64/kernal/chrout_real.s index 190a4067..03d2b849 100644 --- a/c64/kernal/chrout_real.s +++ b/c64/kernal/chrout_real.s @@ -110,7 +110,7 @@ not_0a: bne not_0d // RETURN clears quote and insert modes lda #$00 - sta quote_mode_flag + sta QTSW sta insert_mode jmp screen_advance_to_next_line not_0d: @@ -235,7 +235,7 @@ done_delete: not_14: // Check for quote mode - ldx quote_mode_flag + ldx QTSW bne is_quote_mode ldx insert_mode bne is_quote_mode @@ -274,7 +274,7 @@ not_quote_mode: colour_check_loop: cmp colour_codes,x bne !+ - stx text_colour + stx COLOR jmp chrout_done !: dex bpl colour_check_loop @@ -415,14 +415,14 @@ output_literal_char: bne not_quote // Toggle quote flag if required - lda quote_mode_flag + lda QTSW eor #$80 - sta quote_mode_flag + sta QTSW not_quote: // Set colour - lda text_colour + lda COLOR sta (current_screen_line_colour_ptr),y // Advance the column, and scroll screen down if we need @@ -556,7 +556,7 @@ no_copy_down: // Erase newly inserted line ldy #79 !: - lda text_colour + lda COLOR sta (current_screen_line_colour_ptr),y lda #$20 sta (current_screen_line_ptr),y @@ -659,7 +659,7 @@ scroll_copy_loop2: // Fill in scrolled up area ldx load_or_scroll_temp_pointer+0 scroll_copy_loop3: - lda text_colour + lda COLOR sta (current_screen_line_colour_ptr),y lda #$20 sta (current_screen_line_ptr),y diff --git a/c64/kernal/cint_real.s b/c64/kernal/cint_real.s index 97a4d701..23452e08 100644 --- a/c64/kernal/cint_real.s +++ b/c64/kernal/cint_real.s @@ -79,17 +79,17 @@ cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start? // But require key to be held for ~1/3sec before // repeating (Compute's Mapping the 64 p58) ldx #22-2 // Fudge factor to match speed - stx key_first_repeat_delay + stx DELAY // Set current colour for text (Compute's Mapping the 64 p215) ldx #$01 // default is light blue ($0E), but we use a different one - stx text_colour + stx COLOR // Set maximum keyboard buffer size (Compute's Mapping the 64 p215) ldx #10 - stx key_buffer_size - // Put non-zero value in enable_case_switch - stx enable_case_switch + stx XMAX + // Put non-zero value in MODE to enable case switch + stx MODE // Set default I/O devices (see SCINIT description at http://sta.c64.org/cbm64krnfunc.html) jsr clrchn_reset diff --git a/c64/kernal/e544.clear_screen.s b/c64/kernal/e544.clear_screen.s index d0e0e639..e699f2ec 100644 --- a/c64/kernal/e544.clear_screen.s +++ b/c64/kernal/e544.clear_screen.s @@ -47,7 +47,7 @@ clearscreen_l2: // Clear colour RAM // (Compute's Mapping the 64 p216) - lda text_colour + lda COLOR clearscreen_l3: sta $d800,y sta $d900,y diff --git a/c64/kernal/f13e.getin.s b/c64/kernal/f13e.getin.s index 485535b0..c5f6b713 100644 --- a/c64/kernal/f13e.getin.s +++ b/c64/kernal/f13e.getin.s @@ -22,7 +22,7 @@ GETIN: rts !: - lda keyboard_buffer + lda KEYD pha jsr pop_keyboard_buffer diff --git a/c64/kernal/fda3.ioinit.s b/c64/kernal/fda3.ioinit.s index bdffec29..00fbf343 100644 --- a/c64/kernal/fda3.ioinit.s +++ b/c64/kernal/fda3.ioinit.s @@ -53,15 +53,15 @@ IOINIT: #endif // CONFIG_SID_D4XX || CONFIG_SID_D5XX #if CONFIG_SID_2ND - lda SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS + lda SID_SIGVOL - __SID_BASE + CONFIG_SID_2ND_ADDRESS and #$F0 - sta SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS + sta SID_SIGVOL - __SID_BASE + CONFIG_SID_2ND_ADDRESS #endif // CONFIG_SID_2ND #if CONFIG_SID_3RD - lda SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS + lda SID_SIGVOL - __SID_BASE + CONFIG_SID_3RD_ADDRESS and #$F0 - sta SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS + sta SID_SIGVOL - __SID_BASE + CONFIG_SID_3RD_ADDRESS #endif // CONFIG_SID_3RD // Initialize CIAs diff --git a/c64/kernal/scnkey.s b/c64/kernal/scnkey.s index 6bf96d90..31a587a4 100644 --- a/c64/kernal/scnkey.s +++ b/c64/kernal/scnkey.s @@ -74,9 +74,9 @@ SCNKEY: sta BufferQuantity // Decrement key repeat timeout if non-zero - ldx key_repeat_counter + ldx KOUNT beq sk_start - dec key_repeat_counter + dec KOUNT sk_start: // Call main keyboard scanning routine @@ -110,7 +110,7 @@ accept_key: // Convert matrix position to key code // XXX - Add offset of $40, $80 or $C0 if shift, CONTROL or C= are held down pha - lda key_bucky_state + lda SHFLAG and #$7 tax pla @@ -123,9 +123,9 @@ accept_key: // Stash key into keyboard buffer ldx keys_in_key_buffer - cpx key_buffer_size + cpx XMAX beq sk_nokey - sta keyboard_buffer,x + sta KEYD,x inc keys_in_key_buffer sk_nokey: @@ -204,10 +204,10 @@ ReturnNoKeys: NoActivityDetected: // So cancel all bucky keys - lda key_bucky_state - sta key_last_bucky_state + lda SHFLAG + sta LSTSHF lda #$00 - sta key_bucky_state + sta SHFLAG jmp ReturnNoKeys @@ -239,7 +239,7 @@ JoystickActivity: // Clear bucky key status lda #$00 - sta key_bucky_state + sta SHFLAG lda $dc01 and #$03 @@ -254,7 +254,7 @@ JoystickActivity: // Up // Mark shift as pressed ldx #$01 - stx key_bucky_state + stx SHFLAG ldx #$07 // UP/DOWN jsr KeyFound !: @@ -278,7 +278,7 @@ JoystickActivity: cmp #$08 bne !+ ldx #$01 - stx key_bucky_state + stx SHFLAG ldx #$02 jsr KeyFound // LEFT/RIGHT !: @@ -332,20 +332,20 @@ next_row: // Store de-bounce data for bucky keys // (Compute's Mapping the 64, p58-59) - lda key_bucky_state - sta key_last_bucky_state + lda SHFLAG + sta LSTSHF // Build bucky state lda #$00 - sta key_bucky_state + sta SHFLAG lda ScanResult+6 eor #%10000000 and #%10000000 // Left shift rol rol and #$01 - ora key_bucky_state - sta key_bucky_state + ora SHFLAG + sta SHFLAG // Right shift lda ScanResult+1 @@ -355,15 +355,15 @@ next_row: lsr lsr and #$01 - ora key_bucky_state - sta key_bucky_state + ora SHFLAG + sta SHFLAG // Control lda ScanResult+0 eor #$04 and #$04 - ora key_bucky_state - sta key_bucky_state + ora SHFLAG + sta SHFLAG // Vendor key lda ScanResult+0 @@ -373,17 +373,17 @@ next_row: lsr lsr and #$02 - ora key_bucky_state - sta key_bucky_state + ora SHFLAG + sta SHFLAG // Chick for shift + Vendor cmp #$03 bne no_case_toggle - lda key_last_bucky_state + lda LSTSHF cmp #$03 beq no_case_toggle - lda enable_case_switch + lda MODE beq no_case_toggle lda $D018 @@ -509,15 +509,15 @@ KeyHeld: // Different key held sta last_key_matrix_position pha - lda key_first_repeat_delay - sta key_repeat_counter + lda DELAY + sta KOUNT pla BuckyHeld: jmp ConsiderNextKey SameKeyHeld: pha - lda key_repeat_counter + lda KOUNT bmi KeyCanRepeat bne KeyRepeatWait // Count down ended, so repeat key now @@ -526,7 +526,7 @@ KeyCanRepeat: // (Compute's Mapping the 64 p58) pha lda #6-2 // Fudge factor to match speed - sta key_repeat_counter + sta KOUNT pla pla From 2abda0944b2b6800b46347f06d7bf2ac83701219 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 27 Sep 2019 20:06:23 +0200 Subject: [PATCH 19/40] vectors at #300 are now initialized --- c64/aliases/,aliases_ram_lowmem.s | 12 ++--- c64/basic/basic_cold_start.s | 10 +++- c64/basic/basic_vector_defaults.s | 16 ++++++ c64/basic/cmd_unimplemented.s | 84 +++++++++++++++++++++++++++++-- 4 files changed, 110 insertions(+), 12 deletions(-) create mode 100644 c64/basic/basic_vector_defaults.s diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 0c63eaa0..4dfdefcd 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -193,12 +193,12 @@ // [!] XXX document $2A7-$2FF usage // BASIC vectors - .label IERROR = $300 // $300-$301 -- NOT IMPLEMENTED -- - .label IMAIN = $302 // $302-$303 -- NOT IMPLEMENTED -- - .label ICRNCH = $304 // $304-$305 -- NOT IMPLEMENTED -- - .label IQPLOP = $306 // $306-$307 -- NOT IMPLEMENTED -- - .label IGONE = $308 // $308-$309 -- NOT IMPLEMENTED -- - .label IEVAL = $30A // $30A-$30B -- NOT IMPLEMENTED -- + .label IERROR = $300 // $300-$301 + .label IMAIN = $302 // $302-$303 + .label ICRNCH = $304 // $304-$305 + .label IQPLOP = $306 // $306-$307 + .label IGONE = $308 // $308-$309 + .label IEVAL = $30A // $30A-$30B .label SAREG = $30C // .A storage, for SYS call .label SXREG = $30D // .X storage, for SYS call diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 2107d6ca..38d9cefb 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -1,7 +1,15 @@ // BASIC Cold start entry point // Compute's Mapping the 64 p211 -basic_cold_start: +basic_cold_start: + + // Setup vectors at $300 + ldy #$0B +!: + lda basic_vector_defaults, y + sta IERROR, y + dey + bpl !- // Print startup banner jsr printf // XXX don't use printf, keep it for debug purposes only diff --git a/c64/basic/basic_vector_defaults.s b/c64/basic/basic_vector_defaults.s new file mode 100644 index 00000000..5f2f5943 --- /dev/null +++ b/c64/basic/basic_vector_defaults.s @@ -0,0 +1,16 @@ + +// +// Default values for BASIC vectors - described in: +// +// - [RG64] C64 Programmer's Reference Guide - pages 68-70 +// - [CM64] Compute's Mapping the Commodore 64 - page 318 +// + +basic_vector_defaults: + + .word ERROR // IERROR + .word MAIN // IMAIN + .word CHRNCH // ICHRNCH + .word QPLOP // IQPLOP + .word GONE // IGONE + .word EVAL // IEVAL diff --git a/c64/basic/cmd_unimplemented.s b/c64/basic/cmd_unimplemented.s index 67ec4811..ffdffd96 100644 --- a/c64/basic/cmd_unimplemented.s +++ b/c64/basic/cmd_unimplemented.s @@ -1,82 +1,156 @@ +// // 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 From c6350cc86b695807d8ebce46dff96be596588760 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 27 Sep 2019 20:50:27 +0200 Subject: [PATCH 20/40] added more stubs --- STATUS.md | 15 +++++++++------ bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/basic_mega65.rom | Bin 8192 -> 8192 bytes bin/basic_ultimate64.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/aliases/,aliases_ram_lowmem.s | 6 +++--- c64/basic/basic_adray1.s | 5 +++++ c64/basic/basic_adray2.s | 5 +++++ c64/basic/basic_cold_start.s | 18 +++++++++++++++++- c64/basic/basic_vector_defaults.s | 19 ++++++++++++------- c64/kernal/cint_real.s | 7 +++++++ c64/kernal/setup_keydecode.s | 5 +++++ 14 files changed, 63 insertions(+), 17 deletions(-) create mode 100644 c64/basic/basic_adray1.s create mode 100644 c64/basic/basic_adray2.s create mode 100644 c64/kernal/setup_keydecode.s diff --git a/STATUS.md b/STATUS.md index 10c353e2..8c9e16db 100644 --- a/STATUS.md +++ b/STATUS.md @@ -54,12 +54,14 @@ Note: vectors at `$0300` are not supported yet - for now only the locations belo | Entry | Unofficial | Name | Status | Remarks | | :-------: | :--------: | :--------- | :------: | :------------------------------------------------: | -| | `$E38B` | `ERROR` | NOT DONE | | -| | `$A483` | `MAIN` | NOT DONE | some implementation exists, but not connected here | -| | `$A57C` | `CHRNCH` | NOT DONE | | -| | `$A71A` | `QPLOP` | NOT DONE | some implementation exists, but not connected here | -| | `$A7E4` | `GONE` | NOT DONE | some implementation exists, but not connected here | -| | `$AE86` | `EVAL` | NOT DONE | some implementation exists, but not connected here | +| `($0003)` | | `ADRAY1` | NOT DONE | | +| `($0005)` | | `ADRAY2` | NOT DONE | | +| `(00300)` | `$E38B` | `ERROR` | NOT DONE | | +| `(00302)` | `$A483` | `MAIN` | NOT DONE | some implementation exists, but not connected here | +| `(00304)` | `$A57C` | `CHRNCH` | NOT DONE | | +| `(00306)` | `$A71A` | `QPLOP` | NOT DONE | some implementation exists, but not connected here | +| `(00308)` | `$A7E4` | `GONE` | NOT DONE | some implementation exists, but not connected here | +| `(0030A)` | `$AE86` | `EVAL` | NOT DONE | some implementation exists, but not connected here | | `($A000)` | | cold start | PARTIAL | | | `($A002)` | | warm start | PARTIAL | | @@ -95,6 +97,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | Address | Unofficial | Name | Status | Remarks | | :-------: | :--------: | :---------- | :------: | :------------------------------------------------: | +| `($028F)` | | `KEYLOG` | NOT DONE | | | `$FF81` | `$FF5B` | `CINT` | DONE | | | `$FF84` | `$FDA3` | `IOINIT` | PARTIAL | CIA initialization incomplete | | `$FF87` | `$FD50` | `RAMTAS` | DONE | | diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 826cc63b74271c7c7984edff63250f4ca1365257..e201428e98e771623dabee586c95e55aad6dee30 100644 GIT binary patch delta 1851 zcmcgseQXp(6rbI_ul7ps)S~6XGGG%B+FDWQQMm?8h!?Uz14KgtWYNUbU}Ayvn!9^@ zq>V_;-kX}OI}~Y?2#Q>8@k)GS%RLg$wA?FEdV|ts^^2C$<;#|=sGuZV)(K)(3{Rm8 zFVZyVHNKI`xb7RNqBR|y(sNdL8t%wLNqrXc>lLg{6T1ASBu|;%tG8B5a&MHD=rlDf z-;QWfmp{<{n*Y!2^ab9X)*jB6Hcx~Tr{pz1dJ z%&GlcBVCO~b?A&yn=tfs*&^LzSf)g$#^kFyj%vSss%=Az_NzbHpBLw+)s>Dp!NbwS zIYqhppC5Tm29e9td+E5Syoqyx&EhUr!K%2#DmAjdb=E-ZEFW#N(oI>3AFSX9nU6ir z%Pm&J9@8t?BkWPVidD1Oib79vqas^i(Clw?i2IaMb#K|?!lmg3=GF*3992ilW{k(U z&zC9+LiU@^0UX3q#iu5n53a$KkHeH>D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lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 4dfdefcd..7979fff0 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -12,8 +12,8 @@ // // $02 -- UNUSED -- free for user software - .label ADRAY1 = $03 // $03-$04 -- NOT IMPLEMENTED -- - .label ADRAY2 = $05 // $05-$06 -- NOT IMPLEMENTED -- + .label ADRAY1 = $03 // $03-$04 + .label ADRAY2 = $05 // $05-$06 .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 -- @@ -170,7 +170,7 @@ .label DELAY = $28C // -- NOT IMPLEMENTED -- .label SHFLAG = $28D // bucky keys (SHIFT/CTRL/C=) flags .label LSTSHF = $28E // last bucky key flags - .label KEYLOG = $28F // $28F-$290 -- NOT IMPLEMENTED -- keyboard decoding pointer + .label KEYLOG = $28F // $28F-$290 routine to setup keyboard decoding .label MODE = $291 // flag, is case switch allowed .label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 diff --git a/c64/basic/basic_adray1.s b/c64/basic/basic_adray1.s new file mode 100644 index 00000000..879a6bce --- /dev/null +++ b/c64/basic/basic_adray1.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +basic_adray1: + STUB_IMPLEMENTATION() diff --git a/c64/basic/basic_adray2.s b/c64/basic/basic_adray2.s new file mode 100644 index 00000000..dbdd00c1 --- /dev/null +++ b/c64/basic/basic_adray2.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +basic_adray2: + STUB_IMPLEMENTATION() diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 38d9cefb..01928aef 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -6,11 +6,27 @@ basic_cold_start: // Setup vectors at $300 ldy #$0B !: - lda basic_vector_defaults, y + lda basic_vector_defaults_1, y sta IERROR, y dey bpl !- + // Setup misc vectors + ldy #$04 +!: + lda basic_vector_defaults_2, y + sta ADRAY1, y + dey + bpl !- + + // Setup USRPOK + lda #$4C // JMP opcode + sta USRPOK + lda #do_ILLEGAL_QUANTITY_error + sta USRADD+1 + // Print startup banner jsr printf // XXX don't use printf, keep it for debug purposes only TARGET_HOOK_BANNER() diff --git a/c64/basic/basic_vector_defaults.s b/c64/basic/basic_vector_defaults.s index 5f2f5943..a12d2275 100644 --- a/c64/basic/basic_vector_defaults.s +++ b/c64/basic/basic_vector_defaults.s @@ -6,11 +6,16 @@ // - [CM64] Compute's Mapping the Commodore 64 - page 318 // -basic_vector_defaults: +basic_vector_defaults_1: - .word ERROR // IERROR - .word MAIN // IMAIN - .word CHRNCH // ICHRNCH - .word QPLOP // IQPLOP - .word GONE // IGONE - .word EVAL // IEVAL + .word ERROR // IERROR + .word MAIN // IMAIN + .word CHRNCH // ICHRNCH + .word QPLOP // IQPLOP + .word GONE // IGONE + .word EVAL // IEVAL + +basic_vector_defaults_2: + + .word basic_adray1 // ADRAY1 + .word basic_adray2 // ADRAY2 diff --git a/c64/kernal/cint_real.s b/c64/kernal/cint_real.s index 23452e08..a312cf6c 100644 --- a/c64/kernal/cint_real.s +++ b/c64/kernal/cint_real.s @@ -56,6 +56,13 @@ cint_pal: !: sta TVSFLG + // Setup KEYLOG vector - XXX is it proper place? + + lda #setup_keydecode + sta KEYLOG+1 + cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start? jsr setup_vicii diff --git a/c64/kernal/setup_keydecode.s b/c64/kernal/setup_keydecode.s new file mode 100644 index 00000000..d6010685 --- /dev/null +++ b/c64/kernal/setup_keydecode.s @@ -0,0 +1,5 @@ + +// XXX provide documentation and implementation + +setup_keydecode: + STUB_IMPLEMENTATION() From 0597988a59d7fdb5d0a85591f34ffdcaec27e3ff Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 27 Sep 2019 23:29:33 +0200 Subject: [PATCH 21/40] more label conflicts fixed --- c64/aliases/,aliases_ram_lowmem.s | 6 +- c64/basic/,aliases.s | 35 -- c64/basic/cmd_load.s | 14 +- c64/basic/select_device.s | 2 +- c64/basic/wedge_dos.s | 4 +- c64/kernal/,aliases.s | 40 +- c64/kernal/blink_cursor.s | 67 ++-- c64/kernal/chrin_real.s | 34 +- c64/kernal/chrout_real.s | 375 +++++++++--------- c64/kernal/cint_real.s | 2 +- c64/kernal/e544.clear_screen.s | 18 +- c64/kernal/f13e.getin.s | 2 +- c64/kernal/f34a.open.s | 12 +- c64/kernal/f4a5.load.s | 12 +- c64/kernal/home_cursor.s | 4 +- c64/kernal/lvs_helpers.s | 8 +- c64/kernal/plot.s | 8 +- c64/kernal/readst.s | 2 +- c64/kernal/scnkey.s | 22 +- .../set_pointer_to_current_screen_line.s | 18 +- c64/kernal/setfls.s | 10 +- 21 files changed, 311 insertions(+), 384 deletions(-) diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 7979fff0..fa96322b 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -99,7 +99,7 @@ .label RIDDATA = $AA // -- NOT IMPLEMENTED -- .label RIPRTY = $AB // -- NOT IMPLEMENTED -- .label SAL = $AC // $AC-$AD -- NOT IMPLEMENTED -- (implemented screen part) - .label EAL = $AE // $AE-$AF -- NOT IMPLEMENTED -- [!] used also byy screen editor + .label EAL = $AE // $AE-$AF -- NOT IMPLEMENTED -- [!] used also by screen editor, for temporary color storage when scrolling .label CMP0 = $B0 // $B0-$B1 temporary tape storage, [!] here used for BRK instruction address .label TAPE1 = $B2 // $B2-$B3 tape buffer pointer .label BITTS = $B4 // -- NOT IMPLEMENTED -- @@ -124,7 +124,7 @@ .label SFDX = $CB // -- NOT IMPLEMENTED -- .label BLNSW = $CC // cursor blink disable flag .label BLNCT = $CD // cursor blink countdown - .label GDBLN = $CE // cursorb saved character + .label GDBLN = $CE // cursor saved character .label BLNON = $CF // cursor visibilityy flag .label CRSW = $D0 // whether to input from screen or keyboard .label PNT = $D1 // $D1-$D2 pointer to the current screen line @@ -134,7 +134,7 @@ .label TBLX = $D6 // current screen Y position .label SCHAR = $D7 // ASCII value of the last printed character .label INSRT = $D8 // insert mode flag/counter - .label LDTB1 = $D9 // $D9-$F2 screen line link table, [!] our usage is different XXX give more details + .label LDTBL = $D9 // $D9-$F2 screen line link table, [!] our usage is different XXX give more details .label USER = $F3 // $F3-$F4 pointer to current color RAM location .label KEYTAB = $F5 // $F5-$F6 -- NOT IMPLEMENTED -- .label RIBUF = $F7 // $F7-$F8 -- NOT IMPLEMENTED -- diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index ef91afa0..479d6bf1 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -53,41 +53,6 @@ .label memmove_src = $69 .label memmove_dst = $6b .label memmove_size = $6d - - .label current_file_num = $98 - .label cassette_buffer_bytes_used = $A6 - .label load_or_scroll_temp_pointer = $AC - // We also use the following for temp colour pointer when scrolling - .label load_save_verify_end_address = $AE - - .label current_logical_filenum = $B8 - .label current_secondary_address = $B9 - .label current_device_number = $BA - .label current_filename_ptr = $BB - .label load_save_start_ptr = $C1 - .label load_save_end_ptr = $C3 - .label last_key_matrix_position = $C5 - .label keys_in_key_buffer = $C6 - .label reverse_video_flag = $C7 - .label end_of_input_line = $C8 - .label start_of_keyboard_input = $C9 - .label current_key_index_entry = $CB - .label cursor_blink_disable = $CC - .label cursor_blink_countdown = $CD - .label cursor_saved_character = $CE - .label cursor_is_visible = $CF - .label keyboard_input_ready = $D0 - .label current_screen_line_ptr = $D1 - .label current_screen_x = $D3 - .label logical_line_length = $D5 - .label current_screen_y = $D6 - .label last_printed_character_ascii = $D7 - .label insert_mode = $D8 - // Bits 0 -3 = bits 8-11 of screen line address - // Bit 7 = line spans multiple physical lines - .label screen_line_link_table = $D9 - .label current_screen_line_colour_ptr = $F3 - .label keyboard_decoding_table_ptr = $F5 #if CONFIG_MEMORY_MODEL_60K diff --git a/c64/basic/cmd_load.s b/c64/basic/cmd_load.s index fdcd3e5a..eb5e1089 100644 --- a/c64/basic/cmd_load.s +++ b/c64/basic/cmd_load.s @@ -37,10 +37,10 @@ cmd_load: !: // Filename starts here so set pointer lda basic_current_statement_ptr+0 - sta current_filename_ptr+0 + sta FNADDR+0 lda basic_current_statement_ptr+1 - sta current_filename_ptr+1 - + sta FNADDR+1 + // Now search for end of line or closing quote // so that we know the length of the filename getting_filename: @@ -60,7 +60,7 @@ got_filename: // Now fetch the file number, start from the default one jsr select_device - stx current_device_number + stx FA jsr injest_comma bcs got_devicenumber @@ -70,20 +70,20 @@ got_filename: jmp do_ILLEGAL_QUANTITY_error !: lda basic_line_number+0 - sta current_device_number + sta FA got_devicenumber: // Now fetch the secondary address lda #$00 - sta current_secondary_address + sta SA jsr injest_comma bcs got_secondaryaddress jsr basic_parse_line_number lda basic_line_number+1 bne !+ lda basic_line_number+0 - sta current_secondary_address + sta SA jmp got_secondaryaddress !: // Second parameter is above 255, this can't be a secondary address diff --git a/c64/basic/select_device.s b/c64/basic/select_device.s index 30f15150..6d9a2e76 100644 --- a/c64/basic/select_device.s +++ b/c64/basic/select_device.s @@ -11,7 +11,7 @@ select_device: // Note: if tape support is introduced here, make sure DOS wedge won't get broken - ldx current_device_number + ldx FA cpx #$08 bcs !+ ldx #$08 diff --git a/c64/basic/wedge_dos.s b/c64/basic/wedge_dos.s index 28785111..40650383 100644 --- a/c64/basic/wedge_dos.s +++ b/c64/basic/wedge_dos.s @@ -74,7 +74,7 @@ wedge_dos_change_drive: bcs !+ jmp do_ILLEGAL_DEVICE_NUMBER_error !: - sta current_device_number + sta FA jmp basic_end_of_line wedge_dos_status_get: @@ -139,7 +139,7 @@ wedge_dos_directory: // First change the secondary address to the one suitable for // directory loading lda #$00 // logical device number - ldx current_device_number + ldx FA ldy #$60 jsr JSETFLS diff --git a/c64/kernal/,aliases.s b/c64/kernal/,aliases.s index 286d92da..528f852f 100644 --- a/c64/kernal/,aliases.s +++ b/c64/kernal/,aliases.s @@ -1,43 +1,5 @@ -// Names of ZP and low memory locations -// (Only those of relevance for the KERNAL) -// (And only those for now that we feel the need to implement initially) -// (https://www.c64-wiki.com/wiki/Zeropage) -// XXX get rid of this file, use ,aliases_ram_lowmem.s instead - - .label current_file_num = $98 - .label input_device_number = DFLTN - .label cassette_buffer_bytes_used = $A6 - .label load_or_scroll_temp_pointer = $AC - // We also use the following for temp colour pointer when scrolling - .label load_save_verify_end_address = $AE - .label current_logical_filenum = $B8 - .label current_secondary_address = $B9 - .label current_device_number = $BA - .label current_filename_ptr = $BB - .label load_save_end_ptr = $C3 - .label last_key_matrix_position = $C5 - .label keys_in_key_buffer = $C6 - .label reverse_video_flag = $C7 - .label end_of_input_line = $C8 - .label start_of_keyboard_input = $C9 - .label current_key_index_entry = $CB - .label cursor_blink_disable = $CC - .label cursor_blink_countdown = $CD - .label cursor_saved_character = $CE - .label cursor_is_visible = $CF - .label keyboard_input_ready = $D0 - .label current_screen_line_ptr = $D1 - .label current_screen_x = $D3 - .label logical_line_length = $D5 - .label current_screen_y = $D6 - .label last_printed_character_ascii = $D7 - .label insert_mode = $D8 - // Bits 0 -3 = bits 8-11 of screen line address - // Bit 7 = line spans multiple physical lines - .label screen_line_link_table = $D9 - .label current_screen_line_colour_ptr = $F3 - .label keyboard_decoding_table_ptr = $F5 +// XXX get rid of this file #if CONFIG_MEMORY_MODEL_60K diff --git a/c64/kernal/blink_cursor.s b/c64/kernal/blink_cursor.s index 1f64e898..5d3c5446 100644 --- a/c64/kernal/blink_cursor.s +++ b/c64/kernal/blink_cursor.s @@ -1,93 +1,96 @@ // We have the following variables: -// cursor_blink_disable -// cursor_blink_countdown -// cursor_saved_character -// cursor_is_visible +// BLNSW (cursor blink switch) +// BLNCT (cursor blink countdown) +// GDBLN (cursor saved character) +// BLNON (if cursor is visible) // GDCOL (colour under cursor) +// USER (current screen line colour pointer) +// PNT (current screen line pointer) +// PNTR (current screen x position) show_cursor_if_enabled: - lda cursor_blink_disable + lda BLNSW beq !+ rts -!: lda cursor_is_visible +!: lda BLNON beq show_cursor rts - + show_cursor: // Set cursor as though it had just finished the off phase, // so that the call to blink_cursor paints it lda #$00 - sta cursor_blink_countdown - sta cursor_is_visible + sta BLNCT + sta BLNON jsr blink_cursor // Then set the timeout to 1 frame, so that the cursor // blinks under key repeat conditions, like on the original KERNAL lda #$01 - sta cursor_blink_countdown + sta BLNCT rts - + blink_cursor: // Is the cursor enabled? - lda cursor_blink_disable + lda BLNSW bne no_blink_cursor // Do we need to redraw things? - dec cursor_blink_countdown + dec BLNCT bpl no_blink_cursor // Check if cursor was visible or not, and toggle - lda cursor_is_visible + lda BLNON bne undraw_cursor draw_cursor: jsr calculate_screen_line_pointer - ldy current_screen_x - lda (current_screen_line_ptr),y - sta cursor_saved_character + ldy PNTR + lda (PNT),y + sta GDBLN eor #$80 - sta (current_screen_line_ptr),y + sta (PNT),y // Also set cursor colour - lda (current_screen_line_colour_ptr),y + lda (USER),y sta GDCOL lda COLOR - sta (current_screen_line_colour_ptr),y - + sta (USER),y + lda #1 - sta cursor_is_visible - + sta BLNON + jmp reset_blink_timer undraw_cursor: jsr calculate_screen_line_pointer - lda cursor_saved_character - ldy current_screen_x - sta (current_screen_line_ptr),y + lda GDBLN + ldy PNTR + sta (PNT),y lda GDCOL - sta (current_screen_line_colour_ptr),y + sta (USER),y lda #0 - sta cursor_is_visible + sta BLNON // Fall through reset_blink_timer: // Rest blink counter // (Compute's Mapping the 64, p39-40) lda #20 - sta cursor_blink_countdown + sta BLNCT no_blink_cursor: rts disable_cursor: lda #$80 - sta cursor_blink_disable + sta BLNSW // FALL THROUGH hide_cursor_if_visible: - lda cursor_is_visible + lda BLNON bne undraw_cursor rts enable_cursor: lda #$00 - sta cursor_blink_disable + sta BLNSW rts diff --git a/c64/kernal/chrin_real.s b/c64/kernal/chrin_real.s index 741534e5..cbed585e 100644 --- a/c64/kernal/chrin_real.s +++ b/c64/kernal/chrin_real.s @@ -52,18 +52,18 @@ chrin_repeat: // If so, return the next byte, and clear the flag when we reach the end. // Do we have a line of input waiting? - lda keyboard_input_ready + lda CRSW beq read_from_keyboard - // Yes, we have input waiting at (start_of_keyboard_input)+keyboard_input_ready - // When keyboard_input_ready = end_of_input_line, then we return a carriage return + // Yes, we have input waiting at (LXSP)+CRSW + // When CRSW = INDX, then we return a carriage return // and clear the flag - cmp end_of_input_line + cmp INDX bne not_end_of_input // Return carriage return and clear pending input flag lda #$00 - sta keyboard_input_ready + sta CRSW pla tax clc @@ -75,9 +75,9 @@ not_end_of_input: tay pla tax - lda (start_of_keyboard_input),y + lda (LXSP),y jsr screen_code_to_petscii - inc keyboard_input_ready + inc CRSW clc rts @@ -87,7 +87,7 @@ read_from_keyboard: jsr enable_cursor // Wait for a key - lda keys_in_key_buffer + lda NDX beq chrin_repeat lda KEYD @@ -106,10 +106,10 @@ read_from_keyboard: // (Compute's Mapping the 64, p96) // Set pointer to line of input - lda current_screen_line_ptr+0 - sta start_of_keyboard_input+0 - lda current_screen_line_ptr+1 - sta start_of_keyboard_input+1 + lda PNT+0 + sta LXSP+0 + lda PNT+1 + sta LXSP+1 // Calculate length jsr get_current_line_logical_length @@ -117,18 +117,18 @@ read_from_keyboard: iny !: dey bmi empty_line - lda (current_screen_line_ptr),y + lda (PNT),y cmp #$20 beq !- iny - sty end_of_input_line + sty INDX lda #$01 - sta keyboard_input_ready + sta CRSW // Return first char of line ldy #$00 pla tax - lda (start_of_keyboard_input),y + lda (LXSP),y jsr screen_code_to_petscii clc rts @@ -166,7 +166,7 @@ pop_keyboard_buffer: iny cpy XMAX bne !- - dec keys_in_key_buffer + dec NDX cli rts diff --git a/c64/kernal/chrout_real.s b/c64/kernal/chrout_real.s index 03d2b849..e1ce3c2c 100644 --- a/c64/kernal/chrout_real.s +++ b/c64/kernal/chrout_real.s @@ -11,7 +11,7 @@ chrout_real: - sta last_printed_character_ascii + sta SCHAR // Save X and Y values // (Confirmed by writing a test program that X and Y @@ -34,7 +34,7 @@ chrout_real: chrout_iec: - lda last_printed_character_ascii + lda SCHAR jsr JCIOUT bcc chrout_done @@ -77,7 +77,7 @@ chrout_done: tay pla tax - lda last_printed_character_ascii + lda SCHAR clc // indicate success rts @@ -88,7 +88,7 @@ chrout_screen: jsr hide_cursor_if_visible - lda last_printed_character_ascii + lda SCHAR tax // Check for special characters @@ -111,7 +111,7 @@ not_0a: // RETURN clears quote and insert modes lda #$00 sta QTSW - sta insert_mode + sta INSRT jmp screen_advance_to_next_line not_0d: @@ -125,7 +125,7 @@ not_0d: cmp #79 bne definitely_not_too_long tay - lda (current_screen_line_ptr),y + lda (PNT),y cmp #$20 beq definitely_not_too_long @@ -135,7 +135,7 @@ not_0d: definitely_not_too_long: // Work out if line needs to be expanded, and if so expand it ldy #39 - lda (current_screen_line_ptr),y + lda (PNT),y cmp #$20 beq no_need_to_extend @@ -155,89 +155,89 @@ no_need_to_extend: // though we really don't believe that the routine can be copyrighted // due to the lack of creativity. dey - lda (current_screen_line_colour_ptr),y + lda (USER),y iny - sta (current_screen_line_colour_ptr),y + sta (USER),y dey - lda (current_screen_line_ptr),y + lda (PNT),y iny - sta (current_screen_line_ptr),y + sta (PNT),y dey - cpy current_screen_x + cpy PNTR bne !- // Increase insert mode count (which causes quote-mode like behaviour) - inc insert_mode - + inc INSRT + // Put space in the inserted gap lda #$20 - sta (current_screen_line_ptr),y + sta (PNT),y jmp chrout_done not_94: // DELETE in insert mode embeds control character - ldx insert_mode + ldx INSRT bne not_14 cmp #$14 bne not_14 // Delete - ldx current_screen_x + ldx PNTR bne delete_non_zero_column delete_at_column_0: - ldy current_screen_y + ldy TBLX bne not_row_0 // delete from row 0, col 0 does nothing jmp chrout_done not_row_0: // Column 0 delete just moves us to the end of the // previous line, without actually deleting anything - dec current_screen_y + dec TBLX jsr get_current_line_logical_length - lda logical_line_length - - sta current_screen_x + lda LNMX + + sta PNTR jsr calculate_screen_line_pointer jmp chrout_done delete_non_zero_column: // Copy rest of line down jsr get_current_line_logical_length - ldy current_screen_x - cpy logical_line_length + ldy PNTR + cpy LNMX beq done_delete dey !: iny - lda (current_screen_line_ptr),y + lda (PNT),y dey - sta (current_screen_line_ptr),y + sta (PNT),y iny - lda (current_screen_line_colour_ptr),y + lda (USER),y dey - sta (current_screen_line_colour_ptr),y + sta (USER),y iny - cpy logical_line_length + cpy LNMX bne !- // Clear char at end of line jsr get_current_line_logical_length tay lda #$20 - sta (current_screen_line_ptr),y + sta (PNT),y done_delete: - dec current_screen_x - jmp chrout_done + dec PNTR + jmp chrout_done not_14: // Check for quote mode ldx QTSW bne is_quote_mode - ldx insert_mode + ldx INSRT bne is_quote_mode jmp not_quote_mode @@ -283,24 +283,24 @@ colour_check_loop: cmp #$12 bne not_12 lda #$80 - sta reverse_video_flag + sta RVS jmp chrout_done not_12: // Compute's Mapping the 64 p 38 cmp #$92 bne not_92 lda #$00 - sta reverse_video_flag + sta RVS jmp chrout_done not_92: // Check for cursor movement keys cmp #$11 bne not_11 - lda current_screen_x + lda PNTR clc adc #40 - sta current_screen_x + sta PNTR // We need to advance the pointer manually, as normalising // now will break things. The pointer update is required // so that we can tell if we really are on the bottom phys @@ -311,22 +311,22 @@ not_92: not_11: cmp #$1d bne not_1d - inc current_screen_x + inc PNTR jsr calculate_screen_line_pointer jmp chrout_done not_1d: cmp #$91 bne not_91 - lda current_screen_x + lda PNTR sec sbc #40 - sta current_screen_x + sta PNTR jsr calculate_screen_line_pointer jmp chrout_done not_91: cmp #$9d bne not_9d - dec current_screen_x + dec PNTR jsr calculate_screen_line_pointer jmp chrout_done not_9d: @@ -335,8 +335,8 @@ not_9d: cmp #$13 bne not_13 lda #0 - sta current_screen_x - sta current_screen_y + sta PNTR + sta TBLX jsr calculate_screen_line_pointer jmp chrout_done not_13: @@ -401,14 +401,14 @@ output_literal_char: pha - ldy current_screen_x - ora reverse_video_flag // Compute's Mapping the 64 p38 - sta (current_screen_line_ptr),y + ldy PNTR + ora RVS // Compute's Mapping the 64 p38 + sta (PNT),y // Decrement number of chars waiting to be inserted - lda insert_mode + lda INSRT beq !+ - dec insert_mode + dec INSRT !: pla cmp #$22 @@ -423,36 +423,36 @@ not_quote: // Set colour lda COLOR - sta (current_screen_line_colour_ptr),y + sta (USER),y // Advance the column, and scroll screen down if we need // to insert a 2nd line in this logical line. // (eg Compute's Mapping the 64 p41) - ldx current_screen_y + ldx TBLX iny - sty current_screen_x + sty PNTR cpy #40 bne !+ jsr screen_grow_logical_line - ldy current_screen_x + ldy PNTR !: cpy #80 bcc no_screen_advance_to_next_line lda #0 - sta current_screen_x + sta PNTR jmp screen_advance_to_next_line no_screen_advance_to_next_line: jmp chrout_done screen_grow_logical_line: - ldy current_screen_y + ldy TBLX // Don't grow line if it is already grown - lda screen_line_link_table,y + lda LDTBL,y bpl !+ jmp done_grow_line !: lda #$80 - sta screen_line_link_table,y + sta LDTBL,y // Now make space for the extra line added. // If we are on the last physical line of the screen, @@ -471,11 +471,11 @@ screen_grow_logical_line: ldy #0 count_rows_loop: dex - lda screen_line_link_table,y + lda LDTBL,y bpl !+ dex !: iny - cpy current_screen_y + cpy TBLX bne count_rows_loop cpx #0 @@ -493,28 +493,28 @@ count_rows_loop: lda HIBASE clc adc #3 - sta current_screen_line_ptr+1 - sta load_or_scroll_temp_pointer+1 + sta PNT+1 + sta SAL+1 lda #>$DBC0 - sta load_save_verify_end_address+1 - sta current_screen_line_colour_ptr+1 + sta EAL+1 + sta USER+1 lda #<$03C0 - sta current_screen_line_ptr+0 - sta current_screen_line_colour_ptr+0 + sta PNT+0 + sta USER+0 // souce address is line above sec sbc #40 - sta load_or_scroll_temp_pointer+0 - sta load_save_verify_end_address+0 + sta SAL+0 + sta EAL+0 copy_line_down_loop: ldy #39 cl_inner: - lda (load_save_verify_end_address),y - sta (current_screen_line_colour_ptr),y - lda (load_or_scroll_temp_pointer),y - sta (current_screen_line_ptr),y + lda (EAL),y + sta (USER),y + lda (SAL),y + sta (PNT),y dey bpl cl_inner @@ -523,29 +523,29 @@ cl_inner: // Old source is new destination // Use different registers to minimise byte similarity with C64 KERNAl - ldy load_or_scroll_temp_pointer+1 - sty current_screen_line_ptr+1 - lda load_save_verify_end_address+1 - ldy load_or_scroll_temp_pointer+0 - sta current_screen_line_colour_ptr+1 - sty current_screen_line_ptr+0 - sty current_screen_line_colour_ptr+0 + ldy SAL+1 + sty PNT+1 + lda EAL+1 + ldy SAL+0 + sta USER+1 + sty PNT+0 + sty USER+0 // Decrementing source pointers - lda load_or_scroll_temp_pointer+0 + lda SAL+0 sec sbc #<40 - sta load_or_scroll_temp_pointer+0 - sta load_save_verify_end_address+0 - lda load_or_scroll_temp_pointer+1 + sta SAL+0 + sta EAL+0 + lda SAL+1 sbc #>40 - sta load_or_scroll_temp_pointer+1 + sta SAL+1 // convert to screen equivalent sec sbc HIBASE clc adc #>$D800 - sta load_save_verify_end_address+1 + sta EAL+1 dex bne copy_line_down_loop @@ -557,9 +557,9 @@ no_copy_down: ldy #79 !: lda COLOR - sta (current_screen_line_colour_ptr),y + sta (USER),y lda #$20 - sta (current_screen_line_ptr),y + sta (PNT),y dey cpy #40 bne !- @@ -575,163 +575,163 @@ scroll_up_if_on_last_line: // Colour RAM is always in fixed place, so is easiest // to use to check if we are on the last line. // The last line is at $D800 + 24*40 = $DBC0 - lda current_screen_line_colour_ptr+1 + lda USER+1 cmp #>$DBC0 bne not_last_line - lda current_screen_line_colour_ptr+0 + lda USER+0 cmp #<$DBC0 beq is_last_line - + jsr get_current_line_logical_length clc - adc current_screen_line_colour_ptr+0 + adc USER+0 cmp #<$DBE7-1 - bcc not_last_line + bcc not_last_line -is_last_line: - - dec current_screen_y +is_last_line: + + dec TBLX // FALL THROUGH -scroll_screen_up: +scroll_screen_up: // Now scroll the whole screen up either one or two lines // based on whether the first screen line is linked or not. - + // Get pointers to start of screen + colour RAM lda HIBASE - sta current_screen_line_ptr+1 - sta load_or_scroll_temp_pointer+1 + sta PNT+1 + sta SAL+1 lda #>$D800 - sta current_screen_line_colour_ptr+1 - sta load_save_verify_end_address+1 + sta USER+1 + sta EAL+1 lda #$00 - sta current_screen_line_ptr+0 - sta current_screen_line_colour_ptr+0 + sta PNT+0 + sta USER+0 // Get pointers to screen/colour RAM source - lda screen_line_link_table+0 + lda LDTBL+0 bmi !+ lda #40 .byte $2C // BIT $nnnn to skip next instruction !: lda #80 - sta load_or_scroll_temp_pointer+0 - sta load_save_verify_end_address+0 + sta SAL+0 + sta EAL+0 // Copy first three pages ldy #$00 ldx #3 scroll_copy_loop: - lda (load_save_verify_end_address),y - sta (current_screen_line_colour_ptr),y - lda (load_or_scroll_temp_pointer),y - sta (current_screen_line_ptr),y + lda (EAL),y + sta (USER),y + lda (SAL),y + sta (PNT),y iny bne scroll_copy_loop - inc load_or_scroll_temp_pointer+1 - inc current_screen_line_ptr+1 - inc load_save_verify_end_address+1 - inc current_screen_line_colour_ptr+1 + inc SAL+1 + inc PNT+1 + inc EAL+1 + inc USER+1 dex bne scroll_copy_loop // Copy last partial page // We need to copy 1000-(3*256)-line length // = 232 - line length - lda load_or_scroll_temp_pointer+0 + lda SAL+0 lda #232 sec - sbc load_or_scroll_temp_pointer+0 + sbc SAL+0 tax -scroll_copy_loop2: - lda (load_save_verify_end_address),y - sta (current_screen_line_colour_ptr),y - lda (load_or_scroll_temp_pointer),y - sta (current_screen_line_ptr),y +scroll_copy_loop2: + lda (EAL),y + sta (USER),y + lda (SAL),y + sta (PNT),y iny dex bne scroll_copy_loop2 // Fill in scrolled up area - ldx load_or_scroll_temp_pointer+0 + ldx SAL+0 scroll_copy_loop3: lda COLOR - sta (current_screen_line_colour_ptr),y + sta (USER),y lda #$20 - sta (current_screen_line_ptr),y + sta (PNT),y iny dex bne scroll_copy_loop3 - + // Shift line linkage list ldy #0 ldx #24 link_copy: - lda screen_line_link_table+1,y - sta screen_line_link_table+0,y + lda LDTBL+1,y + sta LDTBL+0,y iny dex bne link_copy // Clear line link flag of last line - stx screen_line_link_table+24 + stx LDTBL+24 // Restore correct line pointers jsr calculate_screen_line_pointer rts - + get_current_line_logical_length: - ldy current_screen_y - lda screen_line_link_table,y + ldy TBLX + lda LDTBL,y bpl line_not_linked_del lda #79 .byte $2c // BIT absolute mode, which we use to skip the next two instruction bytes line_not_linked_del: lda #39 - sta logical_line_length + sta LNMX rts - + screen_advance_to_next_line: // jsr hide_cursor_if_visible // Go to start of line lda #0 - sta current_screen_x + sta PNTR // Advance line number - ldy current_screen_y + ldy TBLX // Do quick fix to line pointer to work out if it is off // the bottom of the screen. ldx #40 - lda screen_line_link_table,y + lda LDTBL,y bmi !+ .byte $2c !: ldx #80 txa clc - adc current_screen_line_ptr+0 - sta current_screen_line_ptr+0 - lda current_screen_line_ptr+1 + adc PNT+0 + sta PNT+0 + lda PNT+1 adc #0 - sta current_screen_line_ptr+1 - - inc current_screen_y - + sta PNT+1 + + inc TBLX + // Check if it will trigger scrolling // Work out if we have gone off the bottom of the screen? // 1040 > 1024, so if high byte of screen pointer is >= (HIBASE+4), // then we are off the bottom of the screen - lda current_screen_line_ptr+1 + lda PNT+1 sec sbc HIBASE cmp #3 bcc !+ - lda current_screen_line_ptr+0 + lda PNT+0 cmp #$e7 bcc !+ @@ -744,83 +744,82 @@ screen_advance_to_next_line: jmp chrout_done add_40_to_screen_x: - lda current_screen_x + lda PNTR clc adc #40 - sta current_screen_x + sta PNTR rts normalise_screen_x_y: // Normalise X and Y values // If X < 0, then make X = X + 40 (or 80, if previous line is linked) -!: lda current_screen_x +!: lda PNTR bpl x_not_negative - dec current_screen_y + dec TBLX // Check that we didn't go backwards off the top of the screen bpl !+ lda #0 - sta current_screen_y + sta TBLX !: jsr add_40_to_screen_x // Check if line is linked, if so, add 40 again - ldy current_screen_y - lda screen_line_link_table,y + ldy TBLX + lda LDTBL,y bpl !+ jsr add_40_to_screen_x !: x_not_negative: // Work out if X is too big - ldy current_screen_y - lda screen_line_link_table,y + ldy TBLX + lda LDTBL,y bpl !+ lda #79 .byte $2C // BIT $nnnn, used to skip next instruction !: lda #39 - cmp current_screen_x + cmp PNTR bcs x_not_too_big // X value is too big, so subtract 40 and increment Y - lda current_screen_x + lda PNTR sec sbc #40 - sta current_screen_x - inc current_screen_y + sta PNTR + inc TBLX x_not_too_big: // Make sure Y isn't negative - lda current_screen_y + lda TBLX bpl !+ lda #0 - sta current_screen_y + sta TBLX !: // Make sure Y isn't too large for absolute size of // screen cmp #24 bcc !+ lda #24 - sta current_screen_y + sta TBLX !: // Make sure Y isn't too much for the screen, taking // into account the line link table ldy #24 // max allowable line ldx #0 link_count_loop: - lda screen_line_link_table,x + lda LDTBL,x bpl !+ dey !: inx cpx #25 bne link_count_loop tya - cmp current_screen_y + cmp TBLX bcs y_ok - sta current_screen_y -y_ok: - + sta TBLX +y_ok: rts calculate_screen_line_pointer: @@ -828,12 +827,12 @@ calculate_screen_line_pointer: // Reset pointer to start of screen lda HIBASE - sta current_screen_line_ptr+1 + sta PNT+1 lda #0 - sta current_screen_line_ptr+0 + sta PNT+0 // Add 40 for every line, or 80 if the lines are linked - ldx current_screen_y + ldx TBLX !: // Stop if we have counted enough lines @@ -844,18 +843,18 @@ calculate_screen_line_pointer: ldy #40 // -1 offset is because we count down from N to 1, not // N-1 to 0. - lda screen_line_link_table-1,x + lda LDTBL-1,x bpl cslp_l1 ldy #80 cslp_l1: // Add computed line length to pointer value tya clc - adc current_screen_line_ptr+0 - sta current_screen_line_ptr+0 - lda current_screen_line_ptr+1 + adc PNT+0 + sta PNT+0 + lda PNT+1 adc #0 - sta current_screen_line_ptr+1 + sta PNT+1 // Loop back to next line dex @@ -864,38 +863,38 @@ cslp_l1: // FALL THROUGH -update_colour_line_pointer: +update_colour_line_pointer: // Now setup pointer to colour RAM - lda current_screen_line_ptr+0 - sta current_screen_line_colour_ptr+0 - lda current_screen_line_ptr+1 + lda PNT+0 + sta USER+0 + lda PNT+1 sec sbc HIBASE clc adc #>$d800 - sta current_screen_line_colour_ptr+1 - + sta USER+1 + rts - - + + advance_screen_pointer_40_bytes: - lda current_screen_line_ptr+0 + lda PNT+0 clc adc #<40 - sta current_screen_line_ptr+0 - sta current_screen_line_colour_ptr+0 - lda current_screen_line_ptr+1 + sta PNT+0 + sta USER+0 + lda PNT+1 adc #>40 - sta current_screen_line_ptr+1 + sta PNT+1 sec sbc HIBASE clc adc #>$D800 - sta current_screen_line_colour_ptr+1 + sta USER+1 jmp update_colour_line_pointer - -colour_codes: + +colour_codes: // consider moving them to separate location // CHR$ codes for the 16 colours .byte 144,5,28,159,156,30,31,158 .byte 129,149,150,151,152,153,154,155 diff --git a/c64/kernal/cint_real.s b/c64/kernal/cint_real.s index a312cf6c..1daf056c 100644 --- a/c64/kernal/cint_real.s +++ b/c64/kernal/cint_real.s @@ -69,7 +69,7 @@ cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start? // Initialise cursor blink flags (Compute's Mapping the 64 p215) lda #$00 - sta cursor_blink_disable + sta BLNSW // Set keyboard decode vector (Compute's Mapping the 64 p215) diff --git a/c64/kernal/e544.clear_screen.s b/c64/kernal/e544.clear_screen.s index e699f2ec..90d1999d 100644 --- a/c64/kernal/e544.clear_screen.s +++ b/c64/kernal/e544.clear_screen.s @@ -9,7 +9,7 @@ clear_screen: lda #$00 ldy #24 clearscreen_l1: - sta screen_line_link_table,y + sta LDTBL,y dey bpl clearscreen_l1 @@ -19,28 +19,28 @@ clearscreen_l1: // We should do this at HIBASE, which annoyingly // is no ZP, so we need to make a vector // (Compute's Mapping the 64 p216) - // Get pointer to the screen into current_screen_line_ptr + // Get pointer to the screen into PNT // as it is the first appropriate place for it found when // searching through the ZP allocations listed in // Compute's Mapping the 64 - sta current_screen_line_ptr+0 + sta PNT+0 lda HIBASE - sta current_screen_line_ptr+1 + sta PNT+1 ldx #$03 // countdown for pages to update iny // Y now = #$00 lda #$20 // space character clearscreen_l2: - sta (current_screen_line_ptr),y + sta (PNT),y iny bne clearscreen_l2 // To draw only 1000 bytes, add 250 to address each time - lda current_screen_line_ptr + lda PNT clc adc #<250 - sta current_screen_line_ptr - lda current_screen_line_ptr+1 + sta PNT + lda PNT+1 adc #>250 - sta current_screen_line_ptr+1 + sta PNT+1 lda #$20 // get space character again dex bpl clearscreen_l2 diff --git a/c64/kernal/f13e.getin.s b/c64/kernal/f13e.getin.s index c5f6b713..5eefc0ac 100644 --- a/c64/kernal/f13e.getin.s +++ b/c64/kernal/f13e.getin.s @@ -13,7 +13,7 @@ GETIN: // Wait for a key - lda keys_in_key_buffer + lda NDX bne !+ // Nothing in keyboard buffer to read diff --git a/c64/kernal/f34a.open.s b/c64/kernal/f34a.open.s index 65b03974..02ce3ac9 100644 --- a/c64/kernal/f34a.open.s +++ b/c64/kernal/f34a.open.s @@ -20,7 +20,7 @@ OPEN: beq !+ dey lda LAT, y - cmp current_logical_filenum + cmp LA bne open_not_yet_open jmp kernalerror_FILE_ALREADY_OPEN open_not_yet_open: @@ -43,11 +43,11 @@ open_has_space: // LAT / FAT / SAT support implemented according to // 'Compute's Mapping the Commodore 64', page 52 - lda current_logical_filenum + lda LA sta LAT, y - lda current_device_number + lda FA sta FAT, y - lda current_secondary_address + lda SA sta SAT, y iny @@ -58,7 +58,7 @@ open_has_space: beq open_done_success // Check for IEC device - lda current_device_number + lda FA jsr iec_check_devnum bcc open_iec @@ -75,7 +75,7 @@ open_iec: bcc !+ jmp kernalerror_DEVICE_NOT_FOUND !: - lda current_secondary_address + lda SA jsr iec_cmd_open bcc !+ jmp kernalerror_DEVICE_NOT_FOUND diff --git a/c64/kernal/f4a5.load.s b/c64/kernal/f4a5.load.s index 1cfc2d3b..87e43c10 100644 --- a/c64/kernal/f4a5.load.s +++ b/c64/kernal/f4a5.load.s @@ -40,7 +40,7 @@ LOAD: TARGET_HOOK_LOAD() // Check whether we support the requested device - lda current_device_number + lda FA and #$FC bne !+ jmp lvs_illegal_device_number // device number below 4, not an IEC device @@ -60,7 +60,7 @@ LOAD: // in the C64, only in the drive. // Call device to LISTEN (p16) - lda current_device_number + lda FA jsr LISTEN bcc !+ jmp lvs_device_not_found_error // XXX deduplicate with other jumps in this routine @@ -77,7 +77,7 @@ LOAD: jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine !: // Now command device to talk (p16) - lda current_device_number + lda FA jsr TALK bcc !+ jmp lvs_load_verify_error // XXX deduplicate with other jumps in this routine @@ -99,7 +99,7 @@ LOAD: bcc !+ jmp lvs_file_not_found_error // XXX deduplicate with other jumps in this routine !: - ldx current_secondary_address + ldx SA beq !+ sta STAL+0 !: @@ -107,7 +107,7 @@ LOAD: bcc !+ jmp lvs_file_not_found_error // XXX deduplicate with other jumps in this routine !: - ldx current_secondary_address + ldx SA beq !+ sta STAL+1 !: @@ -140,7 +140,7 @@ load_loop: // Close file on drive - lda current_device_number + lda FA jsr close_load // Return last address diff --git a/c64/kernal/home_cursor.s b/c64/kernal/home_cursor.s index 0e833d94..37965f96 100644 --- a/c64/kernal/home_cursor.s +++ b/c64/kernal/home_cursor.s @@ -4,7 +4,7 @@ home_cursor: lda #$00 - sta current_screen_x - sta current_screen_y + sta PNTR // x position + sta TBLX // y position jmp set_pointer_to_current_screen_line diff --git a/c64/kernal/lvs_helpers.s b/c64/kernal/lvs_helpers.s index c74295a2..b4984825 100644 --- a/c64/kernal/lvs_helpers.s +++ b/c64/kernal/lvs_helpers.s @@ -10,10 +10,10 @@ lvs_send_file_name_loop: beq lvs_send_file_name_done #if CONFIG_MEMORY_MODEL_60K - ldx #40 - sta current_screen_line_ptr+1 + sta PNT+1 dex bpl sptcsl_l2 diff --git a/c64/kernal/setfls.s b/c64/kernal/setfls.s index 44c7ab8b..d57f770b 100644 --- a/c64/kernal/setfls.s +++ b/c64/kernal/setfls.s @@ -12,9 +12,9 @@ SETFLS: // There are 6 sane ways to implement this routine, // I hope this one won't cause similarity to CBM code - - sta current_logical_filenum - sty current_secondary_address - stx current_device_number - + + sta LA + sty SA + stx FA + rts From d8a1488a5c19eb5e593b51cb499ecb2ad2e6e05f Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 27 Sep 2019 23:41:46 +0200 Subject: [PATCH 22/40] dettached colour codes from CHROUT --- c64/kernal/chrout_real.s | 6 ------ c64/kernal/colour_codes.s | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 c64/kernal/colour_codes.s diff --git a/c64/kernal/chrout_real.s b/c64/kernal/chrout_real.s index e1ce3c2c..1c60be55 100644 --- a/c64/kernal/chrout_real.s +++ b/c64/kernal/chrout_real.s @@ -876,7 +876,6 @@ update_colour_line_pointer: rts - advance_screen_pointer_40_bytes: lda PNT+0 clc @@ -893,8 +892,3 @@ advance_screen_pointer_40_bytes: sta USER+1 jmp update_colour_line_pointer - -colour_codes: // consider moving them to separate location - // CHR$ codes for the 16 colours - .byte 144,5,28,159,156,30,31,158 - .byte 129,149,150,151,152,153,154,155 diff --git a/c64/kernal/colour_codes.s b/c64/kernal/colour_codes.s new file mode 100644 index 00000000..fdf0b980 --- /dev/null +++ b/c64/kernal/colour_codes.s @@ -0,0 +1,6 @@ + +// CHR$ codes for the 16 colours + +colour_codes: + .byte 144,5,28,159,156,30,31,158 + .byte 129,149,150,151,152,153,154,155 From 2d5bf15ac98ecae00b984b608165128a811b4f77 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sat, 28 Sep 2019 10:10:49 +0200 Subject: [PATCH 23/40] fixed MEMSIZ value, some cleanups --- Makefile | 8 ++++---- bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/basic_ultimate64.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/aliases/,aliases_ram_lowmem.s | 2 +- c64/basic/cmd_new.s | 6 +++--- c64/kernal/{ => assets}/cartridge_signature.s | 0 c64/kernal/{ => assets}/colour_codes.s | 0 c64/kernal/{ => assets}/fd30.interop | 0 .../{ => assets}/fd30.vector_defaults.s | 0 c64/kernal/{ => assets}/keyboard_matrix.s | 0 13 files changed, 8 insertions(+), 8 deletions(-) rename c64/kernal/{ => assets}/cartridge_signature.s (100%) rename c64/kernal/{ => assets}/colour_codes.s (100%) rename c64/kernal/{ => assets}/fd30.interop (100%) rename c64/kernal/{ => assets}/fd30.vector_defaults.s (100%) rename c64/kernal/{ => assets}/keyboard_matrix.s (100%) diff --git a/Makefile b/Makefile index f48d2564..d4751fce 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SRCDIR_COMMON = c64/aliases SRCDIR_BASIC_COMMON = $(SRCDIR_COMMON) c64/basic -SRCDIR_KERNAL_COMMON = $(SRCDIR_COMMON) c64/kernal c64/kernal/jumptable c64/kernal/iec c64/kernal/interrupts +SRCDIR_KERNAL_COMMON = $(SRCDIR_COMMON) c64/kernal c64/kernal/assets c64/kernal/jumptable c64/kernal/iec c64/kernal/interrupts SRCDIR_BASIC_generic = $(SRCDIR_BASIC_COMMON) c64/basic/,target_generic SRCDIR_BASIC_mega65 = $(SRCDIR_BASIC_COMMON) c64/basic/,target_mega65 @@ -127,9 +127,9 @@ build/basic_generic.rom: build/target_generic/newrom build/basic_mega65.rom: build/target_mega65/newrom build/basic_ultimate64.rom: build/target_ultimate64/newrom -build/symbols_generic.vs: build/target_generic/BASIC_combined.vs build/target_generic/KERNAL_combined.vs -build/symbols_mega65.vs: build/target_generic/BASIC_mega65.vs build/target_generic/KERNAL_mega65.vs -build/symbols_ultimate64.vs: build/target_ultimate64/BASIC_combined.vs build/target_ultimate64/KERNAL_combined.vs +build/symbols_generic.vs: build/target_generic/BASIC_combined.vs build/target_generic/KERNAL_combined.vs +build/symbols_mega65.vs: build/target_mega65/BASIC_combined.vs build/target_mega65/KERNAL_combined.vs +build/symbols_ultimate64.vs: build/target_ultimate64/BASIC_combined.vs build/target_ultimate64/KERNAL_combined.vs # Rules - BASIC and KERNAL diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index e201428e98e771623dabee586c95e55aad6dee30..fb2f7c1915b6c3f86dbdd2b2de2684014bfa7eb6 100644 GIT binary patch delta 23 fcmZp0XmHr@pN(sQ&dLR?7Of^L88&mWf0qCNbqNVZ delta 23 fcmZp0XmHr@pN(t2&dT|%7Of^L|8M4G|1JRldguy6 diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index 28f7f46c3e74e0bf2443fce8f30058ebec6b1a6e..bbeab1f391903479d4a14cceaa3fad92ef7fbfba 100644 GIT binary patch delta 23 fcmZp0XmHr@pN(sQ&dLR?7Of^L88&mWf0qCNbqNVZ delta 23 fcmZp0XmHr@pN(t2&dT|%7Of^L|8M4G|1JRldguy6 diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index bed9f709f6c6f1c2614cf159fd943d0233e4f0b2..8868de5b9709b4c9a095b598049029b485875ffe 100644 GIT binary patch delta 1226 zcmX|Ae@t6d6mH+^Z^U&4MkOn~PJ)G*IEOQ3fr*T4jNC+$8675DUb18<0b}-u%3`t= z!z%`b6fPp*uTtBFF0z%7s7#~i49i=Bd*rbW7RUHwEtE{9ZOU~^@Od6BCNKA%`_B2k z@7#0Fb=SG;A`2Q@6-74cW$|XpSjPu&!+KBSaHF9E-A$oiVkD`tGO*=oFIe(uFVAo} zZy{B@L)v}McLaQ)v7rAHH=(*$alaRqzhU8q8w0}|rVpoE7<666^D);rs!HQ0)8vl! z4Q6zU9MGL`o{tMAk;Sm(i^i~uU*H$<@q{oa9!AcD@TzDUpPU!ah7#d>HftjL8gi0J zT}k=*cxX{PCKQVGAxYd5h;9?jMgbYT%}Z!G0VoJf>Pjv-6XRjjKR+wMuh4?12Ox`& zt~OS1VxG&|>h?0NKjZkS%fIX1w^Y>ic^C-1X-)|iQ6F~mH{c`;fT_xwyG3(QvbH)v ziK4oO5EYKSQk_Q-ZERw71W z#;dKkgyZD8{_r#QwSY9!>{a9?C=WyiqSH$%GmEdRh20}dDs+_~Lz{Y;d~85!Cz&vG zfL(5^bKJ;fm&=w5O6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L<3}Ft&i)JUI_z2i diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 9e443ee8d7dad582a67fbd0daca951a6c5a9bdc9..571c7efbd62559f0a3289cf323f1ebc8e383d04a 100644 GIT binary patch delta 1233 zcmY*ZeQZ-z6mMVGPn>igg=Wz8I_K=>N6^Q0%0?WJxR!Miv%aOffGN-W+U^gNmwV57 z=bYc~+}}I*d0IRzF|XFTjvQkd)bAR08G1n_0VE42LYdlz1GJ;PROkiIGPJB*RRd*m2nHAdkN})9(3LC+n zRULAs$D-i)wJDLlip&UlTBw0-cU|>JSm(BOd;CoIFEDl29a=yC0}*rsK87Y81}1g;iCqicH%RJUTW7FTO3!4-4(ky+Pk78|p;3tL!OC@>!XUuHTo{ zzSNcijU@USBpC`m=pJ*QvLeuwU31{71Q^M$fe$6)G8+clmgrfBPLu=nKKw-ai>Cb0 zbi!4u4+p4A?0Fc{QZx z!aLY-Ob5gTIK84wWk*H{b!2d&Vn0=;wen+HaG`RO`ZB&*xd|*JX-AS2i7zwkumAHd zg1;Vt1#Gd@tfw6`%Z2`K(22(FmL^($*z#62M`9P1!G4v*&d0kLHeiK=S=1X2Mn<_% z=ftW-uWngL22DrIIYa@r{EL)N$R^B>`jUS z@Op;U0~?`dU6qUg{z3fO&EKA^wtv$%^u?FMBZ04I98Ya@Z8!z?l77IEXhClIUhOYoz}G)$~i- delta 1209 zcmY*YZA@Eb6uuwyb23VyqhTw&FvNl%K^rG7poj}L%bQ4oADhXRyAYF-;r?hGi9c3^ zTM;wT?L`GdD5b4*QB%_&OQ%jY67()%xyywL%g9I^jG{60lJ;d=*!8__`C)Q%?{nVs zoO7OY?s?r!?xsku#`<3JJkN0b&LOA13;de`I0bIY;C+lnHI@4=fgaosqBy+52f&dH zFp0rjl0)}2!TM8cf>C54`Q(d+FvZXFi}0m{Fen}d_Jr`JXq@`#mH;+YhVQ8?1O@BB zj;?7-t52iH7k*$(7dQ4 zfh=^~ch+#?9+$Pl?PWTCgYo+=f5CFahNvCzFobx+BnxIy7k2Z%6HB;AAeDuMqA4g@ zJM5&&_X~5=neK7l}kIII^miD34@j zu@W%|(_T%@IT%Nh?(o5a^?)?p>Q&22WITi!h{u*F6AQ=I!|vfF3XG#V{b~9p8r1{Z zj(*j55q!wdWWStKms86HC6i?~ZptH>;^0gomj;|cV}{r0kI{;uioSz1##(ba;nf@% zA1x~%>;CequZM<5zCq6$t@L{Is8Opc;xG69;`y0_|7>L&fhRUld*PF$=;wtt^8T){ z>P5#IXh?-$g*Zt#gRUvpB`XIUc-Mew88EV!g%4%JW@ax)?~@nJfbK&T<`;~SyxzD+ z3dBPaI$>@uZAisFU<8g#>gp=IB5Sg%6k)+6ikZ)9_il5rT|tM6-lC)Ei=wB29Rnrp z*98Md`9MSqqJqGj0VyP@33K|t>aBwrP9!zYxP>ZF3g!fq9E{o#G_1JL+yn-WFV(kn+Vugb# z?gwhQ2A`*vqiKtdZkk{98T(8->S^60uB+GQnc)4$xUPUNG!Y~~$cr%b99e~jD#c)` zxl2NG@J|9!V~M>Y;~_@Y>DB$%&3ykU!wqyZ1LQ*nk6b0TgX(=$J9elY!-XU{2R2MP zOv?rUMXd7vC~;bcoPnWDW1p&gMuDbn*A#GU!M$72YU{I_)_jE}50|0T>6VT&;da9vmFWqB(VKhQlmB!XbBgX*I&|LkypL06nYlK^nf1f;||{ zC1Di984N#q3>!CKYZ6VDAE?@cVKMHsvz@hU=QAukDZ`TrY?FO={1it~3)r($DgOu7 Cxjd`@ diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index fa96322b..00d19059 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -39,7 +39,7 @@ .label STREND = $31 // $31-$32 -- NOT IMPLEMENTED -- .label FRETOP = $33 // $33-$34 -- NOT IMPLEMENTED -- .label FRESPC = $35 // $35-$36 [!] our implementation might be different XXX give more details - .label MEMSIZ = $37 // $37-$38 -- NOT IMPLEMENTED -- highest address of BASIC memory + .label MEMSIZ = $37 // $37-$38 highest address of BASIC memory + 1 .label CURLIN = $39 // $39-$3A current BASIC line number .label OLDLIN = $3B // $3B-$3C previous BASIC line number .label OLDTXT = $3D // $3D-$3E current BASIC line pointer diff --git a/c64/basic/cmd_new.s b/c64/basic/cmd_new.s index a7fbd49e..8fbcb727 100644 --- a/c64/basic/cmd_new.s +++ b/c64/basic/cmd_new.s @@ -47,21 +47,21 @@ basic_do_new: #if CONFIG_MEMORY_MODEL_60K lda #>$F7FF #else // CONFIG_MEMORY_MODEL_38K - lda #>$9FFF + lda #>$A000 #endif .byte $2C !: #if CONFIG_MEMORY_MODEL_60K lda #>$F7FF #else // CONFIG_MEMORY_MODEL_38K - lda #>$9FFF + lda #>$A000 #endif sta basic_top_of_memory_ptr+1 sta basic_start_of_strings_ptr+1 #if CONFIG_MEMORY_MODEL_60K lda #<$F7FF #else // CONFIG_MEMORY_MODEL_38K - lda #<$9FFF + lda #<$A000 #endif sta basic_top_of_memory_ptr+0 sta basic_start_of_strings_ptr+0 diff --git a/c64/kernal/cartridge_signature.s b/c64/kernal/assets/cartridge_signature.s similarity index 100% rename from c64/kernal/cartridge_signature.s rename to c64/kernal/assets/cartridge_signature.s diff --git a/c64/kernal/colour_codes.s b/c64/kernal/assets/colour_codes.s similarity index 100% rename from c64/kernal/colour_codes.s rename to c64/kernal/assets/colour_codes.s diff --git a/c64/kernal/fd30.interop b/c64/kernal/assets/fd30.interop similarity index 100% rename from c64/kernal/fd30.interop rename to c64/kernal/assets/fd30.interop diff --git a/c64/kernal/fd30.vector_defaults.s b/c64/kernal/assets/fd30.vector_defaults.s similarity index 100% rename from c64/kernal/fd30.vector_defaults.s rename to c64/kernal/assets/fd30.vector_defaults.s diff --git a/c64/kernal/keyboard_matrix.s b/c64/kernal/assets/keyboard_matrix.s similarity index 100% rename from c64/kernal/keyboard_matrix.s rename to c64/kernal/assets/keyboard_matrix.s From 1130db35e05ef422a866ba9f8afd5b62ddcde775 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sat, 28 Sep 2019 10:57:12 +0200 Subject: [PATCH 24/40] more aliases cleanup --- c64/aliases/,aliases_ram_lowmem.s | 39 ++++++++++++++++++++++++---- c64/basic/,aliases.s | 27 ------------------- c64/basic/basic_parse_line_number.s | 10 ++++---- c64/basic/fac1_mul.s | 40 ++++++++++++++--------------- c64/basic/injest_number.s | 18 ++++++------- c64/kernal/,aliases.s | 15 ----------- 6 files changed, 68 insertions(+), 81 deletions(-) delete mode 100644 c64/kernal/,aliases.s diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 00d19059..1b4a04b1 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -57,12 +57,22 @@ .label JMPER = $54 // $54-$56 -- NOT IMPLEMENTED -- .label TEMPF1 = $57 // $57-$5B BASIC numeric work area .label TEMPF2 = $5C // $5C-$60 BASIC numeric work area - .label FAC1 = $61 // $61-$66 -- NOT IMPLEMENTED -- + + .label __FAC1 = $61 // $61-$66 floating point accumulator 1 + .label FAC1_exponent = $61 + .label FAC1_mantissa = $62 // $62 - $65 + .label FAC1_sign = $66 + .label SGNFLG = $67 // -- NOT IMPLEMENTED -- - .label BITS = $68 // -- NOT IMPLEMENTED -- - .label FAC2 = $69 // $69-$6E -- NOT IMPLEMENTED -- [!] also used for memory move pointers + .label BITS = $68 // FAC1 overflow + + .label __FAC2 = $69 // $69-$6E floating point accumulator 2 [!] also used for memory move pointers + .label FAC2_exponent = $69 + .label FAC2_mantissa = $6A // $6A - $6D + .label FAC2_sign = $6E + .label ARISGN = $6F // -- NOT IMPLEMENTED -- - .label FACOV = $70 // -- NOT IMPLEMENTED -- + .label FACOV = $70 // FAC1 low order mantissa .label FBUFPT = $67 // $71-$72 -- NOT IMPLEMENTED -- .label CHRGET = $73 // $73-$8A -- NOT IMPLEMENTED -- .label TXTPTR = $7A // $7A-$7B current BASIC statement pointer @@ -190,7 +200,26 @@ .label TD1IRQ = $2A4 // -- NOT IMPLEMENTED -- .label TLNIDX = $2A5 // -- NOT IMPLEMENTED -- .label TVSFLG = $2A6 // 0 = NTSC, 1 = PAL - // [!] XXX document $2A7-$2FF usage + + // [!] $2A7-$2FF is normally free, but in our case some extra functionality uses it + +#if CONFIG_MEMORY_MODEL_60K + + // IRQs are disabled when doing such accesses, and a default NMI handler only increments + // a counter, so that if an NMI occurs, it doesn't crash the machine, but can be captured. + + .label missed_nmi_flag = $2A7 + .label tiny_nmi_handler = $2A8 + .label peek_under_roms = tiny_nmi_handler + peek_under_roms_routine - tiny_nmi_handler_routine + .label poke_under_roms = tiny_nmi_handler + poke_under_roms_routine - tiny_nmi_handler_routine + .label memmap_allram = tiny_nmi_handler + memmap_allram_routine - tiny_nmi_handler_routine + .label memmap_normal = tiny_nmi_handler + memmap_normal_routine - tiny_nmi_handler_routine +#if SEGMENT_BASIC + .label shift_mem_up = tiny_nmi_handler + shift_mem_up_routine - tiny_nmi_handler_routine + .label shift_mem_down = tiny_nmi_handler + shift_mem_down_routine - tiny_nmi_handler_routine +#endif // SEGMENT_BASIC + +#endif // CONFIG_MEMORY_MODEL_60K // BASIC vectors .label IERROR = $300 // $300-$301 diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index 479d6bf1..f5cb035e 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -37,35 +37,8 @@ .label basic_numeric_work_area = $57 // $57 - $60 inclusive = 10 bytes - // Floating point accumulator 1 $61 - $68 - .label basic_fac1_exponent = $61 - .label basic_fac1_mantissa = $62 // $62 - $65 - .label basic_fac1_sign = $66 - .label basic_fac1_overflow = $68 - .label basic_fac1_mantissa_lob = $70 - - .label basic_fac2_exponent = $69 - .label basic_fac2_mantissa = $6A // $6A - $6D - .label basic_fac2_sign = $6E - // We also re-use FAC2 for memory move pointers, since // we can't be doing calculations while moving memory .label memmove_src = $69 .label memmove_dst = $6b .label memmove_size = $6d - -#if CONFIG_MEMORY_MODEL_60K - - // BASIC uses some extra bytes for memory access under ROMs located at $2A7 onwards - // IRQs are disabled when doing such accesses, and a default NMI handler only increments - // a counter, so that if an NMI occurs, it doesn't crash the machine, but can be captured. - .label missed_nmi_flag = $2A7 - .label tiny_nmi_handler = $2A8 - .label shift_mem_up = tiny_nmi_handler+shift_mem_up_routine-tiny_nmi_handler_routine - .label shift_mem_down = tiny_nmi_handler+shift_mem_down_routine-tiny_nmi_handler_routine - .label peek_under_roms = tiny_nmi_handler+peek_under_roms_routine-tiny_nmi_handler_routine - .label poke_under_roms = tiny_nmi_handler+poke_under_roms_routine-tiny_nmi_handler_routine - .label memmap_allram = tiny_nmi_handler+memmap_allram_routine-tiny_nmi_handler_routine - .label memmap_normal = tiny_nmi_handler+memmap_normal_routine-tiny_nmi_handler_routine - -#endif // CONFIG_MEMORY_MODEL_60K diff --git a/c64/basic/basic_parse_line_number.s b/c64/basic/basic_parse_line_number.s index 90aa8336..aab2efb0 100644 --- a/c64/basic/basic_parse_line_number.s +++ b/c64/basic/basic_parse_line_number.s @@ -5,9 +5,9 @@ basic_parse_line_number: // Check if the number is a valid line number // i.e., 16 bits, no exponent, no decimal - lda basic_fac1_mantissa+2 - ora basic_fac1_mantissa+3 - ora basic_fac1_exponent + lda FAC1_mantissa+2 + ora FAC1_mantissa+3 + ora FAC1_exponent beq !+ ml_bad_line_number: // Invalid line number @@ -19,9 +19,9 @@ ml_bad_line_number: bne ml_bad_line_number // Got a valid line number. - lda basic_fac1_mantissa+0 + lda FAC1_mantissa+0 sta basic_line_number+0 - lda basic_fac1_mantissa+1 + lda FAC1_mantissa+1 sta basic_line_number+1 clc rts diff --git a/c64/basic/fac1_mul.s b/c64/basic/fac1_mul.s index f3618aa6..8df97b6a 100644 --- a/c64/basic/fac1_mul.s +++ b/c64/basic/fac1_mul.s @@ -3,13 +3,13 @@ // Implement by shifting MAC left one bit, // and then keeping that value to add on after // shifting two more bits left. -// This should be done using basic_fac1_overflow to +// This should be done using BITS to // hold the overflow bits, so that the result can // be exponent adjusted after, if required. fac1_mul10: lda #$00 - sta basic_fac1_overflow + sta BITS // Multiply mantissa by 2 jsr fac1_mantissa_mul2 @@ -20,7 +20,7 @@ fac1_mul10: // the overflow bits, and the copy is as small as possible) ldx #7 f1m10_l1: - lda basic_fac1_mantissa,x + lda FAC1_mantissa,x sta basic_numeric_work_area,x dex bpl f1m10_l1 @@ -33,21 +33,21 @@ f1m10_l1: ldy #3 ldx #0 clc -f1m10_l2: - lda basic_fac1_mantissa,x +f1m10_l2: + lda FAC1_mantissa,x adc basic_numeric_work_area,x - sta basic_fac1_mantissa,x + sta FAC1_mantissa,x inx dey bpl f1m10_l2 - lda basic_fac1_overflow + lda BITS adc basic_numeric_work_area+7 - sta basic_fac1_overflow + sta BITS // Now shift right and increase exponent until overflow // bits = $00 f1m10_l3: - lda basic_fac1_overflow + lda BITS bne !+ // All done, return clc @@ -55,8 +55,8 @@ f1m10_l3: !: // Divide mantissa by two, and increment exponent jsr fac1_mantissa_div2 - inc basic_fac1_exponent - lda basic_fac1_exponent + inc FAC1_exponent + lda FAC1_exponent bpl f1m10_l3 // Exponent has bit 7 set, so has wrapped. // = OVERFLOW ERROR @@ -68,30 +68,30 @@ fac1_mantissa_mul2: clc f1m1_l1: // Multiply mantissa by 2, and store overflow - // in basic_fac1_bits - lda basic_fac1_mantissa,x + // in FAC1_bits + lda FAC1_mantissa,x rol - sta basic_fac1_mantissa,x + sta FAC1_mantissa,x inx dey bpl f1m1_l1 - lda basic_fac1_overflow + lda BITS rol - sta basic_fac1_overflow + sta BITS rts fac1_mantissa_div2: // Divide mantissa by 2, including using overflow bits clc - lda basic_fac1_overflow + lda BITS ror - sta basic_fac1_overflow + sta BITS ldy #3 f1md2_l1: - lda basic_fac1_mantissa,y + lda FAC1_mantissa,y ror - sta basic_fac1_mantissa,y + sta FAC1_mantissa,y dey bpl f1md2_l1 rts diff --git a/c64/basic/injest_number.s b/c64/basic/injest_number.s index 948ddc82..5ed2b3f7 100644 --- a/c64/basic/injest_number.s +++ b/c64/basic/injest_number.s @@ -60,7 +60,7 @@ injest_number: // Set sign to negative lda #$ff - sta basic_fac1_sign + sta FAC1_sign // Skip over the minus sign jsr basic_consume_character @@ -80,7 +80,7 @@ ij_loop1: // Only add digit if we have not overflowed the accuracy of // the mantissa - lda basic_fac1_exponent + lda FAC1_exponent beq ij_accept_precision // We have an extra digit after saturating our precision. @@ -103,7 +103,7 @@ ij_accept_precision: // we can add the new digit in jsr fac1_mul10 - lda basic_fac1_exponent + lda FAC1_exponent bne ij_consider_next_digit // Get digit @@ -114,14 +114,14 @@ ij_accept_precision: // Add to FAC1 mantissa clc - adc basic_fac1_mantissa+0 - sta basic_fac1_mantissa+0 + adc FAC1_mantissa+0 + sta FAC1_mantissa+0 ldx #1 ldy #3 ij_loop2: - lda basic_fac1_mantissa,x + lda FAC1_mantissa,x adc #$00 - sta basic_fac1_mantissa,x + sta FAC1_mantissa,x inx dey bne ij_loop2 @@ -146,10 +146,10 @@ erase_fac1: lda #$00 ldx #8 !: - sta basic_fac1_exponent,x + sta FAC1_exponent,x dex bpl !- - sta basic_fac1_mantissa_lob + sta FACOV rts diff --git a/c64/kernal/,aliases.s b/c64/kernal/,aliases.s deleted file mode 100644 index 528f852f..00000000 --- a/c64/kernal/,aliases.s +++ /dev/null @@ -1,15 +0,0 @@ - -// XXX get rid of this file - -#if CONFIG_MEMORY_MODEL_60K - - // Under-ROM routines - // (BASIC also includes them. XXX - We should de-duplicate them in a safe manner) - .label missed_nmi_flag = $2A7 - .label tiny_nmi_handler = $2A8 - .label peek_under_roms = tiny_nmi_handler+peek_under_roms_routine-tiny_nmi_handler_routine - .label poke_under_roms = tiny_nmi_handler+poke_under_roms_routine-tiny_nmi_handler_routine - .label memmap_allram = tiny_nmi_handler+memmap_allram_routine-tiny_nmi_handler_routine - .label memmap_normal = tiny_nmi_handler+memmap_normal_routine-tiny_nmi_handler_routine - -#endif // CONFIG_MEMORY_MODEL_60K From 4f5808820714a152b53cff8fd2077204801bdb1f Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sat, 28 Sep 2019 11:59:15 +0200 Subject: [PATCH 25/40] further aliases cleanup --- c64/aliases/,aliases_ram_lowmem.s | 2 +- c64/basic/,aliases.s | 67 +++++++++----------- c64/basic/ab1e.strout.s | 6 +- c64/basic/basic_delete_line.s | 26 ++++---- c64/basic/basic_execute_line.s | 36 +++++------ c64/basic/basic_find_line.s | 6 +- c64/basic/basic_insert_line.s | 20 +++--- c64/basic/basic_main_loop.s | 36 +++++------ c64/basic/basic_parse_line_number.s | 6 +- c64/basic/basic_shift_mem_down.s | 88 +++++++++++++------------- c64/basic/basic_shift_mem_up.s | 98 ++++++++++++++--------------- c64/basic/cmd_list.s | 4 +- c64/basic/cmd_load.s | 16 ++--- c64/basic/cmd_sys.s | 4 +- c64/basic/fac1_mul.s | 8 +-- c64/basic/injest_number.s | 20 +++--- c64/basic/pack_word.s | 58 ++++++++--------- c64/basic/print_packed_message.s | 32 +++++----- c64/basic/tokenise_line.s | 48 +++++++------- c64/basic/under_rom_routines.s | 56 ++++++++--------- c64/basic/wedge_dos.s | 14 ++--- 21 files changed, 321 insertions(+), 330 deletions(-) diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 1b4a04b1..1866304e 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -38,7 +38,7 @@ .label ARYTAB = $2F // $2F-$30 -- NOT IMPLEMENTED -- .label STREND = $31 // $31-$32 -- NOT IMPLEMENTED -- .label FRETOP = $33 // $33-$34 -- NOT IMPLEMENTED -- - .label FRESPC = $35 // $35-$36 [!] our implementation might be different XXX give more details + .label FRESPC = $35 // $35-$36 [!] our implementation uses this as temporary string pointer .label MEMSIZ = $37 // $37-$38 highest address of BASIC memory + 1 .label CURLIN = $39 // $39-$3A current BASIC line number .label OLDLIN = $3B // $3B-$3C previous BASIC line number diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index f5cb035e..d926afe1 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -1,44 +1,35 @@ -// Names of ZP and low memory locations -// (Only those for now that we feel the need to implement initially) -// (https://www.c64-wiki.com/wiki/Zeropage) +// +// Helper aliases to make the code more readable +// Always use double underscore in label names +// to allow automatic VICE label conflict prevention +// -// XXX get rid of this file, use ,aliases_ram_lowmem.s instead + // Temporary variables for various routines + .label __tokenise_work1 = $07 // CHARAC + .label __tokenise_work2 = $08 // ENDCHR + .label __tokenise_work3 = $0B // COUNT + .label __tokenise_work4 = $0F // GARBFL + .label __tokenise_work5 = $0C // DIMFLG - .label tokenise_work1 = $7 - .label tokenise_work2 = $8 - .label tokenise_work3 = $B - .label tokenise_work4 = $F - .label basic_line_number = $14 - .label temp_string_ptr = $35 - .label load_or_verify_or_tokenise_work5 = $C - .label basic_work22 = $22 - .label basic_work23 = $23 - .label basic_work24 = $24 - .label basic_work25 = $25 + // We re-use FAC2 for memory move pointers, since + // we can't be doing calculations while moving memory + .label __memmove_src = $69 + .label __memmove_dst = $6B + .label __memmove_size = $6D + +// XXX cleanup lines below // The various pointers that separate memory regions for BASIC storage // We have multiple names for the ones that mark the boundary of regions. - .label basic_start_of_text_ptr = $2b - .label basic_end_of_text_ptr = $2d - .label basic_start_of_vars_ptr = $2d - .label basic_end_of_vars_ptr = $2f - .label basic_start_of_arrays_ptr = $2f - .label basic_end_of_arrays_ptr = $31 + .label basic_start_of_text_ptr = $2b + .label basic_end_of_text_ptr = $2d + .label basic_start_of_vars_ptr = $2d + .label basic_end_of_vars_ptr = $2f + .label basic_start_of_arrays_ptr = $2f + .label basic_end_of_arrays_ptr = $31 .label basic_start_of_free_space_ptr = $31 - .label basic_start_of_strings_ptr = $33 - .label basic_top_of_memory_ptr = $37 - .label basic_current_line_number = $39 - .label basic_previous_line_number = $3b - .label basic_current_line_ptr = $3d - - // Note that the statement point is in the CHRGET/CHRGOT routine - // in ZP RAM. (Compute's Mapping the 64, p25) - .label basic_current_statement_ptr = $7a - - .label basic_numeric_work_area = $57 // $57 - $60 inclusive = 10 bytes - - // We also re-use FAC2 for memory move pointers, since - // we can't be doing calculations while moving memory - .label memmove_src = $69 - .label memmove_dst = $6b - .label memmove_size = $6d + .label basic_start_of_strings_ptr = $33 + .label basic_top_of_memory_ptr = $37 + .label basic_current_line_number = $39 + .label basic_previous_line_number = $3b + .label basic_current_line_ptr = $3d diff --git a/c64/basic/ab1e.strout.s b/c64/basic/ab1e.strout.s index 89079894..165af8b1 100644 --- a/c64/basic/ab1e.strout.s +++ b/c64/basic/ab1e.strout.s @@ -5,8 +5,8 @@ STROUT: // Setup pointer - sty temp_string_ptr+1 - sta temp_string_ptr+0 + sty FRESPC+1 + sta FRESPC+0 txa pha @@ -18,7 +18,7 @@ STROUT: tya tax - lda (temp_string_ptr),y + lda (FRESPC),y beq !+ jsr JCHROUT diff --git a/c64/basic/basic_delete_line.s b/c64/basic/basic_delete_line.s index 922cc46b..00c2051a 100644 --- a/c64/basic/basic_delete_line.s +++ b/c64/basic/basic_delete_line.s @@ -23,7 +23,7 @@ basic_delete_line: lda (basic_current_line_ptr),y #endif - sta tokenise_work3 + sta __tokenise_work3 iny #if CONFIG_MEMORY_MODEL_60K @@ -32,24 +32,24 @@ basic_delete_line: lda (basic_current_line_ptr),y #endif - sta tokenise_work4 + sta __tokenise_work4 // Work out length of this line by looking at the pointer - lda tokenise_work3 + lda __tokenise_work3 sec sbc basic_current_line_ptr+0 - sta tokenise_work3 - lda tokenise_work4 + sta __tokenise_work3 + lda __tokenise_work4 sbc basic_current_line_ptr+1 - sta tokenise_work4 + sta __tokenise_work4 // jsr printf // .text "LINE LENGTH IS $" - // .byte $f0,tokenise_work4 - // .byte $f0,tokenise_work3 + // .byte $f0,<__tokenise_work4,>__tokenise_work4 + // .byte $f0,<__tokenise_work3,>__tokenise_work3 // .byte $0d,0 - lda tokenise_work4 + lda __tokenise_work4 sbc #0 cmp #$00 beq !+ @@ -58,9 +58,9 @@ basic_delete_line: jmp do_MEMORY_CORRUPT_error !: // Length can now be safely assumed to be in the low - // byte only, i.e., stored in tokenise_work3 + // byte only, i.e., stored in __tokenise_work3 - lda tokenise_work3 + lda __tokenise_work3 pha tax @@ -69,10 +69,10 @@ basic_delete_line: // Now decrease top of BASIC mem pla - sta tokenise_work3 + sta __tokenise_work3 lda basic_end_of_text_ptr+0 sec - sbc tokenise_work3 + sbc __tokenise_work3 sta basic_end_of_text_ptr+0 lda basic_end_of_text_ptr+1 sbc #0 diff --git a/c64/basic/basic_execute_line.s b/c64/basic/basic_execute_line.s index f8e8dc25..6f625c2b 100644 --- a/c64/basic/basic_execute_line.s +++ b/c64/basic/basic_execute_line.s @@ -6,10 +6,10 @@ basic_end_of_statement_check: ldy #0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_current_line_ptr // .byte $f0,basic_current_line_ptr // .text ", STATEMENT PTR = $" - // .byte $f1,basic_current_statement_ptr - // .byte $f0,basic_current_statement_ptr + // .byte $f1,TXTPTR + // .byte $f0,TXTPTR // .byte $d,0 // Go through the line until its end is reached. @@ -73,11 +73,11 @@ basic_execute_statement: ldy #0 #if CONFIG_MEMORY_MODEL_60K - ldx #$0200 - sta basic_current_statement_ptr+1 + sta TXTPTR+1 jsr basic_parse_line_number // Get pointer to next char - lda basic_current_statement_ptr+0 - sta tokenise_work1 + lda TXTPTR+0 + sta __tokenise_work1 // Got a valid line number -- so do add/del line // Skip any spaces after the line number - ldx tokenise_work1 + ldx __tokenise_work1 skip_spaces: lda $0200,x cmp #$20 bne !+ inx bne skip_spaces -!: stx tokenise_work1 +!: stx __tokenise_work1 // First, clear all variables, so that we only have to shove BASIC text around. // (We could later remove this requirement, and the only effect should be @@ -119,8 +119,8 @@ skip_spaces: !: // Insert new line if non-zero length, i.e., that // we are not just deleting the line. - lda tokenise_work1 - cmp tokenise_work2 + lda __tokenise_work1 + cmp __tokenise_work2 beq !+ jsr basic_insert_line !: @@ -133,9 +133,9 @@ not_a_line: // Setup pointer to the statement lda #<$0200 - sta basic_current_statement_ptr+0 + sta TXTPTR+0 lda #>$0200 - sta basic_current_statement_ptr+1 + sta TXTPTR+1 // There is no stored line, so zero that pointer out lda #$00 diff --git a/c64/basic/basic_parse_line_number.s b/c64/basic/basic_parse_line_number.s index aab2efb0..c4b9910f 100644 --- a/c64/basic/basic_parse_line_number.s +++ b/c64/basic/basic_parse_line_number.s @@ -14,14 +14,14 @@ ml_bad_line_number: jmp do_ILLEGAL_QUANTITY_error !: // Line number are not allowed to have decimal points in them - lda tokenise_work4 + lda __tokenise_work4 cmp #$FF bne ml_bad_line_number // Got a valid line number. lda FAC1_mantissa+0 - sta basic_line_number+0 + sta LINNUM+0 lda FAC1_mantissa+1 - sta basic_line_number+1 + sta LINNUM+1 clc rts diff --git a/c64/basic/basic_shift_mem_down.s b/c64/basic/basic_shift_mem_down.s index dfc14bbd..17a66171 100644 --- a/c64/basic/basic_shift_mem_down.s +++ b/c64/basic/basic_shift_mem_down.s @@ -4,28 +4,28 @@ basic_shift_mem_down_and_relink: // Destination is basic_current_line_ptr lda basic_current_line_ptr+0 - sta memmove_dst+0 + sta __memmove_dst+0 lda basic_current_line_ptr+1 - sta memmove_dst+1 + sta __memmove_dst+1 // Source is that plus X txa pha // also keep for later clc adc basic_current_line_ptr+0 - sta memmove_src+0 + sta __memmove_src+0 lda basic_current_line_ptr+1 adc #0 - sta memmove_src+1 + sta __memmove_src+1 // Size is distance from source to end of BASIC text. lda basic_end_of_text_ptr+0 sec - sbc memmove_src+0 - sta memmove_size+0 + sbc __memmove_src+0 + sta __memmove_size+0 lda basic_end_of_text_ptr+1 - sbc memmove_src+1 - sta memmove_size+1 + sbc __memmove_src+1 + sta __memmove_size+1 // jsr printf // .text "TOP OF BASIC = $" @@ -33,14 +33,14 @@ basic_shift_mem_down_and_relink: // .byte $f0,basic_end_of_text_ptr // .byte $0d // .text "SHIFTING DOWN $" - // .byte $f1,memmove_size - // .byte $f0,memmove_size + // .byte $f1,<__memmove_size,>__memmove_size + // .byte $f0,<__memmove_size,>__memmove_size // .text " BYTES FROM $" - // .byte $f1,memmove_src - // .byte $f0,memmove_src + // .byte $f1,<__memmove_src,>__memmove_src + // .byte $f0,<__memmove_src,>__memmove_src // .text " TO $" - // .byte $f1,memmove_dst - // .byte $f0,memmove_dst + // .byte $f1,<__memmove_dst,>__memmove_dst + // .byte $f0,<__memmove_dst,>__memmove_dst // .byte $0d,0 // The copy routine that copies under the ROMs is as simple @@ -54,50 +54,50 @@ basic_shift_mem_down_and_relink: // This means we have to then reduce the source and // target pointers by the same amount - lda memmove_size+0 + lda __memmove_size+0 eor #$ff - sta tokenise_work3 - sta memmove_size+0 + sta __tokenise_work3 + sta __memmove_size+0 - lda memmove_src+0 + lda __memmove_src+0 sec - sbc tokenise_work3 - sta memmove_src+0 - lda memmove_src+1 + sbc __tokenise_work3 + sta __memmove_src+0 + lda __memmove_src+1 sbc #0 - sta memmove_src+1 + sta __memmove_src+1 - lda memmove_dst+0 + lda __memmove_dst+0 sec - sbc tokenise_work3 - sta memmove_dst+0 - lda memmove_dst+1 + sbc __tokenise_work3 + sta __memmove_dst+0 + lda __memmove_dst+1 sbc #0 - sta memmove_dst+1 + sta __memmove_dst+1 // Increase copy page count so we can post-decrement compare with $00 - inc memmove_size+1 + inc __memmove_size+1 // jsr printf // .text "REVISED BOUNDS $" - // .byte $f1,memmove_size - // .byte $f0,memmove_size + // .byte $f1,<__memmove_size,>__memmove_size + // .byte $f0,<__memmove_size,>__memmove_size // .text " BYTES FROM $" - // .byte $f1,memmove_src - // .byte $f0,memmove_src + // .byte $f1,<__memmove_src,>__memmove_src + // .byte $f0,<__memmove_src,>__memmove_src // .text " TO $" - // .byte $f1,memmove_dst - // .byte $f0,memmove_dst + // .byte $f1,<__memmove_dst,>__memmove_dst + // .byte $f0,<__memmove_dst,>__memmove_dst // .byte $0d,0 // Get Y value ready for the copy - ldy memmove_size+0 + ldy __memmove_size+0 jsr shift_mem_down // Get length of deletion back pla - sta tokenise_work3 + sta __tokenise_work3 // Check if we still have any lines left ldy #0 @@ -112,7 +112,7 @@ relink_down_next_line: // inc $d020 // jmp relink_down_next_line - // Subtract tokenise_work3 from the pointer + // Subtract __tokenise_work3 from the pointer ldy #0 #if CONFIG_MEMORY_MODEL_60K @@ -123,8 +123,8 @@ relink_down_next_line: #endif sec - sbc tokenise_work3 - sta memmove_src+0 + sbc __tokenise_work3 + sta __memmove_src+0 iny #if CONFIG_MEMORY_MODEL_60K @@ -134,10 +134,10 @@ relink_down_next_line: #endif sbc #0 - sta memmove_src+1 + sta __memmove_src+1 ldy #0 - lda memmove_src+0 + lda __memmove_src+0 #if CONFIG_MEMORY_MODEL_60K ldx #basic_end_of_text_ptr // .byte $0d // .text "SHIFTING UP $" - // .byte $f1,memmove_size - // .byte $f0,memmove_size + // .byte $f1,<__memmove_size,>__memmove_size + // .byte $f0,<__memmove_size,>__memmove_size // .text " BYTES FROM $" - // .byte $f1,memmove_src - // .byte $f0,memmove_src + // .byte $f1,<__memmove_src,>__memmove_src + // .byte $f0,<__memmove_src,>__memmove_src // .text " TO $" - // .byte $f1,memmove_dst - // .byte $f0,memmove_dst + // .byte $f1,<__memmove_dst,>__memmove_dst + // .byte $f0,<__memmove_dst,>__memmove_dst // .byte $0d,0 // To make life simple for the copy routine that lives in RAM, // we have to adjust the end pointers down one page and set Y to the low // byte of the copy size. - lda memmove_src+0 + lda __memmove_src+0 sec - sbc memmove_size+0 - sta memmove_src+0 - lda memmove_src+1 + sbc __memmove_size+0 + sta __memmove_src+0 + lda __memmove_src+1 sbc #0 - sta memmove_src+1 + sta __memmove_src+1 - lda memmove_dst+0 + lda __memmove_dst+0 sec - sbc memmove_size+0 - sta memmove_dst+0 - lda memmove_dst+1 + sbc __memmove_size+0 + sta __memmove_dst+0 + lda __memmove_dst+1 sbc #0 - sta memmove_dst+1 + sta __memmove_dst+1 // Now make exit easy, by being able to check for zero on size high byte when done - inc memmove_size+1 + inc __memmove_size+1 // Then set Y to the number offset required - ldy memmove_size+0 + ldy __memmove_size+0 iny - stx tokenise_work3 + stx __tokenise_work3 // jsr printf // .text "REVISED BOUNDS $" - // .byte $f1,memmove_size - // .byte $f0,memmove_size + // .byte $f1,<__memmove_size,>__memmove_size + // .byte $f0,<__memmove_size,>__memmove_size // .text " BYTES FROM $" - // .byte $f1,memmove_src - // .byte $f0,memmove_src + // .byte $f1,<__memmove_src,>__memmove_src + // .byte $f0,<__memmove_src,>__memmove_src // .text " TO $" - // .byte $f1,memmove_dst - // .byte $f0,memmove_dst + // .byte $f1,<__memmove_dst,>__memmove_dst + // .byte $f0,<__memmove_dst,>__memmove_dst // .byte $0d,0 // Do the copy @@ -138,10 +138,10 @@ relink_up_next_line: lda (basic_current_line_ptr),y #endif - sta memmove_dst+0 + sta __memmove_dst+0 clc - adc tokenise_work3 - sta memmove_src+0 + adc __tokenise_work3 + sta __memmove_src+0 iny php @@ -152,27 +152,27 @@ relink_up_next_line: lda (basic_current_line_ptr),y #endif - sta memmove_dst+1 + sta __memmove_dst+1 plp adc #0 - sta memmove_src+1 + sta __memmove_src+1 // jsr printf // .text "LINE ADDR = $" // .byte $f1,basic_end_of_text_ptr // .byte $f0,basic_end_of_text_ptr // .text $d," BEFORE = $" - // .byte $f1,memmove_dst - // .byte $f0,memmove_dst + // .byte $f1,<__memmove_dst,>__memmove_dst + // .byte $f0,<__memmove_dst,>__memmove_dst // .text ", AFTER = $" - // .byte $f1,memmove_src - // .byte $f0,memmove_src + // .byte $f1,<__memmove_src,>__memmove_src + // .byte $f0,<__memmove_src,>__memmove_src // .byte $d // .byte 0 - // Write memmove_src back to current line pointer + // Write __memmove_src back to current line pointer ldy #0 - lda memmove_src+0 + lda __memmove_src+0 #if CONFIG_MEMORY_MODEL_60K ldx #packed_keywords - sta temp_string_ptr+1 + sta FRESPC+1 // Subtract $80 from token to get offset in word // list diff --git a/c64/basic/cmd_load.s b/c64/basic/cmd_load.s index eb5e1089..6e3f7cc8 100644 --- a/c64/basic/cmd_load.s +++ b/c64/basic/cmd_load.s @@ -36,9 +36,9 @@ cmd_load: jmp do_SYNTAX_error !: // Filename starts here so set pointer - lda basic_current_statement_ptr+0 + lda TXTPTR+0 sta FNADDR+0 - lda basic_current_statement_ptr+1 + lda TXTPTR+1 sta FNADDR+1 // Now search for end of line or closing quote @@ -65,11 +65,11 @@ got_filename: bcs got_devicenumber jsr basic_parse_line_number - lda basic_line_number+1 + lda LINNUM+1 beq !+ jmp do_ILLEGAL_QUANTITY_error !: - lda basic_line_number+0 + lda LINNUM+0 sta FA got_devicenumber: @@ -80,9 +80,9 @@ got_devicenumber: jsr injest_comma bcs got_secondaryaddress jsr basic_parse_line_number - lda basic_line_number+1 + lda LINNUM+1 bne !+ - lda basic_line_number+0 + lda LINNUM+0 sta SA jmp got_secondaryaddress !: @@ -90,8 +90,8 @@ got_devicenumber: // Use it as load address instead // XXX temporary syntax, it would be better to use something // XXX like 'LOAD"FILE",8 TO 49152' - ldx basic_line_number+0 - ldy basic_line_number+1 + ldx LINNUM+0 + ldy LINNUM+1 bne got_loadaddress got_secondaryaddress: diff --git a/c64/basic/cmd_sys.s b/c64/basic/cmd_sys.s index 2ca529d0..0f46f630 100644 --- a/c64/basic/cmd_sys.s +++ b/c64/basic/cmd_sys.s @@ -12,9 +12,9 @@ cmd_sys: // setup call lda #$4C // JMP opcode sta USRPOK - lda basic_line_number+0 + lda LINNUM+0 sta USRADD+0 - lda basic_line_number+1 + lda LINNUM+1 sta USRADD+1 // Setup the register values diff --git a/c64/basic/fac1_mul.s b/c64/basic/fac1_mul.s index 8df97b6a..4b60948f 100644 --- a/c64/basic/fac1_mul.s +++ b/c64/basic/fac1_mul.s @@ -15,13 +15,13 @@ fac1_mul10: jsr fac1_mantissa_mul2 // copy down to BASIC numeric work area at $57 - // (basic_numeric_work_area) + // (TEMPF1) // (We copy all 7 bytes off the FAC1, so that we have // the overflow bits, and the copy is as small as possible) ldx #7 f1m10_l1: lda FAC1_mantissa,x - sta basic_numeric_work_area,x + sta TEMPF1,x dex bpl f1m10_l1 @@ -35,13 +35,13 @@ f1m10_l1: clc f1m10_l2: lda FAC1_mantissa,x - adc basic_numeric_work_area,x + adc TEMPF1,x sta FAC1_mantissa,x inx dey bpl f1m10_l2 lda BITS - adc basic_numeric_work_area+7 + adc TEMPF1+7 sta BITS // Now shift right and increase exponent until overflow diff --git a/c64/basic/injest_number.s b/c64/basic/injest_number.s index 5ed2b3f7..83f7d464 100644 --- a/c64/basic/injest_number.s +++ b/c64/basic/injest_number.s @@ -1,6 +1,6 @@ -// Parse a number from the input buffer at (basic_current_statement_ptr) +// Parse a number from the input buffer at (TXTPTR) // Result is put into FAC1. -// basic_current_statement_ptr is updated with first position after the number. +// TXTPTR is updated with first position after the number. // XXX - Remember decimal position and exponent, and apply them // after to produce normalised floating point number. @@ -20,7 +20,7 @@ ij_not_a_digit: // Look for decimal point cmp #$2e bne ij_not_decimal - lda tokenise_work4 + lda __tokenise_work4 cmp #$ff beq ij_found_decimal // More than one decimal point in a number means we have reached the end of the number @@ -33,7 +33,7 @@ ij_found_decimal: // can do the necessary number of divide by 10s on the final // number. lda #$00 - sta tokenise_work4 + sta __tokenise_work4 jmp ij_consider_next_digit @@ -48,13 +48,13 @@ injest_number: // Clear decimal position flag lda #$ff - sta tokenise_work4 + sta __tokenise_work4 // Check if leading char is a - sign // Note: the - will have been tokenised to $AB // XXX - implement ldy #$00 - lda (basic_current_statement_ptr),y + lda (TXTPTR),y cmp #$AB bne ij_not_minus @@ -67,10 +67,10 @@ injest_number: ij_not_minus: - + ij_loop1: ldy #$00 - lda (basic_current_statement_ptr),y + lda (TXTPTR),y cmp #$30 bcc ij_not_a_digit cmp #$3a @@ -89,7 +89,7 @@ ij_loop1: // If we have seen a decimal point, then we can completely ignore // the digit, as it is contributing not recordable information - lda tokenise_work4 + lda __tokenise_work4 cmp #$ff bne ij_seen_decimal_point @@ -108,7 +108,7 @@ ij_accept_precision: // Get digit ldy #$00 - lda (basic_current_statement_ptr),y + lda (TXTPTR),y sec sbc #$30 diff --git a/c64/basic/pack_word.s b/c64/basic/pack_word.s index 74eca527..b332d8e2 100644 --- a/c64/basic/pack_word.s +++ b/c64/basic/pack_word.s @@ -13,30 +13,30 @@ 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 + // __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. + // __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 + lda __tokenise_work1 bne !+ sec rts !: // Initialise internal variables lda #$00 - sta tokenise_work2 - sta tokenise_work3 + sta __tokenise_work2 + sta __tokenise_work3 pack_char_loop: @@ -56,13 +56,13 @@ pack_char_loop: // either $FE or $FF, depending on whether this is the last // byte or not - lda tokenise_work3 + 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 + lda __tokenise_work1 cmp #$01 beq at_end lda #$FF @@ -80,11 +80,11 @@ output_exception_byte: have_nybl_before_exception_char: // Or existing byte with #$0F, and clear nybl flag - ldy tokenise_work2 + ldy __tokenise_work2 lda $0100,y ora #$0f sta $0100,y - inc tokenise_work2 + inc __tokenise_work2 // FALL THROUGH @@ -92,7 +92,7 @@ write_literal_and_terminate_if_required: // Clear have nybl flag lda #$00 - sta tokenise_work3 + sta __tokenise_work3 lda $0200,x jsr write_unpacked_char @@ -102,7 +102,7 @@ write_literal_and_terminate_if_required: end_string_if_required: // Check if X points to last char of string to be packed inx - lda tokenise_work1 + lda __tokenise_work1 cmp #$01 beq !+ dex @@ -118,10 +118,10 @@ end_string: rts write_unpacked_char: - ldy tokenise_work2 + ldy __tokenise_work2 sta $0100,y iny - sty tokenise_work2 + sty __tokenise_work2 rts not_exception_char: @@ -130,7 +130,7 @@ not_exception_char: bcs whole_byte_symbol // Nybl encoded value: Put in upper half or lower half of a byte? - ldy tokenise_work3 + ldy __tokenise_work3 bne store_low_nybl // Store in high nybl -- so shift it into the hi nybl @@ -138,26 +138,26 @@ not_exception_char: asl asl asl - ldy tokenise_work2 + 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 + ldy __tokenise_work2 ora $0100,y sta $0100,y stored_nybl: // Now toggle the nybl flag - lda tokenise_work3 + lda __tokenise_work3 eor #$ff - sta tokenise_work3 + 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 + inc __tokenise_work2 // Add termination byte if required // (This re-writes the same byte again, which we don't care about) @@ -168,15 +168,15 @@ whole_byte_symbol: // But if we have a nybl to flush, then we handle it like // a full exception character - ldy tokenise_work3 + ldy __tokenise_work3 beq nothing_to_flush // Set low nybl to $F to mark next byte as literal - ldy tokenise_work2 + ldy __tokenise_work2 lda $0100,y ora #$0f sta $0100,y - inc tokenise_work2 + inc __tokenise_work2 jmp write_literal_and_terminate_if_required @@ -190,7 +190,7 @@ nothing_to_flush: consider_next_char: // Pack next char inx - dec tokenise_work1 + dec __tokenise_work1 beq !+ jmp pack_char_loop !: @@ -198,18 +198,18 @@ consider_next_char: // (but leave flag set so the caller knows if the // bottom nybl might be different if the string were // longer). - lda tokenise_work3 + lda __tokenise_work3 beq !+ - inc tokenise_work2 + 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 + ldy __tokenise_work2 iny lda #$00 sta $0100,y - inc tokenise_work2 + inc __tokenise_work2 rts diff --git a/c64/basic/print_packed_message.s b/c64/basic/print_packed_message.s index 49b03f1c..87523ec0 100644 --- a/c64/basic/print_packed_message.s +++ b/c64/basic/print_packed_message.s @@ -57,9 +57,9 @@ print_packed_word: // Setup pointer to packed words lda #packed_message_words - sta temp_string_ptr+1 + sta FRESPC+1 // Find the word in the list ldy #$ff @@ -69,14 +69,14 @@ packed_word_search: beq found_packed_word // $x0 is an end of work marker - lda (temp_string_ptr),y + lda (FRESPC),y and #$0f cmp #$00 bne !+ dex !: // $FE $xx is an end of work marker - lda (temp_string_ptr),y + lda (FRESPC),y cmp #$fe bne !+ dex @@ -90,7 +90,7 @@ packed_word_search: // Advance to next page if required cpy #$ff bne packed_word_search - inc temp_string_ptr+1 + inc FRESPC+1 jmp packed_word_search found_packed_word: @@ -99,11 +99,11 @@ found_packed_word: // Make sure we don't wrap on a page boundary tya clc - adc temp_string_ptr+0 - sta temp_string_ptr+0 - lda temp_string_ptr+1 + adc FRESPC+0 + sta FRESPC+0 + lda FRESPC+1 adc #$00 - sta temp_string_ptr+1 + sta FRESPC+1 print_packed_string: ldy #$ff @@ -113,7 +113,7 @@ next_packed_word_char: iny // Check for end of word - lda (temp_string_ptr),y + lda (FRESPC),y cmp #$00 beq end_of_packed_word cmp #$fe @@ -124,13 +124,13 @@ next_packed_word_char: beq end_of_packed_word // Check if it is an uncommon char - lda (temp_string_ptr),y + lda (FRESPC),y and #$f0 cmp #$f0 beq is_uncommon_char // Is not an uncommon char, so get char of upper nybl - lda (temp_string_ptr),y + lda (FRESPC),y // Put high nybl into low bits of X lsr @@ -150,7 +150,7 @@ next_packed_word_char: // See if there is a char in the low nybl to print pla tay - lda (temp_string_ptr),y + lda (FRESPC),y and #$0f beq end_of_packed_word cmp #$0f @@ -182,7 +182,7 @@ no_lo_nybl_char: // If current byte has $0F in low nybl, then the next // byte is a whole byte. - lda (temp_string_ptr),y + lda (FRESPC),y and #$0f cmp #$0f beq next_is_literal_char @@ -207,7 +207,7 @@ unpack_literal_char: iny tya pha - lda (temp_string_ptr),y + lda (FRESPC),y jsr JCHROUT pla tay @@ -216,7 +216,7 @@ unpack_literal_char: is_uncommon_char: // Lower nybl has offset into low-frequency part of the table - lda (temp_string_ptr),y + lda (FRESPC),y and #$0f clc adc #14 diff --git a/c64/basic/tokenise_line.s b/c64/basic/tokenise_line.s index df2314af..7a642834 100644 --- a/c64/basic/tokenise_line.s +++ b/c64/basic/tokenise_line.s @@ -1,6 +1,6 @@ // Tokenise a line of BASIC // Stored at $0200 -// Length in tokenise_work1 +// Length in __tokenise_work1 tokenise_line: @@ -19,7 +19,7 @@ tokenise_line: sta $0112 sta QTSW - lda tokenise_work1 + lda __tokenise_work1 sta $0113 tokenise_char: @@ -32,11 +32,11 @@ tokenise_char: // End of line reached // Finished tokenising line - // Update tokenise_work1 and terminate with null + // Update __tokenise_work1 and terminate with null ldx $0112 lda #$00 sta $0200,x - stx tokenise_work1 + stx __tokenise_work1 // Clear quote mode flag that is also used by KERNAL for screen display lda #$00 @@ -50,8 +50,8 @@ tokenise_char: 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 + // 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 @@ -88,7 +88,7 @@ tk_might_be_keyword: // Pack string ldx $0110 lda $0111 - sta tokenise_work1 + sta __tokenise_work1 // XXX - We should implement an optimisation where we // trim the last symbol of successively, instead of re-packing the word @@ -97,7 +97,7 @@ tk_might_be_keyword: // that are available. jsr pack_word - lda tokenise_work2 + lda __tokenise_work2 cmp #$10 bcc !+ // Packed string too long @@ -162,31 +162,31 @@ 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 - // load_or_verify_or_tokenise_work5 = temporary work space + // __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 + 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 load_or_verify_or_tokenise_work5 + lda __tokenise_work2 + sta __tokenise_work5 // Load current position - ldy tokenise_work3 - ldx tokenise_work1 + ldy __tokenise_work3 + ldx __tokenise_work1 // Advance offset in compressed token list, and stop at the end - inc tokenise_work3 - lda tokenise_work3 + inc __tokenise_work3 + lda __tokenise_work3 cmp #packed_keyword_table_len bne next_in_match jmp done_searching_for_token @@ -198,8 +198,8 @@ next_in_match: inx iny - dec load_or_verify_or_tokenise_work5 // Have we compared all bytes yet? - + dec __tokenise_work5 // Have we compared all bytes yet? + bne next_in_match // Keyword matches! @@ -212,7 +212,7 @@ next_in_match: // two byte prior is $FE // Get offset of first byte of this token - ldx tokenise_work3 + ldx __tokenise_work3 dex // pointer points one late, so rewind it // At start of list? @@ -233,7 +233,7 @@ next_in_match: jmp next_kw_offset word_boundary: - // Found a token whose offset is in tokenise_work3 + // 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. diff --git a/c64/basic/under_rom_routines.s b/c64/basic/under_rom_routines.s index c06f5d21..09c19675 100644 --- a/c64/basic/under_rom_routines.s +++ b/c64/basic/under_rom_routines.s @@ -66,8 +66,8 @@ memmap_allram_routine: rts shift_mem_up_routine: - // Move memmove_size bytes from memmove_src to memmove_dst, - // where memmove_dst > memmove_src + // Move __memmove_size bytes from __memmove_src to __memmove_dst, + // where __memmove_dst > __memmove_src // This means we have to copy from the back end down. // This routine assumes the pointers are already pointed // to the end of the areas, and that Y is correctly initialised @@ -75,20 +75,20 @@ shift_mem_up_routine: php jsr memmap_allram smu1: - lda (memmove_src),y - sta (memmove_dst),y + lda (__memmove_src),y + sta (__memmove_dst),y dey bne smu1 - dec memmove_src+1 - dec memmove_dst+1 - dec memmove_size+1 + dec __memmove_src+1 + dec __memmove_dst+1 + dec __memmove_size+1 bne smu1 plp jmp memmap_normal shift_mem_down_routine: - // Move memmove_size bytes from memmove_src to memmove_dst, - // where memmove_dst > memmove_src + // Move __memmove_size bytes from __memmove_src to __memmove_dst, + // where __memmove_dst > __memmove_src // This means we have to copy from the back end down. // This routine assumes the pointers are already pointed // to the end of the areas, and that Y is correctly initialised @@ -96,13 +96,13 @@ shift_mem_down_routine: php jsr memmap_allram smd1: - lda (memmove_src),y - sta (memmove_dst),y + lda (__memmove_src),y + sta (__memmove_dst),y iny bne smd1 - inc memmove_src+1 - inc memmove_dst+1 - dec memmove_size+1 + inc __memmove_src+1 + inc __memmove_dst+1 + dec __memmove_size+1 bne smd1 plp jmp memmap_normal @@ -112,41 +112,41 @@ ram_routines_end: #else // CONFIG_MEMORY_MODEL_60K shift_mem_up: - // Move memmove_size bytes from memmove_src to memmove_dst, - // where memmove_dst > memmove_src + // Move __memmove_size bytes from __memmove_src to __memmove_dst, + // where __memmove_dst > __memmove_src // This means we have to copy from the back end down. // This routine assumes the pointers are already pointed // to the end of the areas, and that Y is correctly initialised // to allow the copy to begin. php smu1: - lda (memmove_src),y - sta (memmove_dst),y + lda (__memmove_src),y + sta (__memmove_dst),y dey bne smu1 - dec memmove_src+1 - dec memmove_dst+1 - dec memmove_size+1 + dec __memmove_src+1 + dec __memmove_dst+1 + dec __memmove_size+1 bne smu1 plp rts shift_mem_down: - // Move memmove_size bytes from memmove_src to memmove_dst, - // where memmove_dst > memmove_src + // Move __memmove_size bytes from __memmove_src to __memmove_dst, + // where __memmove_dst > __memmove_src // This means we have to copy from the back end down. // This routine assumes the pointers are already pointed // to the end of the areas, and that Y is correctly initialised // to allow the copy to begin. php smd1: - lda (memmove_src),y - sta (memmove_dst),y + lda (__memmove_src),y + sta (__memmove_dst),y iny bne smd1 - inc memmove_src+1 - inc memmove_dst+1 - dec memmove_size+1 + inc __memmove_src+1 + inc __memmove_dst+1 + dec __memmove_size+1 bne smd1 plp rts diff --git a/c64/basic/wedge_dos.s b/c64/basic/wedge_dos.s index 40650383..679e3a2c 100644 --- a/c64/basic/wedge_dos.s +++ b/c64/basic/wedge_dos.s @@ -16,7 +16,7 @@ wedge_dos: // Check if user asked for a status ldy #$00 - lda (basic_current_statement_ptr), y + lda (TXTPTR), y bne !+ jmp wedge_dos_status // XXX try to optimize this, perhaps move 'wedge_dos_status' above? !: @@ -31,7 +31,7 @@ wedge_dos: cmp #$3A bcs wedge_dos_command // char code after 9 iny - lda (basic_current_statement_ptr), y + lda (TXTPTR), y beq wedge_dos_change_drive // end of buffer cmp #$20 beq wedge_dos_change_drive @@ -64,11 +64,11 @@ wedge_dos_change_drive: // Reuse the line number parser for device number retrieval jsr basic_parse_line_number - lda basic_line_number+1 + lda LINNUM+1 beq !+ jmp do_ILLEGAL_QUANTITY_error !: - lda basic_line_number+0 + lda LINNUM+0 cmp #$08 bpl !+ bcs !+ @@ -226,13 +226,13 @@ wedge_dos_setnam: ldy #$FF !: iny - lda (basic_current_statement_ptr), y + lda (TXTPTR), y bne !- // Set the name to open tya - ldx basic_current_statement_ptr+0 - ldy basic_current_statement_ptr+1 + ldx TXTPTR+0 + ldy TXTPTR+1 jmp JSETNAM #endif // CONFIG_DOS_WEDGE From 58dc012831f49d7dbcbd9e7280180a3e791a0fcf Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sat, 28 Sep 2019 12:24:46 +0200 Subject: [PATCH 26/40] fixed RSSTAT usage conflict --- bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/aliases/,aliases_ram_lowmem.s | 71 +++++++++++++++++++++++++----- c64/kernal/f4a5.load.s | 4 +- c64/kernal/lvs_helpers.s | 2 - c64/kernal/readst.s | 3 +- c64/kernal/scnkey.s | 19 -------- c64/kernal/vector_real.s | 11 +++-- 10 files changed, 68 insertions(+), 42 deletions(-) diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index fb2f7c1915b6c3f86dbdd2b2de2684014bfa7eb6..1a3e9780e91b94c6f7e382837f4e961c336fe256 100644 GIT binary patch delta 51 zcmZp0XmHrDi-oE0-{w6m%*=v)|D1wc9laTrTAlp=fnNbAe1V-ujNSSF(hUmE|2IFD Hm1P0|FYFb_ delta 51 zcmZp0XmHrDi-k$y+vYti%*=uc-<*P69laTrTAlp=fnNbAe1V-ujQ#4jr5hBke%t(5 HR+b3>4HXr5 diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 8868de5b9709b4c9a095b598049029b485875ffe..8b262ddfe7fef2b1bd83190127238ef71b0ffbe5 100644 GIT binary patch delta 1422 zcmYjRUrbY17{B*iN()*k)Y1xKKN-=2V`0NZmYD%jp^`J0hz4KGjb@=U@UX>2_A+s? z%&8@nV>V9rr>>{Ye>V&DCCNlq(Y{I<%(9!qQZ%Q|IgAfJyKEn@>$>4l6xw8Xlo0ZL%wH9T zykEjH?2JKA5)_GA$R^Dm)RQDN8f@0cE+^tMaa-h6Tof9}_nKY1#fcCKb6$lP-Mp^- z;&ktn$LiJwwsO~|{F*ycH@0$@46kfFS=Q7e=Q!Duy^EIP&li7(5yfqSg@ny9;ux*r zHxQna$fwzJ?2luOTErRVWOy$|3p8-}@hUxd>_jfB)dPysj$TJ|7O=cZI`TW%O7bwj zitX<&0JekdEcn7o57`cta-a)^_;5BP*6>7Bv)~+tgU|dN^pilrIkYa5cZ^4xC_Tu+ zgOFxP48V)k6klMJ@YgZ5Z74~oj3wOJ@Xs3E;b@eyBxuFqCg-p}o05iSVk&7f#xiY+ zZQ8{v6%i8#*V1&c7($Zv@!!weF7l#a`(3jL7JyhR%z<#*75gJ-rf$=cYKSgrx z{0zS-4{(R1x~+>OlCQcRKh%1-;RJPM@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-06|q?s>iJ`oy~nL^obLL*7g%e)9=Ugb8-n{*y4t7VInJ_vx^~>m{l%)hxz@gfU=- zi8Rhq8W8^Uk}o$=7pXIomz2edP(t#O;;)kYjXK%knijP5)|~8!rUS+5KB9|&$f|Y~ zkfe4N5U6_#s7c*ZK&|TT0@|ehwusoa+In>CuKm$|EF-Ifq?II=$l)UIAaS|q{)~$r z%S47tT>`6g?7(+*(BWA(mc*S{GhcUyp8;EXl?{|5-C|vKKf$447W>0G;ViS%IfZWa zYaIv@J5|?!9>aC<%Kwsnd!R`PUBPdIW%+pMDn94a^*^kVIju_3o16}E+LNY#Bx!n% c24|^{(+4v&&gs1*-NK^v+e{h0_2bIaX98lJ7XSbN delta 944 zcmYk5ZAep57{~8DcXOM$TAF&7P9KX(tw@rf2-Ku-#Gx0n7b)oWLS4d&BC3xIT#+)- zPGB!2vbIR!#)bKz6-o9XxAa7!i`zXOjvAesd$@ekzr$#;2Ge^(yYb2gEVG+=f?vL zCM4tyO~9H-w!y6D>{b(0(>~69S-vgzXB*EOLW(Vy=q68t*p0|WwNCJ5^?AT~th!2sWc||Be z$@sj(wFhZfXyIJYnuH5UXiLJmFOjurlU z8VVbfZY23TC9jt;Vt#Qsh2)giBbvp(5J^zujz;?z!UP&zLp;)zwE`%NUV?Zc#y)6RtOp& zHhN9)B*w0h?d3Z>Xr>Z$0oTVrLM3Y2XbRjxE@#@Uku2lp zxQyj^pey?jPx2ib*tG3-xR+Pc)KJI&z9{=5jM9hS-npz@X`AyjOrdO&@nbl_MXV)t z{6Vs*1o%R7yrhg}bd@~I|2)xa_m)fktL()XtRCvW#)kYv>B2=d6cE`zCP@#m^%+L~(-Rog`SgF3UDu`(r`$4|2ApEdT%j diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 571c7efbd62559f0a3289cf323f1ebc8e383d04a..65ec49a3a98dcb4cdc55dce72fe26c7011c6d773 100644 GIT binary patch delta 1089 zcmYjQUrbw77{B-2mI52lF=}twN{>jeC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mz=&{Y-DuXO1l+rt=1}az z4#=Luk9EB3ag+2mI7qT*Ku*wX(D4tNGpzR;fiQ-%9q)ke3wY<&gClMd0aRNdRBg>r zvhc5B9l^7k=)HRV(7iz|xL%0Zpq0=+JZ!+)nrv4R`=mtL2A6(AizWO--*%farME*j zHnx7pDtNxL7u+QHm(Jtn{m<3vhWYQ9ZUvR7X8%3Pi&9MB;b$d$)akX;np+`F7v}Jtx+)`rs^Cj~N z-4dYMqL6dcAJi;RH~(|(J|(jC1{Yd!7#eq5D+|;we5`xd3qxgipoo4dQVyv(rYp@5 z{YWC#ZJ%E5^L%nP_R+-T)bz*yKOdG7Xz%LS-Jr^Itu9Wth^Ki@L?fGc-sG-SFbq zU0rMlkGY;5jaHI1DJi9-FXY-KkdHGLx%@>Y|0kQ*_Mv1Y$%Ml|W%GV6$7)vD4nvh3 z&{|~nQW!j7oK6R4-3)moXQ3g$3~728VluRj`JR3@il6T}GxBCdZc<+cItM9os7D%z zS6^x%s2*-0pL(c)2GoNM6i^S;5hgtzs@UDT%LS`J^#T|G+LmC_621UL5w%xE1gn`3 zTE1kl(|!E$4I-Np)9PSp1SKNGnT1)s{mNIj7G`;k4bV-XQy1&|w(XCNxJ&j4cjemj z7)?Lr>G$p?sLMca6C@GzR0W+YpvoE=DWg$>7K=zB=q5pLZQ?o4(~tT{JTEf>!`vY! IYuk-~0i@dVMgRZ+ diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 1866304e..70df9d2c 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -104,17 +104,45 @@ .label CNTDN = $A5 // -- NOT IMPLEMENTED -- .label BUFPNT = $A6 // -- NOT IMPLEMENTED -- .label INBIT = $A7 // -- NOT IMPLEMENTED -- - .label BITCI = $A8 // -- NOT IMPLEMENTED -- - .label RINONE = $A9 // -- NOT IMPLEMENTED -- - .label RIDDATA = $AA // -- NOT IMPLEMENTED -- - .label RIPRTY = $AB // -- NOT IMPLEMENTED -- + +// #if CONFIG_EXTENDED_SCNKEY + + // Reuse RS232 variables, since they should not be used by other things. + // Carefully avoid $A7 which is used by 64NET + .label KeyQuantity = $A8 // 1 byte + .label BufferNew = $A9 // 3 bytes + +// #endif // CONFIG_EXTENDED_SCNKEY +// .label BITCI = $A8 // -- NOT IMPLEMENTED -- +// .label RINONE = $A9 // -- NOT IMPLEMENTED -- +// .label RIDDATA = $AA // -- NOT IMPLEMENTED -- +// .label RIPRTY = $AB // -- NOT IMPLEMENTED -- + .label SAL = $AC // $AC-$AD -- NOT IMPLEMENTED -- (implemented screen part) .label EAL = $AE // $AE-$AF -- NOT IMPLEMENTED -- [!] used also by screen editor, for temporary color storage when scrolling .label CMP0 = $B0 // $B0-$B1 temporary tape storage, [!] here used for BRK instruction address .label TAPE1 = $B2 // $B2-$B3 tape buffer pointer - .label BITTS = $B4 // -- NOT IMPLEMENTED -- + +// #if CONFIG_EXTENDED_SCNKEY + + // Reuse RS232 variables, since they should not be used by other things. + // This one should be initialized in cinit to $FF + .label BufferQuantity = $B4 // 1 byte + +// #endif // CONFIG_EXTENDED_SCNKEY +// .label BITTS = $B4 // -- NOT IMPLEMENTED -- + .label NXTBIT = $B5 // -- NOT IMPLEMENTED -- - .label RODATA = $B6 // -- NOT IMPLEMENTED -- + +// #if CONFIG_EXTENDED_SCNKEY + + // Reuse RS232 variables, since they should not be used by other things. + // Carefully avoiding $A7 which is used by 64NET + .label TempZP = $B6 // 1 byte + +// #endif // CONFIG_EXTENDED_SCNKEY +// .label RODATA = $B6 // -- NOT IMPLEMENTED -- + .label FNLEN = $B7 // current file name length .label LA = $B8 // current logical_file number .label SA = $B9 // current secondary address @@ -163,6 +191,15 @@ // .label BUF = $200 // $200-$250, BASIC line editor input buffer (81 bytes) + +// #if CONFIG_EXTENDED_SCNKEY + + // $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20 + // and not used on C64, so safe for us to use, probably. + .label ScanResult = $250 // 8 bytes + +// #endif // CONFIG_EXTENDED_SCNKEY + // [!] XXX document $251-$258 usage .label LAT = $259 // $259-$262, logical file numbers (table, 10 bytes) .label FAT = $263 // $263-$26C, device numbers (table, 10 bytes) @@ -183,12 +220,22 @@ .label KEYLOG = $28F // $28F-$290 routine to setup keyboard decoding .label MODE = $291 // flag, is case switch allowed .label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable - .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 - .label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551 - .label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551 - .label RSSTAT = $297 // -- NOT IMPLEMENTED -- mock 6551, RS-232 status - .label BITNUM = $298 // -- NOT IMPLEMENTED -- - .label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED -- + +// #if CONFIG_EXTENDED_SCNKEY + + // Reuse RS232 variables, since they should not be used by other things. + // This one should be initialized in cinit to $FF + .label BufferOld = $293 // 3 bytes + .label Buffer = $297 // 4 bytes + +// #endif // CONFIG_EXTENDED_SCNKEY +// .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 +// .label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551 +// .label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551 +// .label RSSTAT = $297 // -- NOT IMPLEMENTED -- mock 6551, RS-232 status +// .label BITNUM = $298 // -- NOT IMPLEMENTED -- +// .label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED -- + .label RIDBE = $29B // -- NOT IMPLEMENTED -- .label RIDBS = $29C // -- NOT IMPLEMENTED -- .label RODBS = $29D // -- NOT IMPLEMENTED -- diff --git a/c64/kernal/f4a5.load.s b/c64/kernal/f4a5.load.s index 87e43c10..e1cccc1d 100644 --- a/c64/kernal/f4a5.load.s +++ b/c64/kernal/f4a5.load.s @@ -97,7 +97,7 @@ LOAD: // Get load address and store it if secondary address is zero jsr iec_rx_byte bcc !+ - jmp lvs_file_not_found_error // XXX deduplicate with other jumps in this routine + jmp kernalerror_FILE_NOT_FOUND // XXX deduplicate with other jumps in this routine !: ldx SA beq !+ @@ -105,7 +105,7 @@ LOAD: !: jsr iec_rx_byte bcc !+ - jmp lvs_file_not_found_error // XXX deduplicate with other jumps in this routine + jmp kernalerror_FILE_NOT_FOUND // XXX deduplicate with other jumps in this routine !: ldx SA beq !+ diff --git a/c64/kernal/lvs_helpers.s b/c64/kernal/lvs_helpers.s index b4984825..ef47ebf4 100644 --- a/c64/kernal/lvs_helpers.s +++ b/c64/kernal/lvs_helpers.s @@ -164,8 +164,6 @@ lvs_illegal_device_number: jsr kernalstatus_DEVICE_NOT_FOUND jmp kernalerror_ILLEGAL_DEVICE_NUMBER -.label lvs_file_not_found_error = kernalerror_FILE_NOT_FOUND - lvs_load_verify_error: // XXX should we really return BASIC error code here? lda VERCKK diff --git a/c64/kernal/readst.s b/c64/kernal/readst.s index cb313166..10a7d11f 100644 --- a/c64/kernal/readst.s +++ b/c64/kernal/readst.s @@ -18,7 +18,8 @@ READST: // This is RS-232 device - according to 'Compute's Mapping the Commodore 64' page 239 // it reads status from RSSTAT - lda RSSTAT + // XXX 'lda RSSTAT' not possible due to extended scnkey, fix it! + lda #$FF rts !: // According to 'Compute's Mapping the Commodore 64' page 239, it usually retrieves diff --git a/c64/kernal/scnkey.s b/c64/kernal/scnkey.s index f4468cb2..ac22a7ca 100644 --- a/c64/kernal/scnkey.s +++ b/c64/kernal/scnkey.s @@ -46,25 +46,6 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - // // ZERO PAGE Varibles - // $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20 - // and not used on C64, so safe for us to use, probably. - // (Compute's Mapping the 64 p51) - .label ScanResult = $250 // 8 bytes - // Other variables are in RS232 ZP locations for now - // (Carefully avoiding $A7 which is used by 64NET) - .label BufferNew = $A9 // 3 bytes - .label KeyQuantity = $A8 // 1 byte - .label TempZP = $B6 // 1 byte - - // Reuse RS232 variables, since they should not be used - // by other things - // These are initialised in cinit all to $FF - .label BufferOld = $293 // 3 bytes - .label Buffer = $297 // 4 bytes - .label BufferQuantity = $B4 // 1 byte - - // Operational Variables .const MaxKeyRollover = 3 diff --git a/c64/kernal/vector_real.s b/c64/kernal/vector_real.s index ed6640fa..b3540f9c 100644 --- a/c64/kernal/vector_real.s +++ b/c64/kernal/vector_real.s @@ -1,10 +1,9 @@ vector_real: - // Temporary storage location - checked on real C64 that this is the + // Use MEMUSS as temporary storage location - checked on real C64 that this is the // address originally used; after calling VECTOR and checking zero page // area afterwards, the address could be found there - .label _caller_arr_ptr = MEMUSS // According to 'Compute's Mapping the Commodore 64' page 237, // the CBM implementation does not disable IRQs - yet, the @@ -17,20 +16,20 @@ vector_real: // Prepare the user data pointer - strange order to reduce risk // of potential similarity to the original routine - sty _caller_arr_ptr + 1 - stx _caller_arr_ptr + 0 + sty MEMUSS + 1 + stx MEMUSS + 0 // Select routine variant - store or restore vectors ldy #$1F bcc vector_restore lda CINV, y - sta (_caller_arr_ptr), y + sta (MEMUSS), y bcs vector_end_loop // branch always vector_restore: - lda (_caller_arr_ptr), y + lda (MEMUSS), y sta CINV, y // FALLTROUGH From d17b5f9cdecf441b8111bdb880cfe27321b7f076 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 29 Sep 2019 21:02:45 +0200 Subject: [PATCH 27/40] fixed 'BYTES FREE' value --- STATUS.md | 2 +- c64/basic/basic_cold_start.s | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/STATUS.md b/STATUS.md index 8c9e16db..472daf2b 100644 --- a/STATUS.md +++ b/STATUS.md @@ -5,7 +5,7 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8 * improved keyboard scanning, supports multi-key roll-over and rejection of spurious joystick input * joystick (port 1) can be used to move text cursor -* uses RAM under ROM and I/O: 61436 bytes free +* uses RAM under ROM and I/O: 61438 bytes free * cold/warm start silences multiple SID chips - all $D4xx and $D5xx addresses * wark start due to BRK prints out the instruction address * extended `LOAD` command diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 01928aef..ed3dbe46 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -43,10 +43,10 @@ basic_cold_start: jsr basic_do_new lda basic_top_of_memory_ptr+0 sec - sbc basic_end_of_text_ptr+0 + sbc basic_start_of_text_ptr+0 tax lda basic_top_of_memory_ptr+1 - sbc basic_end_of_text_ptr+1 + sbc basic_start_of_text_ptr+1 jsr print_integer From 9fd0297e519530d6c9308bf637be70f942d5896d Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 29 Sep 2019 22:09:33 +0200 Subject: [PATCH 28/40] added temporary handling of double LOAD/SAVE entries in Kernal --- Makefile | 2 +- STATUS.md | 6 ++++-- bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/basic_mega65.rom | Bin 8192 -> 8192 bytes bin/basic_ultimate64.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/kernal/f49e.interop | 2 ++ c64/kernal/f49e.load_int.s | 13 +++++++++++++ c64/kernal/f5dd.interop | 2 ++ c64/kernal/f5dd.save_int.s | 12 ++++++++++++ c64/kernal/jumptable/ffd5.jload.s | 2 +- c64/kernal/jumptable/ffd8.jsave.s | 2 +- 14 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 c64/kernal/f49e.interop create mode 100644 c64/kernal/f49e.load_int.s create mode 100644 c64/kernal/f5dd.interop create mode 100644 c64/kernal/f5dd.save_int.s diff --git a/Makefile b/Makefile index d4751fce..afec2b7e 100644 --- a/Makefile +++ b/Makefile @@ -189,7 +189,7 @@ test_mega65: build/kernal_mega65.rom build/basic_mega65.rom build/symbols_mega65 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 -8 empty.d64 -test_m65: build/newc65 +test_m65: build/newc65.rom m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65.rom -4 testremote: build/kernal_generic.rom build/basic_generic.rom build/symbols_generic.vs diff --git a/STATUS.md b/STATUS.md index 472daf2b..9c26e41b 100644 --- a/STATUS.md +++ b/STATUS.md @@ -126,8 +126,10 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFCC` | `$F333` | `CLRCHN` | DONE | | | `$FFCF` | `$F157` | `CHRIN` | PARTIAL | | | `$FFD2` | `$F1CA` | `CHROUT` | PARTIAL | | -| `$FFD5` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support, no STOP key, check $F49E addr | -| `$FFD8` | `$F5ED` | `SAVE` | NOT DONE | check $F5DD location | +| `$FFD5` | `$F49E` | `LOAD` | PARTIAL | not yet clear what's this entry doing | +| `($0330)` | `$F4A5` | `LOAD` | PARTIAL | no VERIFY support, no STOP key, check $F49E addr | +| `$FFD8` | `$F5DD` | `SAVE` | NOT DONE | | +| `($0332)` | `$F5ED` | `SAVE` | NOT DONE | | | `$FFDB` | | `SETTIM` | DONE | | | `$FFDE` | | `RDTIM` | DONE | | | `$FFE1` | `$F6ED` | `STOP` | DONE | | diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 1a3e9780e91b94c6f7e382837f4e961c336fe256..f1d719c8d8b0a08dccdd5716d66b190fdfba521d 100644 GIT binary patch delta 19 bcmZp0XmHqYmxWDx)l!S6I-4J}$VvkMP&Nmx delta 19 bcmZp0XmHqYmxWDt)l!S6dYd1!$VvkMP*?}C diff --git a/bin/basic_mega65.rom b/bin/basic_mega65.rom index f992e1d8130f73ccb117f79d784e5e97fde3e914..e12993d3c5ef1183c4009fc561bad6ad673d22db 100644 GIT binary patch delta 43 zcmV+`0M!40K!8B7egzSZ{z6hkK}!IoI?4a=4rLZ7F|Fbg(%@~uI B62AZd delta 43 zcmV+`0M!40K!8B7egzRA_CiucK}!IoI?4a=4 B66F8@ diff --git a/bin/basic_ultimate64.rom b/bin/basic_ultimate64.rom index bbeab1f391903479d4a14cceaa3fad92ef7fbfba..a870b4ac262af372a8394c776d09ce493f3e8475 100644 GIT binary patch delta 61 zcmV-D0K)%(K!8B7q67y+|D~`XL;sVh1o{Gw{*$EzGX^WFr8wm*v)%>a0TGV=LQ+LR TO8})h$^Y;VAdddC&<8LWR_hyf delta 61 zcmV-D0K)%(K!8B7q67!k_NA~O)%KIA1o{FX_LHRrGX^cHr8wm-v)%>a0TCefLQ+LR TO8})h$^Y;VARzX$&<8LWZCo2F diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 8b262ddfe7fef2b1bd83190127238ef71b0ffbe5..d5c4c797b52ebe04da2ab04b51cefff58d4604f9 100644 GIT binary patch delta 1646 zcmYjReN0nV6z_YlAAo|bd_55CWs6(O%p{_*#w8METJ^^Gv6;Ed?Iy(8C}!C(kw2En zBCi?+QoT5pIagl#3}x%m1rt}8e}KeT6U@tqpM&8RVTqag`uf^uVbI-6VKHfXf9JgW z&ikEne&;mRG}VNMjd>x%Xf|jyj5=SCKZFn1>Ts>8rYxQGmxvDJmfB^@L_6;h&LJM$ z(I?s=9>;zYze4JbvN9J;Bguzo3@eQ>Mq_k?YW);w(1VYK0H}Qm>U1y^!+)C&f>J$f zlkS7Aw6736o_2V;Jl!rdkDyn>pPTQp?<9KM7KSV6(!ts|iEQQISPV4H@bIqQvoGhl zc~fuF!=v0ZM}7#dO8Rq7TBj*f#pogwJ?NDCf;+1bJW|P9z@~~e5~b3*=(enbiZ~d4 z0zRbi@B-6Y$A+JH972E+kpet|8z%sY1=mA87BmR$)XgJMtj-%SsRCB@ad1-2R%Vk6 zbFfZFQLE1!MGEUeBnC`S(o>nDIP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4^5ANym?-ZI}<$1B+fQhaOym2oa8j^ZVn zv&#J)>tz~*@kRhoV8bR|ry3rq10L#Dy=NkR91h1b$QQ_|V$!9ps!K=7-fu{{zzr^vqqdI(ASOfl2c;VogR#BCO~g5lJCd#dU2qcR7;LZ-3z}lkymX3m{Y* z?c1$grqD;i++`u%MmSHC=v4UTjmz*RwMov@eIU2<=u z?^7z$SFL!!wB{bz=nS(d z_MN0aA+Xf;4-=Nwz9V5Fdv(In+p7{*p?!P8DzE2C)86+r+VfdJsPj$yuUiHD(S5Hlg z0j52W{WQX6g1bOH3nYOS1mQElSAhtVF~5Wa0awmnT%Rsc@S|Vg# zJ&I!Jl?9XdNL1EXN*!C&q_7dK1MHe6g`OTA02a%n(LoP|*MSDOv+BhNh0?1l%BsqZ zo3?I58!D?15lcEVmK3ye6W@)>$SID2X$a_@6;+$cHtYg8fm0;egDcC{%UiI~hN{Xf z=q-X91o3eL82-+x2jswx%KzLDV-9C6)!;FoEr-?9T!%dADHs%7CtAWB%wM$FC}K?j zUlj2P5!Z%slMjbOxGRXyi1>~l-xl$Z55LDa^K}K>IDRpKXNWjUtkF|71ys#)3hxQv UJrb@C*t{%36U3BQGO;l5FQ~?ih5!Hn diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 65ec49a3a98dcb4cdc55dce72fe26c7011c6d773..8b59fe0892c66ac4de153037cac97a540f561d69 100644 GIT binary patch delta 1726 zcmYjSZA?>F7{0x?rND-?2=szLkIav@*&>QgmMsw@O3^cM1&x?(xrM1Cw2 zleRMoqMv4Q1<6gUKu^2_G|-#I2d}BO64sSbn$4 zy5hO81Xjnu-6!B$1ZPlTUNdeM&~p#KsO&BShodI@sC}$~S+<}{M4#o|Bj1USTeT`m z=aax&G2BZ>!ADWtVZ5VI$Sa;m*lDInrtpV>n-l1ezNUTsdcn!E1re{Gg9mU{Gzz29*cdN~}hF z>naRI@F*E#!g=852%Hc!SqK6Y=t9AgW2*1b#+A117%UQ>J{iei#s$IO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P7DdVQD1Tfi%m~y=z)L>d)xsU5YxKsFj*0OQp5fOp ze_gomZDoS_p%39w76#Fa|eeKVc_mK)-0OgSHPJ7y(odm|urj z(kQ{D6d%a^PQBz&WPS&C+@HduH%S;f6HOxzmrh3-!;WNTelmu0B+~B}7{@TYZH>S` zsf?pZf|D6Bu$+;>5{Y-3>x93dT$aaNe56e}eXjn~yn8c;1!jKK ziNk+5aMY+TrH3o5wm=*vv@jYc=i)&oR0?QMx!`Ixh8{UAI7`h11DUWRnVnN-lbO}< zha~e>#i^-sk%2#=Q+Xu3ERTZ2M3X0DuDlLilB1H|JZq}_IILy2`ZBxkp)Nveii?=# zG1^ePcv(0J>%;f}-!2{?{-{%3_T$Nl${+S0?LO9Xy!S-gJ*(Hi<{Mc-Wp6RCcG8d< z`mOkLW$n)i{+y8SQuvQCur_hy+PP4S3ra$z)!WIKwS#tZZTXzU;N>|lg=ziQpMS>) z>Qk-E_;t>u-QiDP0vnJb%Ng6}Eb7 zw#OrDHOkm+oh_=|0#VI@Bjb+ diff --git a/c64/kernal/f49e.interop b/c64/kernal/f49e.interop new file mode 100644 index 00000000..e3e2a1b3 --- /dev/null +++ b/c64/kernal/f49e.interop @@ -0,0 +1,2 @@ +This is a well-known address of a heavily used Kernal routine, it has to be the same so our ROM is compatible. + diff --git a/c64/kernal/f49e.load_int.s b/c64/kernal/f49e.load_int.s new file mode 100644 index 00000000..837d896c --- /dev/null +++ b/c64/kernal/f49e.load_int.s @@ -0,0 +1,13 @@ + +// +// XXX Note: something unusual was done with LOAD routine - although the vector at $330 points to $F4A5, +// the Kernal jump table points to $F49E (see also Mapping the C64, page 76). By experimenting +// I have already discovered that $F4A5 performs indirect jump via ($0330) vector, but it must +// be doing a little bit more - not sure yet, what. Something similar is done with SAVE. +// +// This has to be clarified. +// + +LOAD_INT: + jmp (ILOAD) + diff --git a/c64/kernal/f5dd.interop b/c64/kernal/f5dd.interop new file mode 100644 index 00000000..e3e2a1b3 --- /dev/null +++ b/c64/kernal/f5dd.interop @@ -0,0 +1,2 @@ +This is a well-known address of a heavily used Kernal routine, it has to be the same so our ROM is compatible. + diff --git a/c64/kernal/f5dd.save_int.s b/c64/kernal/f5dd.save_int.s new file mode 100644 index 00000000..7ef54a41 --- /dev/null +++ b/c64/kernal/f5dd.save_int.s @@ -0,0 +1,12 @@ + +// +// XXX Note: something unusual was done with LOAD routine - although the vector at $330 points to $F4A5, +// the Kernal jump table points to $F49E (see also Mapping the C64, page 76). By experimenting +// I have already discovered that $F4A5 performs indirect jump via ($0330) vector, but it must +// be doing a little bit more - not sure yet, what. Something similar is done with SAVE. +// +// This has to be clarified. +// + +SAVE_INT: + jmp (ISAVE) diff --git a/c64/kernal/jumptable/ffd5.jload.s b/c64/kernal/jumptable/ffd5.jload.s index b632434d..ef66f320 100644 --- a/c64/kernal/jumptable/ffd5.jload.s +++ b/c64/kernal/jumptable/ffd5.jload.s @@ -1,4 +1,4 @@ // load RAM from a device // C64 Programmer's Reference Guide Page 272 - jmp LOAD + jmp LOAD_INT diff --git a/c64/kernal/jumptable/ffd8.jsave.s b/c64/kernal/jumptable/ffd8.jsave.s index 1ac529e4..1213f478 100644 --- a/c64/kernal/jumptable/ffd8.jsave.s +++ b/c64/kernal/jumptable/ffd8.jsave.s @@ -1,4 +1,4 @@ // SAVE RAM to device // C64 Programmer's Reference Guide Page 273 - jmp SAVE + jmp SAVE_INT From c3cbfcebfb96306deade2ad208bd6bf0f1a143be Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 2 Oct 2019 22:35:36 +0200 Subject: [PATCH 29/40] all label naming conflicts resolved --- c64/aliases/,aliases_ram_lowmem.s | 2 +- c64/basic/,aliases.s | 17 ------ c64/basic/basic_cold_start.s | 8 +-- c64/basic/basic_delete_line.s | 22 ++++---- c64/basic/basic_execute_line.s | 36 ++++++------- c64/basic/basic_find_line.s | 24 ++++----- c64/basic/basic_find_next_line.s | 12 ++--- c64/basic/basic_follow_link_to_next_line.s | 10 ++-- c64/basic/basic_insert_line.s | 30 +++++------ c64/basic/basic_main_loop.s | 6 +-- c64/basic/basic_shift_mem_down.s | 34 ++++++------ c64/basic/basic_shift_mem_up.s | 52 +++++++++--------- c64/basic/cmd_break.s | 11 ++-- c64/basic/cmd_list.s | 22 ++++---- c64/basic/cmd_load.s | 54 +++++++++---------- c64/basic/cmd_new.s | 40 +++++++------- c64/basic/cmd_run.s | 12 ++--- c64/basic/do_basic_error.s | 14 ++--- c64/basic/injest_number.s | 5 +- c64/basic/peek_line_pointer_null_check.s | 6 +-- c64/basic/under_rom_routines.s | 8 +-- c64/basic/wedge_dos.s | 6 +-- .../,target_ultimate64/,aliases_ultimate64.s | 6 +-- c64/kernal/chrout_real.s | 17 +++--- c64/kernal/jumptable/fff3.jiobase.s | 2 +- c64/kernal/udtim.s | 9 ++-- c64/kernal/under_rom_routines.s | 8 +-- 27 files changed, 222 insertions(+), 251 deletions(-) diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 70df9d2c..8a90a931 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -73,7 +73,7 @@ .label ARISGN = $6F // -- NOT IMPLEMENTED -- .label FACOV = $70 // FAC1 low order mantissa - .label FBUFPT = $67 // $71-$72 -- NOT IMPLEMENTED -- + .label FBUFPT = $71 // $71-$72 -- NOT IMPLEMENTED -- .label CHRGET = $73 // $73-$8A -- NOT IMPLEMENTED -- .label TXTPTR = $7A // $7A-$7B current BASIC statement pointer .label RNDX = $8B // $8B-$8F -- NOT IMPLEMENTED -- diff --git a/c64/basic/,aliases.s b/c64/basic/,aliases.s index d926afe1..2726f748 100644 --- a/c64/basic/,aliases.s +++ b/c64/basic/,aliases.s @@ -16,20 +16,3 @@ .label __memmove_src = $69 .label __memmove_dst = $6B .label __memmove_size = $6D - -// XXX cleanup lines below - - // The various pointers that separate memory regions for BASIC storage - // We have multiple names for the ones that mark the boundary of regions. - .label basic_start_of_text_ptr = $2b - .label basic_end_of_text_ptr = $2d - .label basic_start_of_vars_ptr = $2d - .label basic_end_of_vars_ptr = $2f - .label basic_start_of_arrays_ptr = $2f - .label basic_end_of_arrays_ptr = $31 - .label basic_start_of_free_space_ptr = $31 - .label basic_start_of_strings_ptr = $33 - .label basic_top_of_memory_ptr = $37 - .label basic_current_line_number = $39 - .label basic_previous_line_number = $3b - .label basic_current_line_ptr = $3d diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index ed3dbe46..c77ad42a 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -41,12 +41,12 @@ basic_cold_start: // Work out free bytes, display them jsr basic_do_new - lda basic_top_of_memory_ptr+0 + lda MEMSIZ+0 sec - sbc basic_start_of_text_ptr+0 + sbc TXTTAB+0 tax - lda basic_top_of_memory_ptr+1 - sbc basic_start_of_text_ptr+1 + lda MEMSIZ+1 + sbc TXTTAB+1 jsr print_integer diff --git a/c64/basic/basic_delete_line.s b/c64/basic/basic_delete_line.s index 00c2051a..33a3d5b5 100644 --- a/c64/basic/basic_delete_line.s +++ b/c64/basic/basic_delete_line.s @@ -9,18 +9,18 @@ basic_delete_line: // jsr printf // .text "DELETING LINE AT $" - // .byte $f1,basic_current_line_ptr - // .byte $f0,basic_current_line_ptr + // .byte $f1,OLDTXT + // .byte $f0,OLDTXT // .byte $0d,0 // Get address of next line ldy #0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_current_line_ptr - // .byte $f0,basic_current_line_ptr + // .byte $f1,OLDTXT + // .byte $f0,OLDTXT // .text ", STATEMENT PTR = $" // .byte $f1,TXTPTR // .byte $f0,TXTPTR @@ -119,7 +119,7 @@ not_a_token: // BASIC programmers should implement communication with drives // the standard way, handling channels properly. Besides, // current implementation does not support characters under ROM - ldx basic_current_line_number+1 + ldx CURLIN+1 cpx #$ff bne !+ // We are in direct mode, allow wedge to handle '@' sign @@ -175,7 +175,7 @@ basic_end_of_line: // one. // Are we in direct mode - lda basic_current_line_number+1 + lda CURLIN+1 cmp #$ff bne basic_not_direct_mode @@ -184,17 +184,17 @@ basic_end_of_line: basic_not_direct_mode: // Copy line number to previous line number - lda basic_current_line_number+0 - sta basic_previous_line_number+0 - lda basic_current_line_number+1 - sta basic_previous_line_number+1 + 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 basic_current_line_ptr+0 - ora basic_current_line_ptr+1 + lda OLDTXT+0 + ora OLDTXT+1 bne basic_execute_from_current_line // End of program found @@ -210,33 +210,33 @@ basic_execute_from_current_line: jmp basic_main_loop !: // Skip pointer and line number to get address of first statement - lda basic_current_line_ptr+0 + lda OLDTXT+0 clc adc #4 sta TXTPTR+0 - lda basic_current_line_ptr+1 + lda OLDTXT+1 adc #0 sta TXTPTR+1 ldy #2 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_current_line_ptr - // .byte $f0,basic_current_line_ptr + // .byte $f1,OLDTXT + // .byte $f0,OLDTXT // .byte $0d,0 - lda basic_current_line_ptr+0 + lda OLDTXT+0 pha - lda basic_current_line_ptr+1 + lda OLDTXT+1 pha @@ -44,27 +44,27 @@ basic_insert_line: // Now increase top of BASIC mem pla clc - adc basic_end_of_text_ptr+0 - sta basic_end_of_text_ptr+0 - lda basic_end_of_text_ptr+1 + adc VARTAB+0 + sta VARTAB+0 + lda VARTAB+1 adc #0 - sta basic_end_of_text_ptr+1 + sta VARTAB+1 // Get pointer back pla - sta basic_current_line_ptr+1 + sta OLDTXT+1 pla - sta basic_current_line_ptr+0 + sta OLDTXT+0 // Write the line number ldy #2 lda LINNUM+0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_end_of_text_ptr - // .byte $f0,basic_end_of_text_ptr + // .byte $f1,VARTAB + // .byte $f0,VARTAB // .byte $0d // .text "SHIFTING DOWN $" // .byte $f1,<__memmove_size,>__memmove_size @@ -116,10 +116,10 @@ relink_down_next_line: ldy #0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_end_of_text_ptr - // .byte $f0,basic_end_of_text_ptr + // .byte $f1,VARTAB + // .byte $f0,VARTAB // .byte $0d // .text "SHIFTING UP $" // .byte $f1,<__memmove_size,>__memmove_size @@ -106,22 +106,22 @@ basic_shift_mem_up_and_relink: // to make it end up pointing to the next line ldy #0 - lda basic_current_line_ptr+0 + lda OLDTXT+0 #if CONFIG_MEMORY_MODEL_60K - ldx #basic_end_of_text_ptr - // .byte $f0,basic_end_of_text_ptr + // .byte $f1,VARTAB + // .byte $f0,VARTAB // .text $d," BEFORE = $" // .byte $f1,<__memmove_dst,>__memmove_dst // .byte $f0,<__memmove_dst,>__memmove_dst @@ -175,10 +175,10 @@ relink_up_next_line: lda __memmove_src+0 #if CONFIG_MEMORY_MODEL_60K - ldx #$0801 - sta basic_start_of_text_ptr+1 - sta basic_start_of_vars_ptr+1 + sta TXTTAB+1 + sta VARTAB+1 lda #<$0803 - sta basic_start_of_vars_ptr+0 + sta VARTAB+0 // Zero line pointer - // XXX - We should also zero $0800, i.e., basic_start_of_text_ptr - 1 + // XXX - We should also zero $0800, i.e., TXTTAB - 1 ldy #$00 tya - sta (basic_start_of_text_ptr),y + sta (TXTTAB),y iny - sta (basic_start_of_text_ptr),y + sta (TXTTAB),y // Get top of memory. @@ -39,7 +39,7 @@ basic_do_new: // free for some optimisation structures, e.g., FOR/NEXT loop // records (without them going on the stack), GOSUB stack // (same story), expression value cache? - + sec // Read, not write value jsr JMEMTOP cpx #$80 @@ -56,25 +56,25 @@ basic_do_new: #else // CONFIG_MEMORY_MODEL_38K lda #>$A000 #endif - sta basic_top_of_memory_ptr+1 - sta basic_start_of_strings_ptr+1 + sta MEMSIZ+1 + sta FRETOP+1 #if CONFIG_MEMORY_MODEL_60K lda #<$F7FF #else // CONFIG_MEMORY_MODEL_38K lda #<$A000 #endif - sta basic_top_of_memory_ptr+0 - sta basic_start_of_strings_ptr+0 - + sta MEMSIZ+0 + sta FRETOP+0 + // FALL THROUGH - + basic_do_clr: // Clear variables, arrays and strings - lda basic_start_of_vars_ptr+0 - sta basic_start_of_arrays_ptr+0 - sta basic_start_of_free_space_ptr+0 - lda basic_start_of_vars_ptr+1 - sta basic_start_of_arrays_ptr+1 - sta basic_start_of_free_space_ptr+1 + lda VARTAB+0 + sta ARYTAB+0 + sta STREND+0 + lda VARTAB+1 + sta ARYTAB+1 + sta STREND+1 rts diff --git a/c64/basic/cmd_run.s b/c64/basic/cmd_run.s index 83b3c12c..fefd6e6d 100644 --- a/c64/basic/cmd_run.s +++ b/c64/basic/cmd_run.s @@ -1,13 +1,13 @@ cmd_run: // RUN clears all variables jsr basic_do_clr -cmd_goto: +cmd_goto: // Reset line pointer to first line of program. - lda basic_start_of_text_ptr+0 - sta basic_current_line_ptr+0 - lda basic_start_of_text_ptr+1 - sta basic_current_line_ptr+1 - + lda TXTTAB+0 + sta OLDTXT+0 + lda TXTTAB+1 + sta OLDTXT+1 + jsr basic_end_of_statement_check bcs !+ diff --git a/c64/basic/do_basic_error.s b/c64/basic/do_basic_error.s index e41822bf..296241c1 100644 --- a/c64/basic/do_basic_error.s +++ b/c64/basic/do_basic_error.s @@ -120,12 +120,12 @@ do_TO_MANY_FILES_error: lda $EA and #$80 sta $EA - + // FALL THROUGH // Error # in X - -do_basic_error: + +do_basic_error: // "?" txa pha @@ -142,12 +142,12 @@ do_basic_error: // A space between error name and word error lda #$20 jsr $ffd2 - + // "ERROR" ldx #33 jsr print_packed_message - lda basic_current_line_number+1 + lda CURLIN+1 cmp #$ff beq !+ @@ -156,8 +156,8 @@ do_basic_error: .text " IN " .byte 0 - lda basic_current_line_number+1 - ldx basic_current_line_number+0 + lda CURLIN+1 + ldx CURLIN+0 jsr print_integer !: // New lines diff --git a/c64/basic/injest_number.s b/c64/basic/injest_number.s index 83f7d464..6266e036 100644 --- a/c64/basic/injest_number.s +++ b/c64/basic/injest_number.s @@ -56,7 +56,7 @@ injest_number: ldy #$00 lda (TXTPTR),y cmp #$AB - bne ij_not_minus + bne ij_loop1 // not minus // Set sign to negative lda #$ff @@ -64,9 +64,6 @@ injest_number: // Skip over the minus sign jsr basic_consume_character - -ij_not_minus: - ij_loop1: ldy #$00 diff --git a/c64/basic/peek_line_pointer_null_check.s b/c64/basic/peek_line_pointer_null_check.s index e7a8fb38..e71a8d56 100644 --- a/c64/basic/peek_line_pointer_null_check.s +++ b/c64/basic/peek_line_pointer_null_check.s @@ -6,11 +6,11 @@ peek_line_pointer_null_check: ldy #$00 #if CONFIG_MEMORY_MODEL_60K - ldx #BUF - stx basic_current_line_ptr+1 - ldx #basic_current_line_ptr + stx OLDTXT+1 + ldx #OLDTXT jsr list_single_line // Read & display next line or quit diff --git a/c64/kernal/,target_ultimate64/,aliases_ultimate64.s b/c64/kernal/,target_ultimate64/,aliases_ultimate64.s index 65e2d20a..5c8bd0dc 100644 --- a/c64/kernal/,target_ultimate64/,aliases_ultimate64.s +++ b/c64/kernal/,target_ultimate64/,aliases_ultimate64.s @@ -4,10 +4,8 @@ // and ultimate_dos_v1.0.pdf and command_interface_v1.0.pdf by Gideon Zweijtzer // Command interface registers - .label U64_CONTROL = $DF1C // write - .label U64_STATUS = $DF1C // read - .label U64_COMMAND_DATA = $DF1D // write - .label U64_IDENTIFICATION = $DF1D // read + .label U64_CONTROL_STATUS = $DF1C // write = CONTROL, read = STATUS + .label U64_COMMAND_DATA_IDENTIFY = $DF1D // write = COMMAND_DATA, read = IDENTIFICATION .label U64_RESPONSE_DATA = $DF1E // read only .label U64_STATUS_DATA = $DF1F // read only diff --git a/c64/kernal/chrout_real.s b/c64/kernal/chrout_real.s index 1c60be55..578383c0 100644 --- a/c64/kernal/chrout_real.s +++ b/c64/kernal/chrout_real.s @@ -365,12 +365,12 @@ not_clearscreen: bcc !+ and #$7f - jmp not_high_char + jmp output_literal_char // not high char !: // Range $20-$3F is unchanged cmp #$40 - bcc not_high_char + bcc output_literal_char // not high char // Unshifted letters and symbols from $40-$5F // all end up being -$40 @@ -385,16 +385,12 @@ not_clearscreen: // Fix shifted chars by adding $20 again cmp #$20 - bcc not_high_char + bcc output_literal_char // not high char cmp #$40 - bcs not_high_char + bcs output_literal_char // not high char clc adc #$20 -not_high_char: - -chrout_l1: - output_literal_char: // Write normal character on the screen @@ -449,7 +445,7 @@ screen_grow_logical_line: // Don't grow line if it is already grown lda LDTBL,y bpl !+ - jmp done_grow_line + jmp not_last_line // doneb grow line !: lda #$80 sta LDTBL,y @@ -563,10 +559,9 @@ no_copy_down: dey cpy #40 bne !- - + rts -done_grow_line: not_last_line: rts diff --git a/c64/kernal/jumptable/fff3.jiobase.s b/c64/kernal/jumptable/fff3.jiobase.s index 3fbd234c..3250765f 100644 --- a/c64/kernal/jumptable/fff3.jiobase.s +++ b/c64/kernal/jumptable/fff3.jiobase.s @@ -12,7 +12,7 @@ // As there is nothing between here and $FFFA, we can just hard code this in place. -iobase: +// iobase: - commented out to prevent label naming conflict ldy #$DC ldx #$00 rts diff --git a/c64/kernal/udtim.s b/c64/kernal/udtim.s index 9fce89a2..2d8aac00 100644 --- a/c64/kernal/udtim.s +++ b/c64/kernal/udtim.s @@ -14,14 +14,13 @@ UDTIM: // after this time we have to reset the clock. inc TIME+0 - bne udtim_clock_done + bne udtim_update_stkey // done with clock inc TIME+1 bne udtim_clock_rollover inc TIME+2 // FALLTROUGH -udtim_clock_done: udtim_update_stkey: // entry to be used when interrupts are disabled // Another action we have to perform is to copy the last row of keyboard to RAM, @@ -44,11 +43,11 @@ udtim_clock_rollover: // At this point TIME+0 contains 0 lda TIME+1 cmp #$1A - bne udtim_clock_done + bne udtim_update_stkey // done with clock lda TIME+2 cmp #$4F - bne udtim_clock_done + bne udtim_update_stkey // done with clock lda #$00 sta TIME+2 sta TIME+1 - beq udtim_clock_done // will always jump + beq udtim_update_stkey // done with clock - will always jump diff --git a/c64/kernal/under_rom_routines.s b/c64/kernal/under_rom_routines.s index 8b4526df..5e45aa15 100644 --- a/c64/kernal/under_rom_routines.s +++ b/c64/kernal/under_rom_routines.s @@ -8,9 +8,9 @@ install_ram_routines: // Copy routines into place - ldx #ram_routines_end-ram_routines_start-1 + ldx #__ram_routines_end-__ram_routines_start-1 !: - lda ram_routines_start,x + lda __ram_routines_start,x sta tiny_nmi_handler,x dex bpl !- @@ -23,7 +23,7 @@ install_ram_routines: rts -ram_routines_start: +__ram_routines_start: tiny_nmi_handler_routine: inc missed_nmi_flag @@ -63,6 +63,6 @@ memmap_allram_routine: pla rts -ram_routines_end: +__ram_routines_end: #endif // CONFIG_MEMORY_MODEL_60K From c173540facf5a616f4359e05e2657b6050ae8cc7 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 3 Oct 2019 21:21:34 +0200 Subject: [PATCH 30/40] started separating 'printf' as debug-only routine --- CONFIG.md | 2 +- c64/,,config_generic.s | 3 +- c64/,,config_mega65.s | 3 +- c64/,,config_ultimate64.s | 3 +- c64/aliases/,aliases_config.s | 2 +- c64/basic/,imports.s | 6 +++- c64/basic/basic_warm_start.s | 5 ++-- c64/basic/cmd_break.s | 13 ++++---- c64/basic/do_basic_error.s | 5 ++-- c64/kernal/lvs_helpers.s | 8 ++--- c64/kernal/print_hex_byte.s | 48 ++++++++++++++++++++++++++++++ c64/kernal/printf.s | 56 +++++------------------------------ src/compress_text.c | 6 ++-- 13 files changed, 86 insertions(+), 74 deletions(-) create mode 100644 c64/kernal/print_hex_byte.s diff --git a/CONFIG.md b/CONFIG.md index 199220f2..4b8a320d 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -94,7 +94,7 @@ On the most widespread CPUs the D flag is not cleared upon entering interrupts. Feature needs 2 bytes in KERNAL segmment (for CPUs needing the patch), but at the same time allows optimizations allowing to gain some more bytes. If unsure - enable. -### `CONFIG_STUBS_BRK` +### `CONFIG_DBG_STUBS_BRK` Option just for debugging purposes - replaces `RTS` stubbed routines implementation with one causing a break. diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index d9cfb900..5f5b261f 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -23,4 +23,5 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS -// #define CONFIG_STUBS_BRK +// #define CONFIG_DBG_STUBS_BRK +#define CONFIG_DBG_PRINTF diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index 4a54f292..94b3d725 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -23,4 +23,5 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS -// #define CONFIG_STUBS_BRK +// #define CONFIG_DBG_STUBS_BRK +#define CONFIG_DBG_PRINTF diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index 2351e37a..bce0b758 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -23,4 +23,5 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS -// #define CONFIG_STUBS_BRK +// #define CONFIG_DBG_STUBS_BRK +#define CONFIG_DBG_PRINTF diff --git a/c64/aliases/,aliases_config.s b/c64/aliases/,aliases_config.s index f7a70eda..868fc670 100644 --- a/c64/aliases/,aliases_config.s +++ b/c64/aliases/,aliases_config.s @@ -75,7 +75,7 @@ .macro STUB_IMPLEMENTATION() { -#if CONFIG_STUBS_BRK +#if CONFIG_DBG_STUBS_BRK STUB_IMPLEMENTATION_BRK() #else STUB_IMPLEMENTATION_RTS() diff --git a/c64/basic/,imports.s b/c64/basic/,imports.s index 81d75baf..0c14f4b0 100644 --- a/c64/basic/,imports.s +++ b/c64/basic/,imports.s @@ -3,5 +3,9 @@ #import "KERNAL_combined.sym" + +#if CONFIG_DBG_PRINTF .label printf = KERNAL.printf -.label printf_printhexbyte = KERNAL.printf_printhexbyte +#endif + +.label print_hex_byte = KERNAL.print_hex_byte diff --git a/c64/basic/basic_warm_start.s b/c64/basic/basic_warm_start.s index 55ca0a7f..eeabd60a 100644 --- a/c64/basic/basic_warm_start.s +++ b/c64/basic/basic_warm_start.s @@ -16,12 +16,11 @@ basic_warm_start: jsr print_packed_message lda CMP0+1 - jsr printf_printhexbyte + jsr print_hex_byte lda CMP0+0 - jsr printf_printhexbyte + jsr print_hex_byte lda #$0D jsr JCHROUT !: jmp basic_main_loop - diff --git a/c64/basic/cmd_break.s b/c64/basic/cmd_break.s index 3ab1bae3..ffcab37f 100644 --- a/c64/basic/cmd_break.s +++ b/c64/basic/cmd_break.s @@ -1,17 +1,16 @@ cmd_stop: - jsr printf // XXX don't use printf, use packed messages! - .text "BREAK" - .byte 0 + ldx #38 // "BREAK" + jsr print_packed_message - // Check for direct mode // Are we in direct mode lda CURLIN+1 cmp #$FF beq !+ + // Not direct mode - jsr printf // XXX don't use printf, use packed messages! - .text " IN " - .byte 0 + ldx #37 + jsr print_packed_message + lda CURLIN+1 ldx CURLIN+0 jsr print_integer diff --git a/c64/basic/do_basic_error.s b/c64/basic/do_basic_error.s index 296241c1..f598247a 100644 --- a/c64/basic/do_basic_error.s +++ b/c64/basic/do_basic_error.s @@ -152,9 +152,8 @@ do_basic_error: beq !+ // We were in a program, so show IN - jsr printf // XXX don't use printf, use packed messages - .text " IN " - .byte 0 + ldx #37 + jsr print_packed_message lda CURLIN+1 ldx CURLIN+0 diff --git a/c64/kernal/lvs_helpers.s b/c64/kernal/lvs_helpers.s index ef47ebf4..c662d65b 100644 --- a/c64/kernal/lvs_helpers.s +++ b/c64/kernal/lvs_helpers.s @@ -117,9 +117,9 @@ lvs_display_start_addr: .text " FROM $" .byte 0 lda STAL+1 - jsr printf_printhexbyte + jsr print_hex_byte lda STAL+0 - jmp printf_printhexbyte + jmp print_hex_byte lvs_display_done: // Display end address @@ -129,9 +129,9 @@ lvs_display_done: .text " TO $" .byte 0 lda STAL+1 - jsr printf_printhexbyte + jsr print_hex_byte lda STAL+0 - jsr printf_printhexbyte + jsr print_hex_byte lda #$0D jmp JCHROUT diff --git a/c64/kernal/print_hex_byte.s b/c64/kernal/print_hex_byte.s new file mode 100644 index 00000000..d5d53760 --- /dev/null +++ b/c64/kernal/print_hex_byte.s @@ -0,0 +1,48 @@ + +// +// Print the hex value in .A as two digits +// + +print_hex_byte: + +#if HAS_BCD_SAFE_INTERRUPTS + + // Idea by Haubitze + + sed + pha + lsr + lsr + lsr + lsr + cmp #$0A + adc #$30 + jsr JCHROUT + pla + and #$0F + cmp #$0A + adc #$30 + cld + jmp JCHROUT + +#else + + pha + lsr + lsr + lsr + lsr + ora #$30 + cmp #$3A + bcc !+ + adc #6 +!: jsr JCHROUT + pla + and #$0f + ora #$30 + cmp #$3A + bcc !+ + adc #6 +!: jmp JCHROUT + +#endif diff --git a/c64/kernal/printf.s b/c64/kernal/printf.s index 599e4e15..44738e47 100644 --- a/c64/kernal/printf.s +++ b/c64/kernal/printf.s @@ -9,6 +9,8 @@ // .byte 2,$low,$hi = display word as hex // .byte $f0+n,$low,$hi = display byte at $hi$lo+n as hex +#if CONFIG_DBG_PRINTF + printf: // Temporary storage is between end of screen at $0400 // and the sprite pointers at $7f8 @@ -63,7 +65,7 @@ printf_continues: // Read the low byte jsr $7f4 // Print as hex - jsr printf_printhexbyte + jsr print_hex_byte jmp printf_nextchar not_hexbyte: @@ -77,13 +79,13 @@ not_hexbyte: // Read the high byte jsr $7f4 // Print as hex - jsr printf_printhexbyte + jsr print_hex_byte // Skip the token jsr printf_retreat // Read the low byte jsr $7f4 // Print as hex - jsr printf_printhexbyte + jsr print_hex_byte jsr printf_advance jmp printf_nextchar @@ -107,7 +109,7 @@ not_hexword: sta $fe lda ($fd),y - jsr printf_printhexbyte + jsr print_hex_byte jmp printf_nextchar not_pointer: @@ -118,7 +120,6 @@ printf_nextchar: jsr printf_advance jmp printf_loop - printf_advance: // Advance pointer to next character inc $7f5 @@ -138,48 +139,5 @@ printf_retreat: sta $7f6 rts -printf_printhexbyte: +#endif // CONFIG_DBG_PRINTF - // Print the hex value in .A as two digits - -#if HAS_BCD_SAFE_INTERRUPTS - - // Idea by Haubitze - - sed - pha - lsr - lsr - lsr - lsr - cmp #$0A - adc #$30 - jsr JCHROUT - pla - and #$0F - cmp #$0A - adc #$30 - cld - jmp JCHROUT - -#else - - pha - lsr - lsr - lsr - lsr - ora #$30 - cmp #$3A - bcc !+ - adc #6 -!: jsr JCHROUT - pla - and #$0f - ora #$30 - cmp #$3A - bcc !+ - adc #6 -!: jmp JCHROUT - -#endif diff --git a/src/compress_text.c b/src/compress_text.c index cf7e4751..85a62d06 100644 --- a/src/compress_text.c +++ b/src/compress_text.c @@ -24,7 +24,7 @@ LOAD and SAVE. Indeed, that this is so is highlighted by the fact that it was used in the C64 ROM. Therefore there is no exercise of creativity here, and a reasonable person would likely select this name independently. Also, single words cannot be copyright. - + Further, the list is a list of facts, and thus not copyrightable. We sourced the list from a public source, https://www.c64-wiki.com/wiki/BASIC, which has @@ -161,11 +161,13 @@ char *error_list[]={ "READY.\r", // #29 // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser "NTSC, ", // #30 "PAL, ", // #31 - "BRK AT $", // #32 + "BREAK AT $", // #32 "ERROR", // #33 // Simply the word error that is attached to the other parts of messages https://fjkraan.home.xs4all.nl/comp/apple2faq/app2asoftfaq.html "BYTES FREE\r\r", // #34 // https://github.com/stefanhaustein/expressionparser "MEMORY CORRUPT", // #35 "NOT IMPLEMENTED", // #36 + " IN ", // #37 + "BREAK", // #38 NULL}; // XXX: create separate list for Kernal From 2608e1b153e62655a8441ca52b1e32379dcd0ea5 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 3 Oct 2019 22:21:44 +0200 Subject: [PATCH 31/40] deduplicated some print character routines --- Makefile | 2 +- STATUS.md | 3 +-- c64/basic/,imports.s | 2 ++ c64/basic/basic_cold_start.s | 4 +--- c64/basic/basic_do_error.s | 12 ++++------- c64/basic/basic_main_loop.s | 7 +++---- c64/basic/basic_warm_start.s | 3 +-- c64/basic/cmd_break.s | 4 ++-- c64/basic/cmd_list.s | 10 ++++----- c64/basic/do_basic_error.s | 14 +++++-------- c64/basic/e422.initmsg.s | 27 +++++++++++++++++++++++-- c64/basic/print_packed_message.s | 3 +-- c64/basic/wedge_dos.s | 3 +-- c64/kernal/lvs_helpers.s | 3 +-- c64/kernal/{ => print}/print_hex_byte.s | 0 c64/kernal/print/print_return.s | 8 ++++++++ c64/kernal/print/print_space.s | 8 ++++++++ c64/kernal/{ => print}/printf.s | 0 18 files changed, 68 insertions(+), 45 deletions(-) rename c64/kernal/{ => print}/print_hex_byte.s (100%) create mode 100644 c64/kernal/print/print_return.s create mode 100644 c64/kernal/print/print_space.s rename c64/kernal/{ => print}/printf.s (100%) diff --git a/Makefile b/Makefile index afec2b7e..74ab4305 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SRCDIR_COMMON = c64/aliases SRCDIR_BASIC_COMMON = $(SRCDIR_COMMON) c64/basic -SRCDIR_KERNAL_COMMON = $(SRCDIR_COMMON) c64/kernal c64/kernal/assets c64/kernal/jumptable c64/kernal/iec c64/kernal/interrupts +SRCDIR_KERNAL_COMMON = $(SRCDIR_COMMON) c64/kernal c64/kernal/assets c64/kernal/jumptable c64/kernal/iec c64/kernal/interrupts c64/kernal/print SRCDIR_BASIC_generic = $(SRCDIR_BASIC_COMMON) c64/basic/,target_generic SRCDIR_BASIC_mega65 = $(SRCDIR_BASIC_COMMON) c64/basic/,target_mega65 diff --git a/STATUS.md b/STATUS.md index 9c26e41b..2b7915dc 100644 --- a/STATUS.md +++ b/STATUS.md @@ -65,7 +65,6 @@ Note: vectors at `$0300` are not supported yet - for now only the locations belo | `($A000)` | | cold start | PARTIAL | | | `($A002)` | | warm start | PARTIAL | | -
### Unofficial BASIC routines/locations @@ -82,7 +81,7 @@ Not all of them - only these we want to have implemented. | `$AB1E` | STROUT | DONE | | | `$BDCD` | LINPRT | NOT DONE | | | `$E3BF` | INIT | NOT DONE | | -| `$E422` | INITMSG | NOT DONE | | +| `$E422` | INITMSG | PARTIAL | banner printed outside | | `$E453` | RVECT | NOT DONE | |
diff --git a/c64/basic/,imports.s b/c64/basic/,imports.s index 0c14f4b0..b195dcac 100644 --- a/c64/basic/,imports.s +++ b/c64/basic/,imports.s @@ -9,3 +9,5 @@ #endif .label print_hex_byte = KERNAL.print_hex_byte +.label print_return = KERNAL.print_return +.label print_space = KERNAL.print_space diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index c77ad42a..9863ea5b 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -49,10 +49,8 @@ basic_cold_start: sbc TXTTAB+1 jsr print_integer + jsr print_space - lda #$20 - jsr JCHROUT - // Print the rest of the start up message ldx #34 jsr print_packed_message diff --git a/c64/basic/basic_do_error.s b/c64/basic/basic_do_error.s index ba31a966..6266b0ef 100644 --- a/c64/basic/basic_do_error.s +++ b/c64/basic/basic_do_error.s @@ -6,8 +6,7 @@ basic_do_error: pha // Print ? at start - lda #$0D - jsr JCHROUT + jsr print_return lda #$3F jsr JCHROUT @@ -17,8 +16,7 @@ basic_do_error: jsr print_packed_message // Print ERROR at end - lda #$20 - jsr JCHROUT + jsr print_space ldx #33 jsr print_packed_message @@ -26,10 +24,8 @@ basic_do_error: // XXX print line number if not in direct mode - lda #$0D - jsr JCHROUT - lda #$0D // XXX do we need this? - jsr JCHROUT + jsr print_return + jsr print_return // Reset stack, and go back to main loop ldx #$FE diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index f29d5d37..4318aa78 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -34,7 +34,7 @@ got_line_of_input: stx __tokenise_work1 // Strip leading spaces from the line -remove_leading_spaces: +remove_leading_spaces: lda $0200 cmp #$20 bne !+ @@ -51,15 +51,14 @@ rsl_l1: lda $0200,x bne remove_leading_spaces !: // Do printing of the new line - lda #$0d - jsr JCHROUT + jsr print_return // Ignore empty lines lda __tokenise_work1 beq basic_read_next_line // Else, tokenise the line - jsr tokenise_line + jsr tokenise_line // Has the user entered a line of BASIC beginning with a number? lda $0200 diff --git a/c64/basic/basic_warm_start.s b/c64/basic/basic_warm_start.s index eeabd60a..1416ec4e 100644 --- a/c64/basic/basic_warm_start.s +++ b/c64/basic/basic_warm_start.s @@ -19,8 +19,7 @@ basic_warm_start: jsr print_hex_byte lda CMP0+0 jsr print_hex_byte - lda #$0D - jsr JCHROUT + jsr print_return !: jmp basic_main_loop diff --git a/c64/basic/cmd_break.s b/c64/basic/cmd_break.s index ffcab37f..d3aa3cd3 100644 --- a/c64/basic/cmd_break.s +++ b/c64/basic/cmd_break.s @@ -16,7 +16,7 @@ cmd_stop: jsr print_integer !: - lda #$0D - jsr JCHROUT + jsr print_return + cmd_end: jmp basic_main_loop diff --git a/c64/basic/cmd_list.s b/c64/basic/cmd_list.s index 91078fc8..2aef7ccb 100644 --- a/c64/basic/cmd_list.s +++ b/c64/basic/cmd_list.s @@ -60,8 +60,7 @@ list_single_line: // entry point needed by DOS wedge tax pla jsr print_integer - lda #$20 - jsr JCHROUT + jsr print_space // Iterate through printing out the line // contents @@ -69,7 +68,7 @@ list_single_line: // entry point needed by DOS wedge sta QTSW ldy #4 -list_print_loop: +list_print_loop: #if CONFIG_MEMORY_MODEL_60K ldx # Date: Thu, 3 Oct 2019 23:11:57 +0200 Subject: [PATCH 32/40] routine at $E422 is now implemented --- STATUS.md | 2 +- c64/basic/basic_cold_start.s | 29 ++--------------------------- c64/basic/e422.initmsg.s | 20 ++++++++++++++++++-- c64/basic/startup_banner.s | 7 +++++++ 4 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 c64/basic/startup_banner.s diff --git a/STATUS.md b/STATUS.md index 2b7915dc..01af1e7c 100644 --- a/STATUS.md +++ b/STATUS.md @@ -81,7 +81,7 @@ Not all of them - only these we want to have implemented. | `$AB1E` | STROUT | DONE | | | `$BDCD` | LINPRT | NOT DONE | | | `$E3BF` | INIT | NOT DONE | | -| `$E422` | INITMSG | PARTIAL | banner printed outside | +| `$E422` | INITMSG | DONE | | | `$E453` | RVECT | NOT DONE | |
diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 9863ea5b..5f8d27e3 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -27,33 +27,8 @@ basic_cold_start: lda #>do_ILLEGAL_QUANTITY_error sta USRADD+1 - // Print startup banner - jsr printf // XXX don't use printf, keep it for debug purposes only - TARGET_HOOK_BANNER() - - // Print PAL/NTSC - ldx #30 // NTSC - lda TVSFLG - beq !+ - ldx #31 // PAL -!: - jsr print_packed_message - - // Work out free bytes, display them - jsr basic_do_new - lda MEMSIZ+0 - sec - sbc TXTTAB+0 - tax - lda MEMSIZ+1 - sbc TXTTAB+1 - - jsr print_integer - jsr print_space - - // Print the rest of the start up message - ldx #34 - jsr print_packed_message + // Print startup messages + jsr INITMSG // jump into warm start loop jmp basic_warm_start diff --git a/c64/basic/e422.initmsg.s b/c64/basic/e422.initmsg.s index 739de6ce..261ce40b 100644 --- a/c64/basic/e422.initmsg.s +++ b/c64/basic/e422.initmsg.s @@ -1,8 +1,24 @@ -// XXX provide documentation and finish the implementation +// +// Well-known BASIC routine, described in: +// +// - [CM64] Compute's Mapping the Commodore 64 - page 212 +// +// Prints the start-up messages +// INITMSG: + // Print startup banner, up to 255 characters + ldx #$00 +!: + lda startup_banner, x + beq !+ // 0 means end of banner + jsr JCHROUT + inx + bne !- + +!: // Print PAL/NTSC ldx #30 // NTSC lda TVSFLG @@ -23,6 +39,6 @@ INITMSG: jsr print_integer jsr print_space - // Print the rest of the start up message + // Print rest of the start up message ldx #34 jmp print_packed_message diff --git a/c64/basic/startup_banner.s b/c64/basic/startup_banner.s new file mode 100644 index 00000000..957ab11d --- /dev/null +++ b/c64/basic/startup_banner.s @@ -0,0 +1,7 @@ + +// +// Startup banner, to be displayed durin cold start +// + +startup_banner: + TARGET_HOOK_BANNER() From 4be1f222a96dbaf5f3fefe9df512e8dd9de77342 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 3 Oct 2019 23:59:43 +0200 Subject: [PATCH 33/40] 'printf' routine is now optional --- CONFIG.md | 10 ++++-- c64/,,config_generic.s | 2 +- c64/,,config_mega65.s | 2 +- c64/,,config_ultimate64.s | 2 +- c64/kernal/assets/kernal_messages.s | 44 +++++++++++++++++++++++++ c64/kernal/lvs_helpers.s | 39 +++++++++------------- c64/kernal/print/print_kernal_message.s | 14 ++++++++ 7 files changed, 85 insertions(+), 28 deletions(-) create mode 100644 c64/kernal/assets/kernal_messages.s create mode 100644 c64/kernal/print/print_kernal_message.s diff --git a/CONFIG.md b/CONFIG.md index 4b8a320d..8e85748f 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -94,8 +94,14 @@ On the most widespread CPUs the D flag is not cleared upon entering interrupts. Feature needs 2 bytes in KERNAL segmment (for CPUs needing the patch), but at the same time allows optimizations allowing to gain some more bytes. If unsure - enable. +## Debug options + +Options in this section are for debug purposes only. If unsure - disable. + ### `CONFIG_DBG_STUBS_BRK` -Option just for debugging purposes - replaces `RTS` stubbed routines implementation with one causing a break. +Replaces `RTS` stubbed routines implementation with one causing a break. -If unsure - disable. +### `CONFIG_DBG_PRINTF` + +Makes 'printf' routine available. diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 5f5b261f..909a70ed 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -24,4 +24,4 @@ #define CONFIG_BCD_SAFE_INTERRUPTS // #define CONFIG_DBG_STUBS_BRK -#define CONFIG_DBG_PRINTF +// #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index 94b3d725..f292a412 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -24,4 +24,4 @@ #define CONFIG_BCD_SAFE_INTERRUPTS // #define CONFIG_DBG_STUBS_BRK -#define CONFIG_DBG_PRINTF +// #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index bce0b758..1c075909 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -24,4 +24,4 @@ #define CONFIG_BCD_SAFE_INTERRUPTS // #define CONFIG_DBG_STUBS_BRK -#define CONFIG_DBG_PRINTF +// #define CONFIG_DBG_PRINTF diff --git a/c64/kernal/assets/kernal_messages.s b/c64/kernal/assets/kernal_messages.s new file mode 100644 index 00000000..9bbc3e33 --- /dev/null +++ b/c64/kernal/assets/kernal_messages.s @@ -0,0 +1,44 @@ + +// +// Messages to be prined out by Kernal +// + +// Double underscore prevents labels from being passed to VICE (would confuse monitor) + +.label __MSG_KERNAL_SEARCHING_FOR = __kernal_message_searching_for - __kernal_messages_start +.label __MSG_KERNAL_LOADING = __kernal_message_loading - __kernal_messages_start +.label __MSG_KERNAL_VERIFYING = __kernal_message_verifying - __kernal_messages_start +.label __MSG_KERNAL_SAVING = __kernal_message_saving - __kernal_messages_start +.label __MSG_KERNAL_FROM_HEX = __kernal_message_from_hex - __kernal_messages_start +.label __MSG_KERNAL_TO_HEX = __kernal_message_to_hex - __kernal_messages_start + + +__kernal_messages_start: + +__kernal_message_searching_for: + .byte $0D + .text "SEARCHING FOR " + .byte 0 + +__kernal_message_loading: + .byte $0D + .text "LOADING" + .byte 0 + +__kernal_message_verifying: + .byte $0D + .text "VERIFYING" + .byte 0 + +__kernal_message_saving: + .byte $0D + .text "SAVING" + .byte 0 + +__kernal_message_from_hex: + .text " FROM $" + .byte 0 + +__kernal_message_to_hex: + .text " TO $" + .byte 0 diff --git a/c64/kernal/lvs_helpers.s b/c64/kernal/lvs_helpers.s index bde3f0b7..996fbfa8 100644 --- a/c64/kernal/lvs_helpers.s +++ b/c64/kernal/lvs_helpers.s @@ -71,10 +71,10 @@ lvs_advance_pointer: lvs_display_searching_for: lda MSGFLG bpl lvs_display_end - jsr printf // XXX don't use printf, use packed message - .byte $0D - .text "SEARCHING FOR " - .byte 0 + + ldx #__MSG_KERNAL_SEARCHING_FOR + jsr print_kernal_message + ldy #$00 !: cpy FNLEN @@ -98,24 +98,21 @@ lvs_display_loading_verifying: // Display LOADING / VERIFYING and start address lda MSGFLG bpl lvs_display_end + + ldx #__MSG_KERNAL_LOADING lda VERCKK beq !+ - jsr printf // XXX don't use printf, use packed message - .byte $0D - .text "VERIFYING" - .byte 0 - jmp lvs_display_start_addr + ldx #__MSG_KERNAL_VERIFYING !: - jsr printf // XXX don't use printf, use packed message - .byte $0D - .text "LOADING" - .byte 0 + jsr print_kernal_message + // FALLTHROUGH lvs_display_start_addr: - jsr printf // XXX don't use printf, use packed message - .text " FROM $" - .byte 0 + ldx #__MSG_KERNAL_FROM_HEX +!: + jsr print_kernal_message + lda STAL+1 jsr print_hex_byte lda STAL+0 @@ -125,13 +122,9 @@ lvs_display_done: // Display end address lda MSGFLG bpl lvs_display_end - jsr printf // XXX don't use printf, use packed message - .text " TO $" - .byte 0 - lda STAL+1 - jsr print_hex_byte - lda STAL+0 - jsr print_hex_byte + + ldx #__MSG_KERNAL_TO_HEX + jsr !- jmp print_return lvs_wrap_around_error: diff --git a/c64/kernal/print/print_kernal_message.s b/c64/kernal/print/print_kernal_message.s new file mode 100644 index 00000000..ed2b9f4e --- /dev/null +++ b/c64/kernal/print/print_kernal_message.s @@ -0,0 +1,14 @@ + +// +// Print one of the standard Kernal messages, index in .X +// + +!: + jsr JCHROUT + inx + +print_kernal_message: + + lda __kernal_messages_start, x + bne !- // 0 marks end of string + rts From ef0ef3162e403bad6231a83f6f4030ba479b11df Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 4 Oct 2019 00:09:33 +0200 Subject: [PATCH 34/40] small optimization - 2 bytes saved --- bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/basic_mega65.rom | Bin 8192 -> 8192 bytes bin/basic_ultimate64.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/kernal/assets/kernal_messages.s | 24 ++++++++++++------------ c64/kernal/print/print_kernal_message.s | 5 +++-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index f1d719c8d8b0a08dccdd5716d66b190fdfba521d..ef561550a2f39c3492b00af085e49527af70ce08 100644 GIT binary patch delta 2342 zcma(TeQX=m{mvKn&bbgfU({(z@(5*3ASr2w(Kyg!0F_ZmnB8CNSDv%LeMGa{HY# zq-xq9obUYJ{l4Gt^9FYe?kJmyy`S5&>xrJ7J^Q!3J6itJk_HLYt77< zUC89F&fNGPE!|Ij0Ra5T5uc}grNqT+hBtZPK_kZ3HdV24! zr_jEq_v~*$jB19=be1v7XFkkorp{*OO+E0B4r$C+1Q;T^K+tohpQiQC{AxA&$do43 zM`e$CMQ&f^Y)E>Vof-qINsqRo+cIfOP8#G~DYWA}8FL@=$R5((#}qk$h%uhhR*YWF zGDu8C4MkyG&=1wG_9H3}YLa#=x z2fq+akNJ|GBDZ9*yZg$47w?Zs_^+yv>>KSL)^9DmxbV`#%leHbsR&8yw+b&7{tE#| zcKXrh(J=qs(RU7JT(@8kcZdr!?)Q%VT-CVXQ)wFiQ5Rc=4k9GD21C{O&htz@bGZyd?0w)AKIw&i)AejtK+~^L@rs#RrKG& zT#9A2(qP#N!*+a9I?l5AGphVnJghwHXs|I^<%DBfiFOVTDrX%V0}zi+c^m1Hx1%=* z@!GqKF$yuLE|w@p%j@ndkq1aOoalJS21V6rRhCs}wOO7D)Im$BNXzJ5w44q_PDY&6 zMJs3}eJg5SuAdRIYjTJjr2acf!ewpD2g6 zOKO1QM4nX3vmk560#_HoIuEcJyg44Nj@0NSjbSzRLDF1_4G~cnOW`U4bs-QD zY8e*rM1(>Y_46@T)ix4Xz-7rF{c^Z^-A`-i^YMd=}Hzr`5%1SC;R{a delta 2299 zcma)7eNc8;g2oTv6{sKth#yEmLiw08&WnILl+I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9WFwhJ1Or~~m_aN9?YuF>NvHY7gY#j{r0;81)xK;3m%MEz61gh95QiLTv zkTrY%+a>mQw(fpwPeWtV-cW;$h7TY(caO{bH{;ZXs~v7*v~pGEgt96;+IBSI$j#lrjiTazrku* z`!=yd7xh(9WU68Y2umS3lMp%svv97+2{Eq~z2N;|RLluK!D<`=$r^qfX`DJ#1&q@hJ{IQ}^y6c^u{ zYqT`y=g`!Ib;YmUTQLrb(y>XBfnH#xASxDs`ZjAmd{oe!7!U^hfkm{)j2mh|m{Brs z#>D}T!xy4GUkcfHw?X{1gs`T>?zIh7RjLf z$YFonBJ+OT;<0To`4bk;2F9PXptwb0)S2O=#T`z-Ukv^<%aLJAYt-W4fxoH9kpd9( zKRh=DG|r-Ps`64Dx-(-06}4-DSMGpMW30R8~qQd$P2~* diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 8b59fe0892c66ac4de153037cac97a540f561d69..6f0041a705790eab125143798ed0987a2997e0cd 100644 GIT binary patch delta 2852 zcmYjS4^R`?8Q<&%2q-2XNJN3>^=tt_Q_&ik2C-Ey>QgCLi*p~NLPcy+GdOw6jTu~uGT1T%i8*UF>)y^1cF0l7#0 zgFgZ6pCF|xy0y8ltHnN*Y}O`IH$R8|+yXwZlFj}c3bB7-vu@iWY>^ET_oppY%&{#` z8vG+}4kes{Ah>pMFMLQg9oyVvc`oeai9^^4l*}T zExbi`tki``u&c5MCIO=Q3yRoIH`_@KY-$GI^6WsK7MCzdV$h5;KB$FO8HGco6fZHP zs>#t!s%x7Zq)Kp*YN3Qe??Scd14>;>aWC9~!XUSgba0=CJV*_21C%Wmwhb-{>{aM>&4p|7wA% z$r9(|@csdz19x>nDgXDD&FESzj>KFl)6&p+-ET%W^wrVW%?#U(f7;K(2V|zfme|R# z=yUyvKMWsGn3fKShn#6Tmvr9`WClX{%D~yTnl39Oy_-Hu#5?Rf>*_PatzDtXRt6yn zCs;0en2JuWM0m~3zZn7bz*^Wc5P)B&l6u^w1S?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?OYoqg4(n7w3q!FJb$?jU-H!jJwoG&S%gaqG6 z#i69+4UNM;4u4bHAC>mSBoBdu&O;s>K+xUr0vpczYR0pv1~!L&GA)EDCO7?8mlfJw$R diff --git a/c64/kernal/assets/kernal_messages.s b/c64/kernal/assets/kernal_messages.s index 9bbc3e33..b87bce48 100644 --- a/c64/kernal/assets/kernal_messages.s +++ b/c64/kernal/assets/kernal_messages.s @@ -17,28 +17,28 @@ __kernal_messages_start: __kernal_message_searching_for: .byte $0D - .text "SEARCHING FOR " - .byte 0 + .text "SEARCHING FOR" + .byte $80 + $20 // end of string mark + space __kernal_message_loading: .byte $0D - .text "LOADING" - .byte 0 + .text "LOADIN" + .byte $80 + $47 // end of string mark + 'G' __kernal_message_verifying: .byte $0D - .text "VERIFYING" - .byte 0 + .text "VERIFYIN" + .byte $80 + $47 // end of string mark + 'G' __kernal_message_saving: .byte $0D - .text "SAVING" - .byte 0 + .text "SAVIN" + .byte $80 + $47 // end of string mark + 'G' __kernal_message_from_hex: - .text " FROM $" - .byte 0 + .text " FROM " + .byte $80 + $24 // end of string mark + '$' __kernal_message_to_hex: - .text " TO $" - .byte 0 + .text " TO " + .byte $80 + $24 // end of string mark + '$' diff --git a/c64/kernal/print/print_kernal_message.s b/c64/kernal/print/print_kernal_message.s index ed2b9f4e..6ae7a23d 100644 --- a/c64/kernal/print/print_kernal_message.s +++ b/c64/kernal/print/print_kernal_message.s @@ -10,5 +10,6 @@ print_kernal_message: lda __kernal_messages_start, x - bne !- // 0 marks end of string - rts + bpl !- // 0 marks end of string + and #$7F + jmp JCHROUT From e75ceae3f1626098088dd1adec27bbba7ab97582 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 4 Oct 2019 19:54:27 +0200 Subject: [PATCH 35/40] added possibility to build hybrid ROM --- .gitignore | 4 ++++ Makefile | 27 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d9f921e3..40dc1c36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ +# Image which is illegal to distribute + +kernal_hybrid.rom + # Compilation related files assembler/KickAss* diff --git a/Makefile b/Makefile index 74ab4305..4495652a 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,10 @@ EXT_TARGET_LIST = build/newc65.rom REL_TARGET_LIST = $(pathsubst build/%,bin/%, $(STD_TARGET_LIST)) +# Misc strings + +HYBRID_WARNING = "*** WARNING *** Distributing kernal_hybrid.rom violates both original ROM copyright and Open ROMs license!" + # GIT commit GIT_COMMIT:= $(shell git log -1 --pretty='%h' | tr '[:lower:]' '[:upper:]') @@ -165,6 +169,18 @@ build/basic_%.rom: build/symbols_%.vs: sort build/target_$*/BASIC_combined.vs build/target_$*/KERNAL_combined.vs | uniq | grep -v "__" > $@ +build/kernal_hybrid.rom: kernal build/target_generic/OUTK.BIN + @echo + @echo $(HYBRID_WARNING) + @echo + (dd if=kernal bs=1140 count=1 skip=0 ; \ + echo " > HYBRID ROM, DON'T DISTRIBUTE <" ; \ + dd if=kernal bs=1 count=58 skip=1176 ; \ + cat build/target_generic/OUTK.BIN) > $@ + +build/symbols_hybrid.vs: build/target_generic/KERNAL_combined.vs + sort build/target_generic/KERNAL_combined.vs | uniq | grep -v "__" > $@ + # Rules - platform 'Mega 65' specific build/newc65.rom: build/kernal_mega65.rom build/basic_mega65.rom build/chargen.rom Makefile @@ -189,12 +205,21 @@ test_mega65: build/kernal_mega65.rom build/basic_mega65.rom build/symbols_mega65 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 -8 empty.d64 +test_hybrid: build/kernal_hybrid.rom build/symbols_hybrid.vs + @echo + @echo $(HYBRID_WARNING) + @echo + x64 -kernal build/kernal_hybrid.rom -moncommands build/symbols_hybrid.vs -8 empty.d64 + @echo + @echo $(HYBRID_WARNING) + @echo + test_m65: build/newc65.rom m65 -b ../mega65-core/bin/mega65r1.bit -k ../mega65-core/bin/KICKUP.M65 -R build/newc65.rom -4 testremote: build/kernal_generic.rom build/basic_generic.rom build/symbols_generic.vs x64 -kernal build/kernal_generic.rom -basic build/basic_generic.rom -moncommands build/symbols_generic.vs -remotemonitor -testsimilarity: build/target_generic/newrom $(TOOL_SIMILARITY) +testsimilarity: build/target_generic/newrom $(TOOL_SIMILARITY) kernal basic $(TOOL_SIMILARITY) kernal build/target_generic/newrom $(TOOL_SIMILARITY) basic build/target_generic/newrom From af9e6abb8f0d68ddce1f43a79736321239813908 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 4 Oct 2019 20:24:13 +0200 Subject: [PATCH 36/40] fixes to LOAD, some documentation updates --- .gitignore | 2 +- bin/README.txt | 7 +++- bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/basic_mega65.rom | Bin 8192 -> 8192 bytes bin/basic_ultimate64.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/,,config_generic.s | 1 + c64/,,config_mega65.s | 1 + c64/,,config_ultimate64.s | 1 + c64/aliases/,aliases_ram_lowmem.s | 55 ++++++++++++++++++------------ c64/basic/cmd_load.s | 12 +++---- c64/kernal/lvs_helpers.s | 3 +- 14 files changed, 50 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index 40dc1c36..bd558ebd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -# Image which is illegal to distribute +# Image which is illegal to distribute - just for extra safety kernal_hybrid.rom diff --git a/bin/README.txt b/bin/README.txt index d3a254bc..de60839c 100644 --- a/bin/README.txt +++ b/bin/README.txt @@ -4,7 +4,12 @@ Follow these rules, or bad things will happen! - Don't mix ROMs for different platforms - use generic BASIC with generic KERNAL, Mega65 BASIC with Mega65 KERNAL, etc. -- Don't mix these ROMs with any other ROMs; the only exception is CHARGEN, this one is fully interchangeable. +- Don't mix these ROMs with any other ROMs; exceptions: + + - kernal_hybrid.rom, which is meant to be used (and has to be used) with the original BASIC ROM; + however, this hybrid ROM cannot be distributed due to legal/copyright reasons + + - chargen.rom - this one is fully interchangeable - Don't mix ROMs from different builds/versions (again, CHARGEN is an exception). diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index ef561550a2f39c3492b00af085e49527af70ce08..574750553c143803e960ca403f87ebbc9805c5a1 100644 GIT binary patch delta 1028 zcmcgq?{5=j9KYvjySuI3t}W|!Al)7r8 zGAU^=;+ZET@M7_-y7VWhIzziXNAdGOPk3I8&VgNbQ1xovSx=-cCa*N&nwQ+t z$Q$)^Y08fjXB$=BXnMsq| zWqOQ{pg}st9}nmIh^}eFtfnvDy9tX27=s*pDF0TVL*5_wh0?w6z=Q3p@zW3@vcJxT1T(2UDe1Xaf=a5P%?Tfrx&0xgC_{5OhE%{IV>;R@eql zz;*~j7jy%GCt(Nlz)t9eKG+4jAp(0K3jGj+0T_fh?1g=>AD+s<)9?%oK>`lIFgyzf zVFV7rVHkxY|I5QifOdJe(pA1EV-Gl@CbDy5DP?e3QC=uZDRQH1)U%?>&3#@MT*YulX7>$3?y^G7YoZxYOOBB>sp?CnvHKd8E3&nRuJKFtL_%{!(0o z*I5xcTV{Ro!iDjw|DWu8FQt;_k_M-GE^#R5|2wUA+8HI3%wuUDqf^JtX^e7J|3+GF zGIP0H%hil>C#~-KkK>l+IdtkHbDBvvIsGODA&mE%v@X0J(0B(Y8aoMD?>vXeNvirf zTaeYj$dbqCkG@a`1MB9R#@ndouF7LpmHi@Q(fhvmj&-x(t%(KU3Wu6SHr_o!UNRd> zCb-7eT=LiSP-_SJgudMR%83oj-lN3qxWcpRxa18>yXkaQ{KyKREKj~NHNo~PF8PBM z(pyos-3TD(dzLkWh)r{e!w-V!fgj1#sszzAhu6*rk^Py2vo|e2lHLiRPa8?&cmX&3S4bVb$)OuBG$YOZ$D^kdUJ2&qD4RGiki9gc+ zGy3nn|7Yfp4UP?7zVGChC+Gubhej!J__^4%wR25U z=9uzfJ%N&SFQEsNKkD&GeVE>MeMHXF{&lUkKf3NOnX4!VCzMl6?VZRvu0&(0E78e> zLP6gbLS%@3BYZ;pq^-%npWD>WmRK~#24YN%EDQ3eD>kV_t|#OZVJ*zMMmeo3p$#Oo zXqIPzOti$BGtsJ;7iKuVDwL#5lnFOQt2QgjbWRHPwCdwLNtJ!~6Y4KWrBV$ylIev+ zw!=)On`4)p@(f45-mQ;w&oIlN9iAY64|K%y0X^<+=eY_!<-V9~sR$6^Mgt^x(1`Uo zo%=TDg%5r-;Y_~1umJ%~Pc>sBHbF)UUczRCChjb@BE1+y8`?3ysNiL6!B%X;E7*<> z>_7-R(TQCMqYJO18$Ia7YuJs~@do-3!5-|zo9Is>iUGWZK@4FZhVeGu!3g#vh668T z@drTLq!!AH*M)~u)oHalMSm5;?L9_5kZZP_mq=FBIpupJ?V2pB7nV+kzw1)oHK^>~ z_wg~~WVeF}79WZ0oF;0L{Z-20g2`EjnPj!BFu^1>hhE>MKPoG$##(mOQ2Pow@ft_m z-k&&9wY8tp?8LnBl;JGfn6h1T)%dZod(XU)lWN}obJX9BH6a^6E7Tn7&jyofj;a{X zi6xzTq8iU~bK`Wh@x9K4g1IvtHoMb;x%aX|T_~_yR$I|W3Vxyq%2|VnrZ4SKzgklK z^qF%DKAtdCYke=L;a#? zkK5ePU2A!zH0!bc%S+`7SKCmY8M+(t)}*y)KC)ZgRLqV&*;}L(^4bqYN;b~E@R8y< oIUdnD63_SpBz`rszTcZs8t8AqCcd{q?*xbWzNxF*+x{ev0pe`h9RL6T diff --git a/bin/basic_mega65.rom b/bin/basic_mega65.rom index 62f86610081b70abcd928517949e46cb511dca09..2b665a44bdbff98f29822d288b4358848a8d014d 100644 GIT binary patch delta 178 zcmV;j08RgZK!8B79t8m$vmXVK1RJI+q%5fbAl3f}AXxG!kOivBOrPY2Erc#0*OSHx zPXgbm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M*;g!Q2noi~P8BLHyvr!fa%wEN@eq z%JYJ#>bog+P{a%_?Z|&G*6Wvs^|fnKzdl^~5d4)4FJ-*PT3cRt@wrCFiD!?$U%lv9Wfir^3`I*f`HNJ*iR$5kjtjh-k)8qgxV0F^;G@>b|jksehd1FAw# zR->n?QH}9w^bD%4Lx+waq8?S7#1>Lj{ng@zTfV?8ADCreqoQ}%vE&;za`~W)^4zCP z`fp+Viia0RnpUCL$DaeohE)!Y|4=*KTP7;%47sgd7tp#^;Ol;|f{Ch!2@QDv`_bAR zhof!sFOIgu>K|QhxHI;Rh7I;9WK?1Rt|mgZwk4p)H#F?q?Qs}SzTRU=!~va@SB=vg zWpLkx^^f|vEeN)?G{KPQ(ayOyxrP;`3%LGA6jxK~Airv{mDWH~emV|A13(YNQROaJ zLpDL@gZv119&t|(+BtOsOl)G2Ba8GG&)xvQ>e+} zp}f|>yz?e`FA$=gt?UpFO4lM+2OnBAmOjf}Wi$9J!7eo<&%t>PxGfR-KHG*ie#@YS z^-nX@z*hmlspv?qDQ|?zVty`GXPk*pF5dC`#|)-8!jOs#re4t{Szl$YDlSTLR~fBx F<$uo+sQ>@~ diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 77e705075aae4a0c7ecd3e28b46485d83f0b4823..954448703f6360e140d5439ade471bc779824d85 100644 GIT binary patch delta 1462 zcmbtT|4$QV7{7au(t@G|`En%|Ud6;>0K1W8kckqrq@BJYOl8@YOm88&(?IqEY$MSG zx9r#^V!&4v6}EEWjK$PoG*K`vY-5I!XgV}bN!@gz&0=&OZM`cj*gZ$I+AK;n z9;D><)J!UQJvCv=Ir9w$h0T-8dTJE&uax>^MaA}F6N=oHsm=ssL1adI~f>u zN}ofZ4@_%KypEB6JiV~;h`Y~?>*sKZ4v}os+U~o3JeOtT)HJb)=S1RqDgADcEXo-_ zrV*M;j6FM^Pq``XhnD8WDB>BQeRK8jfN(snYPSn9A1k1tIW=IYWN@H2Ezer3LgnYgNEU%Eay zag`6SRq$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7((o!>dX^E=;jdYgKi z!Z&r6V8U+=R0}R~FlJa8<7&t3Liw3kPxxPa{*OS2^nY&$Q zSZZfuDPCw4;Mx{&cv)9p*hTKbGzoq82I1o$7{yik8ivDddWCr%X*KvcotyAz2Co)B zqwXgqmCPufEtz+6WPs%bnz>y=oQ2EDZG!WgkV>FiiIB#-=>3F#|H0u>bA_3}m92n5 z3?B0a!+Pi-Xej}10xcV0#y?8;6xNk0=8H>Y2!C7eYmu2SHXW}Wpst$ z17(+tpmsuYwq=bxFRNpWLRy@WjegDSW0wAPjki=Rq^4di5V>ID-Rd1y);+z-uDlcc zhKpe>I51cbF^BOvYlW*V9n$!Gti*hEXroL_7chV$9c5!&fVt;mvnQ>rMdKMYq#&9{ zLs&H=|9^;jLgV<2)k&ZHW$kRONC)zzGpwuyN=4G?9P!er9D(G{QMJ^TqdMtijvA#C z+k{8U?exXh<@MHR#wGQ$b!=>>E0pK!XFVSDGUGwfOymKlW3jpN{azrF=3CKU;jU}Q zmEW!EO4VK73=~thv#4-BMqpQhZUS8laATvb*4#ln)!v}0xftXHmzoF-__%HV9x34w z#9^Rg)It{#N3!%~oz7@Dr1g%_OSzaX^rUT$X}}llPWxOO)ev-pp!)=UPN6Xct!<$G WIO-zk%Q~9I5qmBBB94F9?f(FE6?BjQ diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index 6f0041a705790eab125143798ed0987a2997e0cd..f2e21005026ff3e59d38c8ed18af75497f4ee32c 100644 GIT binary patch delta 1885 zcmX|BeN>az8GrJ=gdmE%V8WL`E`ks+Kt$QJMv1VEwBBhVh~Q~8)pUop&h}W>IqZrl zgl!@$MWR#r&5`x;lZKRHgfok?##dxQJV`m*VVjoY?ve{wT!_`#2M7=Bz=-%{J8 zFKXUdvL(f+E>!KRSXEwDxqH(_El3!`CJSQ|2(G)Zd3zOZYJ0N3{yrJcXwB#wZvEQm8YHZ&E2SETugCQCzuzisB_%Vd4pZ*dK+{u?0ILsh-j2LJv z)M2x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}9>+{4l5S2sC^6p;^rl-Z-nF@P=8<8D2lDxx)|6YOBI^ zS&clhuo5!vSa@4m>lJVK5a;I90&mFDc8K%&@UvHZxb;e3NB;es)gim3X?%f{SFEZu zmrI9vni!i?D+clDQF_E&5gzT(=~39b=PDMPd-7Vv26iR6T(NA;@w9BE!TZEuBp2Qi zJFl6q368t47JJ^XI_c)|KpJMmn;n|9e5C0SZ9XJFvFH@L zmNZnlmwuVTXHxj3NqjtmKT6?4DZE3+KaSx`DZF7Ccc<~6<7A+6$>PCOqmyr3#y3{+ YxMB?ZQ+Sas#brid80*C?M&0GV0fg&wH~;_u diff --git a/c64/,,config_generic.s b/c64/,,config_generic.s index 909a70ed..3843ec00 100644 --- a/c64/,,config_generic.s +++ b/c64/,,config_generic.s @@ -22,6 +22,7 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS +#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_mega65.s b/c64/,,config_mega65.s index f292a412..e856a52c 100644 --- a/c64/,,config_mega65.s +++ b/c64/,,config_mega65.s @@ -22,6 +22,7 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS +#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/,,config_ultimate64.s b/c64/,,config_ultimate64.s index 1c075909..f7ce1b93 100644 --- a/c64/,,config_ultimate64.s +++ b/c64/,,config_ultimate64.s @@ -22,6 +22,7 @@ #define CONFIG_DOS_WEDGE #define CONFIG_BCD_SAFE_INTERRUPTS +#define CONFIG_EXTENDED_SCNKEY // for now has to be enabled // #define CONFIG_DBG_STUBS_BRK // #define CONFIG_DBG_PRINTF diff --git a/c64/aliases/,aliases_ram_lowmem.s b/c64/aliases/,aliases_ram_lowmem.s index 8a90a931..bc391aae 100644 --- a/c64/aliases/,aliases_ram_lowmem.s +++ b/c64/aliases/,aliases_ram_lowmem.s @@ -105,43 +105,51 @@ .label BUFPNT = $A6 // -- NOT IMPLEMENTED -- .label INBIT = $A7 // -- NOT IMPLEMENTED -- -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // Carefully avoid $A7 which is used by 64NET .label KeyQuantity = $A8 // 1 byte .label BufferNew = $A9 // 3 bytes -// #endif // CONFIG_EXTENDED_SCNKEY -// .label BITCI = $A8 // -- NOT IMPLEMENTED -- -// .label RINONE = $A9 // -- NOT IMPLEMENTED -- -// .label RIDDATA = $AA // -- NOT IMPLEMENTED -- -// .label RIPRTY = $AB // -- NOT IMPLEMENTED -- +#else + .label BITCI = $A8 // -- NOT IMPLEMENTED -- + .label RINONE = $A9 // -- NOT IMPLEMENTED -- + .label RIDDATA = $AA // -- NOT IMPLEMENTED -- + .label RIPRTY = $AB // -- NOT IMPLEMENTED -- + +#endif .label SAL = $AC // $AC-$AD -- NOT IMPLEMENTED -- (implemented screen part) .label EAL = $AE // $AE-$AF -- NOT IMPLEMENTED -- [!] used also by screen editor, for temporary color storage when scrolling .label CMP0 = $B0 // $B0-$B1 temporary tape storage, [!] here used for BRK instruction address .label TAPE1 = $B2 // $B2-$B3 tape buffer pointer -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // This one should be initialized in cinit to $FF .label BufferQuantity = $B4 // 1 byte -// #endif // CONFIG_EXTENDED_SCNKEY -// .label BITTS = $B4 // -- NOT IMPLEMENTED -- +#else + + .label BITTS = $B4 // -- NOT IMPLEMENTED -- + +#endif .label NXTBIT = $B5 // -- NOT IMPLEMENTED -- -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // Carefully avoiding $A7 which is used by 64NET .label TempZP = $B6 // 1 byte -// #endif // CONFIG_EXTENDED_SCNKEY -// .label RODATA = $B6 // -- NOT IMPLEMENTED -- +#else + + .label RODATA = $B6 // -- NOT IMPLEMENTED -- + +#endif .label FNLEN = $B7 // current file name length .label LA = $B8 // current logical_file number @@ -192,13 +200,13 @@ .label BUF = $200 // $200-$250, BASIC line editor input buffer (81 bytes) -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // $250-$258 is the 81st - 88th characters in BASIC input, a carry over from VIC-20 // and not used on C64, so safe for us to use, probably. .label ScanResult = $250 // 8 bytes -// #endif // CONFIG_EXTENDED_SCNKEY +#endif // [!] XXX document $251-$258 usage .label LAT = $259 // $259-$262, logical file numbers (table, 10 bytes) @@ -221,20 +229,23 @@ .label MODE = $291 // flag, is case switch allowed .label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable -// #if CONFIG_EXTENDED_SCNKEY +#if CONFIG_EXTENDED_SCNKEY // Reuse RS232 variables, since they should not be used by other things. // This one should be initialized in cinit to $FF .label BufferOld = $293 // 3 bytes .label Buffer = $297 // 4 bytes -// #endif // CONFIG_EXTENDED_SCNKEY -// .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 -// .label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551 -// .label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551 -// .label RSSTAT = $297 // -- NOT IMPLEMENTED -- mock 6551, RS-232 status -// .label BITNUM = $298 // -- NOT IMPLEMENTED -- -// .label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED -- +#else + + .label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551 + .label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551 + .label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551 + .label RSSTAT = $297 // -- NOT IMPLEMENTED -- mock 6551, RS-232 status + .label BITNUM = $298 // -- NOT IMPLEMENTED -- + .label BAUDOF = $299 // $299-$29A -- NOT IMPLEMENTED -- + +#endif .label RIDBE = $29B // -- NOT IMPLEMENTED -- .label RIDBS = $29C // -- NOT IMPLEMENTED -- diff --git a/c64/basic/cmd_load.s b/c64/basic/cmd_load.s index cc4698d7..374943f1 100644 --- a/c64/basic/cmd_load.s +++ b/c64/basic/cmd_load.s @@ -95,12 +95,15 @@ got_devicenumber: bne got_loadaddress got_secondaryaddress: - ldx #<$0801 // XXX use start text vector - ldy #>$0801 + ldx TXTTAB+0 + ldy TXTTAB+1 got_loadaddress: lda #$00 // LOAD not verify - jsr via_ILOAD + jsr JLOAD + php + jsr print_return + plp bcc !+ // A = KERNAL error code, which also almost match @@ -218,6 +221,3 @@ end_of_line_search: sta OLDTXT+0 jmp basic_relink_loop - -via_ILOAD: - jmp (ILOAD) diff --git a/c64/kernal/lvs_helpers.s b/c64/kernal/lvs_helpers.s index 996fbfa8..4548f58e 100644 --- a/c64/kernal/lvs_helpers.s +++ b/c64/kernal/lvs_helpers.s @@ -124,8 +124,7 @@ lvs_display_done: bpl lvs_display_end ldx #__MSG_KERNAL_TO_HEX - jsr !- - jmp print_return + jmp !- lvs_wrap_around_error: // This error is probably not even detected by C64 Kernal; From 1f3238ccad6e17a91e0b5ca6619f4ec84766cd7a Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 4 Oct 2019 21:44:58 +0200 Subject: [PATCH 37/40] provided unofficial $E50C routine - for compatibility --- STATUS.md | 25 +++++++++++++------------ bin/basic_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/kernal/e50a.interop | 4 ++++ c64/kernal/{plot.s => e50a.plot.s} | 5 ++++- 7 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 c64/kernal/e50a.interop rename c64/kernal/{plot.s => e50a.plot.s} (64%) diff --git a/STATUS.md b/STATUS.md index 01af1e7c..d5178191 100644 --- a/STATUS.md +++ b/STATUS.md @@ -136,7 +136,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFE7` | `$F32F` | `CLALL` | DONE | | | `$FFEA` | | `UDTIM` | DONE | | | `$FFED` | | `SCREEN` | DONE | | -| `$FFF0` | | `PLOT` | PARTIAL | cursor blink not handled | +| `$FFF0` | `$E50A` | `PLOT` | PARTIAL | cursor blink not handled | | `$FFF3` | | `IOBASE` | DONE | | | `($FFFA)` | | NMI vec | PARTIAL | | | `($FFFC)` | | RESET vec | PARTIAL | | @@ -150,16 +150,17 @@ Not all of them - only these we want to have implemented.
-| Address | Name | Status | Remarks | -| :-------: | :---------------- | :------: | :------------------------------------------------: | -| `$E544` | clear screen | DONE | | -| `$E5A0` | setup VIC II & IO | PARTIAL | | -| `$EA31` | default IRQ | PARTIAL | | -| `$EA7E` | ack CIA1 + below | DONE | | -| `$EA81` | ret from IRQ/NMI | DONE | | -| `$FD30` | default vectors | DONE | | -| `$FE47` | default NMI | PARTIAL | | -| `$FE66` | default BRK | DONE | | -| `$FF80` | revision byte | DONE | | +| Address | Name | Status | Remarks | +| :-------: | :------------------ | :------: | :------------------------------------------------: | +| `$E544` | clear screen | DONE | | +| `$E50C` | set cursor position | PARTIAL | cursor blink not handled | +| `$E5A0` | setup VIC II & IO | PARTIAL | | +| `$EA31` | default IRQ | PARTIAL | | +| `$EA7E` | ack CIA1 + below | DONE | | +| `$EA81` | ret from IRQ/NMI | DONE | | +| `$FD30` | default vectors | DONE | | +| `$FE47` | default NMI | PARTIAL | | +| `$FE66` | default BRK | DONE | | +| `$FF80` | revision byte | DONE | |
diff --git a/bin/basic_mega65.rom b/bin/basic_mega65.rom index 2b665a44bdbff98f29822d288b4358848a8d014d..a8762c7b25f6d6b3d12cf6b034e59c75f7823a14 100644 GIT binary patch delta 19 bcmZp0XmHqYk%dkC+tLjR;+wCtXi5VBPjLr# delta 19 bcmZp0XmHqYk%dj^+tLjRN}I2o2u#GmO<&gQK#Vu=wn`m4_#ZZ@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GjRe$8F)}d-8M9F_b zrM&*Aj*126AcIyT!5K*MBOLZ@x(_huf`^7$sksXaxrEx)UJxgc zlM;jkBFT_bcdT~euUTB~PPxWWgMy2c0L2e#!vuob)SVX?PugO(awmd_aOm&$4&XzdW|6O|xul0w=iiCfS_{WI-C6=L3G)v>%l@L}UQR38J;pU=voY9foG%SS5O4E_KRH`#^9UjYu;gI?M#JMC#Y4 z5jZ<|Pp6@lwZN~;4m4JPh_=_lRSMgc`Q!#uZjX%y{634#@KUZ0w9#wEC>b5iPTE@MP!PW%!MscC) QTNf!pQT4I*Z0o)M0Vsc$p8x;= diff --git a/bin/kernal_mega65.rom b/bin/kernal_mega65.rom index e692530224c01f7400eed964459726f3032d7417..b978c8a2f26bbf456d57a200d054f283880c74be 100644 GIT binary patch delta 1156 zcmYjRe`p(39KYT*=~CD3(qBnff4tH$({9BQrPP5KN5mk{Dig*gt$R|$GU7i&q2SPp zy=>G9b#H20tER`@*vSS56}EIva0oMEp)9j*lF2%DFp9d%CAqg5viQAp9m4T=y!UZ-FeTH7Dct0z|DX=U|PnxHG?I~Rv7k#&E7uaxQE-cA~Eh56UA zH0}y@qWT=ZQyNnerxsNC070*o5YMIsY+IhNq~ORpz3U4046#Wx&$OG8f+Fi^ilOB! znT*avw~V3mZ4_qc4-17@5SI&dmwRUwPxra=Rc97osImFyr1KNW_);Yt{biu1b7#35 zqJTX%yz}F8Ido(l>iuhZ%u04$z*CH*#A$bmnEU|olg0OIGj5N@Noi>ncNuiVd-xT= zsXdF|T7L-Qod-(HV%o zmg3AcxHU76;^&!u$%$8T`Vt&UbACKgh=qhl-na>hkwooru|xolN9_Ln6Yd6qZk`-H zJ^C$(o-a^eOBX%Svft&haKxZ%)guk+r((5M_LBjPBV!YZ_<}@5U*IuyDaEe{TA8TR z^hw{IdhpVrP45Bm_k7(0`2zF+r2qdsAbi!BcC~&p-`?@{ho61^#mwy7m&%M;d%Uma z`ayo>9@HU=zxrNw@y8y}wzj9XPTEoRq**Xd?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>aMfjex>T8Qrs%O_;)nDoCRcG>VXiUi1H4aM@B3 zd^hgOnb989K+jdy9+}qh1%|(1cwrllr|{of_;VeH8D2K=1jDO3E;8}$O?tDk^0^#_ h-7Fjs!Zkwpn1Cxx9MSQqo#=|p5srJTcV$j&{0j#QGm`)S diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index f2e21005026ff3e59d38c8ed18af75497f4ee32c..0eff723afeff861635a9c4e4cc2e400ea86b647e 100644 GIT binary patch delta 1372 zcmYjRe@q)y94~jY1(J2guhB*dZ*G|dM$&*;(6ESxXhWWxanUf7#g`B#Suk0Y82rb9 z>s5l2R39qTUr>9c zGxVRry|mfd#Jm!x0c)K%XusfRE}dn_IX}}6Q_y~?hq>?`L;8D|ewg}vgFbXjN2@6q zao;Ab-}7>bHG!LD{!niI2|=*{IIiytKN6+VKRmn9Z2$Rx%EZ84%S4a7;t-z}K674w(<*8*1w4sVJU zevY5V`()Zyc*7=R^<@)47n)bY8Awpg*{5bS4`lHGP+Ju>nh?sarsHtR zkjU~Of^iD6u{aF~@H@1;=2x8m8k#@I_FMxzSDUq=tWO`?~QsD_r7K6)5<>Q0)#z4l*^ zGc#*W(g39(huVjL+B%>%mZNxMjB*evgJta&*}EV&?JTW715v+cqZT1*A!bqTL8P*{ z6Stm{CJk1+nlu3)`H&O)Qyq2ej+pL(B#6N%S9RN9650su1n|&igb$>H*7C2vsHps^ z=aWxA8ypIK{_uWNJs-i%+lsoA0HLB4JzNOKRdc&RS7@(_PHHHVhMllowD{1S1iiLr zpW~#~?%^ZtW9{dKh?CHJxot;n%AUFrtj zx^?(zMGxB0hzc`u861S|LZpR{NH(AZdkj|_cLZ!5)2Fy4k7-9PZ)#@EYnUF=_{@8x zkshf)Pdfi_@oKm*fv?E;ri{<6;gKX>PvZ|{+^ON|I9^X-R~qlv@Zn|r0{yYl lz2B3^kPj8*^u delta 1370 zcmYjReM}o=7%z9U1EtuZjcV<*IcjlWc>RJ7x<^XRZPfFjZ0O+J7YVn~akC57-2!#GFuhgrE6ar8x7 zoM}!>y6p+(A-F#m!Tr_$o~8@gyC&bxo3j;dNwe?}ETnooquw!IXd|?v;27dBdA{;q z$z1*LDtbx{@NTZ>`svP(qd+!)n;BXRp_96~ zLs@bBj>=#5guGJ*o157Hr9lgSwsWHMJh;_sn+M>NzV2+KS;Y=!Nug!MuDZy|sO5)C za_;9>K(U|j-Z&9I=GKL+B9$4T6h&497rex2&{e#OLEJZr_qCZoyz!tV1H>B#AOPr0 zT%1A&4QOZLL1L<4?vXc@S$#=Z6=ggmGyGNb;AtAY6h}T41CSZclIy~Zyff5pY-=~@-2!*h?vln6VD($ZY8kAqhb{6g zu#}hY+eM<%G<-qFQ_>WCfa71fPylgj zxUDm@8mdy!go-X3Aq9KT;)b}iecSe<6Kbc64;VU%0S6J^%F03FzuG?2B( zcMY}Y`9=J9ESxPdO(a|?-6K-AXVE(!SR9`xZt<*~-Gu(rJIyNLsw0pM5vRh;EE`M{ zafs07((+29{9ZL>lUVFcL0ew%Fc9CbqRjJeY1Rut2LEWs`Y_VEG92Has+%3u{{0{m)?&2TF&A#KFUnVDUyGujk1a+`C* zO%GI{r#q5uUCbz0)U6vR%uz!?^$n4B-!a{5I6KJW0(V1WaYQbF5i(KnMSf#4h+wW= z7t;P7H;T)&(PhCxEEfA}N4oXS|CzIu&j0`b diff --git a/c64/kernal/e50a.interop b/c64/kernal/e50a.interop new file mode 100644 index 00000000..392ddf02 --- /dev/null +++ b/c64/kernal/e50a.interop @@ -0,0 +1,4 @@ +The original reason to move PLOT routine into its original position was to provide support for unofficial $E50C address: + +- it is well known: https://www.lemon64.com/forum/viewtopic.php?t=3296&%3Bstart=15 +- 'Duotris' game calls $E50C during startup screen initialization diff --git a/c64/kernal/plot.s b/c64/kernal/e50a.plot.s similarity index 64% rename from c64/kernal/plot.s rename to c64/kernal/e50a.plot.s index 0f439cde..e72b33d2 100644 --- a/c64/kernal/plot.s +++ b/c64/kernal/e50a.plot.s @@ -11,6 +11,10 @@ PLOT: bcs plot_get + // Note: the 'set' part has to start from $E50C, as this is a known address + // - https://www.lemon64.com/forum/viewtopic.php?t=3296&%3Bstart=15 + // - 'Duotris' game calls $E50C during startup screen initialization + plot_set: sty TBLX stx PNTR @@ -23,4 +27,3 @@ plot_get: ldy TBLX ldx PNTR rts - From ab7af621d5c2ecead461484af2e8e331c7a8093c Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sat, 5 Oct 2019 10:16:19 +0200 Subject: [PATCH 38/40] small code reordering to avoid accidental similarities --- STATUS.md | 4 ++-- c64/basic/cmd_load.s | 2 +- c64/kernal/e50a.interop | 1 + c64/kernal/e50a.plot.s | 2 ++ c64/kernal/fd15.restor.s | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/STATUS.md b/STATUS.md index d5178191..96d2da0c 100644 --- a/STATUS.md +++ b/STATUS.md @@ -136,7 +136,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFE7` | `$F32F` | `CLALL` | DONE | | | `$FFEA` | | `UDTIM` | DONE | | | `$FFED` | | `SCREEN` | DONE | | -| `$FFF0` | `$E50A` | `PLOT` | PARTIAL | cursor blink not handled | +| `$FFF0` | `$E50A` | `PLOT` | PARTIAL | | | `$FFF3` | | `IOBASE` | DONE | | | `($FFFA)` | | NMI vec | PARTIAL | | | `($FFFC)` | | RESET vec | PARTIAL | | @@ -153,7 +153,7 @@ Not all of them - only these we want to have implemented. | Address | Name | Status | Remarks | | :-------: | :------------------ | :------: | :------------------------------------------------: | | `$E544` | clear screen | DONE | | -| `$E50C` | set cursor position | PARTIAL | cursor blink not handled | +| `$E50C` | set cursor position | PARTIAL | | | `$E5A0` | setup VIC II & IO | PARTIAL | | | `$EA31` | default IRQ | PARTIAL | | | `$EA7E` | ack CIA1 + below | DONE | | diff --git a/c64/basic/cmd_load.s b/c64/basic/cmd_load.s index 374943f1..b02ee765 100644 --- a/c64/basic/cmd_load.s +++ b/c64/basic/cmd_load.s @@ -95,8 +95,8 @@ got_devicenumber: bne got_loadaddress got_secondaryaddress: - ldx TXTTAB+0 ldy TXTTAB+1 + ldx TXTTAB+0 got_loadaddress: lda #$00 // LOAD not verify diff --git a/c64/kernal/e50a.interop b/c64/kernal/e50a.interop index 392ddf02..b661797e 100644 --- a/c64/kernal/e50a.interop +++ b/c64/kernal/e50a.interop @@ -1,4 +1,5 @@ The original reason to move PLOT routine into its original position was to provide support for unofficial $E50C address: - it is well known: https://www.lemon64.com/forum/viewtopic.php?t=3296&%3Bstart=15 + https://sys64738.org/2019/05/c64-bedtime-coding-eng-printing-08/ - 'Duotris' game calls $E50C during startup screen initialization diff --git a/c64/kernal/e50a.plot.s b/c64/kernal/e50a.plot.s index e72b33d2..58afa453 100644 --- a/c64/kernal/e50a.plot.s +++ b/c64/kernal/e50a.plot.s @@ -13,6 +13,7 @@ PLOT: // Note: the 'set' part has to start from $E50C, as this is a known address // - https://www.lemon64.com/forum/viewtopic.php?t=3296&%3Bstart=15 + // - https://sys64738.org/2019/05/c64-bedtime-coding-eng-printing-08/ // - 'Duotris' game calls $E50C during startup screen initialization plot_set: @@ -20,6 +21,7 @@ plot_set: stx PNTR // XXX handle cursor blink + // XXX should we update some more variables? // FALLTROUGH to save one byte on RTS diff --git a/c64/kernal/fd15.restor.s b/c64/kernal/fd15.restor.s index c71fe1c4..5e181423 100644 --- a/c64/kernal/fd15.restor.s +++ b/c64/kernal/fd15.restor.s @@ -11,8 +11,8 @@ RESTOR: clc // clear carry - for writing to system table - ldx #vector_defaults + ldx # Date: Sat, 5 Oct 2019 11:19:38 +0200 Subject: [PATCH 39/40] size optimization in BASIC, reordered some code to avoid accidental similarities --- bin/basic_generic.rom | Bin 8192 -> 8192 bytes bin/basic_mega65.rom | Bin 8192 -> 8192 bytes bin/basic_ultimate64.rom | Bin 8192 -> 8192 bytes bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/basic/cmd_load.s | 10 ++-------- c64/basic/init_oldtxt.s | 9 +++++++++ c64/kernal/fda3.ioinit.s | 6 +++--- 9 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 c64/basic/init_oldtxt.s diff --git a/bin/basic_generic.rom b/bin/basic_generic.rom index 574750553c143803e960ca403f87ebbc9805c5a1..7d407af190d226713705a083c74c425b65913ef0 100644 GIT binary patch delta 1812 zcmbtVeN0Um6 zGQTM=Q)g5<(%YVbIwpQ?5j18h-5;*bEPlp-AT$1BTVNA6d%eY&_=kU(_};tsot%4q z_nhDFzMS`j;|a&;L6wJ=NCGuWb~ho-&h0zNuI3%P%><|>qNs9*K+;OOaZr$3Xc!_c zs*7a&Of}&ZQDumkLy0qF$)8+Z@{9GI{!L69OLW z_G@|6h%uqhbou)Nm7QK3C^5_}43^a_*ILwfsFDm*ah`IOdO`~6G5!`Ldx%Lj;=>{NxvNI9d70iarT8o*O+oTgP%IDnlqZD7 z!zYB{F3v=5*Ay90stmm$ZF;K6Gwfr;JuQ1RC8-DKQBWQ>T=J<-K1t=UW}U|e95{J` zC*Zu?Pc?ECLbc=^>l)_DkbP_@C;4uV^JggWG8gEV|9y#f&4x=OdaCCqpjV_PKO?<3 ziCnd_D0k~Dib<4@>5BD-kS`5skKA^~a9O(FEi1IW^4^qe#j{jCkaCxYi%>0Xp*50? zd_GPEwLPNb<@tcD4UQ%)Dx~jMNj=og&+Rdvf>W$c@=S^tpe9ViHJFYWn2Bp~9sV%> z-S~RU!fYh?T;Lg+gBx&ZJQwqDBj#fP7Ge<=1*d07XEwazeLJex(sKi)hS{w7)+X|Xe zUFO`vJ*6dHXR^n4Y<{15O|Nu)sIaon<5oJ@CrHV14U3a0PxX@IBNv4}rz~cQ_X2f$cGs1za&= z?f3%bUh9rsgn`!P2I%8sY~SSlG5goq?GStLcM_|}7Y!dY*XLKjqUoM_=<5Mj&pa!= z0(FD+39|>jdfp5RE>9D5!zD27b}r24^uKe>l`9ad+f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c2e400ea86b647e..bde1ca3e30ae1c2ffbd26c8d432861f171658d87 100644 GIT binary patch delta 219 zcmZp0XmFU|&UAd`L{DcRxv`ItnRWIWg_xC-r!Z@3m#s`lSh|6A;|HNd3JSB=EZwM3 z@OSA3AfXWP$>+mTg%^)Or05f$vXzrxFxxslUH*Yh;nM#X7rri%Tf2w zCyTN=P$y8OBFJK^lm9>PEK&tCmsx_$i1@UU0caJ_{>_(JoF!Nm{9R-)SxR;t%iUhy LJDbnQnlJ$XkjrOQ delta 219 zcmZp0XmFU|&a`shL{DcRxv`ItnbmZqg5AE!QMNGL>n^0~J};l*PRDf+}GV&CK!%(jlbOFytFT>Agw!q-J|YnL&7U|J*()CN?x z)ZF5!_Nt{8PjwVp*C@pOU!>$?x-vmw>AsUXA2?4ceE6!cVV^~UM8f1k7RkvCEL@X2 zS(Md*I)N$`K^9w`{QrSxkt&$E%o1cq#HW=EK&ycEZ@$dpEWxtKV8P$XQnKq Date: Sat, 5 Oct 2019 13:15:52 +0200 Subject: [PATCH 40/40] handled all similarities >3 --- bin/kernal_generic.rom | Bin 8192 -> 8192 bytes bin/kernal_mega65.rom | Bin 8192 -> 8192 bytes bin/kernal_ultimate64.rom | Bin 8192 -> 8192 bytes c64/basic/e422.initmsg.s | 2 +- strings/0000000020 | 3 +++ strings/00000020 | 3 +++ strings/00DD29EF8D00DD60 | 5 +++++ strings/0D4C4F4144494EC70D | 4 ++++ strings/0D564552494659494EC70D | 4 ++++ strings/0DDC8D0D | 3 +++ strings/13F720 | 3 +++ strings/20D2FFC8 | 3 +++ strings/2860A9 | 3 +++ strings/29DF8D00DD60AD00DD09 | 5 +++++ strings/464F52A00D | 4 ++++ strings/48AA2073 | 3 +++ strings/48C8B1 | 3 +++ strings/494EC7 | 4 ++++ strings/494EC70D | 4 ++++ strings/494EC70D534156494E | 4 ++++ strings/4C5BFF4CA3FD4C50FD4C15FD4C1AFD4C | 1 + ...F250F233F357F1CAF1EDF63EF12FF366FEA5F4EDF5 | 6 ++++++ strings/6090051C9F9C1E1F9E8195969798999A9B | 3 +++ ...1E036C20036C22036C24036C26034C9EF44CDDF54C | 1 + strings/7F8D0DDD | 3 +++ strings/8539C8B1 | 3 +++ strings/8A4820 | 3 +++ strings/8BE383A47CA51AA7E4A786AE | 7 +++++++ strings/8D00DD60 | 6 ++++++ strings/8D0DDD8D | 3 +++ strings/8D1003A9 | 3 +++ strings/8D8F02A9 | 3 +++ strings/A2164C37 | 3 +++ strings/A4A53D85 | 3 +++ strings/A4AD00DD | 6 ++++++ strings/A593F002 | 3 +++ strings/A5AD00DD | 3 +++ strings/A86885 | 3 +++ strings/A9002090FF | 3 +++ strings/A9A90185 | 3 +++ strings/A9C92CF0 | 3 +++ strings/AC9D0001 | 3 +++ strings/B1BB20D2FFC8 | 3 +++ strings/BABD04012910 | 3 +++ strings/C902D003 | 3 +++ strings/D0036C028020 | 3 +++ strings/D003CAD0F560 | 3 +++ strings/E52BAAA538E52C20 | 3 +++ strings/E54C0AE5 | 1 + strings/FF0000000000000000000000000000000000 | 3 +++ 50 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 strings/0000000020 create mode 100644 strings/00000020 create mode 100644 strings/00DD29EF8D00DD60 create mode 100644 strings/0D4C4F4144494EC70D create mode 100644 strings/0D564552494659494EC70D create mode 100644 strings/0DDC8D0D create mode 100644 strings/13F720 create mode 100644 strings/20D2FFC8 create mode 100644 strings/2860A9 create mode 100644 strings/29DF8D00DD60AD00DD09 create mode 100644 strings/464F52A00D create mode 100644 strings/48AA2073 create mode 100644 strings/48C8B1 create mode 100644 strings/494EC7 create mode 100644 strings/494EC70D create mode 100644 strings/494EC70D534156494E create mode 100644 strings/4C5BFF4CA3FD4C50FD4C15FD4C1AFD4C create mode 100644 strings/6031EA66FE47FE4AF391F20EF250F233F357F1CAF1EDF63EF12FF366FEA5F4EDF5 create mode 100644 strings/6090051C9F9C1E1F9E8195969798999A9B create mode 100644 strings/6C1A036C1C036C1E036C20036C22036C24036C26034C9EF44CDDF54C create mode 100644 strings/7F8D0DDD create mode 100644 strings/8539C8B1 create mode 100644 strings/8A4820 create mode 100644 strings/8BE383A47CA51AA7E4A786AE create mode 100644 strings/8D00DD60 create mode 100644 strings/8D0DDD8D create mode 100644 strings/8D1003A9 create mode 100644 strings/8D8F02A9 create mode 100644 strings/A2164C37 create mode 100644 strings/A4A53D85 create mode 100644 strings/A4AD00DD create mode 100644 strings/A593F002 create mode 100644 strings/A5AD00DD create mode 100644 strings/A86885 create mode 100644 strings/A9002090FF create mode 100644 strings/A9A90185 create mode 100644 strings/A9C92CF0 create mode 100644 strings/AC9D0001 create mode 100644 strings/B1BB20D2FFC8 create mode 100644 strings/BABD04012910 create mode 100644 strings/C902D003 create mode 100644 strings/D0036C028020 create mode 100644 strings/D003CAD0F560 create mode 100644 strings/E52BAAA538E52C20 create mode 100644 strings/E54C0AE5 create mode 100644 strings/FF0000000000000000000000000000000000 diff --git a/bin/kernal_generic.rom b/bin/kernal_generic.rom index 314606655f5ab95134513ce458af85d1a46a0a87..2ccae4bd8a2715d347905055d5c4d8ad0ddec3b1 100644 GIT binary patch delta 16 XcmZp0XmHqI$HHu})O@oe%YJD9F7gFj delta 16 XcmZp0XmHqI$HKhS++wpM%YJD9FJ1*) diff --git a/bin/kernal_mega65.rom b/bin/kernal_mega65.rom index 44b877505515d13fcacb5bbad8b75207dc874e0e..a598b2b07ef2321e78aa6a6dfcff0f4eb0cd756b 100644 GIT binary patch delta 16 XcmZp0XmHqI$HHu})O@oe%YJD9F7gFj delta 16 XcmZp0XmHqI$HKhS++wpM%YJD9FJ1*) diff --git a/bin/kernal_ultimate64.rom b/bin/kernal_ultimate64.rom index bde1ca3e30ae1c2ffbd26c8d432861f171658d87..5278a59b7ce040966ad62a69ef61625a7bb4fe15 100644 GIT binary patch delta 16 XcmZp0XmHqI$HHu})O@oe%YJD9F7gFj delta 16 XcmZp0XmHqI$HKhS++wpM%YJD9FJ1*) diff --git a/c64/basic/e422.initmsg.s b/c64/basic/e422.initmsg.s index 261ce40b..2520c5bd 100644 --- a/c64/basic/e422.initmsg.s +++ b/c64/basic/e422.initmsg.s @@ -29,8 +29,8 @@ INITMSG: // Work out free bytes, display them jsr basic_do_new + sec lda MEMSIZ+0 - sec sbc TXTTAB+0 tax lda MEMSIZ+1 diff --git a/strings/0000000020 b/strings/0000000020 new file mode 100644 index 00000000..07a73cb0 --- /dev/null +++ b/strings/0000000020 @@ -0,0 +1,3 @@ +couple 0's + JMP (address does not match) + +Similairty only due to some parts of the ROM being empty. And not even a full instruction - not copyrightable. diff --git a/strings/00000020 b/strings/00000020 new file mode 100644 index 00000000..07a73cb0 --- /dev/null +++ b/strings/00000020 @@ -0,0 +1,3 @@ +couple 0's + JMP (address does not match) + +Similairty only due to some parts of the ROM being empty. And not even a full instruction - not copyrightable. diff --git a/strings/00DD29EF8D00DD60 b/strings/00DD29EF8D00DD60 new file mode 100644 index 00000000..99a521b2 --- /dev/null +++ b/strings/00DD29EF8D00DD60 @@ -0,0 +1,5 @@ +$DD00 + AND #$EF + STA $DD00 + RTS + +$DD00 is a hardware register, where one typically set/unset/read individual bits. +Having a set of trivial helper subroutines to set/clear individual bits (or groups of bits) is an obvious solution (thus not copyrightable), some similarities are unevitable. +Besides, in this case (since the similarity does not even cover a single subroutine from start to end) it is clear that the similar code actually performs slightly different actions. diff --git a/strings/0D4C4F4144494EC70D b/strings/0D4C4F4144494EC70D new file mode 100644 index 00000000..6b9411da --- /dev/null +++ b/strings/0D4C4F4144494EC70D @@ -0,0 +1,4 @@ +PETSCII string: LOADIN(G + end of string mark) + + +Encoding strings by adding $80 to it's last character (to mark end of stream) is a common byte-saving technique - for example, Turbo Basic XL (for Atari, now open-source) does the same. +And a single word following the is not copyrightable. diff --git a/strings/0D564552494659494EC70D b/strings/0D564552494659494EC70D new file mode 100644 index 00000000..d87e9d11 --- /dev/null +++ b/strings/0D564552494659494EC70D @@ -0,0 +1,4 @@ +PETSCII string: + VERIFYIN(G + end of string mark) + + +Encoding strings by adding $80 to it's last character (to mark end of stream) is a common byte-saving technique - for example, Turbo Basic XL (for Atari, now open-source) does the same. +And a single word following the is not copyrightable. diff --git a/strings/0DDC8D0D b/strings/0DDC8D0D new file mode 100644 index 00000000..f8e36ee1 --- /dev/null +++ b/strings/0DDC8D0D @@ -0,0 +1,3 @@ +$DC0D + STA $xxxx (only one byte of the address match) + +Not even a full instruction - not copyrightable. diff --git a/strings/13F720 b/strings/13F720 new file mode 100644 index 00000000..14d51096 --- /dev/null +++ b/strings/13F720 @@ -0,0 +1,3 @@ +$F713 + JSR (address does not match) + +Not even a full instruction - not copyrightable. diff --git a/strings/20D2FFC8 b/strings/20D2FFC8 new file mode 100644 index 00000000..33dc38ad --- /dev/null +++ b/strings/20D2FFC8 @@ -0,0 +1,3 @@ +JSR $FFD2 (official CHROUT jumptable entry) + INY + +Very small part of a loop displaying something - not copyrightable. diff --git a/strings/2860A9 b/strings/2860A9 new file mode 100644 index 00000000..1e7b5c2d --- /dev/null +++ b/strings/2860A9 @@ -0,0 +1,3 @@ +PLP + RTS + (new subroutine) LDA #$xx (value does not match) + +End of routine made to preserve processor status + one byte of the next subroutine. Trivial - not copyrightable. diff --git a/strings/29DF8D00DD60AD00DD09 b/strings/29DF8D00DD60AD00DD09 new file mode 100644 index 00000000..5ca17c37 --- /dev/null +++ b/strings/29DF8D00DD60AD00DD09 @@ -0,0 +1,5 @@ +AND #$DF + STA $DD00 + RTS + (start of the next routine) LDA $DD00 + ORA #$xx (value does not match) + +$DD00 is a hardware register, where one typically set/unset/read individual bits. +Having a set of trivial helper subroutines to set/clear individual bits (or groups of bits) is an obvious solution (thus not copyrightable), some similarities are unevitable. +Besides, in this case (since the similarity does not even cover a single subroutine from start to end) it is clear that the similar code actually performs slightly different actions. diff --git a/strings/464F52A00D b/strings/464F52A00D new file mode 100644 index 00000000..2deab4bb --- /dev/null +++ b/strings/464F52A00D @@ -0,0 +1,4 @@ +PETSCII string: FOR (space + end of string mark) + + +Encoding strings by adding $80 to it's last character (to mark end of stream) is a common byte-saving technique - for example, Turbo Basic XL (for Atari, now open-source) does the same. +And a single word is not copyrightable. diff --git a/strings/48AA2073 b/strings/48AA2073 new file mode 100644 index 00000000..d45c3127 --- /dev/null +++ b/strings/48AA2073 @@ -0,0 +1,3 @@ +PHA + TAX + JSR (address does not fully match) + +Simple stack/register manipulation (common of 6502 family) + jump to subroutine (not even matching address) - trivial, not copyrightable. diff --git a/strings/48C8B1 b/strings/48C8B1 new file mode 100644 index 00000000..90fe365f --- /dev/null +++ b/strings/48C8B1 @@ -0,0 +1,3 @@ +$48 + INY + LDA ($xx),Y (argument does not match) + +One instruction and some parts - not copyrightable. diff --git a/strings/494EC7 b/strings/494EC7 new file mode 100644 index 00000000..e278c110 --- /dev/null +++ b/strings/494EC7 @@ -0,0 +1,4 @@ +PETSCII string: IN(G + end of string mark) + +Encoding strings by adding $80 to it's last character (to mark end of stream) is a common byte-saving technique - for example, Turbo Basic XL (for Atari, now open-source) does the same. +And a single syllable is not copyrightable. diff --git a/strings/494EC70D b/strings/494EC70D new file mode 100644 index 00000000..0d013451 --- /dev/null +++ b/strings/494EC70D @@ -0,0 +1,4 @@ +PETSCII string: IN(G + end of string mark) + + +Encoding strings by adding $80 to it's last character (to mark end of stream) is a common byte-saving technique - for example, Turbo Basic XL (for Atari, now open-source) does the same. +And a single syllable is not copyrightable. diff --git a/strings/494EC70D534156494E b/strings/494EC70D534156494E new file mode 100644 index 00000000..1e139695 --- /dev/null +++ b/strings/494EC70D534156494E @@ -0,0 +1,4 @@ +PETSCII string: IN(G + end of string mark) + + SAVIN + +Encoding strings by adding $80 to it's last character (to mark end of stream) is a common byte-saving technique - for example, Turbo Basic XL (for Atari, now open-source) does the same. +Here we don't even have a single word - not copyrightable. diff --git a/strings/4C5BFF4CA3FD4C50FD4C15FD4C1AFD4C b/strings/4C5BFF4CA3FD4C50FD4C15FD4C1AFD4C new file mode 100644 index 00000000..fcfe7208 --- /dev/null +++ b/strings/4C5BFF4CA3FD4C50FD4C15FD4C1AFD4C @@ -0,0 +1 @@ +This is a part of Kernal jumptable - series of jumps, sometimes to the well known addreses (or through documented vectors). No business logic, part of the Kernal API itself - not copyrightable. diff --git a/strings/6031EA66FE47FE4AF391F20EF250F233F357F1CAF1EDF63EF12FF366FEA5F4EDF5 b/strings/6031EA66FE47FE4AF391F20EF250F233F357F1CAF1EDF63EF12FF366FEA5F4EDF5 new file mode 100644 index 00000000..c9996113 --- /dev/null +++ b/strings/6031EA66FE47FE4AF391F20EF250F233F357F1CAF1EDF63EF12FF366FEA5F4EDF5 @@ -0,0 +1,6 @@ +RTS (from previous routine) + a list of vectors to be copied starting from $0314 + +Values of the vectors are already present in many autostart software - as it often overrides them, +sometimes changing one to trigger autostart (one of the possible techniques). We have to use the same +vector values to be compatible (in fact, it even complicates our implementation) - see *.interop files +for more details. diff --git a/strings/6090051C9F9C1E1F9E8195969798999A9B b/strings/6090051C9F9C1E1F9E8195969798999A9B new file mode 100644 index 00000000..93585716 --- /dev/null +++ b/strings/6090051C9F9C1E1F9E8195969798999A9B @@ -0,0 +1,3 @@ +RTS + list of C64 colour codes + +List of facts (RTS matches only due to build system decision algorithm). Not copyrightable. diff --git a/strings/6C1A036C1C036C1E036C20036C22036C24036C26034C9EF44CDDF54C b/strings/6C1A036C1C036C1E036C20036C22036C24036C26034C9EF44CDDF54C new file mode 100644 index 00000000..fcfe7208 --- /dev/null +++ b/strings/6C1A036C1C036C1E036C20036C22036C24036C26034C9EF44CDDF54C @@ -0,0 +1 @@ +This is a part of Kernal jumptable - series of jumps, sometimes to the well known addreses (or through documented vectors). No business logic, part of the Kernal API itself - not copyrightable. diff --git a/strings/7F8D0DDD b/strings/7F8D0DDD new file mode 100644 index 00000000..5fb50d7f --- /dev/null +++ b/strings/7F8D0DDD @@ -0,0 +1,3 @@ +$7F + STA $DD0D + +Instruction and some part - not copyrightable. diff --git a/strings/8539C8B1 b/strings/8539C8B1 new file mode 100644 index 00000000..f1c0de4e --- /dev/null +++ b/strings/8539C8B1 @@ -0,0 +1,3 @@ +STA $39 + INY + LDA ($xx), Y (argument does not match) + +Small part of a loop manipulating BASIC memory - not copyrightable. diff --git a/strings/8A4820 b/strings/8A4820 new file mode 100644 index 00000000..a5bc0fa6 --- /dev/null +++ b/strings/8A4820 @@ -0,0 +1,3 @@ +TXA + PHA + JSR (addres does not match) + +Simple stack/register manipulation (common of 6502 family, would be reduced to PHX on some CPUs) + jump to subroutine (not even matching address) - trivial, not copyrightable. diff --git a/strings/8BE383A47CA51AA7E4A786AE b/strings/8BE383A47CA51AA7E4A786AE new file mode 100644 index 00000000..5b3e3e6d --- /dev/null +++ b/strings/8BE383A47CA51AA7E4A786AE @@ -0,0 +1,7 @@ +a list of vectors to be copied starting from $0300 + +Values of the vectors are already present in many autostart software - as it often overrides them, +sometimes changing one to trigger autostart (one of the possible techniques). We have to use the same +vector values to be compatible (in fact, it even complicates our implementation) - see *.interop files +for more details. + diff --git a/strings/8D00DD60 b/strings/8D00DD60 new file mode 100644 index 00000000..2a4681d3 --- /dev/null +++ b/strings/8D00DD60 @@ -0,0 +1,6 @@ +STA $DD00 + RTS + +$DD00 is one of the CIA ports, so storing value +into this port is something rather expected and common. + +Besides, these are just two instructions, second one being end of subroutine - not copyrightable. diff --git a/strings/8D0DDD8D b/strings/8D0DDD8D new file mode 100644 index 00000000..2819f811 --- /dev/null +++ b/strings/8D0DDD8D @@ -0,0 +1,3 @@ +STA $DD0D + STA (address does not match) + +Instruction and some part - not copyrightable. diff --git a/strings/8D1003A9 b/strings/8D1003A9 new file mode 100644 index 00000000..74148a77 --- /dev/null +++ b/strings/8D1003A9 @@ -0,0 +1,3 @@ +STA $0310 + LDA #$xx (value does not match) + +Instruction + a half. Not copyrightable. diff --git a/strings/8D8F02A9 b/strings/8D8F02A9 new file mode 100644 index 00000000..3e0425bf --- /dev/null +++ b/strings/8D8F02A9 @@ -0,0 +1,3 @@ +STA $028F + LDA #$xx (value does not match) + +Instruction + a half. Not copyrightable. diff --git a/strings/A2164C37 b/strings/A2164C37 new file mode 100644 index 00000000..a030896b --- /dev/null +++ b/strings/A2164C37 @@ -0,0 +1,3 @@ +LDX #$16 + JMP $xx37 (address does not fully match) + +Instruction + a part of another one. Not copyrightable. diff --git a/strings/A4A53D85 b/strings/A4A53D85 new file mode 100644 index 00000000..b9094fe0 --- /dev/null +++ b/strings/A4A53D85 @@ -0,0 +1,3 @@ +$A4 + LDA $3D + STA (address does not match) + +Instruction + some parts. Not copyrightable. diff --git a/strings/A4AD00DD b/strings/A4AD00DD new file mode 100644 index 00000000..34920d45 --- /dev/null +++ b/strings/A4AD00DD @@ -0,0 +1,6 @@ +$A4 + LDA $DD00 + +$DD00 is one of the CIA ports, so checking the value of inputs +on this port is something rather expected and common. + +Besides - this is just one instruction and some part - not copyrightable. diff --git a/strings/A593F002 b/strings/A593F002 new file mode 100644 index 00000000..df080101 --- /dev/null +++ b/strings/A593F002 @@ -0,0 +1,3 @@ +LDA $93 + BEQ (offset match, skip 2 bytes) + +Decision based on a content of a documented memory location - trivial, not copyrightable. diff --git a/strings/A5AD00DD b/strings/A5AD00DD new file mode 100644 index 00000000..3a7e9ae3 --- /dev/null +++ b/strings/A5AD00DD @@ -0,0 +1,3 @@ +$A5 + LDA $DD00 + +Instruction and some part - not copyrightable. diff --git a/strings/A86885 b/strings/A86885 new file mode 100644 index 00000000..a2b87807 --- /dev/null +++ b/strings/A86885 @@ -0,0 +1,3 @@ +TAY + PLA + STA (zero page address does not match) + +Simple stack/register manipulation, not even matching memory address (which is a documented/well-known variable) - not copyrightable. diff --git a/strings/A9002090FF b/strings/A9002090FF new file mode 100644 index 00000000..c97baee0 --- /dev/null +++ b/strings/A9002090FF @@ -0,0 +1,3 @@ +LDA #$00 + JSR $FF90 (official docummented SETMSG jumptable address) + +Two instructions to enabla Kernal string messages - trivial, not copyrightable. diff --git a/strings/A9A90185 b/strings/A9A90185 new file mode 100644 index 00000000..5497d5af --- /dev/null +++ b/strings/A9A90185 @@ -0,0 +1,3 @@ +$A9 + LDA #$01 + STA (zeropage location does not match) + +Instruction and some parts - not copyrightable. diff --git a/strings/A9C92CF0 b/strings/A9C92CF0 new file mode 100644 index 00000000..1481503a --- /dev/null +++ b/strings/A9C92CF0 @@ -0,0 +1,3 @@ +$A9 + CMP #$2C + BEQ (offset does not match) + +Instruction + some parts. Not copyrightable. diff --git a/strings/AC9D0001 b/strings/AC9D0001 new file mode 100644 index 00000000..b75f2557 --- /dev/null +++ b/strings/AC9D0001 @@ -0,0 +1,3 @@ +$AC + STA $0100,X + +Instruction + some part. Not copyrightable. diff --git a/strings/B1BB20D2FFC8 b/strings/B1BB20D2FFC8 new file mode 100644 index 00000000..9d85d44d --- /dev/null +++ b/strings/B1BB20D2FFC8 @@ -0,0 +1,3 @@ +LDA ($BB),Y + JSR $FFD2 (CHROUT official jumptable entry) + INY + +Part of a loop displaying a string - trivial, not copyrightable. diff --git a/strings/BABD04012910 b/strings/BABD04012910 new file mode 100644 index 00000000..3f42a187 --- /dev/null +++ b/strings/BABD04012910 @@ -0,0 +1,3 @@ +TSX + LDA $0104,X + AND #$10 + +Simple check what caused an interrupt - not copyrightable. diff --git a/strings/C902D003 b/strings/C902D003 new file mode 100644 index 00000000..82ab06f9 --- /dev/null +++ b/strings/C902D003 @@ -0,0 +1,3 @@ +CMP #$02 + BNE (offset matches, skip 3 bytes) + +Becision based on accumulator being equal to 2 (which is a number of a specific unique device) - trivial, not copyrightable. diff --git a/strings/D0036C028020 b/strings/D0036C028020 new file mode 100644 index 00000000..d89b34f0 --- /dev/null +++ b/strings/D0036C028020 @@ -0,0 +1,3 @@ +BNE (offset match, skip 3 bytes) + JMP ($8002) + JSR (address does not match) + +If cartridge present, jump into it using official API, else - do some subroutine. Not creative - not copyrightable. diff --git a/strings/D003CAD0F560 b/strings/D003CAD0F560 new file mode 100644 index 00000000..eaf70a44 --- /dev/null +++ b/strings/D003CAD0F560 @@ -0,0 +1,3 @@ +BNE (offset match, skip 3 bytes) + DEX + BNE (backwards, offset match) + RTS + +Part of a routine scanning for a valid cartridge - there aren't many sane ways to do this (compare strings), some similarity is unevitable. Not creative - not copyrightable. diff --git a/strings/E52BAAA538E52C20 b/strings/E52BAAA538E52C20 new file mode 100644 index 00000000..44750a39 --- /dev/null +++ b/strings/E52BAAA538E52C20 @@ -0,0 +1,3 @@ +SBC $2B + TAX + LDA $38 + SBC $2C + JSR (address does not match) + +Part of the code printing available BASIC memory size (it has to substract two 16 bit values). Not many ways to do this, some similarity is inevitable. Not creative - not copyrightable. diff --git a/strings/E54C0AE5 b/strings/E54C0AE5 new file mode 100644 index 00000000..fcfe7208 --- /dev/null +++ b/strings/E54C0AE5 @@ -0,0 +1 @@ +This is a part of Kernal jumptable - series of jumps, sometimes to the well known addreses (or through documented vectors). No business logic, part of the Kernal API itself - not copyrightable. diff --git a/strings/FF0000000000000000000000000000000000 b/strings/FF0000000000000000000000000000000000 new file mode 100644 index 00000000..f4672b03 --- /dev/null +++ b/strings/FF0000000000000000000000000000000000 @@ -0,0 +1,3 @@ +$FF followed by multiple 0's + +Meaningless - results of both ROM sets having empty space. Not copyrightable.