-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Add s3freak's 4 MiB S3 patch #1244
Merged
Merged
Conversation
This file contains 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
This pull request introduces 12 alerts when merging e639f57 into 40f37ed - view on LGTM.com new alerts:
|
9098f71
to
f165daf
Compare
986a3f5
to
9ee1cab
Compare
e52faf2
to
a28839c
Compare
a28839c
to
7a26dc2
Compare
kklobe
reviewed
Sep 6, 2021
kklobe
reviewed
Sep 6, 2021
Fixes: - warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] - LOG(LOG_VGA,LOG_NORMAL)("Blinking %d",enabled);
We know these Bitu's are only 32-bit on Win32 (and these don't involve pointers or memory addresses), so we can safely down-grade these to fixed sizes. Cleans up 20 warnings flagged on macOS Clang: vga_draw.cpp:1042:51: warning: format specifies type 'int' but the argument has type 'double' [-Wformat] vga_draw.cpp:1310:11: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1310:18: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1310:27: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1310:34: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1310:3: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1310:43: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1312:11: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1312:18: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1312:27: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1312:34: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1312:3: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1312:43: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1352:56: warning: format specifies type 'int' but the argument has type 'double' [-Wformat] vga_draw.cpp:1356:68: warning: format specifies type 'int' but the argument has type 'double' [-Wformat] vga_draw.cpp:1360:65: warning: format specifies type 'int' but the argument has type 'double' [-Wformat] vga_draw.cpp:1360:95: warning: format specifies type 'int' but the argument has type 'double' [-Wformat] vga_draw.cpp:1786:48: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:1786:55: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat] vga_draw.cpp:819:40: warning: format specifies type 'int' but the argument has type 'Bitu' (aka 'unsigned long') [-Wformat]
Fixes many warnings of this type: "warning C4244: '=': conversion from 'Bitu' to 'uint32_t', possible loss of data" We know these sizes at most only hold 32-bit as that's their limit when compiled on Win32.
These are at-most hundreds of millions. Likewise, we also know on 32-bit platforms these Bitu values are only uint32's.
Per the S3 specification (last sentence): If bit 7 of CR68 is set to 1, the PD bus size for the Trio64 is determined by the memory size speci- fied in bits 7-5 of CR36. For a 1-MByte configura- tion, the bus size is 32 bits. For 2-MByte or larger configurations, the bus size is 64 bits. EDO mem- ory can be used for 1- or 2-MByte configurations. Fast page mode memory is required for 4-MByte configurations.
The previous version has silent expectations that the VGA mode enums would have specific values. For example, M_LIN8 was assumed to be 5. If M_LIN8 isn't 5 then the various bit-wise operations will produce unexpected results. Obviously this is extremely fragile, as changing the order of the enums (or inserting new items) will alter their underlying values. This commit lifts out those hardcoded expected values into local constexpr's, and then uses a switch statement to perform the mapping. This way, the original enum list can be changed as needed without any risk coming to the XGA code.
This will ease the comparison of multiple modes.
790e4df
to
7959308
Compare
Also improve vmemsize conf setting by adding 'auto' as the default.
7959308
to
3d9679f
Compare
29addb0
to
420ebcb
Compare
420ebcb
to
93a63d9
Compare
Thanks to:
|
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.
This PR adds s3freak's excellent S3 patch to provide a similar
vmemsize =
setting like ECE and DOSBox-X have.Care has been taken to ensure it's running clean using SciTech's
VBETEST
5.3a testing tool, attached: sdd53a.zip. Simply unzip and launch this branch inside the unzipped directory.Logging
A small feature is that the video adapter and memory details are provided (given vmem is now configurable):
Tall-mode handling
Tall VESA modes are those that are taller than they are wide, ie: 320x400.
When
aspect = true
, this branch will aspect-correct the image so things appear "correct" in terms of proportions.For example, notice both VBETEST's graphically-drawn font is correctly proportioned as are the 3D structures and lettering inside Quake:
When
aspect = false
, tall modes will be stretched to "fit the CRT", which may result in distorted proportions.We always provide information to the user so they can adjust as needed.
Fixes: #366
Reviewers: suggest reviewing commit-by-commit.