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.16k stars 83 forks source link

Simcity 4 couldn't initialize DirectDraw (Dd7to9 = 1) #89

Closed rainman7cn closed 1 month ago

rainman7cn commented 3 years ago

Hiya @elishacloud , Thanks to @Durfsurn 's kind sharing, I started to try dxwrapper as well, but have no luck in running SC4 with dedicated card, here is my tests's result: https://community.simtropolis.com/forums/topic/759351-raymonds-newbie-thoughts/?do=findComment&comment=1737944 I have no idea if there is any chance among the settings, Appreciate any tips on this, i can do any further tests if it's necessary, Thank you for your selfless efforts. at least you bring light of hope to our beloved game. Thanks a million! Sincerely, -- Raymond

rainman7cn commented 3 years ago

20201003130750 jpg dc0426d43e9663c52754361c116e6a8c

20201003130759 jpg 2f771248038c7ae940268d4245558f5d 20201003130832 jpg f1dc8ffa5f762b3b966ca48f816b2e32

rainman7cn commented 3 years ago

5808 13:04:47.846 Starting DxWrapper v1.0.6387.21 5808 13:04:47.846 HP HP Pavilion Notebook Type1ProductConfigId (Notebook) 5808 13:04:47.846 HP 8217 83.72 (Notebook) 5808 13:04:47.846 Intel(R) HD Graphics 630 5808 13:04:47.846 Windows 10 Enterprise 64-bit (10.0.18362) 5808 13:04:47.846 "SimCity 4.exe" (PID:8124) 5808 13:04:47.849 Set exception handler 5808 13:04:47.849 Loaded library: kernel32.dll 5808 13:04:47.850 Finished setting exception handler 5808 13:04:47.850 Loading 'ddraw.dll'... 5808 13:04:47.850 Hooking ddraw.dll APIs... 5808 13:04:47.850 Enabling ddraw wrapper 5808 13:04:47.851 Enabling d3d9 wrapper 5808 13:04:47.851 Loading 'd3d9.dll'... 5808 13:04:47.853 Hooking d3d9.dll APIs... 5808 13:04:47.853 DxWrapper loaded! 5808 13:04:47.853 dd_DirectDrawCreate 5808 13:04:47.853 dd_DirectDrawCreateEx 5808 13:04:47.853 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 5808 13:04:47.853 Creating interface m_IDirectDrawX::m_IDirectDrawX(00C07DE0) converting interface from v1 to v9 5808 13:04:47.853 d9_Direct3DCreate9 5808 13:04:47.853 Redirecting 'Direct3DCreate9' ... 5808 13:04:47.960 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex(00C31BF8) 5808 13:04:48.072 m_IDirectDrawX::~m_IDirectDrawX(00C07DE0) deleting interface! 5808 13:04:48.072 m_IDirect3D9Ex::~m_IDirect3D9Ex(00C31BF8) deleting interface! 5808 13:04:48.072 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 5808 13:04:48.072 Redirecting 'DirectDrawCreate' IID_IDirectDraw7 to --> 'Direct3DCreate9' 5808 13:04:48.072 Creating interface m_IDirectDrawX::m_IDirectDrawX(00C07BD8) converting interface from v7 to v9 5808 13:04:48.072 Redirecting 'Direct3DCreate9' ... 5808 13:04:48.093 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex(00C43080) 5808 13:04:48.262 Setting MultiSample 8 Quality 0 5808 13:04:48.262 Creating interface m_IDirect3DDevice9Ex::InitDirect3DDevice(00C21B58) 5808 13:04:48.271 m_IDirect3DDevice9Ex::~m_IDirect3DDevice9Ex(00C21B58) deleting interface! 5808 13:04:48.274 m_IDirectDrawX::~m_IDirectDrawX(00C07BD8) deleting interface! 5808 13:04:48.276 m_IDirect3D9Ex::~m_IDirect3D9Ex(00C43080) deleting interface! 5808 13:04:48.276 m_IDirectDrawSurfaceX::CleanupSharedEmulatedMemory Deleting 0 emulated surfaces! 5808 13:04:51.442 Redirecting 'DirectDrawCreate' IID_IDirectDraw to --> 'Direct3DCreate9' 5808 13:04:51.442 Creating interface m_IDirectDrawX::m_IDirectDrawX(00C07C40) converting interface from v1 to v9 5808 13:04:51.442 Redirecting 'Direct3DCreate9' ... 5808 13:04:51.489 Creating interface m_IDirect3D9Ex::m_IDirect3D9Ex(00C432A0) 5808 13:04:51.588 Setting MultiSample 8 Quality 0 5808 13:04:51.588 Creating interface m_IDirect3DDevice9Ex::InitDirect3DDevice(00C215B8) 5808 13:04:51.633 m_IDirect3DDevice9Ex::~m_IDirect3DDevice9Ex(00C215B8) deleting interface! 5808 13:04:51.751 UpdatePresentParameter Setting WndProc: WND(000507CC,GDriverClass--Software,{0,0,1920,1080}) 5808 13:04:51.826 Setting MultiSample 8 Quality 0 5808 13:04:51.826 Creating interface m_IDirect3DDevice9Ex::InitDirect3DDevice(09BE2318) 5808 13:04:51.826 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX(09BE3C78) converting interface from v2 to v9 5808 13:04:51.826 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX(09B13160) converting interface from v2 to v9 5808 13:04:51.826 Creating interface m_IDirectDrawSurfaceX::m_IDirectDrawSurfaceX(09B132D0) converting interface from v2 to v9 5808 13:04:51.826 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9(09BE3268) 5808 13:04:54.071 m_IDirectDrawX::~m_IDirectDrawX(00C08258) deleting interface! 5808 13:05:16.589 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9(077A6EE0) 5808 13:05:16.590 Creating interface m_IDirect3DTexture9::m_IDirect3DTexture9(077A6E68) 5808 13:05:16.591 Creating interface m_IDirect3DVertexBuffer9::m_IDirect3DVertexBuffer9(077A7048) 5808 13:05:16.634 UpdatePresentParameter Setting WndProc: WND(000507CC,GDriverClass--Software,{0,0,1920,1080}) 5808 13:05:16.743 Creating interface m_IDirect3DVertexBuffer9::m_IDirect3DVertexBuffer9(09B694D0)

rainman7cn commented 3 years ago

;; Config file for DirectX DLL Wrapper [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 DdrawResolutionHack = 1 Dinputto8 = 0 DisableHighDPIScaling = 0 DisableGameUX = 0 DSoundCtrl = 0 DxWnd = 0 EnableDdrawWrapper = 1 EnableDinput8Wrapper = 0 EnableDsoundWrapper = 0 ForceTermination = 0 HandleExceptions = 1 ResetScreenRes = 0 SingleProcAffinity = 0

[DDrawCompat] DDrawCompat20 = 0 DDrawCompat21 = 1 DDrawCompatExperimental = 0 DDrawCompatDisableGDIHook = 0 DDrawCompatNoProcAffinity = 0

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

[Dd7to9] AutoFrameSkip = 0 DdrawEmulateSurface = 0 DdrawWriteToGDI = 0 DdrawLimitDisplayModeCount = 0 DdrawUseNativeResolution = 0 DdrawClippedWidth = 0 DdrawClippedHeight = 0 DdrawOverrideWidth = 0 DdrawOverrideHeight = 0 DdrawOverrideRefreshRate = 0 DdrawIntegerScalingClamp = 0 DdrawMaintainAspectRatio = 0

[d3d9] AntiAliasing = 1 CacheClipPlane = 0 EnableVSync = 1 EnableWindowMode = 0 FullscreenWindowMode = 0 WindowModeBorder = 0

[FullScreen] FullScreen = 0 ForceWindowResize = 0 SendAltEnter = 0 WaitForWindowChanges = 0 LoopSleepTime = 120 WindowSleepTime = 500 SetFullScreenLayer = 0 SetNamedLayer = IgnoreWindowName =

[dinput8] FilterNonActiveInput = 0

[dinput] 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 AudioFadeOutDelayMS = 20 FixSpeakerConfigType = 1 StoppedDriverWorkaround = 0

[AppCompatData] LockEmulation = 0 BltEmulation = 0 ForceLockNoWindow = 0 ForceBltNoWindow = 0 LockColorkey = 0 FullscreenWithDWM = 0 DisableLockEmulation = 0 EnableOverlays = 0 DisableSurfaceLocks = 0 RedirectPrimarySurfBlts = 0 StripBorderStyle = 0 DisableMaxWindowedMode = 0

[WriteMemory] VerificationAddress = 0x00000000 VerificationBytes = 0x00 ResetMemoryAfter = 0 AddressPointer = 0x00000000 BytesToWrite = 0x00

elishacloud commented 3 years ago

Hello @rainman7cn, yes, the Dd7to9 does not yet support 3D (hardware driver) functions. I am working on adding them but they are not there yet. You will still need to use the integrated video card and not the 3D accelerated one. However, with this project you can use 4k resolution.

Here are the only options you want enabled:

DDrawCompat         = 1
DdrawResolutionHack = 1
EnableDdrawWrapper  = 1

Then you can run the game with a custom parameter to get the higher resolution. Command line option is:

"SimCity 4.exe" -CustomResolution:enabled -r3840x2160x32

Just change -r3840x2160x32 to the resolution you want. Keep the x32 at the end. That tells the game to use 32bit color.

rainman7cn commented 3 years ago

Thank you so much Dear @elishacloud , I see, and you are doing something greatest, we all appreciate the efforts you put into this, Please allow me to follow your work, it's my honor to be here to witness this historic moment. Sincerely, -- Raymond

elishacloud commented 1 month ago

Closing this issue.