« A one huge "bug" in game Arcanum: Of Steamworks and Magick ObscuraLong time no see... »

DirectDraw vs Old Games

Have you ever tried to play any DirectDraw based game on Win7? If you haven't experienced any visual glitches or even crashes, then you're a lucky guy, because those games often don't work on newer systems (Vista+).

Call me paranoid, but it's possible that the support for DirectDraw is going to be dropped completely in near future (Win8?), and provided compatibility modes often don't work as they're supposed, so it's on us - fans of those games - to fix all the problems, so we can enjoy playing those games forever and ever.

Anyway, why I'm talking about this? Recently, a friend of mine, has recommended me a game called Wing Commander. I was aware of this game, but I never played it before. So I decided to buy this game, third episode to be exact, as I didn't liked the graphics of previous episodes (judging from the screenshots).

What was surprising is that the game is running in DosBox. After a bit of searching, I've found out that it's mainly because of DirectDraw related problems.

What I also found is a webpage, which is dedicated to fixing DirectDraw related problems in the Wing Commander series. The author of that website - Jari Komppa (AKA sol), also wrote a library as replacement for DirectDraw, to fix all the problems.

I've noticed that the guy has already abandoned the development of that library, and made source code public, and because I really liked the idea of such library, as I also know a few games that don't work properly on Win7 (e.g. Arcanum and it's WorldEd), I've decided to continue with the development.

Well, I was very enthusiastic about it, until I looked at the source code. It was really hacky for my taste, and I didn't liked a lot of design-related decisions in it (I'm really such perfectionist :)).

 

So after that, I rather decided to write my own library, which will be able not only to log all the calls, parameters and other stuff, but it will be also able to redirect all calls to original library, so it'll serve also as proxy library. Most importantly, it will be also able to emulate all the DirectDraw features.


That was the plan, but after two weeks working on it (well, in free time only), the only thing I've managed to implement is - all the DirectDraw interfaces and it's versions  (i.e. DirectDraw/Surface/Clipper/Palette - 1-7) , proxy calls and functions/methods & parameters logging. It's kinda powerful tool already, but something important is missing...

 

What's missing? the emulation part :) on which I just started working. I chose Direct3D9 for the rendering and stuff, but if I manage to make everything working, I'll also add support for OpenGL, if needed.

 

Anyway, I'm testing the library on Arcanum, and you can see the debug output here: http://pastebin.me/2582666d95f3f39b81a49edb8d00aee0

 

Kinda cool, right? I call this library DDrawEmu :)

 

Categories: Projects

4 comments

Comment from: soshial [Visitor]
soshialSorry, but don't you use OpenGL?
12/12/11 @ 11:06
Comment from: Crypton [Member]
Kinda... I'm experimenting with both, OpenGL and Direct3D9 :) I have both of the API's integrated into DDrawEmu, but right now, I'm working on Direct3D9 only.

If you're asking because of that log file - yes I was using OpenGL, because I was unable fix one bug in Direct3D part, which caused early crash of the host application.

Now it's fixed. :)
12/12/11 @ 13:59
Comment from: soshial [Visitor]
soshialI just thought that if one develops the application with OpenGL, one doesn't need anything to do with D3D :)
12/12/11 @ 16:47
Comment from: Crypton [Member]
Oh, that's a good point... However, believe it or not - it'll be much harder to emulate DirectDraw with OpenGL, and I would like to make things easier for myself :)

Also, I like the possibility to switch between those APIs. In the OpenArcanum, it's possible to use multiple graphics APIs, because the design of the engine allows it. So one day, there will support for Direct3D in OpenArcanum as well.

:)
12/12/11 @ 17:04

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)