# CD32 Native-Akiko — WinUAE Command-Parity Build (2026-05-15)

Boot-reliability release. The bridge's CD command handlers now mirror
WinUAE's `akiko.cpp` on the two places where divergence was causing
deterministic CR2 cold-boot failure. Plus a new opt-in CPU CFG bit for
stock-speed (no-turbo) playback.

**Inherits everything from `CD32-native-pbxperf`** (4-window PBX cache,
fadvise pre-warm, NVRAM saves, Akiko bridge, Cannon Fodder boot).
This release changes both `MiSTer` (ARM userspace) and `Minimig.rbf`.

## What changed

### 1. Chuck Rock 2 — `cmd_pause` clears the TOC drip (the CR2 fix)

CR2 cold-boot was 0/5 deterministic: the intro plays through to t=180s
and then the screen goes pure black for 30+ seconds. Trace shows BIOS
issuing PAUSE mid-TOC-drip; our bridge kept emitting 15-byte
SUBQ-shaped frames at BIOS during the PAUSE window, corrupting BIOS's
command state machine — it never re-set `CDFLAG_ENABLE`, sec_req went
silent for 57 seconds, and the boot hung.

`akiko_cd32.cpp:766` — `cmd_pause` now sets `toc_push_idx = -1` and
`toc_push_last_ms = 0`, mirroring WinUAE's `cdrom_toc_counter = -1`
clear at `akiko.cpp:1012`. After this fix: **5/5 cold-boots reach the
"Son of Chuck — Press Start!" title screen.**

### 2. `cmd_multi` data branch — `cd_paused = 0` symmetry

`akiko_cd32.cpp:929` — the data-read branch of `cmd_multi` now clears
`cd_paused` on entry, matching what the scan-TOC and audio-play
branches already did and what WinUAE does at `akiko.cpp:1054`.
Required so that PAUSE → PLAY DATA correctly resumes the CDDA pump.

This fix sticks to the minimum: only `cd_paused` is touched.
A previous attempt that also cleared `cd_playing` /
`cd_cdda_lba_next` / `cd_cdda_lba_end` regressed CR2's audio flow.

### 3. Stock-speed CPU option (opt-in via CPU CFG bit 5)

Bit 5 of the CPU CFG byte (file offset `0x141E`) is now wired through
to a new RTL gate that controls whether `cachecfg.turbochip` and
`cachecfg.turbokick` are force-set ON post-boot.

- **Bit 5 clear (default, 0x13 etc.)** — `minimig.v:417` still forces
  turbochip + turbokick ON regardless of the user's CFG bits, matching
  current behaviour. No regression for existing CFGs.
- **Bit 5 set (0x33)** — the gate releases and the user's CFG bits
  `[3:2]` are honored. Clear those bits (0x30) for genuine stock
  A1200/CD32 timing (no turbo chip, no turbo kick).

This is an authenticity option for users who want the original CD32
68020 14 MHz feel. Did not help CR2 in the lab (kept here as a feature,
not as a fix).

### 4. Per-game fast-RAM matrix (CFG `0x40E`)

Five bundled CFGs flip to **mem=0x03 (0 fast RAM)** per the
2026-05-14 verified test sweep:

| CFG | mem | Why |
|---|---|---|
| CannonFodder | `0x03` | Boots cleanly at 0 fast (verified) |
| BSS | `0x03` | Boots cleanly at 0 fast (refutes prior "stalls at splash") |
| AlienBreedSE | `0x03` | Z2 fast wedges this title |
| **ChuckRock2** | `0x03` | **Required** — won't load under 0x83 (separate Z2-vs-CD32 issue) |
| Beavers | `0x03` | Boots either way; 0 fast for authenticity |
| DeepCore | `0x83` | Genuinely needs fast — drops to AmigaDOS CLI without |
| _others (Banshee, ChuckRock, DotC, FieldsOfGlory, FireIce, Liberation, LitilDivil, Microcosm, SimCity)_ | `0x83` | Untested at 0 fast; kept at prior setting |

## Files

| File | Path on MiSTer | Purpose |
|---|---|---|
| `MiSTer` | `/media/fat/MiSTer` | Patched ARM userspace (WinUAE-parity command handlers + stock-speed CPU mask) |
| `Minimig.rbf` | `/media/fat/_Test/Minimig.rbf` | Minimig-AGA core (stock-speed gate + dormant chipset trace ring) |
| `*-CD32MVP.cfg` | `/media/fat/config/` | Per-game launch configs (per-game mem byte) |
| `*-CD32MVP.mgl` | `/media/fat/_Computer/` | Per-game MGL launchers |

Bundled launcher set (16): Cannon Fodder, Sim City, Microcosm,
Liberation: Captive 2, Litil Divil, Beneath a Steel Sky, Chuck Rock 1,
**Chuck Rock 2**, Fire & Ice, Banshee, Fields of Glory, Defender of
the Crown, Deep Core, Alien Breed SE, Beavers, plus the CD32 No-CD
test launcher.

## CHD layout assumed

Same as `CD32-native-pbxperf` — AmigaVision pack at
`/media/usb0/Games/AmigaCD32/<title>.chd` (or the
`Not working on MiSTer yet/` subdir for CR2 / CF / CR1 / F&I / Simon).

Kickstart: `../usb0/Games/Amiga/roms/Caldor/cd32_swapped.rom` (390 KB
byte-swapped CD32 Kickstart 3.1).

## Known not-yet-fixed items

Inherited from prior release plus:

- **Stock-speed bit 5 is opt-in** — none of the bundled CFGs set it.
  Edit byte at offset `0x141E` to `0x33` (and `[3:2]` clear → byte
  `0x30`) to enable.
- **Three other WinUAE-parity gaps remain** in cmd handlers (idempotent
  PAUSE early-return, `cdaudiostop()` at cmd_multi entry, SUBQ-during-
  data-read qcode validity). None implicated in CR2; deferred.
- **gfx-trio** (Jim Power / JP3 / Universe rendering glitches) unchanged
  by this release. Investigation infrastructure (chipset bus trace ring)
  is in the RTL gated to `0`, dormant. Flip
  `rtl/agnus.v:CHIPSET_TRACE` to `1` to activate.

## Verification

- 5/5 CR2 cold-boots reach the title screen (pre-fix: 0/5)
- CF intro renders normally at t=120s (no regression)
- Longest sec_req gap during CR2 boot: 57.6s → 7.0s
- Build slack: -0.624 ns on emu PLL counter[0] (pre-existing; same as
  prior fork releases — not a new regression)
