rdoeffinger / xwa_ddraw_d3d11

Direct3D 11 implementation of DDraw.dll for XWA
MIT License
63 stars 2 forks source link

Request to make compatible with Tie Fighter Reconstructed #15

Open AppTRL opened 5 years ago

AppTRL commented 5 years ago

Tie Fighter Reconstructed (https://tinyurl.com/y6aqyz8s) improves the voice and music quality of Tie Fighter 1998, but because it uses a modified TIE95.exe file, it makes it incompatible with the implementation of ddraw.dll using Direct3D 11 (game just crashes when using 3D hardware). Can this be fixed?

rdoeffinger commented 5 years ago

I believe people have posted instructions on how to fix that TIE95.exe in a few places. Is this still relevant or has someone updated that packages to include a fixed TIE95.exe?

PatTheMav commented 5 years ago

As the Reconstructed project hasn't been updated in a while, it's still an issue - the TIE95.exe shipped with that update contains additional code for music playback with the GOG-variant as its basis. As GOG disabled hardware support on purpose, I'd reckon that it needs to be re-enabled using xwahacker on top of the "winmm.dll to win32.dll" hack to get music playback working on more recent Windows 10 versions.

I haven't checked if just re-enabling 3D support will work, I'll report back later (as I've used a TIE95.exe from the Steam community forums so far).

rdoeffinger commented 5 years ago

3D Hardware enable/disable is not the issue (ignored by the dll). It is a patch that xwahacker identifies as "Broken Z-buffer clear (will crash in 3D mode)". Should be fixed by xwahacker TIE95.EXE -p 53 to restore original code or xwahacker TIE95.EXE -p 54 to be closer to GoG original - but it should not matter. As this is clearly a case of a bad patch applied to be binary, I'd rather have the binaries updated than trying to fix it in ddraw.dll...

PatTheMav commented 5 years ago

@rdoeffinger I agree, just wanted to finally answer the question you posed to @AppTRL. It's an issue with the TIE95.exe supplied by the Reconstructed project not the ddraw wrapper.

My idea is to come up with a "FYI, this is gonna be broken out of the box, here's how to fix it" that could maybe be added to the readme. I'll check if disabling the Z-Buffer hack makes everything work as intended.

The Reconstructed project hasn't seen any updates since 2014, so I don't have big expectations of an update from that end.

(On another note: I'm not familiar enough with Win32 programming, so I wonder why just renaming winmm.dll to win32.dll and changing the reference in the binary fixes music playback, while replacing the dll and keeping the name doesn't).

rdoeffinger commented 4 years ago

Been a long time, but: the real winmm.dll might have gotten loaded somehow already and then the local one is ignored. In that case it shouldn't even be necessary to use such a risky name as win32.dll but could instead just change winmm.dll to e.g. winmn.dll That maybe should have been done in the first place. In a way, our ddraw.dll suffers from the same risk. If that's the case it might be possible to fix by ensuring that the functions all point to the patched version, I already re-direct some winmm.dll functions for the joystick emulation...

Khvostya commented 1 year ago

The edit of existing exe to make music loop again with this "win32.dll" thing works, ddraw works fine with that. You can also place reconstructed project music by itself in folders and it will work. However, what reconstructed did in exe edits is they made music to play in places where TIE 98 just has silence. Like in Registration section etc. I don't really know what specific parts of exe I should to hex edit to make it work but same time ddraw to work.