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

[Diablo] Resolution #10

Closed Dadditude closed 1 year ago

Dadditude commented 6 years ago

Is there any way to force Diablo to run full-screen without changing the monitor's resolution? Every time I launch the game, I end up having to resize my open window in Chrome when I'm done playing.

elishacloud commented 6 years ago

DxWrapper does not support this use case yet. It can be done via DxWnd. However there seems to be an issue with DxWnd when using it in fullscreen like this. The picture is pixelated (even when AA is enabled) and the mouse seems to leave a trail behind it. I might be able to create a ddraw wrapper that could do this. I will look into this when I get a chance.

elishacloud commented 6 years ago

@Dadditude, it looks like there is already a ddraw wrapper for Diablo that allows you to change the resolution in game (or by configuring an ini file). I have combined that with DxWrapper's no-cd patch.

Here is the download: diablo.zip

Just unzip these files to your Diablo folder.

Currently it is set to 1920x1080 resolution since that is the native resolution of my computer. But you can modify the ddraw_settings.ini file to change the resolution to whatever you want.

This zip includes files from the Diablo 1 Windows 7/Vista Patch.

Dadditude commented 6 years ago

Awesome! Thanks so much! 1920x1080 is what my monitor is also, so it should work perfectly. I’ll give it a try as soon as I get home.

On Nov 10, 2017, at 12:51 PM, Elisha Riedlinger notifications@github.com wrote:

@Dadditude, it looks like there is already a ddraw wrapper for Diablo that allows you to change the resolution in game (or by configuring an ini file). I have combined that with DxWrapper's no-cd patch.

Here is the download: diablo.zip

Just unzip these files to your Diablo folder.

Currently it is set to 1920x1080 resolution since that is the native resolution of my computer. But you can modify the ddraw_settings.ini file to change the resolution to whatever you want.

This zip includes files from the Diablo 1 Windows 7/Vista Patch.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

elishacloud commented 6 years ago

Looks like the Diablo 1 Windows 7/Vista Patch breaks multi-player mode. I might be able to fix this but probably won't have time to look into it for a while.

Dadditude commented 6 years ago

That’s too bad, but at least it works fine in single player for now. Planning on setting some time aside tomorrow to sit down and play it. I don’t think I ever beat the original.

-- "We do not quit playing because we grow old; we grow old because we quit playing." - Oliver Wendell Holmes

From: Elisha Riedlinger Sent: Sunday, November 12, 2017 11:23 PM To: elishacloud/dxwrapper Cc: Dadditude; Mention Subject: Re: [elishacloud/dxwrapper] [Diablo] Resolution (#10)

Looks like the Diablo 1 Windows 7/Vista Patch breaks multi-player mode. I might be able to fix this but probably won't have time to look into it for a while. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

TarkinMX commented 6 years ago

@elishacloud

Any news on this yet? I had discovered Strange Bytes mod a while back and love it. Discovered yours a few days and tried it out. I love that yours supports multiplayer and previously tried contacting Strange Bytes about maybe implementing your work but sadly no reply. Thought about seeing if it was possible for you to do it and come here to find out you've already done just that. My hat's off to you for your work and I hope that you can get Strange Bytes' version working with multiplayer.

TarkinMX commented 6 years ago

Decided to check back on this and really hope you read my post @elishacloud

On April 7th, 2018, Strange Bytes released the source to their patch so maybe now you can properly merge your patch with theirs. REALLY hoping this is a possibility so that we can get online play with it. Please drop a line and let everyone know what you think. Link is below.

http://www.strangebytes.com/index.php/projects/diablo-1-windows-7-vista-patch-source-code

elishacloud commented 6 years ago

Thanks for the link to the source code! It is very useful. I did a quick glance at it and I should be able to implement most of this into dxwrapper. I won't be able to add the in-game video settings, however, without breaking the multiplayer mode.

I added this to my to-do list...

TarkinMX commented 6 years ago

Hmm... if that's the case then maybe use two different shortcuts? One shortcut for singleplayer where you can get the in-game video settings and the other for online play? So that way the settings the user saves using the in-game video settings during single player can carry over to the multiplayer without worry for having to set it outside the game or in-game console command if there any exist.

elishacloud commented 6 years ago

That is certainly possible, but I need to get into the Strange Bytes source code to see what I can do.

FunkyFr3sh commented 5 years ago

I heard cnc-ddraw used to work with diablo, so it might be an option too. I can't confirm it right now since I can't find my Diablo CD...

elishacloud commented 5 years ago

@FunkyFr3sh, I cannot seem to get cnc-ddraw to work with Diablo. It seems to crash each time after the intro video plays. I did not spend any time troubleshooting it though...

FunkyFr3sh commented 5 years ago

@elishacloud Oh well, it was worth a try I guess. It was the older version from 2012 that used to work. There were a lot changes for C&C games during the last year so I guess one of them might have triggered this bug in Diablo.

Didn't find my CD and the demo doesn't seem to like any ddraw wrappers, so we're out of luck.

elishacloud commented 5 years ago

@Dadditude, it took me a while but over the past year or so I have been working on creating a wrapper to convert ddraw to Direct3D9. It is a lot of work to translate all the ddraw APIs to Direct3D9. Recently I found a way to allow Diablo to run with native monitor resolution while also allowing Battle.net.

Below is a prototype of Diablo running in native monitor resolution while also allowing multiplayer Battle.net. There are still graphical issue with this prototype that I will fix later, however it proves this can be done.

The game is just running internally in 640x480, but I stretch the screen to fit on your native desktop resolution. So it will still look pixelated. But it allows high resolution and Bettle.net (something that is not even available with the GOG version of the game).

This works with both the CD version of the game and with the GOG version of the game. It also this works with the no-CD patch I created.

You can download the prototype here: ddraw.zip

FunkyFr3sh commented 5 years ago

I've been spending some time with it recently too when the game was released on GOG.

You can hide the menu issues easily with fullscreen exclusive mode, however, this trick also breaks battle.net... So that means you actually can't use fullscreen exclusive mode if you want to have battle.net working, but then you get the next problem where you have to deal with stretching these windows that are layered on top of the game :D

Will have a look into your prototype the next days, will be interesting to see what you made out of the mess that is diablo!

elishacloud commented 5 years ago

@FunkyFr3sh, here is the check-in that fixed Battle.net: 7b9dce6

I switched from using heap memory to allowing the game to lock the Direct3D9 texture directly. So rather than creating new memory for the game I simply created an extra Direct3D9 texture.

Note: this check-in also has some stuff about High DPI which you can ignore. That is not related to the Diablo fix.

TarkinMX commented 5 years ago

Hey @elishacloud, I checked out that prototype ddraw.zip you posted and having some trouble with it. I am now on the gog version of the game and if I launch the game by using diablo.exe in the main diablo folder I can't see the main screen, after hitting a enter a few times I get to the screen to load my character and it continues fine. But if I use gog's launcher then it completely ignores your patch, I can tell this because the screen is stretched.

Also, I've come to like using a flavor of devilution that gives me controller support and it will not start at all with your prototype patch but works just fine with Strange Bytes' which of course is disappointing because I can't get online with his. The devilution build with controller support can be found here if you're interested in taking a look at it: devilution: controller support.

I'm also wondering if it would be at all possible to work something like your patch or Strange Bytes' patch directly into the devilution source but I'm not a coder so idk.

FunkyFr3sh commented 5 years ago

@TarkinMX Just curious, what are you actually trying to archive? You can't play online with the gog version? You want windowed mode? You want scaling?

elishacloud commented 5 years ago

I hope that you can get Strange Bytes' version working with multiplayer.

Recently I created a build from the Strange Bytes diablo-ddrawwrapper project that fixes the multiplayer battle.net issue. You can see my updates here.

The download for the updated Strange Bytes Diablo patch is located here: ddraw.zip

This can be combined with the dxwrapper project no-CD fix, which can be downloaded here: dxwrapper.zip

Downloading both of these packages and unzipping them into the Diablo folder will give you access to all the features of the Strange Bytes Diablo patch, plus multiplayer battle.net support, plus no-CD fix.

TarkinMX commented 5 years ago

@FunkyFr3sh It's for online purposes, with the devilution that has controller support I can use my controller online but Strange Bytes' patch doesn't support multiplayer so I get stuck with the original graphics mode and no upscale. Gog's version does the same thing, no upscale when online and that's why they include two exe files with the install.

@elishacloud Thanks for the response, I didn't know you had already done this. I'm not so good with navigating github and had no idea that your tools could be used in combination like this. I'll give it a try with devilution and let you know what happens.

Edit: The link to ddraw.zip only has a text file in it. I'll try to see if I can compile it myself but don't have the time to do so right now.

elishacloud commented 5 years ago

I didn't know you had already done this.

I fixed the Strange Bytes' code about a month ago and added a pull request, but have not published an update until now.

The link to ddraw.zip only has a text file in it. I'll try to see if I can compile it myself but don't have the time to do so right now.

Sorry about that. Not sure what happened. Anyways it is fixed now. Try redownloading it again.

qndel commented 3 years ago

I think it's better to apply the no-cd fix directly to storm.dll as it allows to replace the exes (yeah, I like mods :P) without having to worry about the patch. Maybe it'd even run on bnet? ;)

elishacloud commented 3 years ago

@qndel, my no-cd fix already works on bnet. Two of key goals of this project are: 1) to make a generic wrapper, and 2) to not require any of the game's original files to be modified. If I update storm.dll it would break both of those goals.

BTW: what makes you think it is better to update storm.dll rather than the way I currently handle the no-cd patch?

qndel commented 3 years ago

no idea, how does your no-cd work? I thought you were editing diablo's exe right? Okay I've read your link :D I guess your way is the best way except it works for only one diablo version 🤷 where one patched storm.dll worked for 1.08/1.09 and even hellfire if I remember correctly

elishacloud commented 3 years ago

It is true that my way currently only works with 1.09, but I could simply modify the ini file to add support for 1.08, if needed. Also, 1.09 is the latest and has been out for so many years, I doubt any other offical version will be released.

Hellfire does not have a cd check, at least my version does not have a cd check. It also does not have bnet play. So I don't see any need to modify Hellfire.

elishacloud commented 1 year ago

Closing this as I don't plan to change anything else here.