Files
courier-emu/tests
Cryan209andClaude Opus 5 f85d8a4584 Download a ROM's datapump into the emulated DSP
A flash image does carry a separable C52 payload. Its supervisor sends one
at every boot, and the call site that starts that download names every
parameter needed to find it: the entry word, the source offsets, and the
window segment the downloader loads into ES. Recover it from there rather
than from a constant, because the 25 MHz supervisor keeps the same payload
at 0x296e0 behind the same instructions, and an offset taken from one image
reads the wrong bytes out of another.

Teaching the bridge to receive it needs a second transfer protocol, not an
extension of the first. An update payload's supervisor strobes one window
on port 0x1e; a ROM's downloader alternates two, strobing 0x40..0x4e with 1
and 0x50..0x5e with 2 on port 0x18, and submits its word checksum with 4.
They cannot be merged: 0x58..0x5e are the runtime mailbox under both, and
also the upper transfer window under the ROM's. Nothing in a single write
separates those uses, so the download's own completion does.

Two things then stopped the transfer. The timer model grants timer 2's max
count at the first poll of a control register, which is right for the
calibrated delays both firmwares busy-wait on and wrong for the DSP
transfer routines, which reuse that bit as their handshake timeout: e3aa
reported a failure that never happened and the download never started. The
XMF supervisor has the same collision, already handled by address. Decline
the grant while the CPU is inside the transfer routines the call site
locates. And e370 sets its window up through the same window and strobes as
the program, so its eight 0083 words were counted as payload; drop what
arrived before the entry request completes.

The supervisor now transfers all 27,710 words through the modelled ports,
byte-identical to the flash range, with the checksum strobe after. The C52
core does not execute them yet: nothing performs the launch to the
requested entry that the DSP's own boot ROM would.

Also correct S0STS's bit map against the 80C186EB manual, figure 10-14. The
fields sit above a reserved bit 0, so bit 1 is CTS and bit 3 TXE, one place
higher than a plain reading of the field list gives. Four firmware uses
agree and none parses under the unshifted reading. Behaviour is unchanged:
bit 1 keeps the edges the previous model produced, now named for what it is
and marked as standing in for an unmodelled DTE handshake.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 19:48:47 +12:00
..
2026-09-01 10:48:05 +12:00
2026-08-06 00:31:13 +12:00
2026-08-06 00:31:13 +12:00
2026-08-06 00:31:13 +12:00
2026-08-06 00:31:13 +12:00
2026-09-03 23:14:13 +12:00
2026-08-04 15:16:26 +12:00
2026-08-04 13:01:29 +12:00