• Welcome to Valhalla Legends Archive.
 

DxWnd (Run DirectDraw fullscreen apps as a window) - current version: 1.035

Started by Skywing, February 10, 2004, 12:13 PM

Previous topic - Next topic

Skywing

DxWnd can be used to run DirectDraw 7 (or below) programs as a window, even if they don't natively support a windowed mode.  It probably won't work with programs that use Direct3D or DirectDraw 8/9 right now.

If it doesn't quite give the results you expect with a game (such as odd cursor behavior), you may have some luck by customizing the standard patch configuration for the program.

Feel free to post back with any programs you get it working with, and what options you used.

As a side note, games that were ported from DOS to Win32 are an especially good candidate for this.

A list of known compatible games and the options to use with them is included.

System requirements:
Windows NT 4.0/2000/XP/Server 2003/Longhorn (no support for Win9x/Me)
VC8 runtime libraries (available here if you don't already have them installed).

Update History:

[02/10/2004] Version 1.02 has been released.  This corrects an issue that prevented the Starcraft patcher from working properly, and adds a new patch option to the standard patcher (Defer Window Display).  This option is off by default.

[03/18/2004] Version 1.031 has been released.  This corrects an issue that caused crashes when programs called GetProcAddress with an ordinal.  Additionally, it introduces preliminary Direct3D8 support (further testing is required to determine how well the D3D8 patching will work in practice - this is included in the generic patcher).

[03/18/2004] Version 1.032 has been released.  This adds some new compatibility fixes, which among other things can be used to fix some problems when playing Civilization III with DxWnd.  Additionally, now the first patcher in the patcher list is automatically selected when you first start DxWnd.

[09/24/2006] Version 1.034 has been released.  This is a minor release that fixes a couple of obscure crash problems, and adds experimental support for rescaling windows to a larger size for DirectDraw (at this time, scaling is available only for the Standard patcher, not the Starcraft patcher).  To enable scaling, configure a program with the Standard patcher and select the "Stretch Video" option.  Optionally, specify an initial desired window size with the "Window Size" option.  Rescaling the program's video output in this manner will incur a performance penality, so if your program runs too slow with scaling enabled, you may need to disabling scaling and run the program at it's normal output size.  Additionally, scaling will result in a perceived loss in precision with the mouse cursor, as coordinates are translated back down to the program's preferred video output size.  Enabling scaling will also enable the maximize and resize functionality for the main program window of the program you are patching.  Remember that if you have selected the "Clip Cursor to Window" option, the cursor will continue to be clipped to the client area as long as the target program has focus, so you will probably need to right click on the task bar icon for the program to access to the maximize or resize options from the system menu.  Additionally, this release was rebuilt using a new compiler, so new runtime libraries are required (linked from this post); be sure to install them if you are unable to start the new DxWnd version.

[09/24/2006] Version 1.035 has been released.  This release fixes a longstanding graphics corruption problem with games using IDirectDrawSurface::Flip (such as Master of Orion II), and fixes a problem where the "Stretch Video" option would not function as expected if the window size was left set at the automatic option.

Getting Started:
After you download and extract the DxWnd.zip you can begin by either executing from command line (in Command Prompt) or more conveniently create a shortcut. The syntax for the execution should be: <DxWnd.exe> <Game.exe> <Patch.dxw>
(e.g. With Starcraft, I created a shortcut named "Starcraft – Window Mode" and then as a the target: "C:\Documents and Settings\Interdev\My Documents\My Received Files\DxWnd\DxWnd.exe" "C:\Program Files\Starcraft\starcraft.exe" "C:\Documents and Settings\Interdev\My Documents\My Received Files\DxWnd\Starcraft.dxw")

How You Can Help :):
We are going to extended lengths to provide open knowledge and resources for DxWnd so that we can enhance the database of games in which DxWnd may support. You can help by submitting (preferably in this forum thread) which games you found to be working and which patch was used during testing, so that we may add to our compatibility.txt (or perhaps a more efficient database, depending on popularity). Another way to help would of course be writing the patches for the games that may need them, as well as what options you use while configuring DxWnd to work with the specified game. Finally, you will be a great help by submitting any known errors with DxWnd. –Please-, be specific. Read current known compatibility issues and errors before submitting. Also, give as many details as you possibly can. Thank you all for your interest in DxWnd.


Soul Taker


Hostile

Yes, something currently wrong with website, please don't make any more posts concerning that until its fixed. Thanks.
- Hostile is sexy.

UserLoser.

#3
Work with Starcraft? If so, how?  I tried to run the Starcraft HDL file, and some error came saying something about "Apply"?  Tried run on Starcraft.exe, was still in full window

XP Home/has runtimes

Skywing

#4
If you want to write a patch for a specific game, you can use the following:
DxWnd extensions are DLLs with the .dxw extension.  They must export the DxwQueryProgram and ClientDllInitialize functions, and may export the DxwConfigureProgram function (these are described in DxWnd.h).

If a debugger is attached to the target process, DxWndSrv.dll will breakpoint just before loading your DLL in ServerDllInitialize, but after signalling to DxWnd.exe that the bootstrap sequence completed.  Thus, you should set any breakpoints starting from the ServerDllInitialize breakpoint instead of the initial process breakpoint to avoid DxWnd.exe timing out on the bootstrap sequence and terminating the new process.

In order to debug a game launched by DxWnd, you should start DxWnd.exe under your debugger (with the debugger configured to debug child processes).

If all goes well, you should see something like this when attaching to the new process and running after the initial breakpoint:

DxWndSrv: Process attach completed; breaking before ClientDllInitialize.
DxWndSrv: SharedData @ 00140000
(8dc.95c): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00140000 ecx=77f467f9 edx=00150608 esi=4a000000 edi=00140000
eip=4a0010f5 esp=0012f4f8 ebp=0012fd20 iopl=0         nv up ei pl zr na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00000246
DxWndSrv!ServerDllInitialize+0x85:
4a0010f5 cc               int     3


All calls to ServerDisplayString are also displayed to the debugger, if one is attached.  This is true even if ServerEnableConsole has not been called.

I've compiled a listing of vtable offsets for DirectDraw and DirectInput calls that may be of use if you are looking at the disassembly for a game and are trying to see what DirectX call it's trying to make:
Feel free to post if you think that you have found a bug or deficiency in DxWndSrv.dll.

Maddox

It doesn't work well with Starcraft. Text gets written on top of each other making it impossible to read. The channel list also gets redrawn every second. Everything is also slowed down. I didn't try in-game because I just quit after I saw all the problems.
asdf.

Kp

Quote from: Maddox on February 15, 2004, 03:14 PM
It doesn't work well with Starcraft. Text gets written on top of each other making it impossible to read. The channel list also gets redrawn every second. Everything is also slowed down. I didn't try in-game because I just quit after I saw all the problems.

Yes.  Starcraft does quite a few unusual and bad things for its interface.  Skywing actually wrote ScWnd specifically to window-ize Starcraft, then later created DxWnd as a more generic program.  If you actually want Starcraft in a window, I'd suggest using ScWnd instead.  When I last checked, there were a few minor issues, but it worked much better than the problems you describe. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Spht

Quote from: Maddox on February 15, 2004, 03:14 PM
It doesn't work well with Starcraft. Text gets written on top of each other making it impossible to read. The channel list also gets redrawn every second. Everything is also slowed down. I didn't try in-game because I just quit after I saw all the problems.

It works just fine for me. You may want to considering upgrading if Starcraft's running slow...

Skywing

Note that ScWnd is included with and is useable from DxWnd.

Also, note that in-game performance is significantly improved over in-bnchat performance when using ScWnd due to some expensive workarounds for flaws in how the battle.net chat GUI works.

Maddox

Quote from: Spht on February 15, 2004, 04:33 PM
Quote from: Maddox on February 15, 2004, 03:14 PM
It doesn't work well with Starcraft. Text gets written on top of each other making it impossible to read. The channel list also gets redrawn every second. Everything is also slowed down. I didn't try in-game because I just quit after I saw all the problems.

It works just fine for me. You may want to considering upgrading if Starcraft's running slow...

It only runs slow in the window.
asdf.

Denial

half life works


the version for broodwar goes nice and fast except when i try to move the window it just disappears and shuts down

I tried a ingame thing and when i move the window nothing happens the window doesnt die and i do see text drawn over each other as well


I decided then to try and just make  my own broodwar one. but it keeps the mouse inside the window like its little and i have to alt+tab to get out of the window ... but on yours i dont. This is the stuff i recorded off the one i made


DDPatchInit: Setting initial patches for 00000000...
DIPatchInit: Setting initial patches for 00000000...
MyCreateWindowExA: Setting 640x480 (centered, styles) - requested 1024x768
MyGetProcAddress: Returning MyDirectDrawCreate
PatchDirectDraw: Setting IDirectDraw hooks...
MySetCooperativeLevel: Setting DDSCL_NORMAL, adjusting main window size
MySetDisplayMode: Discarding request for 640x480x8
MyCreateSurface: Surface request (caps 00000200 flags 00000001)
MyCreateSurface: Creating primary surface
MyCreateSurface: Auto-selecting surface dimensions 640x480x8...
PatchDirectDrawSurface: Setting IDirectDrawSurface hooks for 00b31f20...
MyCreateSurface: Primary surface is 00b31f20
Actus non facit reum nisi mens sit rea

Skywing

Remember that you need to use the Starcraft/Diablo I/Warcraft II patcher with SC/BW; don't use the generic patcher.

The battle.snp GUI has some problems, but it's at least useable.  Avoid moving the game window while the Battle.net chat GUI is up, and avoid moving other windows on top of the game window while the Battle.net chat GUI is up.  If I find a good solution to fix these remaining problems, I'll update the Starcraft patcher - but I wouldn't count on this happening any time soon.

And yes, performance will be slower windowed.  However, with the Starcraft patcher you will see much better performance in-game than in-bnchat.  As long as you weren't borderline for the game system requirements, it should be perfectly playable windowed.

Denial

ok ya i tried the ingame play and it works perfectly i owned me some computers

P.S. if you didn't see half-life works pretty nice
Actus non facit reum nisi mens sit rea

TheMinistered

nvm -- oxymoron question ;)

Skywing

Quote from: Denial on February 16, 2004, 01:59 PM
ok ya i tried the ingame play and it works perfectly i owned me some computers

P.S. if you didn't see half-life works pretty nice
With DxWnd? What settings did you use?

Quote from: TheMinistered on February 16, 2004, 09:08 PM
I'm curious how you inject a .NET dll into SC.  Do you drag the entire .NET runtime/clr/whatever it uses into the SC address space?
I don't... none of that is .NET.