narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
970 stars 70 forks source link

Scroll speed in Sid Meier's Gettysburg! #281

Open pas-de-2 opened 10 months ago

pas-de-2 commented 10 months ago

Tried getting Gettysburg to run in win10 with the 1.03 and XP compatibility patches applied. Everything renders well, including the FMVs, except the game scrolls way too fast when edge panning. I tried forcing Vsync, the different FpsLimiters, and exclusive FullScreenMode to no avail. Any chance this is something you could fix?

DDrawCompat-lee.zip

narzoul commented 2 days ago

This game is entirely rendered by GDI. It only seems to use DirectDraw for setting the display mode.

That said, I extended the flipstart/flipend limiters to also detect cases where the screen is updated with a full screen blit, which seems to work well with this game. You can try it out with this patch: ddraw.zip (diff.txt compared to v0.5.4)

I'd recommend using a maximum of flipend(30), maybe even less.

pas-de-2 commented 2 days ago

It works! Thank you so much 🙏 I went all the way down to flipend(10) and the scroll speed feels right.

This prompted me to try it with the sequel, Antietam!, from Sid Meier's Civil War Collection disc, and it works there as well, but I don't suppose you might know what's going on with the color depth here? SMA When launching either Antietam or the South Mountain shortcut with DDrawCompat, it looks like the game launches in the wrong color depth for the intro videos, and then once it reaches the main menu it snaps back to a higher color depth, but there are still these red fringes on various UI elements. It's most obvious on the South Mountain main menu background.

If I launch Antietam.exe without DDrawCompat, the intro videos render at the correct color depth, but once it reaches the main menu the red fringing is still there.

I tried messing with reduced color mode compatability settings and DesktopColorDepth, but neither helped.

(Let me know if you'd rather I open a separate issue for this)

narzoul commented 1 day ago

If I launch Antietam.exe without DDrawCompat, the intro videos render at the correct color depth, but once it reaches the main menu the red fringing is still there.

First of all, install the v2.0 beta patch: https://www.moddb.com/games/sid-meiers-gettysburg/downloads/antietam-beta-patch-v2-0 That should fix this issue.

The videos play incorrectly on Windows 7 natively too, which is the last Windows OS that supported proper 8 bit color depth. It seems to me that DDrawCompat emulates this part well enough. Ironically, it works better on Windows 8+ because they don't properly emulate 8bpp mode, so GDI is actually rendering in 32bpp.

You can patch the executable to run in 32bpp mode natively. After installing the beta patch above, hex edit antietam.exe and replace these bytes: 6A 08 56 50 E8 E5 78 05 00 with this: 6A 20 56 50 E8 E5 78 05 00 Only the second byte is different.

This also fixes the videos natively on Windows 7, or with DDrawCompat on any supported OS.

pas-de-2 commented 1 day ago

Hm, I believe this beta patch was intended for the old stand alone version of SMA. It installs an .exe dated 2/11/2000, while the Antietam.exe installed by the Civil War Collection is dated 8/7/2000. If I install the beta patch over it, the South Mountain add-on (launched with the -campaign 3 argument) no longer works, it just boots to Antietam.

And while your hex edit does fix the startup videos, the game itself still has this weird red fringing along some of the menu sprites: SMA2 when it should look like this: SMA3