Cart start-up: cold boot "DK" carts; wire up "Cart Interrupt Disabled"

A cart loaded after boot in Multi-Pak slot 3 made CART toggle every CPU cycle
forever -- the autostart of a program pak, whose CART pin is tied to Q. A
disk-style ROM (HDB-DOS, Disk BASIC) never drives CART; BASIC starts it from
the "DK" signature at power-on. Under the toggling, FujiNet's CFGLOAD.BIN
(which re-enables the CART interrupt) hung in an endless FIRQ after 17
DriveWire reads; an OSD reset cleared it.

- A cart whose first two bytes are "DK" now gets a cold boot (the existing
  AMW/EE_Cold_Bt path) instead of the autostart interrupt.
- OSD "Cart Interrupt Disabled" (status[16] -> SWITCH[4]) was not connected;
  it now suppresses the slot-3 autostart interrupt.
- Program paks are unchanged: Arkanoid loaded after boot still autostarts.

Verified in the Verilator sim with the hardware sequence (cart loaded after
boot, slot 3, no reset): the FujiNet S3 cart now reads all 98 sectors of
CONFIG, matching the MiSTer after a manual reset. Regression tests unchanged.

The sim gains --cart-frame N to load the cart after boot, as the OSD and MGL
do; loading it before reset had hidden the problem.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Alan SterembergandClaude Opus 5.5 committed 2026-10-02 07:15:44 -04:00
1 parent 874f4f3083
commit 72a50a16bb
4 files changed
+52 -7

No files matched your search

+14 -1
View File
@@ -165,7 +165,20 @@ pty; `tests/fujinet_boot.sh`).
generator (`RX_CLK = TX_CLK`). That is unchanged for control `$1x` and for
baud select 0.
With both fixes, the L3 cart at 19,200 (the MiSTer configuration) boots from the
3. **Slot 3 hung FujiNet's CONFIG loader.** Once a cart finished downloading
after boot, slot 3 toggled the CART interrupt every CPU cycle, forever. That
is right for a program pak (CART tied to Q autostarts it), but a disk-style
ROM such as HDB-DOS never drives CART. FujiNet's `CFGLOAD.BIN` re-enables
that interrupt and then hung in an endless FIRQ, after reading 17 sectors.
A reset cleared it, which is why "load cart, then Reset" worked. The OSD's
"Cart Interrupt Disabled" option was not connected to anything. **Fix:** a
cart that starts with `DK` gets a cold boot instead, the way BASIC starts
it at power-on, and the OSD option now suppresses the autostart interrupt.
Program paks behave as before. The sim reproduces both cases with
`--cart-frame N`, which loads the cart after boot the way the OSD and MGL
do.
With these fixes, the L3 cart at 19,200 (the MiSTer configuration) boots from the
real FujiNet daemon with no checksum errors, and gets to FujiNet's CONFIG
splash. The S3 cart (115,200) reaches the CONFIG host-slots screen.