A few questions and comments regarding EasyCE.
I've finished a game using EasyCE. It compiles fine on a PC with OpenPTC and the EasyCE library was a joy to use.
I added a few things to the library which were useful including a tiled scrolling system, a tga pool, bitmap rotation and animated moving sprites. I also added a few keyboard handling cases to the PC message which were missing.
I don't have an ARM PocketPC only, Jornada hopefully on the way soon, so I did all the development on the PC but when I was going to compile the game in eVC a few things popped up:
Why are a lot of the EasyCE functions parameters defined using char * instead of ACHAR * or TCHAR *? This caused compilation errors when moving to eVC.
Is there any way of finding out how a game will perform on an ARM without actually having access to a machine? If a game runs well in an emulator is there any way of finding out how it will run on a real machine?
Regards
Karl
Hi Karl
I think you really need to test on the iPaq hardware especially when it comes to going live as all sorts of mistakes can creep in that don't show until other people get their hands on your setup.exe
I assume you have followed the posts on the 3800 devices as the latest easyCE is dealing with the performance issues I think.
The most common approach is to organise beta testing. I have an iPaq, an old Casiopeia ppc and 2 hpc's so I have to rely on kind people to test my games on other devices and in some cases like the Jornada 720 take screen shots. The only problem is finding people who will actually test as many people just want to play with something new.
Ian
I will of course test on an IPaq before release but some performance indicators from the emulator would nevertheless be helpful.
I believe that only the functions handled by WindowsCE (as opposed to EasyCE) require TCHARs. The functions that take char* as an argument should use char* instead of tchar*. The reason that this causes problems only in eVC is because TCHAR is actually a define (it equals char in vc++ and unsigned short in eVC) to ease the pain in translating ASCII apps to Unicode. As a result, for anything that takes a char*, it will be fine if TCHAR equals char, but it will fail if TCHAR equals wchar (ie unsigned short). Just store all your easyce stuff as char* and it will work (you will also have to use the char* string functions instead of tchar* string functions). If you have to use something for the windows api AND easyce, you will have to use the WinCE api to translate back and forth (I can't remember exactly what the functions are though).
Why not simply use TCHAR in EasyCE? No conversions needed when porting. PocketPC is an Unicode os.
The main reason EasyCE doesn't use TCHAR, (I think, there may be others) is that there are fewer ASCII characters than there are UNICODE characters. If you look at the code, you will see that there is a lookup table with one element for each POSSIBLE character (in other words, 256), each entry is an index into the array of bitmaps. Each character without any bitmap goes blank. Anyway, with Unicode, there would be two problems. One, the first lookup table would be huge (64k elements for 128 kilobytes of memory - one for each unicode character). This would probably cause serious cache thrashing (Assuming that PPCs have a cache, I don't know for sure that they do, but that's a different post altoghther). Two, this would still have to be the original code on desktops (unless you always use unicode, and that's the same problem as using only ASCII, except you have problem one on top of it), which would be yet another thing that is different between platforms. In the end, the disadvantages basically outweigh the advantages: the only advantage I can think of (aside from using different types for windows calls and easyce) would lie in the use of foreign languages, and if you are going to do that, why not make your own font mapped to a different ASCII code page? The text would be in a different language anyway, so you wouldn't be losing language portability.
BTW, I agree with Conan on the device testing issues: I only have a Jornada and it has caused major (sort of major anyway) headaches getting my code to work with other devices as expected. Fortunately, Mike (from pocketgamer) helped me fix the specific problems I am referring to (thanks mike, btw).
unicode is uncool, ASCII is old school, thats why Jacco didnt use unicode in EasyCE

As for the display of text in a graphical mode like GAPI gives us, there is no reason to use a unicode charset unless you want to do a japanese version of your game aswell

cryo
billcow,
There is no need to make the character font array 256*256 bytes just because the character set is Unicode, anyway the ASCII values for english characters are the same in Unicode and 8 bit ANSI the only difference is that Unicode sees it as a 2 byte value. No difference in the font character set in EasyCE.
Using TCHAR/ACHAR just would have made it easier to port.
Assume I simply want to load an image in a buffer called a, I used to do that in EasyCE 1.5 with the following line :
tgaload(TEXT("image.tga"), 240, 320, a);
which works perfectly in VC++ but doesn't work any more with eVC++ and EasyCE 1.6, because :
TEXT("") returns an unsigned short* whereas a char* is required... Indeed, the prototype of the funtion in EasyCE 1.6 is :
bool tgaload( char* a_File, int w, int h, PIXEL* dest )
Question is : how can I load an image with EasyCE 1.6 ?
Have you tried:
tgaload("image.tga", 240, 320, a);
Thanks. In fact I was coming back to the forum to apologize for this stupid question because I had just found this so simple solution by myself !
Yet, I've got another question about EsayCE 1.6 :
I have to comment the line from EasyCE.cpp :
if (m_Buffer) sndPlaySound( (ACHAR*)m_Buffer, SND_ASYNC + SND_MEMORY );
because the function "sndPlaySound" is unknown...
Where is this function ?
Thx !
EasyCE 1.6 has a basic sound playing class, check out the header file. You'll have to link the Windows Multimedia library to your project to use it or the sndPlaySound function (winmm.lib if I remember correctly)