Files
psxrecomp/runtime/include
Alex Vanderveen 88f2500ca8 cdrom: never destroy a pending data-ready; defer it instead
THE MECHANISM, measured on the palette load with guest cycle stamps:

        0  SECTOR 125109  pend=0 lost=0
  225,792  SECTOR 125110  pend=0 lost=0
  236,023  CMD Setloc(125111)        <- guest asks 10k cycles after 110
  237,956  CMD ReadN
  689,540  SECTOR 125111  pend=1 lost=1
  915,332  SECTOR 125112  pend=1 lost=1
2,273,594  CMD Setloc(125111)        <- the game times out and retries
2,275,306  CMD ReadN
2,726,890  SECTOR 125111  pend=0 lost=0

Sector 111 arrives while the guest has not yet acked the ReadN's INT3,
so its data-ready pends. Sector 112 arrives 225,792 cycles later and
REPLACES that pend, destroying 111's notification outright. The guest is
never told 111 arrived, times out after ~1.6M cycles, and re-issues
Setloc+ReadN. That retry is the entire 2.5M-cycle gap that appears
before every individually requested sector, and it is why the palette
sector is not drained on the first pass.

gap_anatomy attributed 100% of the gap to after the guest asked; the
guest issues its command within ~10,000 cycles every time. The delay was
never guest-side.

With the ring, both sectors are already safe in their own slots, so
there is nothing to drop: the newer sector's announcement now WAITS and
is raised once the guest drains the one already announced
(cdrom_announce_next_held, delayed and guarded like the ack path).
Announcements stay in arrival order and none is lost. int1_lost must now
stay 0; int1_deferred counts the sectors held.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-24 12:55:58 -04:00
..
2026-07-29 03:18:10 -04:00
2026-08-17 22:25:49 -04:00
2026-07-29 03:18:10 -04:00
2026-08-17 23:03:33 -04:00
2026-08-19 22:50:13 -04:00
ok
2026-08-07 22:14:26 -04:00
2026-08-07 16:42:43 -04:00
2026-08-16 17:59:20 -04:00
2026-07-29 03:18:10 -04:00
2026-08-03 05:26:37 -04:00
2026-08-06 20:34:50 -04:00
2026-08-19 22:50:13 -04:00
2026-08-19 22:50:13 -04:00
2026-08-17 22:25:49 -04:00
2026-08-03 05:26:37 -04:00
2026-08-03 05:26:37 -04:00
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00
2026-08-19 22:50:13 -04:00
2026-07-31 17:14:35 -04:00
2026-08-19 22:50:13 -04:00
2026-08-19 22:50:13 -04:00
2026-08-17 22:25:49 -04:00
2026-08-19 22:50:13 -04:00
2026-08-19 09:12:06 -04:00
2026-08-19 22:50:13 -04:00
2026-08-19 22:50:13 -04:00
2026-08-18 08:49:24 -04:00
2026-07-31 17:14:35 -04:00
2026-07-29 03:18:10 -04:00
2026-07-31 17:14:35 -04:00
2026-07-29 03:18:10 -04:00
2026-07-29 03:18:10 -04:00
2026-08-13 10:37:18 -04:00
2026-08-17 23:03:33 -04:00
2026-08-11 18:59:19 -04:00
2026-08-18 08:49:24 -04:00
2026-07-29 03:18:10 -04:00