# CD32 + CDTV native release — 2026-05-23

This is the Minimig-AGA-fork release that adds **native CDTV CD support** on
top of the existing native-Akiko CD32 path. The headline result: Dune (1992)
boots from a CDTV CHD on real MiSTer hardware, end-to-end, with no IDEFix97
or HDF-launcher in the path.

## What's new vs the prior `CD32-native-20260518-cpuspeed` release

### CDTV native CD bridge (M2 Phase-1b)

- New RTL: `cdtv_bridge.v` (DMAC + TPI + CR-511 protocol), `cdtv_hps_bridge.v`
  (UIO cmd / sector / STCH-inject sub-channels), `chipdma_arb.v` extended
  with a CDTV master port for chip-RAM bulk transfers.
- New userspace: `support/minimig/cdtv_cd.{cpp,h}` mounts the CHD on opcode
  0x02 (READ DATA) and pushes sector bytes via UIO 0xF820.
- Validated: BIOS walks the ISO9660 directory tree (LBAs 16 PVD → 18 → 32 →
  1079 → 42, 202, 210 ... — real filesystem traversal), zero same-LBA retry
  stalls, and Dune renders its title credits + desert intro animation.

### IDE-ATAPI path preserved

The native CDTV/Akiko paths were added **alongside** the IDE-ATAPI emulator,
not as a replacement. Legacy CD32 game packs (IDEFix97-style boots from an
HDF) continue to work: `cdrom_parse()` feeds the same CHD image to both the
ATAPI emulator on the IDE bus and the native bridge, so whichever path the
in-Amiga driver uses, it finds the disc.

### OSD UI redesign

The IDE page is now the canonical "what storage/I/O controller is wired
into this machine" selector:

| Row 0 | Effect |
|---|---|
| `I/O controller: OFF`  | No storage controller. |
| `I/O controller: IDE`  | Classic Pri/Sec × Master/Slave IDE grid (A600/A1200/CD32). |
| `I/O controller: CDTV` | CDTV DMAC + TPI + CR-511 path. Slot 0 relabeled `CD0`, slots 1-3 as `HD0/HD1/HD2 (SCSI)`. |

The redundant `CDTV: ON/OFF` row on the System page has been removed —
selecting `I/O controller: CDTV` is the canonical way to enter CDTV mode.
Backwards-compat: old saved CFGs with the chipset CDTV bit set still load
correctly under the new UI.

CD32 vs A1200: no UI difference. Both use the IDE grid. The difference is
purely runtime routing of CD images — Akiko for AGA chipset, ATAPI
otherwise. Same CHD image is exposed via both paths simultaneously.

### File rename

`Minimig.rbf` → `Minimig_20260523.rbf`. The shipped MGLs reference
`_Test/Minimig_20260523` so a dated install doesn't conflict with a stock
Minimig core in `_Test/`. To deploy alongside the stock Minimig:

- Drop the dated RBF in `_Test/` and use the MGLs as-is.
- Or rename the RBF back to `Minimig.rbf` and rewrite the MGLs if you
  prefer the original naming.

## Files

| File | Size | Purpose |
|---|---:|---|
| `Minimig_20260523.rbf` | 3,590,548 | FPGA core (CD32 + CDTV native + AGA + Akiko). |
| `MiSTer_CDTV_20260523` | 1,043,020 | ARM userspace binary with CDTV CD bridge + new OSD. Installed alongside stock `/media/fat/MiSTer` and selected per-core via `MiSTer.ini`. |
| `MiSTer.ini.snippet` | — | INI fragment to append to `/media/fat/MiSTer.ini`. |
| `CDTV-DuneMVP.{cfg,mgl}` | — | CDTV native test: boots Dune to intro credits. |
| `CannonFodder-CD32MVP.{cfg,mgl}` | — | Original native-Akiko gate (CD32). |
| `CD32-NoCD-MVP.{cfg,mgl}` | — | CD32 boot screen, no disc inserted. |
| 14 other `*-CD32MVP.{cfg,mgl}` | — | Per-game CD32 launchers with proven cpu/mem tunings. |
| `VERSION.txt` | — | Sizes, sha256-16, source-commit provenance. |

## Install — sidecar binary (no stock-MiSTer overwrite)

This release uses MiSTer's per-core `main=` INI directive to swap the
running userspace at core-load time, so you do **not** need to back up
or replace `/media/fat/MiSTer`.

1. `Minimig_20260523.rbf` → `/media/fat/_Test/`
2. `MiSTer_CDTV_20260523` → `/media/fat/` (keep stock `MiSTer` untouched).
   Make sure it's executable: `chmod +x /media/fat/MiSTer_CDTV_20260523`.
3. Append the contents of `MiSTer.ini.snippet` to `/media/fat/MiSTer.ini`:
   ```ini
   [Minimig]
   main=MiSTer_CDTV_20260523
   ```
4. `*.cfg` → `/media/fat/config/`
5. `*.mgl` → `/media/fat/_Test/`
6. Pre-place the CD CHD next to the MGL it boots — the MGL uses
   `same_dir="1"` so the CHD lookup happens in the MGL's own directory.

### How the swap works

On any Minimig core load (stock or our dated RBF), the running stock
`MiSTer` reads `[Minimig]` from `MiSTer.ini`, sees `main=MiSTer_CDTV_20260523`,
and `execl()`s into that binary in place. The FPGA bitstream stays loaded
during the handoff. When you switch to a non-Minimig core, the stock binary
is used again.

**Blast-radius note:** the `[Minimig]` section matches by the RBF's embedded
`CONF_STR` ("Minimig"), not the filename — so loading the stock Minimig core
will *also* swap to `MiSTer_CDTV_20260523`. Our binary is upstream-compatible
for non-CDTV functionality (legacy ATAPI path preserved), so this is generally
safe. If you'd rather take the swap only when our dated RBF is loaded, you
can do the classic overwrite install instead:

```
cp /media/fat/MiSTer /media/fat/MiSTer.bak
cp /media/fat/MiSTer_CDTV_20260523 /media/fat/MiSTer
# omit the MiSTer.ini snippet
```

## Tested

- **CDTV-DuneMVP**: validated via `validate_m2_phase1b.py`. 36 READ DATA
  opcode-0x02 invocations in a 30s window, ISO9660 walk visible, Dune intro
  renders. First-ever native CDTV CHD boot on MiSTer.
- **CannonFodder-CD32MVP**: original MVP gate, still boots to title screen.
- **OSD redesign**: System page CDTV row absent, IDE page row 0 cycles
  through OFF/IDE/CDTV, CDTV mode shows CD0+HD0/HD1/HD2 labels.

## Known issues / out of scope

- Audio-CD playback path (Akiko CDDA / CDTV native CDDA) not validated for
  pure Red Book audio discs in this release. The chipset registers and
  driver paths exist; first-frame validation deferred.
- The 14 CD32 launchers other than Cannon Fodder were not re-validated
  against this RBF — they're known-working from prior releases but the
  combination with today's binary changes is not re-tested. Defer to
  per-game CFGs from prior dists if you hit a regression.
- CDTV-Remote controller type not implemented. CDTV mouse + joystick input
  works via existing controller types (Mouse / Joystick).
