Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
beetlejoose

Doom95 mouse patch for XP available - now

Recommended Posts

Hi,

You'll have to forgive me in advance for not knowing a lot about doom. A lot of this is probably old news to you, but anyway...

About a month ago a mate of mine asked me for a solution to Doom95 mouse not working in Windows XP. I looked into it and found the reason to be doom95's dependence on DMOUSE.VxD for mouse input - and XP dosen't support VxDs.

After some more research I was able to write a patch that enables doom95 to use a mouse in XP and probably win 2000 and onwards. The only combination I've tested is shareware doom95 in XP.

I realize that doom95 isn't that popular now, partly because of the lack of mouse support and its age. But at least this was interesting for me :->

So, is there anyone willing to test this? I would like some feedback so I can squash any bugs and then call it finished. The end result will be free for anyone to use.

I'm affraid I don't have a copy hosted anywhere yet. But I can Email an installer to anyone interested. I think it may get hosted on here somewhere soon though - if only for testing purposes.

edit by Bloodshedder: http://youfailit.net/files/dmousexp.zip

Share this post


Link to post

Hey, I've sent you an e-mail about one last important issue, and a few other minor ones. Once you fix those, I'll host the file for you!

Share this post


Link to post

Actually sounds pretty cool, even if most people don't bother with Doom95 anymore. I used to use it all the time before I learned about Chocolate Doom because it was closer to the original exes than the ports I was using at the time.

Share this post


Link to post

Hey,

Thanks for the interest. I'm looking into those problems you pointed out BloodShedder. It can be difficult to notice the obvious when you're in it up to your neck!

Thanks, and I'll post again soon.

Share this post


Link to post

Interesting, although you are pretty much 10 years too late, however alot of the old stuff is figured out 10 years after the game is released so it's pretty good. Good work!

MP2E said:

Doom98SE


I already claimed that years ago, so you can't have it.

Share this post


Link to post
beetlejoose said:

So, is there anyone willing to test this? I would like some feedback so I can squash any bugs and then call it finished.

Doom95 was one of my favourite ports before I migrated to XP - count me in.

Share this post


Link to post

Thats what I don't understand. Why didn't anyone do this 10 years ago when it became clear that doom95 wasn't going to run without VxD's ? I suppose it was because of the availability of other solutions...

Share this post


Link to post

I want to test this too!!!

Doom95 was basically all I ever used for years. Along with the demo fix, this could actually make Doom95 a viable option again!

Share this post


Link to post

Just to note,

Technically this isn't really a patch for Doom95. The Doom95.exe only receives a very minor change. The big change is really a local replacement of Kernel32 - a part of windows. Doom95 is under the illusion that it is still using a VxD.

So, i'm not sure - but I guess its still Doom95!

It'll be available in just a couple of days now. Sorry for the premature thread - I guess I got a bit excited!

Share this post


Link to post
beetlejoose said:

The big change is really a local replacement of Kernel32 - a part of windows. Doom95 is under the illusion that it is still using a VxD.

As a reverse engineer, I find this impressive. Any technical details you'd like to share? ^_^

Share this post


Link to post
Quasar said:

As a reverse engineer, I find this impressive. Any technical details you'd like to share? ^_^


Maybe he means kernel32.dll in the Doom95 dir, local dirs take priority.

Share this post


Link to post

The patch works by replacing doom95.exe's import of kernel32 with a dll that exports all the same functions as kernel32. This dll simply passes on most calls that doom95 makes to kernel32 except that it takes a sneak preview of CreateFile and DeviceIOControl - in other words it statically hooks those two functions. Doom95 wants to open DMOUSE.VxD using CreateFile which fails in windows XP. So my dll simply checks for this and instead of passing on the call to Kernel32 it just returns a fake file handle. When Doom95 wants to talk with the mouse it uses this file handle with DeviceIOControl but ofcourse DeviceIOControl is hooked and is checking for this handle. When it sees a call using the fake handle then instead of passing on the call it services the call itself. When doom95 asks for data from the mouse the hooked DeviceIOControl gets the data by calling standard mouse functions and filling in the data that doom95 expects.

So really the only alteration to doom95.exe required is the name of the dll that it imports. The logic in Doom95 is completely unaltered. It thinks it is dealing directly with Kernel32 and it thinks it has successfully loaded DMOUSE.VxD. Whats really happening is it imports a dll that looks identical to Kernel32 and that dll is simulating the actions of DMOUSE - a middleman that is being selective with the truth!

The installer simply scans Doom95.exe for all occurrences of 'KERNEL32' and replaces them with 'DMOUSEXP' - there are only two. I chose to do this lazily because it avoids having to parse the PE structures. It then extracts DMOUSEXP.dll from itself as a resource and places it in Dooms folder. The installer is just a single exe so no files can get separated. It can also uninstall simply by changing the strings back to KERNEL32.

Share this post


Link to post

Wow, that is awesome.

Tested out the mouse fix, seems to work great, and I love being able to disable the vertical axis.

Now then, isn't there a few things one should do with Doom95 if they are to attempt actually playing with it?

I know there is -emulate that will fix the broken invisibility effect, but wasn't there a couple others related to the sound and demos? what about autorun?

Share this post


Link to post

The demo fix is already on the archives here.

The only serious "bug" remaining is the lack of MIDI playback, and the only real sought-after feature would be DeHackEd support, but I'm afraid the latter is pretty much an impossibility, unless someone created a version of DeHackEd that could patch Doom95.exe!

But with demo and mouse support now, does this mean Doom95 is actually a viable source port? I'm starting to think so!

Share this post


Link to post

I just tested out Doom95 on Windows 7 x64.

A couple things:
Since Nvidia finally got off their ass and fixed the aspect ratio correction in their drivers, you can play Doom95 (or anything else that doesn't support widescreen for that matter) without it being stretched, so that makes that a non-issue.

At first, I was getting an error that dplay.dll was missing, so I browsed to my system32 on my Windows XP partition and copied it into my Doom95 folder.

Everything seems to work just fine now, including the new mouse fix.

Share this post


Link to post

So far so good, had to throttle the mouse sensitivity way back but with that done it's working great!

Share this post


Link to post
Mike.Reiner said:

At first, I was getting an error that dplay.dll was missing, so I browsed to my system32 on my Windows XP partition and copied it into my Doom95 folder.

For Vista/7 users, find dplayx.dll, copy it and rename it to dplay.dll, and that'll work fine.

Share this post


Link to post
entryway said:

This community like to have sources for everything.

True, but what the coder withholdeth, IDA Pro giveth away. ;)

Share this post


Link to post

I see. that is why perhaps, the fix does not work for NT4.0, I get those importation error problems:
in DMOUSEXP.dll:
KERNEL32.DLL:
SetCriticalSectionSpinCount
MoveFileWithProgressW
MoveFileWithProgressA
InitialzeCriticalSectionAndSpinCount
CreateHardLinkW
CreateHardLinkA

I wonder if you could fix it, as DOOM95 itself does not depends on these fuctions.

Share this post


Link to post

Well, well...

To my knowledge I haven't said anything yet about witholding my source's...

You do understand that I only released this yesterday and strictly speaking I am still working on it. Normally I don't just give away my work for free. I have already given you enough information on its implementation that you could reproduce it if you were inclined - if only for interests sake because I can't see much of another reason.

I didn't put in any clauses against reverse engineering my work because basically I know people are going to do it anyway. All you'll find is that its not exactly rocket science - it works more or less exactly how you've already been told and its even written in Delphi 5!

When I'm happy that its finished then I'll gladly give the source to anyone that wants to learn and asks politely...



Thankyou for the information on NT4 I'll correct that very soon.

Share this post


Link to post

Yes. The 'patch' only affects Doom95. It makes no change to any part of the operating system - except making two registry entries to store settings. It inserts itself between doom95 and the OS and doom95 is merely told to use DMOUSEXP.dll instead of KERNEL32.dll.

DMOUSEXP has nothing nasty in it thats going to mess with your computer - but I understand your (or anyone's) concern. Its a healthy concern when you use any new piece of software from an unverified source.

Share this post


Link to post
Guest
This topic is now closed to further replies.
×