PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Testing an app in the emulator

Hi! I'm making a simulation game using edgelib and, since I don't own a PocketPC myself, I'm developing it in Visual C++ Express 2005 and compiling the project from time to time in embedded Visual C++ 4 and testing it in an emulator (the Professional VGA that comes bundled with the Windows Mobile 6 SDK).

Anyway, during my last tests I've noticed that when I draw text using the DrawFont method from E2DSurface I get weird results in the emulator, although I get a correct output in the Windows desktop version. I'm attaching an image that shows the emulator's output on the left and the Win32 desktop's output on the right so that you can see what I mean.

I'd like to ask you if you have experienced any kind of incompatibility when running your edgelib's applications in the Windows Mobile 6 emulators and, if you did, how did you solve them.

Thanks in advance for your answers,

--Nacho
Attachments:
PocketPCvsWin32Desktop.rar (20 KB)
Hi,

When I look at the attached picture, it's strange that only 'GOALS' is written in an odd kind of way. Are the other texts (that display correctly) also written using DrawFont?

Does the bug also appear on the Windows Mobile 5 emulator?
Hi edge, thanks for your reply.

edge wrote:When I look at the attached picture, it's strange that only 'GOALS' is written in an odd kind of way. Are the other texts (that display correctly) also written using DrawFont?


Yes. As a matter of fact, "BUDGET ANALYSIS" and "DONE" are written using the exact same font used for writing "GOALS".

I also forgot to mention in my original post that this behaviour happens in a non-deterministic way, that is, sometimes I would access a screen (screen A) that renders certain fonts incorrectly, click "DONE" to return to the previous screen (screen B) and, when accessing screen A again everything would display correctly. Notice that this I've never experienced this behaviour in the Windows desktop version.

edge wrote:Does the bug also appear on the Windows Mobile 5 emulator?


I don't have the Windows Mobile 5 emulator, but I will download it and report the results in a few hours.

Thanks again for your help,

--Nacho
OK, so I've downloaded the emulator images for Windows Mobile 5. I ran the emulator changing the default command line arguments by removing the "/skin" option and adding "/video 480x640x16".

I ran the game and the problem is still there. I mean, sometimes it renders the text correctly, but sometimes it doesn't :(

Do I have to specify any kind of special flag when creating surfaces in the WM version?

--Nacho
Hi,

I think the error is caused by memory corruption (such as writing to a NULL pointer, an uninitialized pointer, or writing out of bounds). This is usually the case when errors seem appear randomly.

Maybe it's a good idea to make a few tests using the helloworld sample. Also test if the error only appear when using certain font images.
Hi edge,

I've reviewing the helloworld sample and the source code of Blastar. Unfortunately, the helloworld sample writes directly to the screen buffer and I'm writing to an intermediate surface, so it kinda doesn't apply to my current problem.

Nonetheless, one thing I've noticed in Blastar's source code is that all the surfaces are stored as E2DSurfaces. In my project, I store everything as E2DSurfaces * and call the new operator in the class' constructor.

So, I modified my GUIStaticText class and replaced every E2DSurface* by an E2DSurface and it seems to be working correctly now. Since I cannot make that same replacement in all my game classes (because the amount of surfaces per widget is not fixed), should I call an E2DSurface method after creating the surface with the new operator and before calling EDisplay::CreateSurface?

I perused the documentation and found that there's a method named Clear, so I tried invoking it right after using the new operator and it crashed the application (as I expected, because the surface hadn't been created by ClassEDisplay::CreateSurface).

Thanks again for all your help,

--Nacho
edge,

I finally managed to fix it. The problem was that I was blitting surfaces that didn't have a color key assigned using the EFX_COLORKEY flag.

Thanks again for all your help,

--Nacho