It's been exactly 4 months since my last post, yet I feel like it was just yesterday. Well, a lots of things happened since then, and here is a brief overview of personal stuff, if anyone is interested:
-I moved out of home into new apartment. It took me almost two months to find it, the rent is quite high, but the place it's really worth the money. Finally, I have some own space, privacy and equanimity, so I can work on my projects without being disturbed all the time. Hooray! :)
-I finally decided to visit my doctor for a medical check-up. I had last one like 10 years ago, so I was a bit afraid of the results. Well, apparently I should be perfectly healthy, as the results of all tests were okay.
-I found my lost uncle that I haven't seen for about 20 years. I was five when my father died, but at that time, I was living in a children's house and I never seen anyone from father's side of family again since I returned to home. Unfortunately, I found out that he is the last living member of that family, as my grandparents passed away a long time ago, and the rest of the family as well. Well, I also found out that my father and my grandparents weren't buried, thanks to economy situation at that time (post-communism era). I think that they deserved better, so I'm going to start saving money for a joint/family grave, so they can be buried and be together once again. Anyway, my uncle gave me some new-found photos of my father and my grandparents, so I'm really glad that I found him afterall.
-I'm currently trying to finish my thesis and prepare myself for a final exams. I already have the practical part of the thesis finished, but I still have to write at least 40 pages for it, which will be the hardest part for me. Well, I still have a month left to manage that (the dealine is July 6, exams starts in August), so I hope that I will be able to finish it in time. It's my very last chance, and if I don't finish the thesis or pass the exams, then I'm not going to get my degree. No retakes! :(
That's it. I probably forgot to mention something un/important, so I'll update this post later :(
My dog just passed away this morning, due long and exhausting fight against cancer. She was already 12 years old, yet still had so much life in her, but unfortunately she also had many health problems, and there was no hope she would get better any soon, so we had to put her to sleep. I've seen many dogs and other animals in my life, and that's why I can say that she was truly unique, clever and humane dog, and she was like a sister to me.

She is truly irreplaceable, and I'm not going to replace her, so this was my very last pet I ever had.
Rest in peace, my beloved friend... and hold on there, we will see each other again one day...
Just to remind you, DxEmu (formely DDrawEmu), is the DirectDraw/X emulator I'm currently working on. I've managed to implement the OpenGL-based renderer, and here is first preview:


It's only a two screenshots of main menu, but as you can see, it's running in windowed mode, which is one of the most requested mods for fullscreen-only games, like Arcanum :) It's also possible (thru config file) to force any windowed game to run in fullscreen, and force display resolution, window geometry, etc.
Now I'm going to implement support for palettes, color keys and other misc stuff. Hopefully, I'll have it finished before end of this week.
Edit: Open those screenshots in new window, if you want to see them in full resolution.
As you probably already know, this game is using "standard" 256 color palettes, where every color is saved in X8R8G8B8 pixel format. What you probably also know, is that Arcanum is using DirectDraw for the rendering, and there is no support for windowed mode in Arcanum.
Anyway, I just found out that there are a huge design flaws regarding the color palettes and DirectDraw usage.
First of all, Arcanum isn't using IDirectDrawPalette interface at all, and all the color index to pixel conversions are done on CPU. This slows down whole level loading process, but that's still okay, no big deal.
Secondly, the game is running in 16bit fullscreen mode. Yes, you read that correctly, 16 bit color depth, not a 24bit! What does it means? It means, that 8 (or even 9 bits) are removed from every color from the color palletes in pixel format conversion, so the range of possible color shades is significantly reduced, from 16 777 216 to 65 536 (or even 32 768), thus the overall graphics quality is reduced significantly as well.
It's 16bit color depth, but it doesn't mean that it's R5G6B5 pixel format. The DirectDraw also supports X1R5G5G5 pixel format, and it's up to driver which pixel format it chooses for 16bit color depth.
Anyway, few year back, I made a mod for Arcanum, that forces the game to run in windowed mode, which was disabled in Arcanum in release version, because it wasn't finished and fully working feature.
What's surprising, is that when the game is running in windowed mode, there are no pixel format conversions, and game uses a full 24 bit color depth range. That's great, because it means that it's possible to force the Arcanum to run in 24 bit fullscreen mode.
If my time allows it, I'll fix this problem in January, and release it as .exe patch. I found this issue thanks to my DirectDraw emulator, and hopefully it will be useful for finding bugs in other games as well :)
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 :)
