From 9ad7e292f8bdb900a6c5f6bd2815831e6658c5a3 Mon Sep 17 00:00:00 2001 From: Christian Werner Date: Sun, 18 Oct 2026 08:57:01 +0200 Subject: [PATCH] feat(arnitech): a Blade autoboots the first program on device 8 With ARNITECH_BLADE, BASIC's cold start calls blade_autoboot before READY.: it loads "*" from device 8 to BASIC's start, as LOAD"*",8 does, and BASIC then ends that LOAD as a program's, which RUNs what it loaded. RUN/STOP held on the Terminal Card, no Floppy, or no file goes on to READY. --- src/basic/,imports.s | 2 ++ src/basic/init/basic_cold_start_internal.s | 14 ++++++++ src/kernal/arnitech/arnitech_autoboot.s | 40 ++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 src/kernal/arnitech/arnitech_autoboot.s diff --git a/src/basic/,imports.s b/src/basic/,imports.s index e0c61361..3864aa6c 100644 --- a/src/basic/,imports.s +++ b/src/basic/,imports.s @@ -33,6 +33,8 @@ ;; #ALIAS# SELDEV = KERNAL_0.SELDEV +;; #ALIAS# blade_autoboot = KERNAL_0.blade_autoboot + ; ; MEGA65 specific parts ; diff --git a/src/basic/init/basic_cold_start_internal.s b/src/basic/init/basic_cold_start_internal.s index 69905ddc..7f036587 100644 --- a/src/basic/init/basic_cold_start_internal.s +++ b/src/basic/init/basic_cold_start_internal.s @@ -50,6 +50,20 @@ basic_cold_start_internal: ; This is for maximum C64 compatibility jsr copy_CHRGET +} + +!ifdef CONFIG_ARNITECH_BLADE { + + ; A Blade starts its program itself: LOAD"*",8 and RUN, unless RUN/STOP is held or the + ; LOAD fails (arnitech's ADR 0030). Out of direct mode, LOAD's own end RUNs the program. + + jsr blade_autoboot + bcs @3 + lda #$00 + sta VERCKB + sta CURLIN+1 + jmp cmd_load_no_error +@3: } ; jump into warm start loop diff --git a/src/kernal/arnitech/arnitech_autoboot.s b/src/kernal/arnitech/arnitech_autoboot.s new file mode 100644 index 00000000..e5a5c057 --- /dev/null +++ b/src/kernal/arnitech/arnitech_autoboot.s @@ -0,0 +1,40 @@ +;; #LAYOUT# STD * #TAKE +;; #LAYOUT# * * #IGNORE + +; +; Autoboot of the Blade Firmware (mc64blade only, arnitech's ADR 0030): BASIC's cold start, before +; READY., has a Blade LOAD"*",8, the first program on its internal drive's Floppy, and RUNs it. +; +; Out: carry clear if the program loaded, with X/Y the address after its end; carry set if +; RUN/STOP is held on the Terminal Card, or the LOAD failed (no Floppy, no file, no drive). +; + +!ifdef CONFIG_ARNITECH_BLADE { + +blade_autoboot: + + jsr terminal_find + bcs @1 + lda TERMINAL_STATUS, x + and #TERMINAL_STOP_HELD + beq @1 + sec + rts +@1: + lda #$01 + ldx #blade_autoboot_name + jsr JSETNAM + lda #$00 + ldx #$08 + ldy #$00 ; secondary address 0: to BASIC's start + jsr JSETFLS + lda #$00 ; LOAD, not VERIFY + ldx TXTTAB+0 + ldy TXTTAB+1 + jmp JLOAD + +blade_autoboot_name: + + !byte $2A ; "*" +}