Merge pull request #42 from FeralChild64/master

Various improvements
This commit is contained in:
gardners authored and GitHub committed 2020-02-24 10:31:11 +10:30
commit 6deb5a4322
448 files changed
+5504 -718

No files matched your search

+19 -3
View File
@@ -113,7 +113,7 @@ Uses RAM under BASIC, I/O and KERNAL, takes over `$C000`-`$CFFF` area requires s
Comparing to standard memory model, it needs about 180 bytes in BASIC segment and 80 bytes in KERNAL segment - at the moment of doing the test, these values are expected to change often.
## I/O devices
## IEC devices
### `CONFIG_IEC`
@@ -143,17 +143,27 @@ Needs about 430 bytes in KERNAL segment. If unsure - enable.
Causes screen blanking during JiffyDOS file loading to increase performance.
## Tape support
Note: for Mega65 most of the tape support code is placed in it's extended ROM; very little of the (tiny) KERNAL segment is used.
### `CONFIG_TAPE_NORMAL`
Adds a minimal normal (standard Commodore format) tape support - just LOAD command.
Needs about 700 bytes in KERNAL segment (if both normal and turbo are enabled, about 900 bytes are needed, as they share some code). If unsure - enable.
Needs about 1050 bytes in KERNAL segment (if both normal and turbo are enabled, about 900 bytes are needed, as they share some code). If unsure - enable.
### `CONFIG_TAPE_TURBO`
Adds a minimal turbo tape support - just LOAD command (device 7, like on _Action Replay_ and _Final_ cartridges), up to 250 blocks
Needs about 700 bytes in KERNAL segment (if both normal and turbo are enabled, about 950 bytes are needed, as they share some code). If unsure - enable.
Needs about 700 bytes in KERNAL segment (if both normal and turbo are enabled, about 1300 bytes are needed, as they share some code). If unsure - enable.
### `CONFIG_TAPE_AUTODETECT`
Tape format (normal/turbo) is always autodetected.
Needs about 100 more bytes in KERNAL segment.
### `CONFIG_TAPE_NO_KEY_SENSE`
@@ -163,6 +173,12 @@ Enable this option if you are using a tape interface adapter with some audio sig
Enable this option if you are using a tape interface adapter lacking tape motor control (most likely every adapter currently being sold) - this will eliminate the need to quickly press space when the program header information gets displayed. Note: if you are using a cassette player with REM port, and your adapter is connected to this port too, than you do not need this option.
### `CONFIG_TAPE_NO_ERROR_CORRECTION`
Normal tape format contains two copies of each data block - in case some bytes from the first one are damaged, they can be corrected by reading them from the second copy. Enabling this option omits the core to read the second block.
If used with `CONFIG_TAPE_NORMAL`, saves about 125 bytes in KERNAL segment. Not recommended when using real magnetic tapes.
## 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.
+1 -1
View File
@@ -1,3 +1,3 @@
Although the project itself is LGPL3, I (FeralChild64 - Roman St********ski) allow to redistribute
Although the project itself is LGPL3, I (FeralChild64 - Roman Standzikowski) allow to redistribute
my contributions to this project under any OSI (Open Source Initiative) approved open source license.
+25
View File
@@ -0,0 +1,25 @@
# CREDITS to people whose work was of great help to us
## for source code we reused
* TWW/CTR - for his keyboard handling code
* Graham - for his PAL/NTSC detection routine
* enthusi/Onslaught - for his example Turbo Tape 64 compatible loader
## for documentation
* Frantic - for [Codebase 64](https://codebase64.org)
* Joe Forster/STA - for the official/unofficial ROM API description at [sta.c64.org](http://sta.c64.org)
* J. Derogee - for the IEC Disected document
* Michael Steil - for a great IEC protocol description and various other documentation at [his blog](https://www.pagetable.com)
* Jochen Adler - for the JiffyDOS protocol reverse engineering
* H2Obsession - for the JiffyDOS protocol description on [his page](https://sites.google.com/site/h2obsession/CBM/C128/JiffySoft128)
* SD2IEC team - the project [source code](https://github.com/rkrajnc/sd2iec) helped a lot when adding IEC and JiffyDOS support
* slark - for his screen codes / PETSCII description at [slark.me](https://slark.me)
* silverdr - for the floating point routines [description](https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics)
* the [C64 Wiki](https://www.c64-wiki.com) contributors
<br />
* ... and all the others we forgot
+3 -2
View File
@@ -1,8 +1,9 @@
The following copyright notices apply to the entirety of this package,
including each source file, unless otherwise noted in each file.
including each source file, unless otherwise noted in each file or directory.
Copyright Paul Gardner-Stephen, 2019.
Copyright Paul Gardner-Stephen, 2019.
Copyright Roman Standzikowski (FeralChil64), 2019-2020.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
+252 -146
View File
@@ -11,15 +11,21 @@ SRCDIR_COMMON = c64/aliases
SRCDIR_BASIC = $(SRCDIR_COMMON) \
c64/basic \
c64/basic/,stubs \
c64/basic/,stubs_math \
c64/basic/board_m65 \
c64/basic/board_x16 \
c64/basic/commands \
c64/basic/init \
c64/basic/math \
c64/basic/math_consts \
c64/basic/rom_revision
SRCDIR_KERNAL = $(SRCDIR_COMMON) \
c64/kernal \
c64/kernal/,stubs \
c64/kernal/assets \
c64/kernal/banking \
c64/kernal/board_m65 \
c64/kernal/board_x16 \
c64/kernal/iec \
c64/kernal/iec_fast \
c64/kernal/init \
@@ -35,44 +41,90 @@ SRCDIR_KERNAL = $(SRCDIR_COMMON) \
c64/kernal/tape \
c64/kernal/time
SRC_TOOLS = $(wildcard src/tools/*.c,src/tools/*.cc)
SRC_BASIC = $(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s))
SRC_KERNAL = $(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s))
SRC_TOOLS = $(wildcard tools/*.c,tools/*.cc)
# Generated files
GEN_BASIC = build/,generated/packed_messages.s
GEN_BASIC = build/,generated/packed_messages.s build/,generated/float_constants.s
GEN_KERNAL =
# List of build directories
DIR_CUS = build/target_custom
DIR_GEN = build/target_generic
DIR_TST = build/target_testing
DIR_M65 = build/target_mega65
DIR_U64 = build/target_ultimate64
DIR_X16 = build/target_cx16
# List of config files
CFG_CUS = c64/,,config_custom.s
CFG_GEN = c64/,,config_generic.s
CFG_TST = c64/,,config_testing.s
CFG_M65 = c64/,,config_mega65.s
CFG_U64 = c64/,,config_ultimate64.s
CFG_X16 = c64/,,config_cx16.s
# Dependencies - helper variables
DEP_BASIC = $(SRC_BASIC) $(SRCDIR_BASIC) $(GEN_BASIC)
DEP_KERNAL = $(SRC_KERNAL) $(SRCDIR_KERNAL) $(GEN_KERNAL)
# List of tools
TOOL_COLLECT_DATA = build/tools/collect_data
TOOL_COMPRESS_TEXT = build/tools/compress_text
TOOL_PNGPREPARE = build/tools/pngprepare
TOOL_BUILD_SEGMENT = build/tools/build_segment
TOOL_RELEASE = build/tools/release
TOOL_SIMILARITY = build/tools/similarity
TOOL_ASSEMBLER = assembler/KickAss.jar
TOOL_COLLECT_DATA = build/tools/collect_data
TOOL_COMPRESS_TEXT = build/tools/compress_text
TOOL_GENERATE_CONSTANTS = build/tools/generate_constants
TOOL_PNGPREPARE = build/tools/pngprepare
TOOL_BUILD_SEGMENT = build/tools/build_segment
TOOL_RELEASE = build/tools/release
TOOL_SIMILARITY = build/tools/similarity
TOOL_ASSEMBLER = assembler/KickAss.jar
TOOLS_LIST = $(pathsubst src/tools/%,build/tools/%,$(basename $(SRC_TOOLS)))
TOOLS_LIST = $(pathsubst tools/%,build/tools/%,$(basename $(SRC_TOOLS)))
# List of targets
STD_TARGET_LIST_CUSTOM = build/kernal_custom.rom build/basic_custom.rom
STD_TARGET_LIST_GENERIC = build/kernal_generic.rom build/basic_generic.rom
STD_TARGET_LIST_TESTING = build/kernal_testing.rom build/basic_testing.rom
STD_TARGET_LIST_ULTIMATE64 = build/kernal_ultimate64.rom build/basic_ultimate64.rom
STD_TARGET_LIST_MEGA65 = build/mega65.rom
TARGET_CUS_B = build/basic_custom.rom
TARGET_GEN_B = build/basic_generic.rom
TARGET_TST_B = build/basic_testing.rom
TARGET_U64_B = build/basic_ultimate64.rom
STD_TARGET_LIST = build/chargen.rom \
$(STD_TARGET_LIST_CUSTOM) \
$(STD_TARGET_LIST_GENERIC) \
$(STD_TARGET_LIST_TESTING) \
$(STD_TARGET_LIST_MEGA65) \
$(STD_TARGET_LIST_ULTIMATE64)
TARGET_CUS_K = build/kernal_custom.rom
TARGET_GEN_K = build/kernal_generic.rom
TARGET_TST_K = build/kernal_testing.rom
TARGET_U64_K = build/kernal_ultimate64.rom
EXT_TARGET_LIST = build/mega65.rom
TARGET_M65_x = build/mega65.rom
TARGET_X16_x = build/cx16-dummy.rom
REL_TARGET_LIST = $(pathsubst build/%,bin/%, $(STD_TARGET_LIST))
TARGET_LIST_CUS = $(TARGET_CUS_B) $(TARGET_CUS_K)
TARGET_LIST_GEN = $(TARGET_GEN_B) $(TARGET_GEN_K)
TARGET_LIST_TST = $(TARGET_TST_B) $(TARGET_TST_K)
TARGET_LIST_U64 = $(TARGET_U64_B) $(TARGET_U64_K)
TARGET_LIST = build/chargen.rom \
$(TARGET_LIST_CUS) \
$(TARGET_LIST_GEN) \
$(TARGET_LIST_TST) \
$(TARGET_M65_x) \
$(TARGET_LIST_U64) \
$(TARGET_X16_x)
SEG_LIST_M65 = $(DIR_M65)/basic.seg_0 \
$(DIR_M65)/basic.seg_1 \
$(DIR_M65)/kernal.seg_0 \
$(DIR_M65)/kernal.seg_1
SEG_LIST_X16 = $(DIR_X16)/basic.seg_0 \
$(DIR_X16)/basic.seg_1 \
$(DIR_X16)/kernal.seg_0 \
$(DIR_X16)/kernal.seg_1
REL_TARGET_LIST = $(TARGET_LIST_GEN) $(TARGET_LIST_TST) $(TARGET_M65_x) $(TARGET_LIST_U64)
# Misc strings
@@ -87,31 +139,31 @@ GIT_COMMIT:= $(shell git log -1 --pretty='%h' | tr '[:lower:]' '[:upper:]')
.PHONY: all clean updatebin
all:
$(MAKE) -j64 --output-sync=target $(STD_TARGET_LIST) $(EXT_TARGET_LIST)
$(MAKE) -j64 --output-sync=target $(TARGET_LIST) $(EXT_TARGET_LIST)
clean:
@rm -rf build c64/basic/combined.s c64/kernal/combined.s
updatebin:
$(MAKE) -j64 --output-sync=target $(STD_TARGET_LIST) $(EXT_TARGET_LIST) $(TOOL_RELEASE)
$(TOOL_RELEASE) -i ./build -o ./bin basic_generic.rom kernal_generic.rom basic_testing.rom kernal_testing.rom basic_ultimate64.rom kernal_ultimate64.rom mega65.rom
$(MAKE) -j64 --output-sync=target $(TARGET_LIST) $(TOOL_RELEASE)
$(TOOL_RELEASE) -i ./build -o ./bin $(patsubst build/%,%,$(REL_TARGET_LIST))
cp build/chargen.rom bin/chargen.rom
# Rules - tools
$(TOOL_PNGPREPARE): src/pngprepare.c
$(TOOL_PNGPREPARE): tools/pngprepare.c
@mkdir -p build/tools
$(CC) -O2 -Wall -I/usr/local/include -L/usr/local/lib -o $@ $< -lpng
$(TOOL_COMPRESS_TEXT): src/compress_text.c
$(TOOL_COMPRESS_TEXT): tools/compress_text.c
@mkdir -p build/tools
$(CC) -O2 -Wall -I/usr/local/include -L/usr/local/lib -o $@ $< -lm
build/tools/%: src/%.c
build/tools/%: tools/%.c
@mkdir -p build/tools
$(CC) -O2 -Wall -o $@ $<
build/tools/%: src/%.cc src/common.h
build/tools/%: tools/%.cc tools/common.h
@mkdir -p build/tools
$(CXX) -O2 -Wall -o $@ $<
@@ -122,157 +174,208 @@ build/chargen.rom: $(TOOL_PNGPREPARE) assets/8x8font.png
# Dependencies - BASIC and KERNAL
build/target_custom/OUTB.BIN build/target_custom/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \
c64/,,config_custom.s build/target_custom/KERNAL_combined.sym \
$(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s))
build/target_generic/OUTB.BIN build/target_generic/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \
c64/,,config_generic.s build/target_generic/KERNAL_combined.sym \
$(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s))
build/target_testing/OUTB.BIN build/target_testing/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \
c64/,,config_testing.s build/target_testing/KERNAL_combined.sym \
$(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s))
build/target_mega65/OUTB_0.BIN build/target_mega65/BASIC_0_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \
c64/,,config_mega65.s build/target_mega65/KERNAL_0_combined.sym \
$(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s))
build/target_ultimate64/OUTB.BIN build/target_ultimate64/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_BASIC) $(SRCDIR_BASIC) \
c64/,,config_ultimate64.s build/target_ultimate64/KERNAL_combined.sym \
$(foreach dir,$(SRCDIR_BASIC),$(wildcard $(dir)/*.s))
$(DIR_CUS)/OUTB_x.BIN $(DIR_CUS)/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_CUS) $(DIR_CUS)/KERNAL_combined.sym
$(DIR_GEN)/OUTB_x.BIN $(DIR_GEN)/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_GEN) $(DIR_GEN)/KERNAL_combined.sym
$(DIR_TST)/OUTB_x.BIN $(DIR_TST)/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_TST) $(DIR_TST)/KERNAL_combined.sym
$(DIR_U64)/OUTB_x.BIN $(DIR_U64)/BASIC_combined.vs: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_U64) $(DIR_U64)/KERNAL_combined.sym
build/target_custom/OUTK.BIN build/target_custom/KERNAL_combined.vs build/target_custom/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \
c64/,,config_custom.s \
$(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s))
build/target_generic/OUTK.BIN build/target_generic/KERNAL_combined.vs build/target_generic/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \
c64/,,config_generic.s \
$(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s))
build/target_testing/OUTK.BIN build/target_testing/KERNAL_combined.vs build/target_testing/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \
c64/,,config_testing.s \
$(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s))
build/target_mega65/OUTK_0.BIN build/target_mega65/KERNAL_0_combined.vs build/target_mega65/KERNAL_0_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \
c64/,,config_mega65.s \
$(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s))
build/target_ultimate64/OUTK.BIN build/target_ultimate64/KERNAL_combined.vs build/target_ultimate64/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(GEN_KERNAL) $(SRCDIR_KERNAL) \
c64/,,config_ultimate64.s \
$(foreach dir,$(SRCDIR_KERNAL),$(wildcard $(dir)/*.s))
$(DIR_CUS)/OUTK_x.BIN $(DIR_CUS)/KERNAL_combined.vs $(DIR_CUS)/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_CUS)
$(DIR_GEN)/OUTK_x.BIN $(DIR_GEN)/KERNAL_combined.vs $(DIR_GEN)/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_GEN)
$(DIR_TST)/OUTK_x.BIN $(DIR_TST)/KERNAL_combined.vs $(DIR_TST)/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_TST)
$(DIR_U64)/OUTK_x.BIN $(DIR_U64)/KERNAL_combined.vs $(DIR_U64)/KERNAL_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_U64)
build/target_custom/newrom: build/target_custom/OUTB.BIN build/target_custom/OUTK.BIN
build/target_generic/newrom: build/target_generic/OUTB.BIN build/target_generic/OUTK.BIN
build/target_testing/newrom: build/target_testing/OUTB.BIN build/target_testing/OUTK.BIN
build/target_mega65/newrom_0: build/target_mega65/OUTB_0.BIN build/target_mega65/OUTK_0.BIN
build/target_ultimate64/newrom: build/target_ultimate64/OUTB.BIN build/target_ultimate64/OUTK.BIN
$(DIR_M65)/OUTB_0.BIN $(DIR_M65)/BASIC_0_combined.vs $(DIR_M65)/BASIC_0_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym
$(DIR_M65)/OUTK_0.BIN $(DIR_M65)/KERNAL_0_combined.vs $(DIR_M65)/KERNAL_0_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65)
build/kernal_custom.rom: build/target_custom/newrom
build/kernal_generic.rom: build/target_generic/newrom
build/kernal_testing.rom: build/target_testing/newrom
build/kernal_mega65.rom_0: build/target_mega65/newrom_0
build/kernal_ultimate64.rom: build/target_ultimate64/newrom
$(DIR_X16)/OUTB_0.BIN $(DIR_X16)/BASIC_0_combined.vs $(DIR_X16)/BASIC_0_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(DIR_X16)/KERNAL_0_combined.sym
$(DIR_X16)/OUTK_0.BIN $(DIR_X16)/KERNAL_0_combined.vs $(DIR_X16)/KERNAL_0_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_X16)
build/basic_custom.rom: build/target_custom/newrom
build/basic_generic.rom: build/target_generic/newrom
build/basic_testing.rom: build/target_testing/newrom
build/basic_mega65.rom_0: build/target_mega65/newrom_0
build/basic_ultimate64.rom: build/target_ultimate64/newrom
$(DIR_M65)/basic.seg_1 $(DIR_M65)/BASIC_1_combined.vs $(DIR_M65)/BASIC_1_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym $(DIR_M65)/BASIC_0_combined.sym
$(DIR_M65)/kernal.seg_1 $(DIR_M65)/KERNAL_1_combined.vs $(DIR_M65)/KERNAL_1_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_M65) $(DIR_M65)/KERNAL_0_combined.sym
build/symbols_custom.vs: build/target_custom/BASIC_combined.vs build/target_custom/KERNAL_combined.vs
build/symbols_generic.vs: build/target_generic/BASIC_combined.vs build/target_generic/KERNAL_combined.vs
build/symbols_testing.vs: build/target_testing/BASIC_combined.vs build/target_testing/KERNAL_combined.vs
build/symbols_mega65_0.vs: build/target_mega65/BASIC_0_combined.vs build/target_mega65/KERNAL_0_combined.vs
build/symbols_ultimate64.vs: build/target_ultimate64/BASIC_combined.vs build/target_ultimate64/KERNAL_combined.vs
$(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1_combined.vs $(DIR_X16)/BASIC_1_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_BASIC) $(CFG_X16) $(DIR_M65)/KERNAL_0_combined.sym $(DIR_X16)/BASIC_0_combined.sym
$(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1_combined.vs $(DIR_X16)/KERNAL_1_combined.sym: \
$(TOOL_ASSEMBLER) $(TOOL_BUILD_SEGMENT) $(DEP_KERNAL) $(CFG_X16) $(DIR_X16)/KERNAL_0_combined.sym
# Rules - BASIC and KERNAL
$(DIR_CUS)/OUTx_x.BIN: $(DIR_CUS)/OUTB_x.BIN $(DIR_CUS)/OUTK_x.BIN
$(DIR_GEN)/OUTx_x.BIN: $(DIR_GEN)/OUTB_x.BIN $(DIR_GEN)/OUTK_x.BIN
$(DIR_TST)/OUTx_x.BIN: $(DIR_TST)/OUTB_x.BIN $(DIR_TST)/OUTK_x.BIN
$(DIR_M65)/OUTx_0.BIN: $(DIR_M65)/OUTB_0.BIN $(DIR_M65)/OUTK_0.BIN
$(DIR_U64)/OUTx_x.BIN: $(DIR_U64)/OUTB_x.BIN $(DIR_U64)/OUTK_x.BIN
$(DIR_X16)/OUTx_0.BIN: $(DIR_X16)/OUTB_0.BIN $(DIR_X16)/OUTK_0.BIN
$(TARGET_CUS_B): $(DIR_CUS)/OUTx_x.BIN
$(TARGET_GEN_B): $(DIR_GEN)/OUTx_x.BIN
$(TARGET_TST_B): $(DIR_TST)/OUTx_x.BIN
$(TARGET_U64_B): $(DIR_U64)/OUTx_x.BIN
$(TARGET_CUS_K): $(DIR_CUS)/OUTx_x.BIN
$(TARGET_GEN_K): $(DIR_GEN)/OUTx_x.BIN
$(TARGET_TST_K): $(DIR_TST)/OUTx_x.BIN
$(TARGET_U64_K): $(DIR_U64)/OUTx_x.BIN
build/symbols_custom.vs: $(DIR_CUS)/BASIC_combined.vs $(DIR_CUS)/KERNAL_combined.vs
build/symbols_generic.vs: $(DIR_GEN)/BASIC_combined.vs $(DIR_GEN)/KERNAL_combined.vs
build/symbols_testing.vs: $(DIR_TST)/BASIC_combined.vs $(DIR_TST)/KERNAL_combined.vs
build/symbols_ultimate64.vs: $(DIR_U64)/BASIC_combined.vs $(DIR_U64)/KERNAL_combined.vs
# Rules - BASIC and KERNAL intermediate files
build/,generated/packed_messages.s: $(TOOL_COMPRESS_TEXT)
@mkdir -p build/,generated
$(TOOL_COMPRESS_TEXT) > build/,generated/packed_messages.s
.PRECIOUS: build/target_%/OUTB.BIN build/target_%/BASIC_combined.vs
build/target_%/OUTB.BIN build/target_%/BASIC_combined.vs:
build/,generated/float_constants.s: $(TOOL_GENERATE_CONSTANTS)
@mkdir -p build/,generated
$(TOOL_GENERATE_CONSTANTS) -o build/,generated/float_constants.s
.PRECIOUS: build/target_%/OUTB_x.BIN build/target_%/BASIC_combined.vs
build/target_%/OUTB_x.BIN build/target_%/BASIC_combined.vs:
@mkdir -p build/target_$*
@rm -f $@* build/target_$*/BASIC*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s BASIC -i BASIC-$* -o OUTB.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC) $(GEN_BASIC)
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s BASIC -i BASIC-$* -o OUTB_x.BIN -d build/target_$* -l a000 -h e4d2 c64/,,config_$*.s $(SRCDIR_BASIC) $(GEN_BASIC)
.PRECIOUS: build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym
build/target_%/OUTK.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym:
.PRECIOUS: build/target_%/OUTK_x.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym
build/target_%/OUTK_x.BIN build/target_%/KERNAL_combined.vs build/target_%/KERNAL_combined.sym:
@mkdir -p build/target_$*
@rm -f $@* build/target_$*/KERNAL*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s KERNAL -i KERNAL-$* -o OUTK.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL) $(GEN_KERNAL)
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r STD -s KERNAL -i KERNAL-$* -o OUTK_x.BIN -d build/target_$* -l e4d3 -h ffff c64/,,config_$*.s $(SRCDIR_KERNAL) $(GEN_KERNAL)
build/target_mega65/OUTB_0.BIN build/target_mega65/BASIC_0_combined.vs:
@mkdir -p build/target_mega65
@rm -f $@* build/target_mega65/BASIC_0*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_0 -i BASIC_0-mega65 -o OUTB_0.BIN -d build/target_mega65 -l a000 -h e4d2 c64/,,config_mega65.s $(SRCDIR_BASIC) $(GEN_BASIC)
# Rules - BASIC and KERNAL intermediate files, for Mega65
build/target_mega65/OUTK_0.BIN build/target_mega65/KERNAL_0_combined.vs build/target_mega65/KERNAL_0_combined.sym:
@mkdir -p build/target_mega65
@rm -f $@* build/target_mega65/KERNAL_0*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_0 -i KERNAL_0-mega65 -o OUTK_0.BIN -d build/target_mega65 -l e4d3 -h ffff c64/,,config_mega65.s $(SRCDIR_KERNAL) $(GEN_KERNAL)
$(DIR_M65)/OUTB_0.BIN $(DIR_M65)/BASIC_0_combined.vs $(DIR_M65)/BASIC_0_combined.sym:
@mkdir -p $(DIR_M65)
@rm -f $@* $(DIR_M65)/BASIC_0*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_0 -i BASIC_0-mega65 -o OUTB_0.BIN -d $(DIR_M65) -l a000 -h e4d2 $(CFG_M65) $(SRCDIR_BASIC) $(GEN_BASIC)
build/target_mega65/kernal.seg_1 build/target_mega65/KERNAL_1_combined.vs build/target_mega65/KERNAL_1_combined.sym: $(TOOL_BUILD_SEGMENT)
@mkdir -p build/target_mega65
@rm -f $@* build/target_mega65/kernal.seg_1 build/target_mega65/KERNAL_1*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_1 -i KERNAL_1-mega65 -o kernal.seg_1 -d build/target_mega65 -l 4000 -h 5fff c64/,,config_mega65.s $(SRCDIR_KERNAL) $(GEN_KERNAL)
$(DIR_M65)/OUTK_0.BIN $(DIR_M65)/KERNAL_0_combined.vs $(DIR_M65)/KERNAL_0_combined.sym:
@mkdir -p $(DIR_M65)
@rm -f $@* $(DIR_M65)/KERNAL_0*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_0 -i KERNAL_0-mega65 -o OUTK_0.BIN -d $(DIR_M65) -l e4d3 -h ffff $(CFG_M65) $(SRCDIR_KERNAL) $(GEN_KERNAL)
.PRECIOUS: build/target_%/newrom
build/target_%/newrom:
cat build/target_$*/OUTB.BIN build/target_$*/OUTK.BIN > $@
$(DIR_M65)/basic.seg_1 $(DIR_M65)/BASIC_1_combined.vs $(DIR_M65)/BASIC_1_combined.sym:
@mkdir -p $(DIR_M65)
@rm -f $@* $(DIR_M65)/basic.seg_1 $(DIR_M65)/BASIC_1*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s BASIC_1 -i BASIC_1-mega65 -o basic.seg_1 -d $(DIR_M65) -l 4000 -h 5fff $(CFG_M65) $(SRCDIR_BASIC) $(GEN_BASIC)
$(DIR_M65)/kernal.seg_1 $(DIR_M65)/KERNAL_1_combined.vs $(DIR_M65)/KERNAL_1_combined.sym:
@mkdir -p $(DIR_M65)
@rm -f $@* $(DIR_M65)/kernal.seg_1 $(DIR_M65)/KERNAL_1*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r M65 -s KERNAL_1 -i KERNAL_1-mega65 -o kernal.seg_1 -d $(DIR_M65) -l 4000 -h 5fff $(CFG_M65) $(SRCDIR_KERNAL) $(GEN_KERNAL)
# Rules - BASIC and KERNAL intermediate files, for Commander X16
$(DIR_X16)/OUTB_0.BIN $(DIR_X16)/BASIC_0_combined.vs $(DIR_X16)/BASIC_0_combined.sym:
@mkdir -p $(DIR_X16)
@rm -f $@* $(DIR_X16)/BASIC_0*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s BASIC_0 -i BASIC_0-mega65 -o OUTB_0.BIN -d $(DIR_X16) -l c000 -h e4d2 $(CFG_X16) $(SRCDIR_BASIC) $(GEN_BASIC)
$(DIR_X16)/OUTK_0.BIN $(DIR_X16)/KERNAL_0_combined.vs $(DIR_X16)/KERNAL_0_combined.sym:
@mkdir -p $(DIR_X16)
@rm -f $@* $(DIR_X16)/KERNAL_0*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s KERNAL_0 -i KERNAL_0-mega65 -o OUTK_0.BIN -d $(DIR_X16) -l e4d3 -h ffff $(CFG_X16) $(SRCDIR_KERNAL) $(GEN_KERNAL)
$(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1_combined.vs $(DIR_X16)/BASIC_1_combined.sym:
@mkdir -p $(DIR_X16)
@rm -f $@* $(DIR_X16)/basic.seg_1 $(DIR_X16)/BASIC_1*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s BASIC_1 -i BASIC_1-mega65 -o basic.seg_1 -d $(DIR_X16) -l a000 -h bfff $(CFG_X16) $(SRCDIR_BASIC) $(GEN_BASIC)
$(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1_combined.vs $(DIR_X16)/KERNAL_1_combined.sym:
@mkdir -p $(DIR_X16)
@rm -f $@* $(DIR_X16)/kernal.seg_1 $(DIR_X16)/KERNAL_1*
@$(TOOL_BUILD_SEGMENT) -a ../../$(TOOL_ASSEMBLER) -r X16 -s KERNAL_1 -i KERNAL_1-mega65 -o kernal.seg_1 -d $(DIR_X16) -l a000 -h bfff $(CFG_X16) $(SRCDIR_KERNAL) $(GEN_KERNAL)
# Rules - BASIC and KERNAL
.PRECIOUS: build/target_%/OUTx_x.BIN
build/target_%/OUTx_x.BIN:
cat build/target_$*/OUTB_x.BIN build/target_$*/OUTK_x.BIN > $@
.PRECIOUS: build/kernal_%.rom
build/kernal_%.rom:
dd if=build/target_$*/newrom bs=8192 count=1 skip=2 of=$@
dd if=build/target_$*/OUTx_x.BIN bs=8192 count=1 skip=2 of=$@
.PRECIOUS: build/basic_%.rom
build/basic_%.rom:
dd if=build/target_$*/newrom bs=8192 count=1 skip=0 of=$@
dd if=build/target_$*/OUTx_x.BIN 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 | grep -v "__" > $@
build/target_mega65/newrom_0:
cat build/target_mega65/OUTB_0.BIN build/target_mega65/OUTK_0.BIN > $@
$(DIR_M65)/OUTx_0.BIN:
cat $(DIR_M65)/OUTB_0.BIN $(DIR_M65)/OUTK_0.BIN > $@
build/kernal_mega65.rom_0:
dd if=build/target_mega65/newrom_0 bs=8192 count=1 skip=2 of=$@
$(DIR_M65)/kernal.seg_0: $(DIR_M65)/OUTx_0.BIN
dd if=$(DIR_M65)/OUTx_0.BIN bs=8192 count=1 skip=2 of=$@
build/basic_mega65.rom_0:
dd if=build/target_mega65/newrom_0 bs=8192 count=1 skip=0 of=$@
$(DIR_M65)/basic.seg_0: $(DIR_M65)/OUTx_0.BIN
dd if=$(DIR_M65)/OUTx_0.BIN bs=8192 count=1 skip=0 of=$@
build/kernal_hybrid.rom: kernal build/target_generic/OUTK.BIN
$(DIR_X16)/OUTx_0.BIN:
cat $(DIR_X16)/OUTB_0.BIN $(DIR_X16)/OUTK_0.BIN > $@
$(DIR_X16)/kernal.seg_0: $(DIR_X16)/OUTx_0.BIN
dd if=$(DIR_X16)/OUTx_0.BIN bs=8192 count=1 skip=1 of=$@
$(DIR_X16)/basic.seg_0: $(DIR_X16)/OUTx_0.BIN
dd if=$(DIR_X16)/OUTx_0.BIN bs=8192 count=1 skip=0 of=$@
build/kernal_hybrid.rom: kernal $(DIR_GEN)/OUTK_x.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) > $@
cat $(DIR_GEN)/OUTK_x.BIN) > $@
build/symbols_hybrid.vs: build/target_generic/KERNAL_combined.vs
sort build/target_generic/KERNAL_combined.vs | uniq | grep -v "__" > $@
build/symbols_hybrid.vs: $(DIR_GEN)/KERNAL_combined.vs
sort $(DIR_GEN)/KERNAL_combined.vs | uniq | grep -v "__" > $@
# Rules - platform 'Mega 65' specific
# Rules - platform 'Mega65' specific
build/mega65.rom: build/kernal_mega65.rom_0 build/target_mega65/kernal.seg_1 build/basic_mega65.rom_0 build/chargen.rom
dd if=/dev/zero bs=8192 count=1 of=build/padding_8k
dd if=/dev/zero bs=8192 count=8 of=build/padding_64k
cat build/padding_8k > build/mega65.rom
cat build/padding_8k >> build/mega65.rom
cat build/target_mega65/kernal.seg_1 >> build/mega65.rom
cat build/padding_8k >> build/mega65.rom
cat build/padding_8k >> build/mega65.rom
cat build/basic_mega65.rom_0 >> build/mega65.rom
cat build/chargen.rom build/chargen.rom >> build/mega65.rom
cat build/kernal_mega65.rom_0 >> build/mega65.rom
cat build/padding_64k >> build/mega65.rom
rm -f build/padding*
$(TARGET_M65_x): $(SEG_LIST_M65) build/chargen.rom
dd if=/dev/zero bs=8192 count=1 of=build/m65_padding_08_KB
dd if=/dev/zero bs=8192 count=8 of=build/m65_padding_64_KB
cat build/m65_padding_08_KB > $(TARGET_M65_x)
cat build/m65_padding_08_KB >> $(TARGET_M65_x)
cat $(DIR_M65)/kernal.seg_1 >> $(TARGET_M65_x)
cat $(DIR_M65)/basic.seg_1 >> $(TARGET_M65_x)
cat build/m65_padding_08_KB >> $(TARGET_M65_x)
cat $(DIR_M65)/basic.seg_0 >> $(TARGET_M65_x)
cat build/chargen.rom >> $(TARGET_M65_x)
cat build/chargen.rom >> $(TARGET_M65_x)
cat $(DIR_M65)/kernal.seg_0 >> $(TARGET_M65_x)
cat build/m65_padding_64_KB >> $(TARGET_M65_x)
rm -f build/m65_padding_*
# Rules - platform 'Commander X16' specific
$(TARGET_X16_x): $(SEG_LIST_X16) build/chargen.rom
dd if=/dev/zero bs=8192 count=1 of=build/x16_padding_08_KB
dd if=/dev/zero bs=8192 count=8 of=build/x16_padding_64_KB
cat $(DIR_X16)/basic.seg_0 > $(TARGET_X16_x)
cat $(DIR_X16)/kernal.seg_0 >> $(TARGET_X16_x)
cat build/chargen.rom >> $(TARGET_X16_x)
cat $(DIR_X16)/basic.seg_1 >> $(TARGET_X16_x)
cat $(DIR_X16)/kernal.seg_1 >> $(TARGET_X16_x)
rm -f build/x16_padding_*
# Rules - tests
@@ -295,12 +398,15 @@ test_generic_x128: build/kernal_generic.rom build/basic_generic.rom build/symbol
test_testing: build/kernal_testing.rom build/basic_testing.rom build/symbols_testing.vs
x64 -kernal build/kernal_testing.rom -basic build/basic_testing.rom -moncommands build/symbols_testing.vs -1 $(TESTTAPE) -8 $(TESTDISK)
test_mega65: build/mega65.rom
../xemu/build/bin/xmega65.native -dmarev 2 -forcerom -loadrom build/mega65.rom
test_ultimate64: build/kernal_ultimate64.rom build/basic_ultimate64.rom build/symbols_ultimate64.vs
x64 -kernal build/kernal_ultimate64.rom -basic build/basic_ultimate64.rom -moncommands build/symbols_ultimate64.vs -1 $(TESTTAPE) -8 $(TESTDISK)
test_mega65: $(TARGET_M65_x)
../xemu/build/bin/xmega65.native -dmarev 2 -forcerom -loadrom $(TARGET_M65_x)
test_cx16: $(TARGET_X16_x)
../x16-emulator/x16emu -rom $(TARGET_X16_x)
test_hybrid: build/kernal_hybrid.rom build/symbols_hybrid.vs
@echo
@echo $(HYBRID_WARNING)
@@ -316,6 +422,6 @@ test_m65: build/mega65.rom
testremote: build/kernal_custom.rom build/basic_custom.rom build/symbols_custom.vs
x64 -kernal build/kernal_custom.rom -basic build/basic_custom.rom -moncommands build/symbols_custom.vs -remotemonitor
testsimilarity: build/target_generic/newrom $(TOOL_SIMILARITY) kernal basic
$(TOOL_SIMILARITY) kernal build/target_generic/newrom
$(TOOL_SIMILARITY) basic build/target_generic/newrom
testsimilarity: $(TOOL_SIMILARITY) $(DIR_GEN)/OUTx_x.BIN kernal basic
$(TOOL_SIMILARITY) kernal $(DIR_GEN)/OUTx_x.BIN
$(TOOL_SIMILARITY) basic $(DIR_GEN)/OUTx_x.BIN
+2
View File
@@ -5,6 +5,8 @@ A project to create unencumbered open-source ROMs for use on selected retro comp
* [implementation status](./STATUS.md) of various APIs and functionalities
* [configuration options](./CONFIG.md) for those willing to compile their own, customized ROM set
* [development guide](./doc/Development.md) for those interested in OpenROMs technical aspects
* [license](./LICENSE) information and list of major contributors
* [credits](./CREDITS.md) to people whose work was of great help to us
# Problem Statement and Motivation
+139 -14
View File
@@ -12,7 +12,9 @@ Here are the features of the Open ROMs not found in the original ROMs from the 8
* DOS wedge (direct mode only) - `@<drive_number>`, `@<command>`, `@$`, `@$<params>`, `@`
* turbo tape load support (as device 7, or using `←L`), quite sophisticated: up to 250 blocks (can store bytes under I/O), automatically adjusts for tape speed differences
* improved support for tape adapters (for using regular casette players and other audio devices instead of Datasette)
* normal tape load error log is limited by free stack space only (no artificial limitation like in original ROMs)
* tape format autodetection; normal vs turbo is mostly transparent to user
* improved support for tape adapters (for using regular casette players and other audio devices instead of Datasette) and emulators
* extended `LOAD` command
* start/end addresses are displayed, in the Final cartridge style
@@ -48,29 +50,41 @@ The following ROM features are currently missing:
## Keyboard
<br />
| Driver | Status | Remarks |
| :----------------: | :------: | :------------------------------------------------: |
| C64 | DONE | |
| C128 | DONE | |
| Mega65 | NOT DONE | code should be complete, but is not tested yet |
<br />
## Screen
<br />
| Driver | Status | Remarks |
| :----------------: | :------: | :------------------------------------------------: |
| VIC-II | DONE | |
| 80 columns, VDC | NOT DONE | |
| 80 columns, Mega65 | NOT DONE | |
<br />
## Tape port (LOAD only!)
* Tapuino
* Datasette
<br />
| Driver | Status | Remarks |
| :----------------: | :------: | :------------------------------------------------: |
| normal | PARTIAL | no tape speed calibratrion, no error correction |
| turbo (250 blocks) | DONE | |
| normal | DONE | up to 202 blocks, like original ROM |
| turbo | DONE | up to 250 blocks, like the best implementations |
<br />
## IEC bus
@@ -79,6 +93,8 @@ The following ROM features are currently missing:
* most disk drives and printers
* some hard drives
<br />
| Driver | Status | Remarks |
| :----------------: | :------: | :------------------------------------------------: |
| standard | DONE | |
@@ -87,27 +103,36 @@ The following ROM features are currently missing:
| CIA burst mod | NOT DONE | |
| Mega65 burst | NOT DONE | |
<br />
## IEEE-488 bus
* petSD+
* PET era disk drives and printers
* various scientific equipment
<br />
| Driver | Status | Remarks |
| :----------------: | :------: | :------------------------------------------------: |
| CBM cartridge | NOT DONE | |
<br />
## RS-232
* modems (telephone, WiFi)
* parallel port printers
<br />
| Driver | Status | Remarks |
| :----------------: | :------: | :------------------------------------------------: |
| UP2400 | NOT DONE | |
| UP9600 | NOT DONE | work started, not functional yet |
| ACIA 6551 | NOT DONE | |
<br />
# API status
@@ -142,7 +167,107 @@ For the current status of the low memory location implementation andd usage chec
<br />
### Unofficial BASIC routines/locations
### Math package
Floating point mathematical routines - not official, but well known and broadly used. Note: there is an awful mess regarding naming (sometimes same name references different routines in different sources), so a custom naming scheme was applied.
<br />
| Address | Name | Status | Remarks |
| :-------: | :--------------------- | :------: | :------------------------------------------------: |
| `$A9C4` | `convert_FAC1_to_INT` | NOT DONE | |
| `$AABC` | `print_FAC1` | NOT DONE | |
| `$AF7B` | `compute_TI` | NOT DONE | |
| `$AF7E` | not named yet | NOT DONE | |
| `$AF87` | not named yet | NOT DONE | |
| `$AF9A` | `compute_ST` | NOT DONE | |
| `$B1AA` | `FACINX` | NOT DONE | convert FAC1 to 16-bit signed integer |
| `$B1BF` | `convert_FAC1_to_s16` | NOT DONE | |
| `$B391` | `GIVAYF` | NOT DONE | 16-bit signed integer to FAC1 |
| `$B3A2` | `convert_Y_to_FAC1` | NOT DONE | |
| `$B794` | `convert_A_to_FAC1` | NOT DONE | |
| `$B7B5` | `STRVAL` | NOT DONE | imports string to FAC1 |
| `$B7F7` | `convert_FAC1_to_ADDR` | NOT DONE | |
| `$B849` | `add_HALF_FAC1` | NOT DONE | |
| `$B850` | `sub_MEM_FAC1` | DONE | |
| `$B853` | `sub_FAC2_FAC1` | DONE | |
| `$B862` | `add_align_exponents` | DONE | |
| `$B867` | `add_MEM_FAC1` | DONE | |
| `$B86A` | `add_FAC2_FAC1` | DONE | |
| `$B8FE` | `normal_FAC1` | DONE | |
| `$B947` | `inv_FAC1_mantissa` | NOT DONE | |
| `$B983` | `MULSHF` | NOT DONE | |
| `$B9EA` | `log_FAC1` | NOT DONE | |
| `$BA28` | `mul_MEM_FAC1` | PARTIAL | needs `mul_FAC2_FAC1` |
| `$BA2B` | `mul_FAC2_FAC1` | NOT DONE | some work started |
| `$BA59` | `MLTPLY` | NOT DONE | |
| `$BA8C` | `mov_MEM_FAC2` | DONE | |
| `$BA90` | `get_FAC2_via_INDEX` | NOT DONE | |
| `$BAE2` | `mul10_FAC1` | NOT DONE | |
| `$BAFE` | `div10_FAC1_p` | NOT DONE | |
| `$BB0F` | `div_MEM_FAC1` | PARTIAL | needs `div_FAC2_FAC1` |
| `$BB12` | `div_FAC2_FAC1` | NOT DONE | |
| `$BBA2` | `mov_MEM_FAC1` | DONE | |
| `$BBA6` | `get_FAC2_via_INDEX` | NOT DONE | |
| `$BBC7` | `mov_r_FAC1_TMP2` | PARTIAL | not fully tested yet |
| `$BBCA` | `mov_r_FAC1_TMP1` | PARTIAL | not fully tested yet |
| `$BBD0` | `mov_r_FAC1_VAR` | PARTIAL | not fully tested yet |
| `$BBD4` | `mov_r_FAC1_MEM` | PARTIAL | not fully tested yet |
| `$BBFC` | `mov_FAC2_FAC1` | PARTIAL | not fully tested yet |
| `$BC0C` | `mov_r_FAC1_FAC2` | PARTIAL | not fully tested yet |
| `$BC0F` | `mov_FAC1_FAC2` | DONE | |
| `$BC1B` | `round_FAC1` | PARTIAL | not fully tested yet |
| `$BC2B` | `sgn_FAC1_A` | NOT DONE | |
| `$BC39` | `sgn_FAC1` | NOT DONE | |
| `$BC3C` | `convert_A_to_FAC1` | NOT DONE | |
| `$BC44` | `convert_i16_to_FAC1` | NOT DONE | |
| `$BC58` | `abs_FAC1` | NOT DONE | |
| `$BC5B` | `FCOMP` | NOT DONE | compare FAC1 with RAM location |
| `$BC9B` | `QINT` | NOT DONE | convert FAC1 to 32 bit signed integer |
| `$BCCC` | `int_FAC1` | NOT DONE | |
| `$BCF3` | `FIN` | NOT DONE | imports string to FAC1, ignores spaces |
| `$BD7E` | `FINLOG` | NOT DONE | |
| `$BDDD` | `FOUT` | NOT DONE | outputs FAC1 to string at $0100 |
| `$BF71` | `sqr_FAC1` | NOT DONE | |
| `$BF74` | `sqr_FAC2` | NOT DONE | |
| `$BF78` | `FPWR` | NOT DONE | set FAC1 as RAM raised to the power of FAC1 |
| `$BF7B` | `FPWRT` | NOT DONE | set FAC1 as FAC2 raised to the power of FAC1 |
| `$BFB4` | `toggle_sign_FAC1` | DONE | |
| `$BFED` | `exp_FAC1` | NOT DONE | |
| `$E043` | `poly1_FAC1` | NOT DONE | |
| `$E059` | `poly2_FAC1` | NOT DONE | |
| `$E097` | `rnd_FAC1` | PARTIAL | requires `sgn_FAC1_A` |
| `$E09A` | `rnd_A` | DONE | |
| `$E0BE` | `rnd_generate` | DONE | |
| `$E264` | `cos_FAC1` | NOT DONE | |
| `$E26B` | `sin_FAC1` | NOT DONE | |
| `$E2B4` | `tan_FAC1` | NOT DONE | |
| `$E30E` | `atn_FAC1` | NOT DONE | |
<br />
In addition to the routines, the following floating-number constants are available at their original locations:
| Address | Name | Status | Remarks |
| :-------: | :-------------------------- | :------: | :-------------------------------------------: |
| `$AEA8` | `const_PI` | DONE | π |
| `$B1A5` | `const_NEG_32768` | DONE | -32768 |
| `$B9BC` | `const_ONE` | DONE | 1.0 |
| `$B9D6` | `const_INV_SQR_2` | DONE | 1.0 / sqr(2.0) |
| `$B9DB` | `const_SQR_2` | DONE | sqr(2.0) |
| `$B9E0` | `const_NEG_HALF` | DONE | -0.5 |
| `$B9E5` | `const_LOG_2` | DONE | log_e(2.0) |
| `$BAF9` | `const_TEN` | DONE | 10.0 |
| `$BF11` | `const_HALF` | DONE | 0.5 |
| `$BFBF` | `const_INV_LOG_2` | DONE | 1.0 / log_e(2.0) |
| `$BFE8` | `const_ONE` duplicate | DONE | 1.0 |
| `$E2E0` | `const_HALF_PI` | DONE | PI / 2.0 |
| `$E2E5` | `const_DOUBLE_PI` | DONE | PI * 2.0 |
| `$E2EA` | `const_QUARTER` | DONE | 0.25 |
| `$E309` | `const_DOUBLE_PI` duplicate | DONE | PI * 2.0 |
### Other unofficial BASIC routines/locations
Not all of them - only these we want to have implemented.
@@ -151,19 +276,19 @@ Not all of them - only these we want to have implemented.
| Address | Name | Status | Remarks |
| :-------: | :----------- | :------: | :------------------------------------------------: |
| `$A004` | revision str | DONE | |
| `$A408` | REASON | NOT DONE | |
| `$A408` | `REASON` | NOT DONE | |
| `$A453` | (unknown) | NOT DONE | |
| `$A533` | LINKPRG | DONE | |
| `$A533` | `LINKPRG` | DONE | |
| `$A644` | new | NOT DONE | |
| `$A659` | set txt ptr | NOT DONE | |
| `$A68E` | RUNC | DONE | |
| `$A7AE` | NEWSTT | PARTIAL | redirected to RUN command |
| `$AB1E` | STROUT | DONE | |
| `$AD9E` | FRMEVL | NOT DONE | |
| `$BDCD` | LINPRT | DONE | temporary implementation |
| `$E3BF` | INIT | NOT DONE | |
| `$E422` | INITMSG | DONE | |
| `$E453` | RVECT | NOT DONE | |
| `$A68E` | `RUNC` | DONE | |
| `$A7AE` | `NEWSTT` | PARTIAL | redirected to RUN command |
| `$AB1E` | `STROUT` | DONE | |
| `$AD9E` | `FRMEVL` | NOT DONE | |
| `$BDCD` | `LINPRT` | DONE | temporary implementation |
| `$E3BF` | `INIT` | NOT DONE | |
| `$E422` | `INITMSG` | DONE | |
| `$E453` | `RVECT` | NOT DONE | |
<br />
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+8 -7
View File
@@ -50,18 +50,19 @@
#define CONFIG_IEC_DOLPHINDOS_FAST
#define CONFIG_IEC_JIFFYDOS
#define CONFIG_IEC_JIFFYDOS_BLANK
// #define CONFIG_IEC_BURST_CIA1 // please keep disabled for now
// #define CONFIG_IEC_BURST_CIA2 // please keep disabled for now
// #define CONFIG_IEC_BURST_SOFT // please keep disabled for now
// #define CONFIG_IEC_BURST_CIA1 // please keep disabled for now
// #define CONFIG_IEC_BURST_CIA2 // please keep disabled for now
// #define CONFIG_IEC_BURST_SOFT // please keep disabled for now
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT // mostly works, but not fullyy done yet!
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
// #define CONFIG_RS232_UP2400 // please keep disabled for now
// #define CONFIG_RS232_UP9600 // please keep disabled for now
// #define CONFIG_RS232_UP2400 // please keep disabled for now
// #define CONFIG_RS232_UP9600 // please keep disabled for now
// Multiple SID support
@@ -115,7 +116,7 @@
// Screen editor
#define CONFIG_EDIT_STOPQUOTE
#define CONFIG_EDIT_TABULATORS
// #define CONFIG_EDIT_TABULATORS
// Software features
+136
View File
@@ -0,0 +1,136 @@
.const CONFIG_ID = $04 // should be 1 byte, different for each config file!
.encoding "petscii_upper"
//
// Please read CONFIG.md before modifying this file!
//
// Idea:
// - settings file for the Commander X16 machine
// Hardware platform and brand
#define CONFIG_PLATFORM_COMMANDER_X16
// #define CONFIG_MB_MEGA_65
// #define CONFIG_MB_ULTIMATE_64
#define CONFIG_BRAND_CUSTOM_BUILD
// #define CONFIG_BRAND_GENERIC
// #define CONFIG_BRAND_TESTING
// #define CONFIG_BRAND_MEGA_65
// #define CONFIG_BRAND_ULTIMATE_64
.const CONFIG_CUSTOM_BRAND = @"FOR COMMANDER X16"
// Processor instruction set
// #define CONFIG_CPU_MOS_6502
#define CONFIG_CPU_WDC_65C02
// #define CONFIG_CPU_CSG_65CE02
// #define CONFIG_CPU_M65_45GS02
// #define CONFIG_CPU_WDC_65816
// Memory model
#define CONFIG_MEMORY_MODEL_38K
// #define CONFIG_MEMORY_MODEL_60K
// I/O devices
// #define CONFIG_IEC
// #define CONFIG_IEC_DOLPHINDOS
// #define CONFIG_IEC_DOLPHINDOS_FAST
// #define CONFIG_IEC_JIFFYDOS
// #define CONFIG_IEC_JIFFYDOS_BLANK
// #define CONFIG_TAPE_NORMAL
// #define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
// Multiple SID support
// #define CONFIG_SID_2ND
.const CONFIG_SID_2ND_ADDRESS = $D440
// #define CONFIG_SID_3RD
.const CONFIG_SID_3RD_ADDRESS = $D480
// #define CONFIG_SID_D4XX
// #define CONFIG_SID_D5XX
// Keyboard settings
// #define CONFIG_LEGACY_SCNKEY
// #define CONFIG_KEYBOARD_C128
// #define CONFIG_KEYBOARD_C128_CAPS_LOCK
// #define CONFIG_KEYBOARD_C65 // untested
// #define CONFIG_KEYBOARD_C65_CAPS_LOCK // untested
// #define CONFIG_KEY_REPEAT_DEFAULT
// #define CONFIG_KEY_REPEAT_ALWAYS
// #define CONFIG_KEY_FAST_SCAN
// #define CONFIG_JOY1_CURSOR
// #define CONFIG_JOY2_CURSOR
// #define CONFIG_PROGRAMMABLE_KEYS
.const CONFIG_KEYCMD_RUN = @"LOAD\"*\""
.const CONFIG_KEYCMD_F1 = @"@"
.const CONFIG_KEYCMD_F2 = @""
.const CONFIG_KEYCMD_F3 = @"RUN:"
.const CONFIG_KEYCMD_F4 = @""
.const CONFIG_KEYCMD_F5 = @"LOAD"
.const CONFIG_KEYCMD_F6 = @""
.const CONFIG_KEYCMD_F7 = @"@$"
.const CONFIG_KEYCMD_F8 = @""
.const CONFIG_KEYCMD_HELP = @"LIST"
.const CONFIG_KEYCMD_F9 = @"REM F9"
.const CONFIG_KEYCMD_F10 = @"REM F10"
.const CONFIG_KEYCMD_F11 = @"REM F11"
.const CONFIG_KEYCMD_F12 = @"REM F12"
.const CONFIG_KEYCMD_F13 = @"REM F13"
.const CONFIG_KEYCMD_F14 = @"REM F14"
// Screen editor
// #define CONFIG_EDIT_STOPQUOTE
// #define CONFIG_EDIT_TABULATORS
// Software features
// #define CONFIG_PANIC_SCREEN
// #define CONFIG_DOS_WEDGE
// #define CONFIG_TAPE_WEDGE
#define CONFIG_BCD_SAFE_INTERRUPTS
// Eye candy
// #define CONFIG_COLORS_BRAND
// #define CONFIG_BANNER_SIMPLE
#define CONFIG_BANNER_FANCY
// #define CONFIG_BANNER_BRAND
// #define CONFIG_SHOW_FEATURES
// #define CONFIG_SHOW_PAL_NTSC
// Debug options
// #define CONFIG_DBG_STUBS_BRK
// #define CONFIG_DBG_PRINTF
+5 -3
View File
@@ -50,8 +50,10 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
// Multiple SID support
@@ -69,8 +71,8 @@
// Keyboard settings
// #define CONFIG_LEGACY_SCNKEY
#define CONFIG_KEYBOARD_C128
#define CONFIG_KEYBOARD_C128_CAPS_LOCK
// #define CONFIG_KEYBOARD_C128
// #define CONFIG_KEYBOARD_C128_CAPS_LOCK
// #define CONFIG_KEYBOARD_C65 // untested
// #define CONFIG_KEYBOARD_C65_CAPS_LOCK // untested
// #define CONFIG_KEY_REPEAT_DEFAULT
@@ -105,7 +107,7 @@
// Screen editor
#define CONFIG_EDIT_STOPQUOTE
#define CONFIG_EDIT_TABULATORS
// #define CONFIG_EDIT_TABULATORS
// Software features
+4 -2
View File
@@ -48,10 +48,12 @@
#define CONFIG_IEC_JIFFYDOS
#define CONFIG_IEC_JIFFYDOS_BLANK
// #define CONFIG_TAPE_NORMAL
// #define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
// Multiple SID support
+2
View File
@@ -50,8 +50,10 @@
// #define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
// #define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
#define CONFIG_TAPE_NO_ERROR_CORRECTION
// Multiple SID support
+3 -1
View File
@@ -50,8 +50,10 @@
#define CONFIG_TAPE_NORMAL
#define CONFIG_TAPE_TURBO
#define CONFIG_TAPE_AUTODETECT
// #define CONFIG_TAPE_NO_KEY_SENSE
// #define CONFIG_TAPE_NO_MOTOR_CONTROL
// #define CONFIG_TAPE_NO_ERROR_CORRECTION
// Multiple SID support
@@ -105,7 +107,7 @@
// Screen editor
#define CONFIG_EDIT_STOPQUOTE
#define CONFIG_EDIT_TABULATORS
// #define CONFIG_EDIT_TABULATORS
// Software features
+3
View File
@@ -14,6 +14,9 @@
#if CONFIG_PLATFORM_COMMODORE_64
.eval selected++
#endif
#if CONFIG_PLATFORM_COMMANDER_X16
.eval selected++
#endif
.if (selected != 1) .error "Please select exactly one CONFIG_PLATFORM_* option"
}
+24 -1
View File
@@ -34,7 +34,7 @@
.pseudocommand panic code
{
// If case no panic screen is used, we can skip providing error codes within Kernal
#if CONFIG_PANIC_SCREEN || !SEGMENT_KERNAL
#if CONFIG_PANIC_SCREEN
lda code
#endif
jmp ($E4B7)
@@ -99,10 +99,33 @@
.byte $E3, arg
}
// additional addressing modes
.pseudocommand jsr_ind addr
{
.var arg = addr.getValue()
.byte $22, mod(arg, $100), floor(arg / $100)
}
#endif
//
// Calculation shortcuts
//
.pseudocommand lda_zero // WARNING: do not use within interrupts
{
#if HAS_OPCODES_65CE02
tba
#else
lda #$00
#endif
}
//
// Stack manipulation - some CPUs will leave .A unchanged, some will use it as temporary storage, so consider .A trashed
//
+73
View File
@@ -0,0 +1,73 @@
//
// Names of hardware registers
//
#if CONFIG_PLATFORM_COMMANDER_X16
// VERA registers
.label __VERA_BASE = $9F20 // base address of the chip
.label VERA_ADDR_LO = $9F20
.label VERA_ADDR_MID = $9F21
.label VERA_ADDR_HI = $9F22
.label VERA_DATA0 = $9F23
.label VERA_DATA1 = $9F24
.label VERA_CTRL = $9F25
.label VERA_IEN = $9F26
.label VERA_ISR = $9F27
// VIA #1 registers
.label __VIA1_BASE = $9F60 // base address of the chip
.label VIA1_PRB = $9F60
.label VIA1_PRA = $9F61
.label VIA1_DDRB = $9F62
.label VIA1_DDRA = $9F63
.label VIA1_T1C_L = $9F64
.label VIA1_T1C_H = $9F65
.label VIA1_T1L_L = $9F66
.label VIA1_T1L_H = $9F67
.label VIA1_T2C_L = $9F68
.label VIA1_T2C_H = $9F69
.label VIA1_SR = $9F6A
.label VIA1_ACR = $9F6B
.label VIA1_PCR = $9F6C
.label VIA1_IFR = $9F6D
.label VIA1_IER = $9F6E
.label VIA1_PRA_NH = $9F6F
// VIA #2 registers
.label __VIA2_BASE = $9F70 // base address of the chip
.label VIA2_PRB = $9F70
.label VIA2_PRA = $9F71
.label VIA2_DDRB = $9F72
.label VIA2_DDRA = $9F73
.label VIA2_T1C_L = $9F74
.label VIA2_T1C_H = $9F75
.label VIA2_T1L_L = $9F76
.label VIA2_T1L_H = $9F77
.label VIA2_T2C_L = $9F78
.label VIA2_T2C_H = $9F79
.label VIA2_SR = $9F7A
.label VIA2_ACR = $9F7B
.label VIA2_PCR = $9F7C
.label VIA2_IFR = $9F7D
.label VIA2_IER = $9F7E
.label VIA2_PRA_NH = $9F7F
#endif
+36 -12
View File
@@ -1,6 +1,6 @@
//
// Names of ZP and low memory locations:
// - Compute's Mapping the Commodore 64
// - Computes Mapping the Commodore 64
// - https://www.c64-wiki.com/wiki/Zeropage
// - http://unusedino.de/ec64/technical/project64/memory_maps.html
//
@@ -31,7 +31,7 @@
.label TEMPPT = $16 // -- NOT IMPLEMENTED --
.label LASTPT = $17 // $17-$18 -- NOT IMPLEMENTED --
.label TEMPST = $19 // $19-$21 -- NOT IMPLEMENTED --
.label INDEX = $22 // $22-$25 -- NOT IMPLEMENTED -- temporary variables
.label INDEX = $22 // $22-$25 temporary variables, [!] our usage might be different
.label RESHO = $26 // $26-$2A -- NOT IMPLEMENTED --
.label TXTTAB = $2B // $2B-$2C start of BASIC code
.label VARTAB = $2D // $2D-$2E end of BASIC code, start of variables
@@ -76,15 +76,15 @@
.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 --
.label RNDX = $8B // $8B-$8F random number seed
//
// Page 0 - Kernal area ($90-$FF)
//
.label IOSTATUS = $90
.label STKEY = $91 // Keys down clears bits. STOP - bit 7, C= - bit 6, SPACE - bit 4, CTRL - bit 2
.label SVXT = $92 // -- NOT IMPLEMENTED --
.label STKEY = $91 // keys down clears bits. STOP - bit 7, C= - bit 6, SPACE - bit 4, CTRL - bit 2
.label SVXT = $92 // tape reading constant [!] our tape routines use it differently
.label VERCKK = $93 // 0 = LOAD, 1 = VERIFY
.label C3PO = $94 // flag - is BSOUR content valid
.label BSOUR = $95 // serial bus buffered output byte
@@ -100,8 +100,8 @@
.label COLSTORE = $9C // [!] screen border storage for tape routines
#endif
.label MSGFLG = $9D // bit 6 = error messages, bit 7 = control message
.label PTR1 = $9E // -- NOT IMPLEMENTED --
.label PTR2 = $9F // -- NOT IMPLEMENTED --
.label PTR1 = $9E // for tape support, counter of errorneous bytes
.label PTR2 = $9F // for tape support, counter for errorneous bytes correction
.label TIME = $A0 // $A0-$A2 jiffy clock
#if !CONFIG_IEC_JIFFYDOS && !CONFIG_IEC_DOLPHINDOS && !CONFIG_IEC_BURST_CIA1 && !CONFIG_IEC_BURST_CIA2 && !CONFIG_IEC_BURST_SOFT
.label TSFCNT = $A3 // temporary variable for tape and IEC, [!] our usage differs
@@ -118,8 +118,8 @@
.label RIDDATA = $AA // -- NOT IMPLEMENTED --
.label RIPRTY = $AB // -- WIP -- checksum while reading tape
#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 SAL = $AC // $AC-$AD -- XXX: describe -- (implemented screen part)
.label EAL = $AE // $AE-$AF -- XXX: describe -- [!] 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_LEGACY_SCNKEY
@@ -145,7 +145,7 @@
.label NDX = $C6 // number of chars in keyboard buffer
.label RVS = $C7 // flag, whether to print reversed characters
.label INDX = $C8 // end of logical line (column, 0-79)
.label LXSP = $C9 // $C9-$CA start of input, X/Y position
.label LSXP = $C9 // $C9-$CA start of input, X/Y position (typo in Mapping the C64, fixed in Mapping the C128)
.label SFDX = $CB // -- NOT IMPLEMENTED --
.label BLNSW = $CC // cursor blink disable flag
.label BLNCT = $CD // cursor blink countdown
@@ -159,7 +159,7 @@
.label TBLX = $D6 // current screen Y position (row), 0-24
.label SCHAR = $D7 // ASCII value of the last printed character
.label INSRT = $D8 // insert mode flag/counter
.label LDTBL = $D9 // $D9-$F2 screen line link table, [!] our usage is different XXX give more details
.label LDTB1 = $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 pointer to keyboard lookup table
.label RIBUF = $F7 // $F7-$F8 -- WIP -- RS-232 receive buffer pointer
@@ -227,7 +227,7 @@
#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.
// a counter, so that if an NMI occurs, it does not crash the machine, but can be captured.
.label missed_nmi_flag = $2A7
.label tiny_nmi_handler = $2A8
@@ -288,3 +288,27 @@
#endif
// $3FC $3FC-$3FF -- UNUSED -- free for user software
//
// Definitions for tape functionality
//
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
.label __normal_time_S = IRQTMP+0 // duration of the short pulse
.label __normal_time_M = IRQTMP+1 // duration of the medium pulse
.label __turbo_half_S = IRQTMP+0 // half-duration of the short pulse
.label __turbo_half_L = IRQTMP+1 // half-duration of the long pulse
.label __pulse_threshold = SVXT // pulse classification threshold
.label __pulse_threshold_ML = SYNO // M/L pulse classification threshold, for normal only
#endif
#if CONFIG_TAPE_TURBO
.label __tape_turbo_bytestore = STACK // location of byte storage helper routine
#endif
+11
View File
@@ -1,4 +1,15 @@
// BASIC startup vectors
#if ROM_LAYOUT_X16
.label IBASIC_COLD_START = $C000
.label IBASIC_WARM_START = $C002
#else
.label IBASIC_COLD_START = $A000
.label IBASIC_WARM_START = $A002
#endif
+5
View File
@@ -1,5 +1,10 @@
#if CONFIG_PLATFORM_COMMODORE_64
// Cartridge ROM locations
.label ICART_COLD_START = $8000 // $8000-$8001, cartridge cold start vector
.label ICART_WARM_START = $8002 // $8002-$8003, cartridge warm start vector (RESTORE key)
.label CART_SIG = $8004 // $8004-$8008, signature for cartridge detection
#endif
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+4 -5
View File
@@ -1,4 +1,7 @@
#if ROM_LAYOUT_STD || (ROM_LAYOUT_M65 && SEGMENT_BASIC_0)
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Official BASIC routine, described in:
@@ -9,9 +12,5 @@
// CPU registers that has to be preserved (see [RG64]): XXX
//
MAIN:
STUB_IMPLEMENTATION()
#endif // ROM layout
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
+1
View File
@@ -1,4 +1,5 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
@@ -0,0 +1,22 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - subtract FAC1 to integer in memory
//
// Output:
// - integer pointed by $49/$4A
//
// See also:
// - https://sta.c64.org/cbm64basconv.html
// - https://www.c64-wiki.com/wiki/BASIC-ROM
//
// XXX implement, test
convert_FAC1_to_INT:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+18
View File
@@ -0,0 +1,18 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - print FAC1 value
//
// See also:
// - https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
//
// XXX implement, test
print_FAC1:
STUB_IMPLEMENTATION()
+17
View File
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - compute TI value
//
// See also:
// - https://www.c64-wiki.com/wiki/BASIC-ROM
//
// XXX implement, test
compute_TI:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+15
View File
@@ -0,0 +1,15 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - sets mantissa to 00yyxxaa
//
// See also:
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX add name, label, implement, test
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+15
View File
@@ -0,0 +1,15 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - set rest of FAC1 and JMP to $b8d2
//
// See also:
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX add name, label, implement, test
STUB_IMPLEMENTATION()
+17
View File
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - compute ST value
//
// See also:
// - https://www.c64-wiki.com/wiki/BASIC-ROM
//
// XXX implement, test
compute_ST:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - convert FAC1 to 16-bit signed integer
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 105
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
//
// XXX provide implementation
FACINX:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - XXX
//
// See also:
// - https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
//
// XXX implement, test
convert_FAC1_to_s16:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
It's a part oof the ACME assembler SDK, see:
- https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - 16-bit signed integer to FAC1
//
// Output:
// - .A - address high byte (XXX really, not the opposite?)
// - .Y - address low byte
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 107
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
//
// XXX provide implementation
GIVAYF:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example codoe utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
@@ -0,0 +1,16 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - XXX
//
// - https://www.c64-wiki.com/wiki/BASIC-ROM
// - https://sta.c64.org/cbm64basconv.html
// - https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX add name, label, documentation, implement, test
STUB_IMPLEMENTATION()
+5
View File
@@ -0,0 +1,5 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
@@ -0,0 +1,13 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - XXX
//
// - https://sta.c64.org/cbm64basconv.html
//
// XXX add name, label, documentation, implement, test
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+20
View File
@@ -0,0 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - imports string to FAC1 - XXX: what about spaces?
//
// Input:
// - .A needs to be loaded with string length
// - string address in $22/$23
//
// See also:
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
//
// XXX provide implementation
STRVAL:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
@@ -0,0 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - subtract FAC1 to memory address at $14/$15 and Y/A
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 112
// - https://sta.c64.org/cbm64basconv.html
// - https://www.c64-wiki.com/wiki/BASIC-ROM
//
// XXX implement, test
convert_FAC1_to_ADDR:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
@@ -0,0 +1,16 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - add 0.5 to FAC1
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 112
// XXX implement
add_HALF_FAC1:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
@@ -0,0 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - invert FAC1 mantissa
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 113
// - https://www.c64-wiki.com/wiki/BASIC-ROM
// - https://sta.c64.org/cbm64basconv.html
//
// XXX implement, test
inv_FAC1_mantissa:
STUB_IMPLEMENTATION()
+18
View File
@@ -0,0 +1,18 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - SHIFT routine
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 113
//
// XXX implement, test
MULSHF:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+5
View File
@@ -0,0 +1,5 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+19
View File
@@ -0,0 +1,19 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - natural logarigthm
//
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 113
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
log_FAC1:
STUB_IMPLEMENTATION()
+18
View File
@@ -0,0 +1,18 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - add a mantissa byte of FAC2 to FAC1, do it .A times
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 113
//
// XXX implement, test
MULTPLY:
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - XXX
//
// See also:
// - https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
//
// XXX implement, test
get_FAC2_via_INDEX:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
It's a part oof the ACME assembler SDK, see:
- https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+18
View File
@@ -0,0 +1,18 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - multiply FAC1 by 10
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
mul10_FAC1:
STUB_IMPLEMENTATION()
+22
View File
@@ -0,0 +1,22 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - divide FAC1 by 10, result is always positive
//
// Notes:
// - shifts FAC1 to FAC2, loads FAC1 with the constant 10, falls through to the division routine
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
div10_FAC1_p:
STUB_IMPLEMENTATION()
+5
View File
@@ -0,0 +1,5 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
@@ -0,0 +1,24 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - divide FAC2 by FAC1, ignores sign
//
// Input:
// - .A - must load FAC1 exponent ($61) beforehand to set the zero flag
//
// Output:
// - leaves the quotient FAC1 and the remainder in FAC2
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 114
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
div_FAC2_FAC1:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing the routine:
- https://www.lemon64.com/forum/viewtopic.php?t=67576&sid=d41e77cdddd28d6f9c9d52ce5b4e8dc3
@@ -0,0 +1,17 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - XXX
//
// See also:
// - https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
//
// XXX implement, test
get_FAC1_via_INDEX:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
It's a part oof the ACME assembler SDK, see:
- https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - evaluate FAC1 sign, to .A
//
// Output:
// - .A - 0 for FAC1 equal 0, 1 for FAC1 > 0, -1 for FAC1 < 0
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
sgn_FAC1_A:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - evaluate FAC1 sign, to FAC1
//
// Output:
// - FAC1 - 0 for FAC1 equal 0, 1 for FAC1 > 0, -1 for FAC1 < 0
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
sgn_FAC1:
STUB_IMPLEMENTATION()
@@ -0,0 +1,14 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - XXX
//
// - https://codebase64.org/doku.php?id=base:asm_include_file_for_basic_routines
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX add name, label, documentation, implement, test
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
@@ -0,0 +1,13 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - XXX
//
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX add name, label, documentation, implement, test
STUB_IMPLEMENTATION()
+3
View File
@@ -0,0 +1,3 @@
This is an important floating point math routine, documented in many places.
XXX - try to find real-life example
+18
View File
@@ -0,0 +1,18 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - absolute value
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
abs_FAC1:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+29
View File
@@ -0,0 +1,29 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - compare FAC1 with RAM location
//
// Input:
// - .A - address low byte
// - .Y - address high byte
//
// Output:
// - .A - $00 for equal, $01 for FAC1 > RAM, $FF for FAC1 < RAM
// - flags N/Z, depending on whether FAC1 is 0, positive, or negative
//
// Notes:
// - uses vector at $24, leaves FAC1 and FAC2 unchanged (Codebase64)
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
FCOMP:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+20
View File
@@ -0,0 +1,20 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - convert FAC1 to 32 bit signed integer
//
// Output:
// - $62-$65, big-endian order
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 115
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
//
// XXX provide implementation
QINT:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
+18
View File
@@ -0,0 +1,18 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Math package - rounds away the decimal to make an integer
//
// See also:
// - [CM64] Computes Mapping the Commodore 64 - page 116
// - https://www.c64-wiki.com/wiki/Floating_point_arithmetic
// - https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics
//
// XXX provide implementation
int_FAC1:
STUB_IMPLEMENTATION()
+4
View File
@@ -0,0 +1,4 @@
This is an important floating point math routine, documented in many places.
Example code utilizing this routine:
- https://github.com/irmen/prog8/blob/master/compiler/res/prog8lib/c64flt.p8
Loaded 100 of 448 files, more files were not shown because too many files have changed in this diff. Show more