Skip to content

DMA6: mask CHCR writes, start the OTC on bits 24 and 28 - #2475

Merged
rixnobis merged 1 commit into
grumpycoders:mainfrom
rixnobis:dma6-otc-chcr
Oct 23, 2026
Merged

rixnobis merged 1 commit into
grumpycoders:mainfrom
rixnobis:dma6-otc-chcr

Conversation

@rixnobis

Copy link
Copy Markdown
Contributor

dma6() only ran on chcr == 0x11000002, so 0x11000000 (what psx-spx documents as enough) did nothing, and any other value with bit 24 set completed instantly with an IRQ and no OT written. On SCPH-1000, SCPH-5501 and SCPH-9002 the writable bits are 24, 28 and 30, bit 1 reads 1, the OTC runs when 24 and 28 are both set, and 24 alone stays busy forever. CHCR writes are now masked to that, and DMA6 skips the generic MADR/BCR writeback, which had been adding 0x200000 to MADR and zeroing BCR.

DMA6 only on purpose; the other channels' CHCR masks and DREQ behaviour are a bigger rework of the DMA dispatch. Not modelled either: a transfer latched with ch6 disabled starts when DPCR enables the channel (on hardware it does; that test stays CESTER_MAYBE_TEST).

The pin points at nugget dma6-otc-strict, which turns the new tests/dma cases on under PCSX_TESTS. pcsx-redux/nugget#272 merges them as hardware-only, since nugget CI runs against the current dev build.

Only bits 24, 28 and 30 of D6_CHCR are writable and bit 1 reads 1.
The OTC runs when 24 and 28 are both set, whatever the other bits;
24 alone stays busy. MADR and BCR are not written back. Measured on
SCPH-1000, SCPH-5501 and SCPH-9002; tests in nugget tests/dma.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between ac48a33 and 3e22b16.

📒 Files selected for processing: 4
  • pcsx-redux.nix
  • src/core/psxdma.cc
  • src/core/psxhw.h
  • src/mips

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Walkthrough

DMA6 now applies specific CHCR handling for OTC transfers and updates its completion behavior. The nugget pin and src/mips submodule reference were also updated to revision 4dae6025feb33651d0550fc443f028248794de52.

Changes: DMA6 OTC handling

Layer / File(s) Summary
DMA6 CHCR and OTC completion
src/core/psxhw.h, src/core/psxdma.cc
DMA6 CHCR writes are masked to bits 24, 28, and 30, with bit 1 forced set. DMA6 returns before generic MADR and BCR updates. OTC transfers run when bits 24 and 28 are set, and completion clears those bits before raising the DMA interrupt.

Submodule revision updates

Layer / File(s) Summary
Update pinned revisions
pcsx-redux.nix, src/mips
The nugget revision and hash were updated. The src/mips submodule reference now points to the same revision.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: nicolasnoble

Merge Risk: ⚪ Minimal · up to 3e22b

No merge-blocking risk is established by the reviewed changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: DMA6 CHCR writes are masked, and the OTC (ordering table clear) starts on bits 24 and 28. The raw summary confirms that src/core/psxdma.cc, src/core/psxhw.h, and the n…
Description check Passed The description explains the DMA6 bug: dma6() ran only for chcr == 0x11000002. It names the writable CHCR bits (24, 28, 30) and the OTC start condition (bits 24 and 28). It also covers the removed MAD…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: DMA6 CHCR writes are masked, and the OTC (ordering table clear) starts on bits 24 and 28. The raw summary confirms that src/core/psxdma.cc, src/core/psxhw.h, and the nugget pin all match this title.

Full details: Description check

Explanation

The description explains the DMA6 bug: dma6() ran only for chcr == 0x11000002. It names the writable CHCR bits (24, 28, 30) and the OTC start condition (bits 24 and 28). It also covers the removed MADR/BCR writeback and the scope limit to DMA6. These match the raw summary's changes in psxdma.cc and psxhw.h and the nugget submodule pin.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rixnobis
rixnobis requested a review from nicolasnoble October 23, 2026 14:45
@rixnobis
rixnobis merged commit de3525e into grumpycoders:main Oct 23, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant