2002.03.26 ~01 PalmZLib, PiNGer An interesting little experience combining my two favorite Palm apps. In order to properly hack on PiNGer, I hit the PNG docs on www.libpng.org. The format is surprisingly simple, flexible, and powerful. I'm surprised no one created it earlier... everyone probably figured GIF was "good enough" until The Great GIF Ymezth started. Anyway, so I started hacking on PiNGer. Well, "hack" is probably an exaggeration at this point... I just merely shuffled variables around and introduced a boatload of data encapsulation. This will certainly help in maintaining and extending PiNGer in the future. Of particular note is how PiNGer accesses various system structs directly (i.e. not using accessor functions), a deprecated method starting with PalmOS SDK 4.0. I ran frequent compile, upload, run cycles to check effects equivalence. Lots of crashes. Last time I remember having crashes this frequent was... um... using my TNT2 with nVidia drivers 0.9xx-something-something. LispMe's DatabaseManager functions (dm-*) came in handy for tracing PiNGer's progress. PiNGer uses a "scratchpad" database as a buffer holding the decoded image. After a reboot, I could use LispMe to dig through the corpse of the scratchpad. I preferred this over dragging the PDB to the desktop then dissecting it there. I think it was because I could start whalloping on the db with Scheme code =) The GIF decoder seems broken. For one, PiNGer can't decode any of the remaining GIFs I happen to have. Two, PiNGer's GIF decoder advertises having used pieces of gif2png (gifread.c in particular), but after tracing the two sources, this doesn't seem true any more (maybe gif2png updated?). Still, not like this is a big loss. I'd just as soon rip out the GIF code. Creating an updated PalmZLib from zlib-1.1.4 was very straightforward. Tom Zerucha's 1.1.3 patch for zlib->palmzlib fit snugly with zlib-1.1.4 (read: no serious rejects by patch(1)). I found a free-speech JPEG compression-only library for PalmOS. It is just a Palm-ified port of the JPEG reference library (libjpeg6b), but the _de_compression routines were left unported. As it were, the library was created/ported to accomodate a camera module for Handspring Visor. For the curious, www.eyemodule.com[/developer/index.asp]. I also started hacking the ZBoxZ core. My greatest achievement there as of this moment is getting the file's list to update on a scroll event without causing screen flicker (which was caused by erasing the whole screen then redrawing every little component). An HTMLized version of the Palm OS Reference manual would be of immense help to me; I find something profoundly disturbing in "flipping through pages" of a manual on a screen. I should also add my PalmOS work to my .project, and finally get around to snipping my .plan to something smaller than a monolithic 26K text stream.