You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6c09eb6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ppu): derive the H-IRQ dot from the clock, not a constant (T-06-A) (#300)
* fix(ppu): derive the H-IRQ dot from the clock, not a constant (T-06-A)
HIRQ_TRIGGER_DELAY = 4 was a dot-domain rounding of ares'
`hcounter(10) == (HTIME+1)<<2`, exact only while every dot is four clocks --
which stopped being true when dots 323 and 327 became six. The match is now
computed where it happens: clock 4*HTIME + 14, mapped to the first dot
boundary at or after it.
Below the long dots the two agree EXACTLY, because 4*HTIME + 14 is never a
multiple of 4 and the next boundary is HTIME + 4. They diverge only for HTIME
321..=337, where the six-clock dots have displaced every later boundary: the
old constant fired up to a whole dot late, and at HTIME 336 suppressed an IRQ
that does fire. HTIME 337 lands on dot 340's boundary, which exists only on
the long line, so it is honoured there and suppressed elsewhere.
The plan records this change as attempted and reverted once because it moved
hdmaen_latch_test_2's golden. It does not this time: no framebuffer golden
moved, the undisbeliever suite passes unchanged, and cross-validation is
byte-identical.
B4.16 is a weaker guard than its own doc claimed. Measured either side of the
change both its readings are unchanged, including the HTIME = 330 one whose
trigger dot moved 334 -> 333: the CPU takes an IRQ at an instruction boundary,
so the handler-entry dot quantises to the spin loop's instruction length and a
one-dot shift is absorbed. It can say "nothing regressed"; it cannot say "the
change took effect". The new unit test does that, sweeping every HTIME and
asserting equality with the old constant below the long dots and strict
inequality above them.
LONG_DOTS and the per-dot clock count move to rustysnes-ppu, which owns the
dot model and now needs the layout twice; the scheduler delegates rather than
keeping a second copy.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs(roadmap,plan): close T-06-A's H-IRQ item and correct two predictions
The roadmap predicted the clock-domain conversion "would shift IRQ timing by
~2 clocks" and re-bless framebuffer goldens. It shifts nothing below the long
dots and moved no golden; only HTIME 321..=337 changes.
The plan predicted the change was "the likeliest thing under B1.05's
residual". It is not, and B4.16 shows why directly: its HTIME = 330 trigger
dot moved 334 -> 333 and its recorded reading did not move, because the
handler-entry dot quantises to the spin loop's instruction length. B1.05 stays
blocked on the same missing clock-domain instrument.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments