-
-
Notifications
You must be signed in to change notification settings - Fork 477
Tandy: Implement CRTC-based display shifting (R2 & R7 registers) #6419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replace frame-based calibration system with timer-based approach - Replace fixed scaling constants with dynamic video mode-aware calculations - Reduce unnecessary vid_update_display_offset() calls by filtering registers - Introduce dynamic horizontal/vertical scaling calculations - Update rendering pipeline to use dynamic display parameters
…riable/function naming
…er clock width calculation and remove vid_get_char_width()
…amp crtc[7] position to valid range and use calibrated baseline_vsyncpos for vsync comparison to avoid display issues when overscan in enabled
- Apply vsync_offset only during the vertical retrace period for a more accurate result - Change the calculation of displine_offs and remove redundant checks around rendering calls - Remove unnecessary clamping logic for crtc[7] - Remove a hack from the previous commit by correctly triggering VSYNC processing when the vertical counter matches the actual crtc[7]
…he rendering functions
…TC register writes
Member
Contributor
Author
|
Sorry about that - I didn't get any warnings when I built it on my end. 481 511 That should make it clear to the compiler. |
Member
|
Committed that and it does fix the warnings, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Summary
This PR adds support for shifting the display position using the CRTC's Horizontal Sync Position (R2) and Vertical Sync Position (R7). This enables the so-called the “screen shake” effect seen in many Sierra games, achieved by dynamically rewriting the specified registers on the fly.
kq1_test.webm
A baseline calibration is used to distinguish between a game setting the initial screen position and a game intentionally shifting the screen for effect. After a video mode is set, the centered sync positions are stored as a reference. Every write to R2 or R7 triggers a calculation of the difference from the stored baseline.
Values outside the documented limits of these registers are not fully emulated:
R4 >= R7 >= R6), but this only affects software that deliberately pushes the CRTC beyond spec to create special visual effects (for example - Area 5150)Here's a test (within the documented range for R7) across three different modes: 80-column text, 320x200x4, and 320x200x16.
basica_test.webm
All other modes available through BASICA have been tested as well.
640x200x16 for Tandy Video II (SL/2) was tested in a game that supports this mode.
Checklist
References
Provide links to datasheets or other documentation that helped you implement this pull request.