Skip to content

Fix Voodoo 1 dirty_line tracking in single buffer mode#6688

Merged
OBattler merged 4 commits into
86Box:masterfrom
AITUS95:master
Jan 9, 2026
Merged

Fix Voodoo 1 dirty_line tracking in single buffer mode#6688
OBattler merged 4 commits into
86Box:masterfrom
AITUS95:master

Conversation

@AITUS95

@AITUS95 AITUS95 commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix missing dirty_line tracking in Voodoo 1 single buffer mode causing rendered content to not be displayed.

When rendering directly to the front buffer in single buffer mode, the render thread and fastfill operations were not marking scanlines as dirty. This caused the display thread to skip updating those lines, resulting in stale content from previous frames being shown on screen.

The fix adds proper dirty_line tracking when rendering triangles and during fastfill operations in single buffer mode.

This was visible in 3DMark99 with Voodoo 1 in single buffer mode, where rendered content would not appear on screen, and in Descent 2 with Voodoo 1, where the top and bottom borders showed stale content from previous frames.

Root Cause

In single buffer mode, both the draw buffer and front buffer point to the same memory location (draw_offset == front_offset). The display thread relies on the dirty_line array to determine which scanlines need to be refreshed from the framebuffer to the screen.

The render thread in vid_voodoo_render.c and fastfill operation in vid_voodoo_blitter.c were writing pixels directly to the framebuffer but never marking the corresponding lines in the dirty_line array. The display thread checks dirty_line[draw_line] before updating the screen, so unmarked lines were never refreshed, causing new content to be written to memory but never displayed.

The fix ensures that whenever content is written to the front buffer in single buffer mode, the corresponding dirty_line entry is marked, allowing the display thread to properly refresh those scanlines.

Checklist

Added logic to handle VGA pass-through state changes and mark lines dirty for refresh.
Added dirty line marking for single buffer mode.
@OBattler OBattler merged commit ec42614 into 86Box:master Jan 9, 2026
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