Skip to content

S3 ViRGE: Add cycle timing to MMIO read functions to fix polling performance issue#6651

Merged
OBattler merged 4 commits into
86Box:masterfrom
AITUS95:master
Dec 30, 2025
Merged

S3 ViRGE: Add cycle timing to MMIO read functions to fix polling performance issue#6651
OBattler merged 4 commits into
86Box:masterfrom
AITUS95:master

Conversation

@AITUS95

@AITUS95 AITUS95 commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

Summary

Games that poll the S3 ViRGE status registers via MMIO (such as Star Trek: Generations) experience extreme slowdowns, particularly with the GX2 variant. Profiling revealed that and related functions were consuming ~25% of CPU time due to tight polling loops executing millions of iterations per second. s3_virge_mmio_read.

Root Cause

The MMIO read functions were missing cycle timing, so any polling loop on the status registers would run at unrealistic speeds. The palette fading in Raptor probably hammers those registers waiting for the GPU to be ready, causing the same issue. This fix adds proper wait states to all MMIO reads, which should resolve it.

Checklist

References

Provide links to datasheets or other documentation that helped you implement this pull request.

@OBattler OBattler merged commit df76d4a into 86Box:master Dec 30, 2025
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants