narzoul / DDrawCompat

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

Mig Alley with DDrawCompat v5.1 #265

Open TheSilkMan opened 7 months ago

TheSilkMan commented 7 months ago

Hi Narzoul, tried the latest version of DDrawCompat and the game freezes when launching into 3D. Since it does not enter into 3D I don't have a crash log to share. However, attached are the log and config files.

DDrawCompat-MigAlley.zip

TheSilkMan commented 7 months ago

Just noticed that if I set DisplayResolution = 1024x768 it will allow me into 3D, but with black bars along the sides. Once in for the first time, I can then go back and set the ini file set DisplayResolution to higher values as well as in game. I can then scale up to higher resolutions in game. It goes higher but the game does not fill the screen.

One thing I noticed is that in this latest build, the overlay no longer is transparent, allowing you to see the changes real time as you make them. Instead, I get a black background. Another thing I noticed is that when scrolling down to the bottom of the overlay list, white text shows up for additional settings but they are not editable in the overlay.

DDrawCompatv5.1LogFiles.zip

OverlayIssue.zip

TheSilkMan commented 7 months ago

Hi Narzoul, still figuring things out. Found the following: ConfigTransparency
DisplayAspectRatio

I set the Alpha to about 40 and that made the overlay transparent again. Changed aspect ratio to 16:9 and that filled in the screen for me.

Super great progress that you are making with these settings.
This version 5.1 also fixes the blurry graphics I was experiencing on version 4. Thank you so much.

TheSilkMan commented 7 months ago

Hi Narzoul, getting these strange striations in ground textures when using the in game "All" filtering selection and PalletizedTextures set to off as noted in the link you sent me: https://github.com/narzoul/DDrawCompat/issues/176

In version 4.0, with the All filter setting, it drew textures correctly. Screen shot attached.

StripedGroundTextures.zip

Also, getting the following crash(ini files attached):


WARNING: Check Image - Checksum mismatch - Dump: 0x842e9, File: 0x84c25 - C:\ProgramData\Dbg\sym\ddraw.dll\2F5AE381e9000\ddraw.dll WARNING: Unable to verify checksum for ddraw.dll

KEY_VALUES_STRING: 1

Key  : AV.Fault
Value: Write

Key  : Analysis.CPU.mSec
Value: 1484

Key  : Analysis.Elapsed.mSec
Value: 1910

Key  : Analysis.IO.Other.Mb
Value: 0

Key  : Analysis.IO.Read.Mb
Value: 0

Key  : Analysis.IO.Write.Mb
Value: 0

Key  : Analysis.Init.CPU.mSec
Value: 484

Key  : Analysis.Init.Elapsed.mSec
Value: 3181

Key  : Analysis.Memory.CommitPeak.Mb
Value: 127

Key  : Failure.Bucket
Value: INVALID_POINTER_WRITE_c0000005_ddraw.dll!D3dDrawPrimitives2

Key  : Failure.Hash
Value: {68d9e94f-6621-ab17-ebf2-e477c25b497d}

Key  : Timeline.Process.Start.DeltaSec
Value: 63

Key  : WER.OS.Branch
Value: vb_release

Key  : WER.OS.Version
Value: 10.0.19041.1

Key  : WER.Process.Version
Value: 2.0.0.0

FILE_IN_CAB: dumplog.dmp

APPLICATION_VERIFIER_FLAGS: 0

CONTEXT: (.ecxr) eax=0021ffde ebx=0763bbec ecx=000000df edx=00000000 esi=07e8af90 edi=12e1214c eip=54c779c9 esp=0ff1f7d0 ebp=0ff1fa1c iopl=0 nv up ei pl nz ac pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010216 ddraw_54c20000!D3dDrawPrimitives2+0x2849: 54c779c9 898c86788c0000 mov dword ptr [esi+eax*4+8C78h],ecx ds:002b:08713b80=???????? Resetting default scope

EXCEPTION_RECORD: (.exr -1) ExceptionAddress: 54c779c9 (ddraw_54c20000!D3dDrawPrimitives2+0x00002849) ExceptionCode: c0000005 (Access violation) ExceptionFlags: 00000000 NumberParameters: 2 Parameter[0]: 00000001 Parameter[1]: 08713b80 Attempt to write to address 08713b80

PROCESS_NAME: MigAlley.exe

WRITE_ADDRESS: 08713b80

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.

EXCEPTION_CODE_STR: c0000005

EXCEPTION_PARAMETER1: 00000001

EXCEPTION_PARAMETER2: 08713b80

STACK_TEXT:
0ff1fa1c 53f74a29 0763bbec 07e9c420 53f74550 ddraw_54c20000!D3dDrawPrimitives2+0x2849 0ff1fa68 53f65c3e 0ff1fa8c 00000002 ecfb7bd3 d3dim!CDirect3DDeviceIDP2::ExecuteI+0x4d9 0ff1fadc 546bee47 07639e00 07e9c420 075b3ba0 d3dim!DIRECT3DDEVICEI::Execute+0x11e WARNING: Stack unwind information not available. Following frames may be wrong. 0ff1fb8c 0054d004 07639e00 07e9c420 075b3ba0 ddraw+0x11ee47 0ff1fbe8 0054f92b 0ff1fbb0 00000030 05319f78 MigAlley!direct_3d::FlushPTDraw+0x104 0ff1fc40 00542692 033aec62 05338c92 006edf28 MigAlley!direct_3d::FlushNZDraw+0x1b 0ff1fc74 00535633 033aec62 00000000 0052eeda MigAlley!direct_3d::SetZUpdate+0x1d2 0ff1fc80 0052eeda 00000000 0043b7bf 00000000 MigAlley!Display::SetZUpdate+0x23 0ff1fc88 0043b7bf 00000000 00000000 006edf28 MigAlley!Display::DoSetZUpdate+0xa 0ff1fd38 004644ad 15ed5788 0ff1fdd0 0064d218 MigAlley!ThreeDee::add_cockpit+0x5af 0ff1fd50 0043a979 069545b0 00000000 00008ae0 MigAlley!btree::drw_obj+0x3d 0ff1fdb0 0043e075 0ff1fe18 069545b0 06a07c78 MigAlley!ThreeDee::render3d+0x649 0ff1fddc 0041a519 0ff1fe18 069545b0 06a07c78 MigAlley!ThreeDee::render+0x105 0ff1febc 7216a124 051ea698 58cc685a 77d06d60 MigAlley!View3d::drawloop+0x149 0ff1ff30 77d06cff 0019f6f4 207c9a40 77d06d60 mfc42!_AfxThreadEntry+0x104 0ff1ff68 77d06dc1 0ff1ff80 7771fcc9 03402630 msvcrt!_callthreadstartex+0x25 0ff1ff70 7771fcc9 03402630 7771fcb0 0ff1ffdc msvcrt!_threadstartex+0x61 0ff1ff80 77e37c6e 03402630 8533a24d 00000000 kernel32!BaseThreadInitThunk+0x19 0ff1ffdc 77e37c3e ffffffff 77e58c24 00000000 ntdll!__RtlUserThreadStart+0x2f 0ff1ffec 00000000 77d06d60 03402630 00000000 ntdll!_RtlUserThreadStart+0x1b

SYMBOL_NAME: ddraw_54c20000!D3dDrawPrimitives2+2849

MODULE_NAME: ddraw_54c20000

IMAGE_NAME: ddraw.dll

STACK_COMMAND: ~15s; .ecxr ; kb

FAILURE_BUCKET_ID: INVALID_POINTER_WRITE_c0000005_ddraw.dll!D3dDrawPrimitives2

OS_VERSION: 10.0.19041.1

BUILDLAB_STR: vb_release

OSPLATFORM_TYPE: x86

OSNAME: Windows 10

IMAGE_VERSION: 6.2.19041.1

FAILURE_ID_HASH: {68d9e94f-6621-ab17-ebf2-e477c25b497d}

Followup: MachineOwner

0:015> lmvm ddraw_54c20000 Browse full module list start end module name 54c20000 54d09000 ddraw_54c20000 # (pdb symbols) C:\ProgramData\Dbg\sym\ddraw.pdb\B99F24CB90CBDA316C60E979B85CC00D1\ddraw.pdb Loaded symbol image file: ddraw.dll Mapped memory image file: C:\ProgramData\Dbg\sym\ddraw.dll\2F5AE381e9000\ddraw.dll Image path: C:\Windows\System32\ddraw.dll Image name: ddraw.dll Browse all global symbols functions data Image was built with /Brepro flag. Timestamp: 2F5AE381 (This is a reproducible build file hash, not a timestamp) CheckSum: 000842E9 ImageSize: 000E9000 File version: 6.2.19041.1 Product version: 10.0.19041.1 File flags: 0 (Mask 3F) File OS: 40004 NT Win32 File type: 2.0 Dll File date: 00000000.00000000 Translations: 0409.04b0 Information from resource tables: CompanyName: Microsoft Corporation ProductName: Microsoft® Windows® Operating System InternalName: DDraw.dll OriginalFilename: DDraw.dll ProductVersion: 10.0.19041.1005 FileVersion: 10.0.19041.1005 (WinBuild.160101.0800) FileDescription: Microsoft DirectDraw LegalCopyright: © Microsoft Corporation. All rights reserved.

DDrawCompat_ini files.zip

narzoul commented 7 months ago

I set the Alpha to about 40 and that made the overlay transparent again.

That's odd, 40 is way too transparent and hard to read for me. Can you take a screenshot of what it looks like at 90 and 40 for you?

Another thing I noticed is that when scrolling down to the bottom of the overlay list, white text shows up for additional settings but they are not editable in the overlay.

That's intentional, check the ConfigRows setting.

getting these strange striations in ground textures when using the in game "All" filtering selection and PalletizedTextures set to off as noted in the link you sent me: https://github.com/narzoul/DDrawCompat/issues/176

In version 4.0, with the All filter setting, it drew textures correctly. Screen shot attached.

I've no idea about this. Unfortunately the game crashes on start for me now (with any wrapper, seems unrelated to ddraw), so it's hard to check out these issues. What you could do is try the previous builds here: https://github.com/narzoul/DDrawCompat/releases/download/v0.5.0/DDrawCompat-v0.5.0-debug-previous-builds.7z Let me know which is the first one that introduced the problem, and the last one that still rendered correctly. Maybe that'll give me some idea.

Also, getting the following crash(ini files attached):

At first look it seems like it might be a bug in the game, since it crashed in native ddraw, not in DDrawCompat. But I'd need the crash dump to check it better. Do you have it somewhere? I think it should be this one: FILE_IN_CAB: dumplog.dmp Or you might find it in %LOCALAPPDATA%\CrashDumps

TheSilkMan commented 7 months ago

Found the dumplog.dmp:

dumplog_11.24.23.zip

TheSilkMan commented 7 months ago

Hi Narzoul, you were right. I found the bug that caused that CTD. It was due to the clouds. Fixed it. Still hunting for the version that did not have the ground texture striations.

Attached is a pic with the overlay set at 34. Overlay_Alpha@34.zip

narzoul commented 7 months ago

Hi Narzoul, you were right. I found the bug that caused that CTD. It was due to the clouds. Fixed it.

How did you figure that out, and what did you do to fix it? I didn't get very far with the crash dump, it's seemingly indexing into an array with a bad index ((0xFFFF 33 + 0xFFFF) 4), but it's way too hard to track down where those 0xFFFFs are coming from. Since we're in the middle of processing the execute buffer contents, I'd assume there's something bad the game puts in the buffer.

Attached is a pic with the overlay set at 34.

You mean 41? Anyway, that actually looks normal to me. I guess we just have different expectations about how transparent it should be. The default 90 should also be transparent, but only a little bit.

I managed to get my game working again, I'm not sure how, I think it started working after reinstalling the demo version. How do I reproduce the texture issue exactly? Which map to load and how? I'm not very good at this game so I'd need detailed instructions how to get there. Also screenshots of your in-game settings could be useful.

TheSilkMan commented 7 months ago

Hi Narzoul, havent been on due to the holidays. I was able to figure it out because everytime i turned the view to look at a batch of clouds, the crash occurred. In the very exact spot. I was testing out a 3D clouds mod. Once I disabled that, the crash stopped. In terms of the Overlay transparency, when it was set to 90, the background was completely black. Adjusting to 41(I guess the overlay game menu takes priority over the ini file's 34 setting), enables the level of transparency shown in that screen shot I sent.

In terms of the striations seen in ground textures in the latest version of DDrawCompat, I did a test in v3.1 versus the latest version. 3.1 does not have them. I have the 3.1 in game settings in a screen shot, ini file and dll in the attached.

ddrawNoStriations3.1.zip

TheSilkMan commented 7 months ago

Ok, likewise attached are the files from the latest version of DDrawCompat with screen shot of striations, ini fils, screenshot of in game 3D settings and dll. When you enter the 3D for the first time(won't happen in the 2D menu), the game may CTD with these settings. The work around is what you had me do in an earlier message where you only list the three lowest resolution settings in the ini file(640x480, 800x600, 1024x768). Then, once you launch to 3D for the first time, exit and add the additional resolutions that your monitor can display to the ini file. You may then select the desired higher resolutions in the game's 2D menu. Pick a campaign mission with the F-51D aircraft. This will put on on the runway. The runway should have steel planking, but it will be striated. If you move your squadron to one of the runway's that are made of dirt, they will be striated as well in this latest version of the dll. The striations are not noticeable from the air unless you fly near the surface.

DDrawCompatLatestwStriations.zip

TheSilkMan commented 7 months ago

The Pusan Perimeter is the F-51D's campaign...

narzoul commented 7 months ago

In terms of the Overlay transparency, when it was set to 90, the background was completely black. Adjusting to 41(I guess the overlay game menu takes priority over the ini file's 34 setting), enables the level of transparency shown in that screen shot I sent.

Yes, your screenshot looks the same as mine at 41. What I don't understand is how can it be completely black at 90, because it doesn't look that way for me. Can you take a screenshot of the overlay at 90 too?

In terms of the striations seen in ground textures in the latest version of DDrawCompat, I did a test in v3.1 versus the latest version. 3.1 does not have them.

It's the SoftwareDevice=hal setting that causes it. I'm not sure why yet, but you can just set it back to default because it's not needed for this game anyway, it's already using a HAL device for 3D.

TheSilkMan commented 7 months ago

Ok, I will change the device to default. Attached are Alpha 100 and 90.

Not sure if any other setting affects it. 90 was looking like 100 before. Now it is better but 41 allows for more color.

Alpha 100.zip