PDA

View Full Version : Graphics and game compatability on the diamond


space123monkey
21st September 2008, 07:07 PM
I've noticed a number of games that don't work right at the start, eg Pocket Lemmings, Guitar Hero. Now they basically seem to drop out as soon as they try to initialise the screen.

Today I started looking at beginning a bit of game development, and with that in mind download microsofts "skitime" starter pack. Basically this is a rubbish game demonstrating the structure and layout to build a DirectDraw based C++ game for windows mobile 6.

The interesting thing about it is that it works in the emulators, but not on the diamond so I spent a lot of time digging into where and why it doesn't work. In a nut shell, the directdraw initialisation stuff calls the "GetCaps" function (presumably this is somewhere in ddi.dll) and the relevant "capabilities" it returns are:
DDSCAPS_BACKBUFFER | DDSCAPS_FLIP
Basically these tell my application that I can do double buffering in video ram (good for performance)

However, when it then tries to create the structures for the primary surfaces, it fails with an E_OUTOFMEMORY. Dig a bit deeper and the info about the device suggests there is only 614400 video memory available, enough for 640x480x16bits.

So the problem is that it is telling the app that it supports double buffering, but it doesn't have the video memory to allocate 2 full frames worth of buffers. In terms of my own app, this is easily worked around, in fact putting in a better check against memory as well fixes it properly. But what I'm really wondering is whether this is what stops other games from working as well.

So, a potential fix would be to make the device not report that it can do double buffering, I did some searching of the registry, but I don't think this device info is stored there, my current guess is that the information is hard coded into the ddi.dll driver file. So, either a hacked ddi.dll file, or maybe it's getting the information from elsewhere.

Thoughts? I would really like to see if we can get more "standard" apps working by fixing this.