NEW VERSION OF EasyCE
A new version of EasyCE is on is way. The new version now supports the 8bit paletize PPCs.
No modifications require to your existing code, just replace EasyCE.cpp and re-compile, it's that
EasyCE (bad joke).
I am currently testing my version with Lemmings and AliCE, more to follow.
If Phantom is listening can I have a copy of the Nutcracker demo source code, this will be used for testing only.
hmm, I start considering going with EasyCE:)
i would also like the nutcracker demo source code. for, uh... testing. yeah... thats it.
hehe, hmm, yeah, testing is important, I want it too;)
If you don't mind, can you send me that palettized stuff, so I can merge it with EasyCE? I can then release EasyCE 1.6, with these modifications. I will also update The Nutcracker to use it; I'm sure many people will like it.

Can you please outline what you did to get it working?
Current status:
Tested with Lemmings, AliCE and Bounce.
Bounce demo, colours does not look quite right even after modifying the tga file. So I am still working on it.
How at works:-
updatedisplay() includes a 8bit section that write a palette index value to the screen based on the RGB565 colour. A 64K array is use to map the RGB colour to the default palette index.
And thats it.
I have tried loading a custom palette without any improvement. If a custom palette is used then GetNearestPaletteIndex() must be called which may affect the fps.
So far Lemmings looks the best as it uses a maximum of 256 colours.
Phantom, I can send you what I have done so far, but I will continue to test and modify.
Phantom,
Where can I download EasyCE 1.5/1.6. I have downloaded the version off your website but cannot find the ASprite class or TGALoad
Thanks in advance
Bad
Phantom, any chance of putting the support for the Win CE 2.11 color devices (E-100 and E-105) BACK in? Just curious, as I know of a few people who would be paying money for nutcracker to play on their old Cassiopeias

If this color code works, then The Nutcarcker should also compile for these devices. The problem is the amount of work involved in creating the 2.11 project files and installers; then I have to upload it to PocketGear and Handango, resulting in 6 separate download packages; quite a lot of work for a couple of sales. I don't think it's going to happen.
Badbazza,
If you click here:
http://www.pocketmatrix.com/phantom/easyce15.htm
then you'll have version 1.5, wich includes the sprite code. The class definition is at the end of the EasyCE.h source.
- Jacco.
LLCool,
Please send it over. I could send you the Nutcracker sources (I trust you

), but it's a huge package and it requires detailed instructions to compile, so I would rather do it myself. This will earn you a free copy of your favorite game (but only if your favorite game is The Nutcracker

).
BTW, I have the following improvements for EasyCE 1.6: Font support (loading from a tga file of an arbitrary monospaced font); a new AAnim class that makes it easier to handle animations (using series of sprites); and finally the new 3800 code. I believe this is quite a significant release. I hope to release it on Friday.
- Jacco.
Phantom,
I will email my changes. But I am not happy with the colours. Grey appears as green even if I create a custom palette. You might have to customize all 24bit/16bit tga files to get the best on a 8bit displays. Bounce look ok (even with grey appearing as green) after I modified the tga file, using standard (web safe) palette colours with error diffusion.
Do you also update the color lookup table after loading your custom palette? I used a similar technique long ago to do full-color crossfading with 8-bit images:
- The two images used a shared palette (I pasted them in one image in Paintshop, reduced colors to 8-bit, then cut them up to create two images with the same palette);
- For each palette entry I calculated 16 intensities (in hi-color);
- A color lookup table made it possible to link the scaled palette entries to the best match in the actual palette;
- Then, while mixing, for each pixel I picked the scaled color of the pixel for image 1 and the scaled color of the pixel for image 2. Adding these results in a 16bit color wich represents the mixed version of the two pixels;
- This mixed 16bit color is then looked up in the 64K table to get the best match in the pallette.
This looks almost true-color, especially when moving.
To get the best results in your case, you need to base your palette on images that you actually use. When EasyCE loads a palettized tga, it can also store the palette of that image in an array that you provide. In the case of the balls demo, you could simply reduce the image that contains the balls to 8-bit, then load it and use the palette from that file as the palette that EasyCE uses. That should result in almost perfect image quality.
In the case of The Nutcracker, this approach can't be used though, since it uses many image files. In that case, it would be best to build the playfield in hi-color, then calculate a palette that matches the final screen. This is tricky though.
Jacco.
If this color code works, then The Nutcarcker should also compile for these devices. The problem is the amount of work involved in creating the 2.11 project files and installers; then I have to upload it to PocketGear and Handango, resulting in 6 separate download packages; quite a lot of work for a couple of sales. I don't think it's going to happen.
I disagree, but its your call

Especailly when most people that want to play games on their wince 2.11 devices are Casio MIPS owners, it wouldnt really be necessary to compile for the other processors. Oh well, sigh.
Yeah, there are no ARM PSPC 2.11 devices, and the 2.11 Jornadas are really weak. I know, I have one.

So you could get by supporting only MIPS for 2.11. If you use stdio then you would have more work cut out for you to build for it.
Dan East
GREAT BALLS OF FIRE.
Palettize code finished.

How it works:-
updatedisplay() includes a 8bit section that write a palette index value to the screen based on the RGB565 colour. A 64K array is use to map the RGB colour to the default palette index. If a custom palette is use the the default palette index is updated with the new values. The screen buffer values are use as an index in the array.
How to use:-
It is recommended that you create a 256 colour palette based on a tga file (or files) used in your project (Don't forget to save the modify tga file(s)). It is easyCE to do, using Paintshop Pro to save the palette as PAL-JACS palette (text). Modify the file with a text editor. (remove lines 1-3 replace <space> with <,> replace <cr> with <,>)
Then copy palette array value into EasyCE.cpp
custom_pal array.
Eg. Palette file.
JASC-PAL
0100
256
0 0 0
0 0 51
0 0 102
0 0 153
In main() call palettize().
Note: palettize() must only be called if you have created a custom palette.
One other thing two versions of any tga files should be supplied with you application. No code has been included to load the different tga files. You will need something like this:-
if ( BPP == 8 ) load(balls8.tag)
else load(balls.tga)
Enjoy,
LLcooL
LLCool,
This is good news!
There is an easier way though:
EasyCE can already read 8-bit palettized images. These are converted to 16bit images internally using the palette stored in the tga file, so you never notice that you used an 8-bit image (it's just a bit smaller, wich is usually the reason for using a palettized file).
The good thing about palettized files is that while they are converted to 8-bit on-the-fly, you *can* get their palette. Have a look at easyce.h: The tgaload function has one extra parameter for palettized files that is 0 by default, so if you omit the parameter, it stays 0. If you *do* supply a parameter, EasyCE assumes this is an array of 256 unsigned shorts, and stores the palette of the loaded tga file in it. You can use this palette as the new default palette, if you wish. That way, people don't have to fiddle around with a weird text file.

If you need help adding this functionality, just let me know.
- Jacco.
Phantom,
I looked at this and decided not to use this method. Reading the palette from the tga file is fine it only one tga file is used or the palette is the same for all tga files. Eg. Lemmings has 8 tga file each with its own unique palette, so I created a single palette for all files. Wait a minute I can load the palette from a tga, hum....
I think I had a reason for doing it this way.
Anyway I will email you the modified bounce source code and the modified balls.tga
LLcooL
Ok, I agree the palette should be read from the tga file.

Can you modified and email me the mods.
LLcooL
I will add some code that lets you read a custom palette from a tga file. Then the user can determine the best tga file to use for this. I think that's the best approach.
hello
When using function Asprite of EasyCe
does the pitch parameter is for rotating sprite?ASprite sprite( 20, 32, 40, spriteimage);
how to use it to turn of 180degrees?
I think it work when I put 40 of pitch
but it goes out of the spritebuffer and so its buggy,
Hm, I think this deserved a separate thread, but OK: The pitch parameter indicates how many pixels you need to move up when you want to draw the next line of a sprite.
Suppose you have four sprites, each 32x32, and you store them side by side in a single .tga file. You load the file, and you create the four sprites. In this case, the pitch is 128: When drawing a sprite, you need to advance 128 pixels to get to the next line, even if the sprite is just 32 pixels wide.
So basically, it's a feature to make it easier to store multiple images in the same image buffer.
thanks!
Sorry for disturbing the subject,
just a small other question about easyce,
the destructor function erase the sprite?
I arrive to use that code but it won't erase the sprite..
sprite.~ASprite();
Am I really bad?
Hm, a sprite in EasyCE is not a sprite like you're used to. If you draw a sprite using it's draw method, it's pasted right into the screen buffer. So there's no way to remove it, except redrawing the backdrop. So indeed, destructing the sprite does not remove it.