elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.23k stars 90 forks source link

Commandos 1 - behind enemy lines #225

Closed AzazelHD closed 5 days ago

AzazelHD commented 1 year ago

Hello. I have set dd7to9, fullscreenwindowmode and ddrawoverridebitmode to 16. But game sound seems... weird. Sometimes it stops while narrator talking. So i randomly added dsound.dll, but idk if thats enough.

Also, is there a possibility so the game doesnt crash when i alt tab?

Sometimes it doesnt, and when it doesnt, all my windows desktop resolution is messed up. Anyway i could fix this?

elishacloud commented 1 year ago

Below is the latest build. I am getting close to releasing it. You can check it out to see if it works better. It shouldn't need fullscreen window mode any more.

But game sound seems... weird. Sometimes it stops while narrator talking. So i randomly added dsound.dll, but idk if thats enough.

Adding the dsound.dll is not needed and probably is not doing anything. You could try settingEnableDsoundWrapper and ForceExclusiveMode or ForcePrimaryBufferFormat. I am not really sure since I have not looked much into any DirectSound issues before.

Also, is there a possibility so the game doesnt crash when i alt tab?

I don't think this game supports alt+tab very well. You could try enabling DdrawEmulateSurface. This way the surface is still available to the game while it is minimized.

Here is the update (I have already enabled DdrawEmulateSurface): dxwrapper.zip

AzazelHD commented 1 year ago

Thanks so much, imma try and let you know

AzazelHD commented 1 year ago

Hi. Little update. I have tested ur files, and I can alt tab now, but it feels like if the game is fullscreen, cuz the alt tab is not inmediate. Is there any option to run the game as borderless?

Thanks ^^

elishacloud commented 1 year ago

it feels like if the game is fullscreen, cuz the alt tab is not inmediate.

Yes, with this update the game is in fullscreen exclusive mode. You can do windowed mode in fullscreen using the FullscreenWindowMode option.

Is there any option to run the game as borderless?

If you mean windowed mode (non-fullscreen), than not with this game. There is an option EnableWindowMode that works with some games, but not with this game. This game does not support window mode. dxwrapper is mainly focused on making older games work on newer OS's the same as they did on older OS's. It is not really trying to add features like windowed mode to games.

AzazelHD commented 1 year ago

Oh I see... I dont wanna be rude nor start a discussion, but there are more libraries like this, and one i tried before was called cnc-draw. That library has a feature to run the game in borderless. Sadly, for me, it lags my mouse. But it uses ddraw.dll too. So i guess cnc is using something else to force games run borderless?

Im asking from the ignorance tho

elishacloud commented 1 year ago

Yes, I am aware of cnc-ddraw. That is a great tool, and I have collaborated with the author on a couple of items. But it has a different purpose than this tool. There is a lot of code in there to support windowed mode: API hooks, mouse control, etc.

These two tools work very differently. cnc-ddraw emulates DirectDraw 2D functions and then outputs them to GDI, Direct3D9 or OpenGL. Whereas dxwrapper's dd7to9 attempts to convert each DirectDraw function (2D and 3D) directly into Direct3D9.

I do this in my spare time and don't have time to add those other items (namely universal window mode). It is enough for me now to just convert all the functions to Direct3D9.

BTW: I also added many other functions into dxwrapper, including converting Direct3D8 to Direct3D9 and converting DirectInput1-7 into DirectInptu8. Most of these functions focus on compatibility.

AzazelHD commented 1 year ago

I see, thanks for your reply ^^

elishacloud commented 12 months ago

Can you test with the latest release? You need to use wsock32.dll for the stub and enable DdrawCreateDeviceEarly and set DdrawOverrideBitMode to 16. If you want to change the frame rate you can also set LimitPerFrameFPS to 59.933.

AzazelHD commented 11 months ago

Hi. Thanks for remembering me ^^ So, i have to copy on the executable folder the following files: wsock32.dll, dxwrapper.dll, ddraw.dll and dxwrapper.ini.

Inside the ini, enable Dd7tod9, DdrawCreateDeviceEarly, DdrawOverrideBitMode and FullscreenWindowMode.

Is that right?

elishacloud commented 11 months ago

Inside the ini, enable Dd7tod9, DdrawCreateDeviceEarly, DdrawOverrideBitMode and FullscreenWindowMode.

Is that right?

You need to set DdrawOverrideBitMode to 16, and you don't need FullscreenWindowMode enabled.

So it should look like this:

;; Config file for DirectX DLL Wrapper
;;
;; For details, see: https://github.com/elishacloud/dxwrapper/wiki/Configuration
;;
[General]
RealDllPath                = AUTO
WrapperMode                = AUTO
LoadCustomDllPath          = 
ExcludeProcess             = 
IncludeProcess             = 
RunProcess                 = 
WaitForProcess             = 0
DisableLogging             = 0

[Plugins]
LoadPlugins                = 0
LoadFromScriptsOnly        = 0

[Compatibility]
Dd7to9                     = 1
D3d8to9                    = 0
DDrawCompat                = 0
Dinputto8                  = 0
DisableGameUX              = 0
DxWnd                      = 0
EnableDdrawWrapper         = 0
EnableD3d9Wrapper          = 0
EnableDinput8Wrapper       = 0
EnableDsoundWrapper        = 0
HandleExceptions           = 0
SingleProcAffinity         = 0

[DDrawCompat]
DDrawCompat20              = 0
DDrawCompat21              = 0
DDrawCompat31              = 0
DDrawCompatDisableGDIHook  = 0
DDrawCompatNoProcAffinity  = 0

[ddraw]
ConvertToDirectDraw7       = 0
ConvertToDirect3D7         = 0
DdrawOverrideBitMode       = 16

[Dd7to9]
DdrawAutoFrameSkip         = 0
DdrawEmulateSurface        = 0
DdrawFixByteAlignment      = 0
DdrawRemoveScanlines       = 0
DdrawRemoveInterlacing     = 0
DdrawReadFromGDI           = 0
DdrawWriteToGDI            = 0
DdrawCreateDeviceEarly     = 1
DdrawDisableDirect3DCaps   = 0
DdrawLimitDisplayModeCount = 0
DdrawUseNativeResolution   = 0
DdrawOverrideWidth         = 0
DdrawOverrideHeight        = 0
DdrawIntegerScalingClamp   = 0
DdrawMaintainAspectRatio   = 0

[d3d9]
AnisotropicFiltering       = 0
AntiAliasing               = 0
EnableVSync                = 0
ForceVsyncMode             = 0
OverrideRefreshRate        = 0
LimitPerFrameFPS           = 0
EnableWindowMode           = 0
WindowModeBorder           = 0
SetInitialWindowPosition   = 0
InitialWindowPositionLeft  = 0
InitialWindowPositionTop   = 0
FullscreenWindowMode       = 0
ForceExclusiveFullscreen   = 0
ForceMixedVertexProcessing = 0
ForceSystemMemVertexCache  = 0
ForceDirect3D9On12         = 0
GraphicsHybridAdapter      = 0

[FullScreen]
FullScreen                 = 0
ForceWindowResize          = 0
WaitForWindowChanges       = 0

[dinput8]
FilterNonActiveInput       = 0

[dsound]
Num2DBuffers               = 0
Num3DBuffers               = 0
ForceCertification         = 0
ForceExclusiveMode         = 0
ForceSoftwareMixing        = 0
ForceHardwareMixing        = 0
ForceHQ3DSoftMixing        = 0
ForceNonStaticBuffers      = 0
ForceVoiceManagement       = 0
ForcePrimaryBufferFormat   = 0
PrimaryBufferBits          = 16
PrimaryBufferSamples       = 44100
PrimaryBufferChannels      = 2
AudioClipDetection         = 0
AzazelHD commented 11 months ago

Hello. Ive been playing it and few things happened. Maybe this has nothing to do with dxwrapper but imma still comment them.

First, game default is 20 fps (if im not wrong), but when ever i move the mouse fps increase, reaching up to 500 fps. Also, when i alt tab, game crashes

elishacloud commented 11 months ago

First, game default is 20 fps (if im not wrong), but when ever i move the mouse fps increase, reaching up to 500 fps.

You could try setting this option LimitPerFrameFPS to something like 20 or 30.

Also, when i alt tab, game crashes

Yes, this is because the surface is lost when you alt+tab. To fix this you can emulate the surface by enabling DdrawEmulateSurface.

elishacloud commented 4 months ago

Try with this latest update. I fixed some things that may help: dxwrapper.zip

elishacloud commented 5 days ago

This issue should be fixed in the latest release. If you still have an issue you can reopen this.