This site is no longer active and is available for archival purposes only. Registration and login is disabled.

PocketFrog v0.4.5 release


PocketFrog v0.4.5 release

Postby Kzinti » Feb 21, 2002 @ 6:23pm

PocketFrog is an easy to use API to write games for pocket PCs.

PocketFrog v0.4.5 has been released on
http://frog.flipcode.com.

New features include dithering for palletized devices such as the Jornada 525 and various fixes.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Digby » Feb 21, 2002 @ 8:20pm

Congrats on your release! (you didn't forget to mention pocketmatrix in your release notes, right???)

I'm curious, where did the name "PocketFrog" come from?
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Chris Edwards » Feb 21, 2002 @ 9:24pm

Hey.. I went to your site and you said you had forums "on the way"... What if we were to set you up a forum here, would that suffice?
Chris Edwards
Founder
User avatar
Chris Edwards
Site Co-Founder
 
Posts: 4048
Joined: Jan 24, 2001 @ 7:14pm
Location: Vancouver, BC


Postby RICoder » Feb 21, 2002 @ 9:56pm

"The digital pimp, hard at work."
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby Kzinti » Feb 21, 2002 @ 9:57pm

Digby:

When I wrote my first engine, I called it the Frog Engine. Reason being that I'm a french canadian and english peoples used to (and sometime still do) call french "frogs". Why? Because French are delighted to eat frog legs and English are disgusted by it.

When I moved to the Pocket PC, I kept the name Frog. Unfortunately, www.frog.org, www.frog.net and www.frog.com are all taken! *sigh*.


Chris:

Thanks for offering. I am not sure I like the idea of having a site on a host and the forum on another. On the other hand, your forum are really nice. Let me think a little about it and I will get back to you?
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby billcow » Feb 21, 2002 @ 10:11pm

I was looking at the PocketFrog Dithering code and I noticed that you used a lookup table to find the nearest color. Is there a reason why you can't just mask off the lower 5 bits (or 6 bits for blue) of the 8-bit color component value? With a 332 palette that should give the same results, shouldn't it? Or did you do this so it can be extended to use custom palettes?

I would think (correct me if I'm wrong) that a lookup table would be slower than a bit-mask, due to caching issues, in addition to requiring more memory.
Most people don't know that "A highly technical term" is actually a highly technical term used to describe something that doesn't mean anything
User avatar
billcow
pm Member
 
Posts: 81
Joined: Jan 6, 2002 @ 12:22am
Location: Dryden, NY


Postby Kzinti » Feb 21, 2002 @ 10:23pm

Billcow:

There is two reasons I use a LUT:

1) I am not sure that using shifts and masks gives the closest matching color in a 332 palette. It will return a pretty close color, but not the closest one. The results looked better this way. I am not sure about the mathematical proof though. I think that handling each color component separately gives a bigger error term. Anyways, continue reading.


2) Is is actually faster with the LUT! This is the results I've got on my desktop PC. I don't have access to a palettized Pocket PC to check it, but it makes sense: a simple memory access is usually faster then using 3 masks with immediate values (3 memory accesses!) + 3 shifts + 2 logical ors.

I have no doubt that this dithering code could be faster, I just don't have the time / need to do it myself. I am pleased with the current result. If someone wants to experiment some more, be my guest.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Kzinti » Feb 21, 2002 @ 10:41pm

Here is the proof that using a LUT looks better then using shift/masks when converting to 332:

Suppose you have the color 0007h which you want to conver to 332. A naive implementation would use a shift and map this to the value '00b':

(00111b >> 3) = 00b

But intuitively, this color is closer to palette entre 01b then 00b.

Let's verify by computing the error when selecting palette entry 0 and 1:

Effective blue for entry 0 is 00000000b
Effective blue for entry 1 is 01010101b

Error for entry 0 is 00111001b - 00000000b = 0111001b
Error for entry 1 is 01010101b - 00111001b = 0011100b

This prooves that the closest color can't be obtained by using shifts/masks alone.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby billcow » Feb 21, 2002 @ 10:51pm

Thanks, that seems to make sense
Most people don't know that "A highly technical term" is actually a highly technical term used to describe something that doesn't mean anything
User avatar
billcow
pm Member
 
Posts: 81
Joined: Jan 6, 2002 @ 12:22am
Location: Dryden, NY


Postby MirekCz » Feb 22, 2002 @ 12:00am

plan9:hmm, althrought I don't understand much from this effective blue thingy(huh, what is it about?!?) I can tell you that you're pretty false about your assumptions that a shift won't do to change a 565 into 332.
You can achieve it like this:
bad way:
0011b >> 2 = 00b
good way:
(0011b+0010b) >> 2 = 0101b >> 2 = 01b

How it works? we simple added half of the number representing 1 , and therefore a (will use floats) 0.9f won't become 0, but will become 0.9f+0.5f=1.4f so 1.

Conclusion? one simlpe add and you can still live pretty nicely with some shifts/ands, which might be better then your version (no concerns about trashing cache, not finding a value in cache which then starts a slow sysmem read etc etc)

hope it helps:)
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Postby Kzinti » Feb 22, 2002 @ 1:05am

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Kzinti » Feb 22, 2002 @ 2:29am

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum