init files

This commit is contained in:
AArt1256 2025-11-13 19:07:39 +03:00
commit 8197a022bd
1409 changed files with 139317 additions and 0 deletions

View file

@ -0,0 +1,21 @@
MEMORY
{
LOADERZP: start = $f7, size = $07, type = rw;
LOWMEM: start = $0b00, size = $0100, type = rw;
RAM: start = $1c01, size = $a3ff, type = rw;
RESIDENT: start = $f900, size = $0600, type = rw;
}
SEGMENTS
{
CODE: load = RAM, type = ro;
ROM_THUNKS: load = RAM, run = LOWMEM, define = yes;
DISKIO_ZP: load = LOADERZP, type = zp;
DISKIO: load = RAM, run = RESIDENT, define = yes;
RESIDENT_CODE: load = RAM, run = RESIDENT, define = yes;
DISKIO_INSTALL: load = RAM;
}

View file

@ -0,0 +1,20 @@
MEMORY
{
LOADERZP: start = $d8, size = $07, type = rw;
LOWMEM: start = $0334, size = $cc, type = rw;
RAM: start = $1c01, size = $63ff, type = rw;
RESIDENT: start = $f700, size = $0600, type = rw;
}
SEGMENTS
{
CODE: load = RAM, type = ro;
DISKIO_INSTALL: load = RAM;
ROM_THUNKS: load = RAM, run = LOWMEM, define = yes;
DISKIO_ZP: load = LOADERZP, type = zp;
DISKIO: load = RAM, run = RESIDENT, define = yes;
RESIDENT_CODE: load = RAM, run = RESIDENT, define = yes;
}

View file

@ -0,0 +1,20 @@
MEMORY
{
LOADERZP: start = $f7, size = $07, type = rw;
LOWMEM: start = $0334, size = $cc, type = rw;
RAM: start = $1c01, size = $83ff, type = rw;
RESIDENT: start = $fa00, size = $05fa, type = rw;
}
SEGMENTS
{
CODE: load = RAM, type = ro;
DISKIO_INSTALL: load = RAM;
ROM_THUNKS: load = RAM, run = LOWMEM, define = yes;
DISKIO_ZP: load = LOADERZP, type = zp;
DISKIO: load = RAM, run = RESIDENT, define = yes;
RESIDENT_CODE: load = RAM, run = RESIDENT, define = yes;
}

View file

@ -0,0 +1,253 @@
ifeq ($(PLATFORM),)
_PLATFORM_ = c64
else ifeq ($(PLATFORM),c116)
_PLATFORM_ = c16
else ifeq ($(PLATFORM),plus4)
_PLATFORM_ = c16
else
_PLATFORM_ = $(PLATFORM)
endif
ifeq ($(NO_VICE),)
NO_VICE = 0
endif
ifneq ($(_PLATFORM_),c64)
ifneq ($(_PLATFORM_),c128)
ifneq ($(_PLATFORM_),c16)
$(error invalid platform $(_PLATFORM_) specified)
endif
endif
endif
ARCH = $(shell uname | tr "[a-z]" "[A-Z]" | tr -c -d "[A-Z]")
ifneq ($(findstring CYGWINNT,$(ARCH)),)
ifeq (CYGWINNT,$(ARCH))
ARCH = WIN32
else
ARCH = WIN64
endif
endif
ifneq ($(findstring DARWIN,$(ARCH)),)
ARCH = MACOSX
endif
ifeq ($(_PLATFORM_),c16)
ifneq ($(NO_VICE),0)
ifneq ($(findstring WIN,$(ARCH)),)
USE_PLUS4EMU = 0
USE_YAPE = 1
else
USE_PLUS4EMU = 1
USE_YAPE = 0
endif
else
USE_PLUS4EMU = 0
USE_YAPE = 0
endif
else
USE_PLUS4EMU = 0
USE_YAPE = 0
endif
ifeq ($(_PLATFORM_),c16)
ifeq ($(ARCH),MACOSX)
# MacOSX, these programs must be installed as applications
VICE = xplus4
PLUS4EMU = open /Applications/plus4emu.app --args
else
VICE = xplus4
PLUS4EMU = plus4emu
ifeq ($(ARCH),WIN64)
YAPE = YapeWin64
else
YAPE = Yape
endif
endif
else
ifeq ($(_PLATFORM_),c128)
VICE = x128
else
VICE = x64
endif
endif
ifneq ($(USE_PLUS4EMU),0)
EMU = $(PLUS4EMU) -disk
else
EMU = $(VICE) -drive8type 1541 -drive9type 0 -autostart
endif
EMU70 = $(VICE) -drive8type 1570 -drive9type 0 -autostart
ECHO = echo
PRINTF = printf
AS = ca65
LD = ld65
PU = ../../tools/pucrunch/pucrunch
PU_SOURCE = ../../tools/pucrunch
CC1541 = ../../tools/cc1541
MKDIR = mkdir -p
RM = rm -f
ifeq ($(ARCH),MACOSX)
RMDIR = rmdir # XXX TODO xargs to remove .DS_Store
else
RMDIR = rmdir
endif
CAT = cat
.PHONY: default loader assemble link compress diskimage run clean distclean wipe
.PHONY: tellarch
BUILDDIR = ../../build
INTERMDIR = ../../build/intermediate
LOADER_SRC = ../../src
LOADER = $(BUILDDIR)/loader-$(_PLATFORM_).lib
RESOURCESDIR = ../resources
PIC1 = $(INTERMDIR)/pic1.bin
PIC2 = $(INTERMDIR)/pic2.bin
ifeq ($(_PLATFORM_),c16)
STARTTRACK = 25
STARTSECTOR = 13
INTERLEAVE = 3
SKEW = 13
DEMO = $(RESOURCESDIR)/threeve.prg
DEMONAME = "threeve"
else ifeq ($(_PLATFORM_),c128)
STARTTRACK = 19
STARTSECTOR = 0
INTERLEAVE = 3
SKEW = 13
DEMO = $(RESOURCESDIR)/doom_c128.prg
DEMONAME = "doom c128"
else
STARTTRACK = 18
STARTSECTOR = 16
INTERLEAVE = 3
SKEW = 1
DEMO = $(RESOURCESDIR)/oxyron_oneder.prg
DEMONAME = "oneder /oxy"
endif
NAME = standalone
SOURCE = $(NAME).s
LOADERCFG = loaderconfig.inc
ASSEMBLE = $(INTERMDIR)/$(NAME)-$(_PLATFORM_).o
LINK = $(INTERMDIR)/$(NAME)-uncompressed-$(_PLATFORM_).prg
COMPRESS = $(INTERMDIR)/$(NAME)-$(_PLATFORM_).prg
DISKIMAGE = $(BUILDDIR)/$(NAME)-$(_PLATFORM_).d64
AS_FLAGS = -I ../../../shared -I ../../include -I $(LOADER) -D EXTCONFIGPATH
PU_FLAGS = -d -l 0x1c01 -x 0x1c01 -i 1
default: diskimage
tellarch:
@$(ECHO) $(ARCH)
loader: $(LOADER)
$(LOADER): $(LOADERCFG)
make -C $(LOADER_SRC) EXTCONFIGPATH=../samples/$(NAME) lib
assemble: $(ASSEMBLE)
$(ASSEMBLE): $(SOURCE) $(LOADERCFG)
$(MKDIR) $(BUILDDIR)
$(MKDIR) $(INTERMDIR)
ifeq ($(_PLATFORM_),c64)
$(AS) $(AS_FLAGS) -t c64 -Wa -D PLATFORM=64 -o $@ $<
else ifeq ($(_PLATFORM_),c128)
$(AS) $(AS_FLAGS) -t c128 -Wa -DPLATFORM=128 -o $@ $<
else
$(AS) $(AS_FLAGS) -t c16 -Wa -D PLATFORM=16 -o $@ $<
endif
link: $(LINK)
$(LINK): Linkfile-$(_PLATFORM_) $(ASSEMBLE) $(LOADER)
$(LD) -o $@ -C $^
compress: $(COMPRESS)
$(COMPRESS): $(LINK) $(PU)
ifeq ($(_PLATFORM_),c64)
$(PU) $(PU_FLAGS) -c64 -g 0x37 $< $@
else ifeq ($(_PLATFORM_),c128)
$(PU) $(PU_FLAGS) -c128 $< $@
else
$(PU) $(PU_FLAGS) -c16 $< $@
endif
diskimage: $(DISKIMAGE)
$(DISKIMAGE): $(COMPRESS) $(DEMO) $(PIC1) $(PIC2) $(CC1541)/cc1541
$(CC1541)/cc1541 -v -n "normal is boring" -i plush -S $(INTERLEAVE) -t \
\
-f "standalone" -s 8 -w $(COMPRESS) \
\
-f $(DEMONAME) -r $(STARTTRACK) -b $(STARTSECTOR) -F -$(SKEW) -w $(DEMO) \
-f pic1 -r 18 -E -w $(PIC1) \
-f pic2 -r 18 -E -w $(PIC2) \
\
$@
ifneq ($(USE_YAPE),0)
run: $(DISKIMAGE)
$(YAPE) "..\..\build\$(NAME)-$(_PLATFORM_).d64"
else
run: $(DISKIMAGE)
ifneq ($(USE_PLUS4EMU),0)
$(EMU) $(realpath $^)
else
$(EMU) $(realpath $^):standalone
endif
run70: $(DISKIMAGE)
$(EMU70) $(realpath $^):standalone
endif
$(INTERMDIR)/%.bin: $(RESOURCESDIR)/%.bin
$(PRINTF) '\000\140' | $(CAT) - $? > $@ # octal 140 = hex 60
$(CC1541)/cc1541: $(CC1541)/cc1541.c
$(MAKE) -C $(CC1541) cc1541
clean:
-$(RM) $(ASSEMBLE) $(LINK) $(COMPRESS) $(DISKIMAGE)
-$(RM) -rf $(INTERMDIR)
-$(RM) $(BUILDDIR)/loader-c64.lib
-$(RM) $(BUILDDIR)/loader-c128.lib
-$(RM) $(BUILDDIR)/loader-c16.lib
-$(RMDIR) $(BUILDDIR)
distclean:
-$(MAKE) -C $(LOADER_SRC) clean
$(MAKE) -C $(CC1541) clean
wipe: distclean clean
$(PU):
$(MAKE) -C $(PU_SOURCE)

View file

@ -0,0 +1,134 @@
OPENFILE_POLLBLOCK_API = 1
FORCE_ASYNCHRONOUS_BURST_HANDSHAKE = 1
; configuration
; set .defines to non-0 to enable the corresponding features
; see loader.inc for function calls and convenience macros
; parameters
.ifndef PLATFORM
PLATFORM = diskio::platform::COMMODORE_64; available are COMMODORE_64, COMMODORE_128 and COMMODORE_16
.endif
; parameter, this changes the host-side code only
DECOMPRESSOR = DECOMPRESSORS::NONE; available are NONE, BITNAX (recommended for demos), BYTEBOOZER2, DOYNAX_LZ, EXOMIZER (not recommended for demos), LEVELCRUSH, LZSA2 (recommended for demos), NUCRUNCH, PUCRUNCH, SUBSIZER, TINYCRUNCH (recommended for demos), TSCRUNCH (strongly recommended for demos), ZX0 (strongly recommended for demos)
; features
; following settings are independent from the installed drive code, several host-side
; resident binaries with different features may be used with the same installed drive code
; basic features, different settings can be run with the same installed drive code, increase host-side code size
.define LOAD_COMPD_API 0 ; include the loadcompd routine to load and depack compressed files on the fly
; requires DECOMPRESSOR != DECOMPRESSORS::NONE
.define LOAD_RAW_API 1 ; include the loadraw routine to load files without decompressing
.define NTSC_COMPATIBILITY 0 ; C-64/128 only: be able to run on both PAL and NTSC machines, this slightly decreases loading speed on PAL,
; note that PAL vs. NTSC is not detected by the install routine, and no error is returned when running on an
; NTSC machine with the NTSC_COMPATIBILITY option disabled: detect, then select either of both incarnations
; of the resident portion (with and without NTSC support) for maximum speed with NTSC and PAL
.define PREFER_SPEED_OVER_SIZE 0 ; For TSCrunch or ZX0, use a bigger but potentially faster decompression routine
.define UNINSTALL_API 1 ; include an uninstallation routine
; extended features, different settings can be run with the same installed drive code, increase host-side code size
.define FILE_EXISTS_API 0 ; include the fileexists call for simple multi-disk handling
.define LOAD_UNDER_D000_DFFF 0 ; C-64/128: enable loading (and decompression) to the RAM at $D000..$DFFF,
; note that this does not slow down loading when not loading to RAM at $D000..$DFFF,
; as there are two separate routines to load data (one regular, the other to RAM at $D000..$DFFF).
; the IRQ handlers will need to change $01 ($FF00 on C-128) to enable the I/O registers at $D000..$DFFF,
; so make sure the IRQ handlers restore the $01 status on C-64 to the value as when they are called.
; the IRQs must run via $FFFE/F, since the ROM is disabled when accessing the RAM at $D000-$DFFF
; this is not needed when only memdecompressing to $D000..$DFFF (simply set $01 to $30 on C-64 and jsr memdecomp in that case)
.define ALLOW_2_MHZ_ON_C128 0 ; C-64 only: allow 2 MHz usage on C-128 in C-64 mode,
; this does not increase raw loading speed but increases combined loading + decompression speed using loadcompd.
; the clock is temporarily switched to 1 MHz while loading,
; interrupt handlers changing the clock speed must restore it upon return to the mainline thread.
.define MEM_DECOMP_API 0 ; include a routine for memory decompression, that is, loading and decompression can be separated.
; C-64: decompression to $D000..$DFFF need not have LOAD_UNDER_D000_DFFF enabled,
; just enable 64 kB of RAM before jsr memdecomp.
; requires DECOMPRESSOR != DECOMPRESSORS::NONE
; this option does not implicitly turn on the LOAD_RAW_API
.define MEM_DECOMP_TO_API 0 ; if carry is set on decompression, the decompressor will use the address set in decdestlo/decdesthi as
; decompression destination address and ignore the file's decompression address.
; requires MEM_DECOMP_API != 0
.define LOAD_TO_API 1 ; if the carry flag is set on load, override load and decompression destination addresses.
; load raw files: use the address set in loadaddrlo/loadaddrhi as absolute loading address
; load compressed files: use relative loading address offset in loadaddroffslo/loadaddroffshi, it is added to the load/depack addresses
.define END_ADDRESS_API 1 ; during and after loading, the file's current and then final end address (address of last file byte + 1) is stored in
; endaddrlo and endaddrhi. for loading compressed files using loadcompd, the end address of the compressed data is stored.
; the file's loading address can be found in loadaddrlo/loadaddrhi during and after loading, so polling the current
; difference of endaddrlo/hi and loadaddrlo/hi can be used to implement progress displays.
.define LOAD_VIA_KERNAL_FALLBACK 0 ; loads via the KERNAL API if drive code installation was not successful
; (i.e., if it cannot installed due to an incompatible drive - possible if it is not
; a 1541, 1541-C, 1541-II, 1541U, 1570, 1571, 1571CR, 1581, or FD2000/4000),
; or true drive emulation being disabled.
; note that this does not necessarily mean slow or non-IRQ loading, as custom KERNALs like JiffyDOS or IDEDOS
; use the original KERNAL API as well.
; the IRQ handlers can be delayed for some rasterlines up to several frames due to KERNAL routines
; temporarily disabling IRQ (but that is unlikely for devices not using the serial bus).
; for the sake of compatibility, only disable this option if the space is really needed.
; C-64:
; Attention: KERNAL, BASIC, and possible cartridge ROMs are enabled, so IRQ handlers are not
; allowed in the ranges $8000..$BFFF and $D000..$FFFF.
; Attention: KERNAL routines may execute CLI, so make sure to have valid IRQ vectors and handlers,
; or disable all IRQ sources (not via SEI), also make sure to correctly handle the different
; IRQ conditions when called via KERNAL vector ($0314) vs. non-KERNAL vector ($FFFE), both are possible -
; best have KERNAL and BASIC enabled before calling the loader, so only the KERNAL vector IRQ handler is
; needed (please note that the handler code is delayed a little when called via $0314 rather than $FFFE).
; C-128:
; Attention: System ROM is enabled, so IRQ handlers are not allowed in the range $C000..$FFFF.
; Attention: KERNAL routines may execute CLI, so make sure to have valid IRQ vectors and handlers,
; or disable all IRQ sources (not via SEI), also make sure to correctly handle the different
; IRQ conditions when called via KERNAL vector ($0314) vs. non-KERNAL vector ($FFFE) - best have System ROM
; enabled before calling the loader, so only the KERNAL vector IRQ handler is needed (please note that
; the handler code is delayed a little when called via $0314 rather than $FFFE).
; C-64/128:
; Attention: KERNAL routines use CIA1 timer A ($DC04/5).
; Plus/4:
; Attention: The ROM space in the upper memory half is enabled, so IRQ handlers are not allowed
; in the range $8000..$FFFF.
; Attention: The ROM routines may execute CLI, so make sure to have valid IRQ vectors and handlers,
; or disable all IRQ sources (not via SEI), also make sure to correctly handle the different
; IRQ conditions when called via ROM vector ($0314) vs. non-ROM vector ($FFFE) - best have ROM enabled
; before calling the loader, so only the ROM vector IRQ handler is needed (please note that
; the handler code is delayed a little when being called via $0314 rather than $FFFE).
; requires ONLY_1541_AND_COMPATIBLE = 0
.define CLOSE_FILE_API 1 ; include the closefile call to close an open file
; these options change drive-side code
.define DIRTRACK 18 ; actual directory track, this can be changed to have a shadow directory so that the
; normal directory does not list the files and can be used entirely for bootstrap and dir-art
.define DIRTRACK81 40 ; (i.e., the loader's directory can be relocated to hide it from the normal directory command).
; DIRTRACK must be 18 when LOAD_VIA_KERNAL_FALLBACK != 0
; DIRTRACK81 must be 40 when LOAD_VIA_KERNAL_FALLBACK != 0
.define FILENAME_MAXLENGTH 16 ; maximum length of filename, if a directory is capable of holding longer names, extra characters are ignored,
; to facilitate dir-art, set to, e.g., 2, then load files as "01*", "02*", etc.
; this reduces host-side install code
.define ONLY_1541_AND_COMPATIBLE 0 ; reduces host-side install code by omitting any native custom drive code for non-1541 compatible
; drives, treats any drive as 1541, using an incompatible drive will cause undefined behaviour

File diff suppressed because it is too large Load diff