Arnitech controller: the TOD set at boot, and a jump table at $FF00

A new option, ARNITECH_CONTROLLER, on in the mc64 configuration only.
IOINIT starts timer A with CIA #1's TOD on 50 Hz, the mc64's mains, and
if the Arnitech controller's signature "ARNI" is at $DE80, latches its
clock and copies its real time into the TOD, hours first and tenths
last, flipping bit 7 of an hour of 12 first, since the CIA flips it
back when 12 is written. Without the signature the TOD is left alone.

The Arnitech jump table at $FF00: "ARNI", version $01, two entries, and
JMPs from $FF06: $FF06 finds the first Card slot holding a Card of the
type in A (carry clear, the slot in A, its Card window's low byte in
X; carry set if none or no controller), $FF09 sets the TOD as IOINIT
does. $FF48-$FF80 stay clear. The code is in new files under
src/kernal/arnitech; other configurations build as before.
This commit is contained in:
chris committed 2026-10-17 02:17:45 +02:00
1 parent 0ec343a727
commit 03e2d4a4b8
8 files changed
+208

No files matched your search

@@ -0,0 +1,40 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * * #IGNORE
;
; The Arnitech jump table (mc64 only): thin wrappers over the Arnitech controller's registers
; (arnitech's ADR 0023), at fixed addresses. Software finds it by reading "ARNI" at $FF00 with
; the KERNAL banked in; on any other KERNAL it uses the registers themselves, which work the same.
; Entries are only ever added, after the last, with the version and count raised; $FF48-$FF80
; stay clear, for the stock IRQ entry, CINT, and the KERNAL revision byte.
;
; $FF00-$FF03 "ARNI"
; $FF04 version of the table, $01
; $FF05 number of entries
;
; $FF06 ARNI_FINDCARD - finds the first Card slot holding a Card of a given type
; In: A = the Card's type ($01 Redstone Card, $02 Internet Card; $00 finds an empty slot)
; Out: carry clear if found: A = the slot (0-5), X = the low byte of its Card window
; ($DEA0 + 16 * slot, so LDA $DE00,X reads the window's first byte);
; carry set if no slot holds one, or no controller answers (a Cartridge switched it off)
; Y is kept; A and X are not, when none is found
;
; $FF09 ARNI_SETTOD - sets CIA1's TOD from the controller's real time, as IOINIT does at boot
; In: nothing; CIA1's CRB bit 7 must be 0, or the time goes into the TOD alarm
; Out: carry clear if set: the TOD on 50 Hz (CIA1 CRA bit 7) and started at the time the
; controller's clock latch read; carry set if no controller answers, with the TOD
; untouched but on 50 Hz all the same
; A and X are not kept, Y is
;
!ifdef CONFIG_ARNITECH_CONTROLLER {
arnitech_jumptable:
!byte $41, $52, $4E, $49 ; "ARNI"
!byte $01 ; version
!byte $02 ; entries
jmp arnitech_find_card ; $FF06
jmp arnitech_set_tod ; $FF09
}