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,319 @@
NAME = benchmark
BENCH ?= BITFIRE
LOADERCPU ?= 100
ALIGNED ?= 0
_PLATFORM_ = c64
export LOG
BUILDDIR = ../../build
DISKIMAGE = $(BUILDDIR)/$(NAME)-$(LOADERCPU)-$(_PLATFORM_).d64
default: $(DISKIMAGE)
run_bitfire:
make run BENCH=BITFIRE
run_spindle_code:
make run BENCH=SPINDLE_CODE
run_spindle_graphics:
make run BENCH=SPINDLE_GRAPHICS
perfbench_bitfire:
make perfbench BENCH=BITFIRE
perfbench_spindle_code:
make perfbench BENCH=SPINDLE_CODE
perfbench_spindle_graphics:
make perfbench BENCH=SPINDLE_GRAPHICS
perfbench: LOG=1
perfbench:
rm -f benchmark.log
make clean
make run LOADERCPU=100
make run LOADERCPU=90
make run LOADERCPU=80
make run LOADERCPU=70
make run LOADERCPU=60
make run LOADERCPU=50
make run LOADERCPU=40
make run LOADERCPU=30
make run LOADERCPU=20
make run LOADERCPU=10
$(MAKE_TEX) < benchmark.log
perftest: LOG=1
perftest:
rm -f benchmark.log
make clean
make run LOADERCPU=100
$(MAKE_TEX) < benchmark.log
ifeq "$(BENCH)" "BITFIRE"
MONCOMMANDS := benchmark-bitfire.mon
MAKE_TEX := ./make-tex-graph-bitfire.lua
else
MONCOMMANDS := benchmark-spindle.mon
ifeq "$(BENCH)" "SPINDLE_CODE"
MAKE_TEX := ./make-tex-graph-spindle-code.lua
else
MAKE_TEX := ./make-tex-graph-spindle-graphics.lua
endif
endif
ifeq "$(LOG)" "1"
VICE = x64sc +saveres -warp -minimized -autostartprgmode 1 +cart -debugcart -monlogname benchmark.log -moncommands $(MONCOMMANDS)
else
VICE = x64sc
endif
EMU = $(VICE) -drive8type 1541 -drive9type 0 -8
EMU71 = $(VICE) -drive8type 1571 -drive9type 0 -8
EMU81 = $(VICE) -drive8type 1581 -drive9type 0 -8
AS = cl65
AS_FLAGS = -Wa -I../../build -u __EXEHDR__
CC1541 = ../../tools/cc1541/cc1541 -v
#CC1541 = ../../tools/cc1541/repo4/cc1541/cc1541 -v
CC1541_SOURCE = ../../tools/cc1541
B2 = ../../tools/b2/b2.exe
B2_SOURCE = ../../tools/b2
BITNAX = ../../tools/bitnax-07a8c67/lz
DOYNAX_LZ = ../../tools/doynamite1.1/lz
EXO = ../../tools/exomizer-3.1/src/exomizer
EXO_SOURCE = ../../tools/exomizer-3.1/src
LC = ../../tools/wcrush/wcrush/wcrush
LCSPEED = 6
LC_SOURCE = ../../tools/wcrush
LZSA2 = ../../tools/lzsa/lzsa
LZSA2_SOURCE = ../../tools/lzsa
NC = ../../tools/nucrunch-1.0.1/target/release/nucrunch
NC_SOURCE = ../../tools/nucrunch-1.0.1
PU = ../../tools/pucrunch/pucrunch
PU_SOURCE = ../../tools/pucrunch
SUBSIZER = ../../tools/subsizer-0.7pre1/subsizer
SUBSIZER_SRC = ../../tools/subsizer-0.7pre1/src
TC = python ../../tools/tinycrunch_v1.2/tc_encode.py
TS_ENCODER = ../../tools/tscrunch/tscrunch.py
TS = python3 $(TS_ENCODER)
ZX0 = ../../tools/dali/dali
ZX0_SRC = ../../tools/dali
CONV = ../../tools/compressedfileconverter.pl
RM = rm -f
CP = cp
MV = mv
INTERMDIR = ../../build/intermediate
LOADER_SRC = ../../src
LOADER = $(BUILDDIR)/loader-$(_PLATFORM_).prg
RESOURCESDIR = ../resources
TEST = $(RESOURCESDIR)/test.prg
SOURCE = $(NAME).s
LOADERCFG = loaderconfig.inc
ASSEMBLE = $(INTERMDIR)/$(NAME)-$(LOADERCPU)-uncompressed-$(_PLATFORM_).prg
DISKIMAGE81 = $(BUILDDIR)/$(NAME)-$(_PLATFORM_).d81
EXTENSION_NONE := prg
EXTENSION_BITNAX := bnx
EXTENSION_BYTEBOOZER2 := b2
EXTENSION_DOYNAX_LZ := dnx
EXTENSION_EXOMIZER := exo
EXTENSION_LEVELCRUSH := lc
EXTENSION_LZSA2 := lzsa2
EXTENSION_NUCRUNCH := nc
EXTENSION_PUCRUNCH := pu
EXTENSION_SUBSIZER := ssz
EXTENSION_TINYCRUNCH := tc
EXTENSION_TSCRUNCH := ts
EXTENSION_ZX0 := zx0
COMPRESSOR := $(shell grep -m 1 'DECOMPRESSORS::' $(LOADERCFG) | sed 's/.*DECOMPRESSORS::\([^; ]*\).*/\1/')
COMPEXT := $(EXTENSION_$(COMPRESSOR))
BENCH_IDX_BITFIRE = 0
FILENAMES_BITFIRE = test a b c d e f g h i j k l m n o p q r
MINTRACKS_BITFIRE = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
INTERLEAVES_BITFIRE = 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
#INTERLEAVES_BITFIRE = -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4
#INTERLEAVES_BITFIRE = -4 -4 -4 -4 -4 -4 -4 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
BENCH_IDX_SPINDLE_CODE = 1
FILENAMES_SPINDLE_CODE = test x0 x1 x2 x3 x4 x5 x6 x7
MINTRACKS_SPINDLE_CODE = 1 1 1 1 1 1 1 1 1
INTERLEAVES_SPINDLE_CODE = 4 4 4 4 4 4 4 4 4
BENCH_IDX_SPINDLE_GRAPHICS = 2
FILENAMES_SPINDLE_GRAPHICS = test y0 y1 y2 y3 y4 y5 y6 y7
MINTRACKS_SPINDLE_GRAPHICS = 1 1 1 1 1 1 1 1 1
INTERLEAVES_SPINDLE_GRAPHICS = 4 4 4 4 4 4 4 4 4
FILES = $(patsubst %, $(INTERMDIR)/%.$(COMPEXT), $(FILENAMES_$(BENCH)))
IMAGEFILES__ = $(foreach filename, $(FILENAMES_$(BENCH)),$(patsubst %,^-f^"%",$(filename).$(COMPEXT))$(patsubst %,^-w^$(INTERMDIR)/%.$(COMPEXT),$(filename)))
IMAGEFILES_ = $(subst "test.$(COMPEXT)","test", $(IMAGEFILES__))
IMAGEFILES = $(subst ^, ,$(join $(addprefix -r^,$(MINTRACKS_$(BENCH))),$(join $(addprefix ^-S^,$(INTERLEAVES_$(BENCH))),$(patsubst %,^%,$(IMAGEFILES_)))))
IMAGEFILES81 = $(subst ^, ,$(join $(addprefix -r^,$(MINTRACKS_$(BENCH))),$(patsubst %,^%,$(IMAGEFILES_))))
ifeq "$(COMPRESSOR)" "NONE"
$(DISKIMAGE): $(ASSEMBLE) $(FILES) $(CC1541)
$(RM) $@
$(CC1541) -n "normal is boring" -i plush -4 \
$(IMAGEFILES) \
-f test-loopfile -l test \
-f test-loopfile2 -l test \
$@
else
$(DISKIMAGE): $(ASSEMBLE) $(FILES) $(CC1541)
$(RM) $@
$(CC1541) -n "normal is boring" -i plush \
$(IMAGEFILES) \
-f test-loopfile -l test \
-S 4 -r 29 -e -f $(NAME) -w $< \
-g $(basename $@).g64 \
$@
endif
# -w $(RESOURCESDIR)/room_0031.prg \
# -w $(RESOURCESDIR)/0031.zx0.prg \
# -w $(RESOURCESDIR)/zb \
$(DISKIMAGE81): $(ASSEMBLE) $(FILES) $(CC1541)
$(RM) $@
$(CC1541) -n "normal is boring" -i plush \
-r 39 -f $(NAME) -w $< \
$(IMAGEFILES81) \
$@
$(ASSEMBLE): $(SOURCE) $(LOADER)
$(AS) $(AS_FLAGS) -C c64-asm.cfg -Wa -DPLATFORM=64 -Wa -DBENCHMARK=$(BENCH_IDX_$(BENCH)) -Wa -DLOADERCPU=$(LOADERCPU) -o $@ $<
$(LOADER): $(LOADERCFG)
make -C $(LOADER_SRC) EXTCONFIGPATH=../samples/$(NAME) PLATFORM=$(_PLATFORM_) PROJECT=$(NAME) INSTALL=0f00 RESIDENT=0a00 ZP=02 prg
run: $(DISKIMAGE)
ifeq "$(ALIGNED)" "0"
$(EMU) $(realpath $^) $(ASSEMBLE)
else
$(EMU) $(basename $(realpath $^)).g64 $(ASSEMBLE)
endif
run71 run70: $(DISKIMAGE)
$(EMU71) $(realpath $^) $(ASSEMBLE)
run81: $(DISKIMAGE81)
$(EMU81) $(realpath $^) $(ASSEMBLE)
clean:
-$(RM) *.o $(ASSEMBLE) $(DISKIMAGE) $(BUILDDIR)/loadersymbols-c64.prg $(BUILDDIR)/install-c64.prg $(BUILDDIR)/loader-c64.prg \
$(INTERMDIR)/test.prg \
$(INTERMDIR)/*.b2 $(INTERMDIR)/*.bnx $(INTERMDIR)/*.dnx $(INTERMDIR)/*.exo $(INTERMDIR)/*.lc $(INTERMDIR)/*.lzsa2 $(INTERMDIR)/*.nc $(INTERMDIR)/*.pu $(INTERMDIR)/*.ssz $(INTERMDIR)/*.tc $(INTERMDIR)/*.ts $(INTERMDIR)/*.zx0
$(CC1541): $(CC1541_SOURCE)/cc1541.c
$(MAKE) -C $(CC1541_SOURCE) cc1541
$(INTERMDIR)/%.prg: $(RESOURCESDIR)/%
$(CP) $^ $@
EXTENSIONS := prg bnx b2 dnx exo lc lzsa2 nc pu ssz tc ts zx0
define COPY
$(INTERMDIR)/x%.$(1): $(INTERMDIR)/x.$(1)
$(CP) $$^ $$@
$(INTERMDIR)/y%.$(1): $(INTERMDIR)/y.$(1)
$(CP) $$^ $$@
endef
$(foreach extension,$(EXTENSIONS),$(eval $(call COPY,$(extension))))
$(INTERMDIR)/%.b2: $(INTERMDIR)/%.prg $(B2)
$(B2) $<
$(MV) $<.b2 $@
$(INTERMDIR)/%.bnx: $(INTERMDIR)/%.prg $(BITNAX)
$(BITNAX) --bitfire -o $@ $<
$(INTERMDIR)/%.dnx: $(INTERMDIR)/%.prg $(DOYNAX_LZ)
$(DOYNAX_LZ) -o $@ $<
$(CONV) dnx $< $@ $@
$(INTERMDIR)/%.exo: $(INTERMDIR)/%.prg $(EXO)
$(EXO) mem -f $< -o $@
$(INTERMDIR)/%.lc: $(INTERMDIR)/%.prg $(LC)
$(LC) $(LCSPEED) $< $@
$(CONV) lc $< $@ $@
$(INTERMDIR)/%.lzsa2: $(INTERMDIR)/%.prg $(LZSA2)
$(LZSA2) -f 2 $< $@
$(INTERMDIR)/%.nc: $(INTERMDIR)/%.prg $(NC)
$(NC) $< --auto -o $@
$(INTERMDIR)/%.pu: $(INTERMDIR)/%.prg $(PU)
$(PU) -c0 -x 0 $< $@
$(INTERMDIR)/%.ssz: $(INTERMDIR)/%.prg $(SUBSIZER)
$(SUBSIZER) -m -f -o $@ $<
$(INTERMDIR)/%.tc: $(INTERMDIR)/%.prg
$(TC) --inPlace $< $@
$(INTERMDIR)/%.ts: $(INTERMDIR)/%.prg $(TS_ENCODER)
$(TS) -i $< $@
$(INTERMDIR)/%.zx0: $(INTERMDIR)/%.prg $(ZX0)
$(ZX0) -o $@ $<
$(BITNAX):
$(CC) $@.c -o $@
$(B2):
$(MAKE) -C $(B2_SOURCE)
$(DOYNAX_LZ):
$(CC) $@.c -o $@
$(EXO):
$(MAKE) -C $(EXO_SOURCE)
$(LC):
$(MAKE) -C $(LC_SOURCE)
$(LZSA2):
$(MAKE) -C $(LZSA2_SOURCE)
$(NC):
$(MAKE) -C $(NC_SOURCE)
$(PU):
$(MAKE) -C $(PU_SOURCE)
$(SUBSIZER):
$(MAKE) -C $(SUBSIZER_SRC)
$(TS):
$(BUILD_TS)
$(ZX0):
$(MAKE) -C $(ZX0_SRC)

View file

@ -0,0 +1,2 @@
watch store d7fe
command 1 "log on;m fd ff;log off;x"

View file

@ -0,0 +1,2 @@
watch store d7fe
command 1 "log on;m 0428 0428;m 0429 0438;log off;x"

View file

@ -0,0 +1,310 @@
; all measurements are done with video frame granularity on PAL
.ifndef LOADERCPU
LOADERCPU = 100; per cent
.endif
OVERALL = (BENCHMARK = BITFIRE)
.enum
BITFIRE = 0; throughput is 185526 * 50 / <printed value> = X B/s
SPINDLE_CODE = 1; throughput is $4000 * 50 / <median of printed values> = X B/s
SPINDLE_GRAPHICS = 2; throughput is $4400 * 50 / <median of printed values> = X B/s
.endenum
VERIFY = 0
NONSEQUENTIAL = 0
FILECOUNT = $fc
LOADER_CPU = $fd
FRAMECOUNT = $fe
.include "loadersymbols-c64.inc"
.ifdef loadcompd
LOAD = loadcompd
.else
LOAD = loadraw
.endif
.org $080d
lda #$7f
sta $dc0d
jsr install
ldx #<test
ldy #>test
jsr LOAD
bcc :+
error: inc $d021
sta $d021
jmp error
: lda #$35
sta $01
lda numfiles
sta FILECOUNT
lda #LOADERCPU
sta LOADER_CPU
sta $0428
lda #0
ldx #38
: sta $0429,x
dex
bpl :-
.if LOADERCPU < 100
lda #<irq
sta $fffe
lda #>irq
sta $ffff
lda #$1b
sta $d011
lda #$33
sta $d012
lda #$01
sta $d01a
sta $d019
.endif
lda #<((312 * 63) - 1); PAL
sta $dc04
lda #>((312 * 63) - 1); PAL
sta $dc05
lda #$ff
sta $dc06
sta $dc07
.if OVERALL
.else
loadnext:
.endif
lda #$51
sta $dc0f
sta $dc0e
.if OVERALL
loadnext:
.endif
.if NONSEQUENTIAL
lda filenames
inc * - 2
sta filename
ldx #<filename
ldy #>filename
.else
ldx #<next
ldy #>next
.endif
jsr LOAD
.if LOADERCPU < 100
bcs error
.endif
.if OVERALL
.else
;lda #0
sta $dc0e
ldx #0
inc * - 1
sec
lda #$ff
sbc $dc06
sta $0429,x
lda #$ff
sbc $dc07
sta $0429 + 8,x
.endif
.if VERIFY
jsr checksum
.endif
dec FILECOUNT
bne loadnext
.if OVERALL
;lda #0
sta $dc0e
sec
lda #$ff
sbc $dc06
tay
lda #$ff
sbc $dc07
tax
tya
.else
clc
lda #0
tax
ldy numfiles
dey
: adc $0429,y
bcc :+
inx
clc
: dey
bpl :--
.endif
sta FRAMECOUNT + 0
stx FRAMECOUNT + 1
jsr prntfrmcnt
lda #0
sta $d7fe
sta $d7ff
done: inc $d020
jmp done
prntfrmcnt: ldx #1
ldy #0
jsr :+
dex
: lda FRAMECOUNT,x
pha
lsr
lsr
lsr
lsr
jsr :+
pla
and #$0f
: clc
adc #'0'
cmp #'9' + 1
bcc :+
sbc #'9'
: sta $0400,y
iny
rts
.if LOADERCPU < 100
irq: pha
txa
pha
tya
pha
lda $d020
pha
ldx #<(312 * (100 - LOADERCPU) / 100); PAL
ldy #>(312 * (100 - LOADERCPU) / 100); PAL
: lda $d012
: inc $d020
cmp $d012
beq :-
dex
bne :--
dey
bpl :--
pla
sta $d020
pla
tay
pla
tax
pla
inc $d019
rti
.endif
numfiles:
.if BENCHMARK = BITFIRE
.byte 18
.else
.byte 8
.endif
test: .asciiz "test"
.if NONSEQUENTIAL
filename: .asciiz " .tc"
filenames: .byte "abcdefghijklmnopqr"
.else
next = * - 1
.endif
.if VERIFY
OFFSET = 0; $e9
checksum: ldy #0
lda verify,y
sec
sbc #<OFFSET
sta checkloop + 1
lda verify + 1,y
sbc #>OFFSET
sta checkloop + 2
sec
lda verify + 2,y
sbc verify,y
tax
lda verify + 3,y
sbc verify + 1,y
tay
clc
txa
eor #$ff
adc #1
tax
tya
eor #$ff
adc #0
tay
clc
lda #0
checkloop: adc $ff00
inc checkloop + 1
bne :+
inc checkloop + 2
: inx
bne checkloop
iny
bne checkloop
ldy checksum + 1
ldx verify + 4,y
cmp verify + 4,y
bne chksumfail
tya
clc
adc #6
sta checksum + 1
rts
chksumfail: .byte 2
verify: .word $a800, $b4f2, $f4; a
.word $2800, $bf80, $24; b
.word $7400, $bd00, $af; c
.word $2f80, $4900, $8d; d
.word $2800, $6600, $9d; e
.word $2800, $4396, $69; f
.word $5c00, $62d5, $7e; g
.word $2800, $2d00, $e9; h
.word $2900, $4500, $50; i
.word $4800, $6358, $b0; j
.word $2800, $6200, $39; k
.word $6100, $7300, $45; l
.word $2800, $67a1, $9c; m
.word $b900, $bef7, $f8; n
.word $6600, $8000, $a3; o
.word $9000, $af00, $d4; p
.word $2800, $666b, $b8; q
.word $8000, $a800, $58; r
.endif; VERIFY
.res LOAD - *
.incbin "../../build/loader-c64.prg", 2
.res install - *
.incbin "../../build/install-c64.prg", 2

View file

@ -0,0 +1,131 @@
; 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::TSCRUNCH; 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 1 ; include the loadcompd routine to load and depack compressed files on the fly
; requires DECOMPRESSOR != DECOMPRESSORS::NONE
.define LOAD_RAW_API 0 ; 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 1 ; For TSCrunch or ZX0, use a bigger but potentially faster decompression routine
.define UNINSTALL_API 0 ; 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 routine 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 0 ; 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 0 ; 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 0 ; 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

View file

@ -0,0 +1,12 @@
#! /usr/bin/env lua
for line in io.stdin:lines() do
local loader_cpu, frames_lo, frames_hi = line:match("^%S+%s*(%x+)%s*(%x+)%s*(%x+)")
loader_cpu = tonumber("0x"..loader_cpu)
frames = tonumber("0x"..frames_lo) + (256 * tonumber("0x"..frames_hi))
throughput = 185526 * 50 / frames;
print(("(%d, %.f)"):format(loader_cpu, throughput))
end

View file

@ -0,0 +1,35 @@
#! /usr/bin/env lua
local lines = {}
for line in io.stdin:lines() do
lines[#lines + 1] = line
end
local loader_cpu
for k, v in pairs(lines) do
if k % 2 == 1 then
loader_cpu = v:match("^%S+%s*(%x+)")
else
local f1l,f2l,f3l,f4l,f5l,f6l,f7l,f8l, f1h,f2h,f3h,f4h,f5h,f6h,f7h,f8h = v:match("^%S+%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)")
loader_cpu = tonumber("0x"..loader_cpu)
local frames = {}
frames[1] = tonumber("0x"..f1l) + (256 * tonumber("0x"..f1h))
frames[2] = tonumber("0x"..f2l) + (256 * tonumber("0x"..f2h))
frames[3] = tonumber("0x"..f3l) + (256 * tonumber("0x"..f3h))
frames[4] = tonumber("0x"..f4l) + (256 * tonumber("0x"..f4h))
frames[5] = tonumber("0x"..f5l) + (256 * tonumber("0x"..f5h))
frames[6] = tonumber("0x"..f6l) + (256 * tonumber("0x"..f6h))
frames[7] = tonumber("0x"..f7l) + (256 * tonumber("0x"..f7h))
frames[8] = tonumber("0x"..f8l) + (256 * tonumber("0x"..f8h))
table.sort(frames)
throughput = 0x4000 * 50 / ((frames[4] + frames[5]) / 2);
print(("(%d, %.f)"):format(loader_cpu, throughput))
end
end

View file

@ -0,0 +1,35 @@
#! /usr/bin/env lua
local lines = {}
for line in io.stdin:lines() do
lines[#lines + 1] = line
end
local loader_cpu
for k, v in pairs(lines) do
if k % 2 == 1 then
loader_cpu = v:match("^%S+%s*(%x+)")
else
local f1l,f2l,f3l,f4l,f5l,f6l,f7l,f8l, f1h,f2h,f3h,f4h,f5h,f6h,f7h,f8h = v:match("^%S+%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)%s*(%x+)")
loader_cpu = tonumber("0x"..loader_cpu)
local frames = {}
frames[1] = tonumber("0x"..f1l) + (256 * tonumber("0x"..f1h))
frames[2] = tonumber("0x"..f2l) + (256 * tonumber("0x"..f2h))
frames[3] = tonumber("0x"..f3l) + (256 * tonumber("0x"..f3h))
frames[4] = tonumber("0x"..f4l) + (256 * tonumber("0x"..f4h))
frames[5] = tonumber("0x"..f5l) + (256 * tonumber("0x"..f5h))
frames[6] = tonumber("0x"..f6l) + (256 * tonumber("0x"..f6h))
frames[7] = tonumber("0x"..f7l) + (256 * tonumber("0x"..f7h))
frames[8] = tonumber("0x"..f8l) + (256 * tonumber("0x"..f8h))
table.sort(frames)
throughput = 0x4400 * 50 / ((frames[4] + frames[5]) / 2);
print(("(%d, %.f)"):format(loader_cpu, throughput))
end
end