narzoul / DDrawCompat

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

Issues with MGS1 Integral #49

Closed JaegerFox closed 3 years ago

JaegerFox commented 5 years ago

I like this ddraw wrapper very much because it shows a higher quality than others, in addition the speed is fast, but in MGS1 at the time of leaving the game nothing appears when a confirmation notification should appear, in addition the game is closed in Game Over using software rendering

MGSI 2 that's the menu that should appear

narzoul commented 3 years ago

I fixed the issue with the confirmation dialog.

The crash after game over is caused by a buffer underwrite bug in the software renderer of the game (it attempts to write in the pixel row just above the locked render target surface). I don't see a good way to fix it from DDrawCompat. It's better to use the hardware renderer instead.

Of course, the hardware renderer doesn't work natively either because of another bug in the game. When enumerating Direct3D devices, it attempt to check if the hardware supports bilinear texture filtering. It's supposed to look for the D3DPTFILTERCAPS_LINEAR flag in the dwTextureFilterCaps member of the D3DPRIMCAPS struct, but it mistakenly looks for it in the dwTextureCaps member instead, where the same constant value actually means D3DPTEXTURECAPS_POW2. The latter is likely only set on some really ancient GPUs. This bug can be fixed by applying a small hex edit to the executable. Replace this pattern: F6 43 5C 02 75 0F with this one: F6 43 60 02 75 0F This will correct the offset of the data member that is checked within D3DPRIMCAPS (from 5C=dwTextureCaps to 60=dwTextureFilterCaps).

Supposedly both bugs are fixed already in the GOG release.