>I see.  So you know where I can get some source code for this? :)

Sure.  Here it is:

void PlayVideo(unsigned long *screen)
// This blits video out at 10 frames/sec.
{
   short int i,j,k;
   unsigned long *fromscreen, *toscreen, *myptr;
   VoidHand handle;

   for (j=0;j<1;j++) { // repeat n times
      for (k=1000;k<1128;k++) { // cycle through available frames
         handle=DmGetResource('GSDT',k);
         myptr=MemHandleLock(handle);
         toscreen=screen;
         fromscreen=&(myptr[87]);
         for (i=0;i<160;i++) {
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
            *(toscreen++)=*(fromscreen++);
         }
         MemHandleUnlock(handle);
         DmReleaseResource(handle);
         SysTaskDelay(9); // delay it down to 10 fps
      }
   }
}

See?  Nothing fancy at all, just a normal blitter with an unrolled loop.
The 'GSDT' resources are just 4bpp PICT resources, renamed to prevent
PalmRez from converting them to a different bit depth.  The 87*4 byte
offset just skips the PICT header to get right to the image data... a
non-demo version would have desktop software to strip out the excess
bytes, but I just used GraphicConverter on the Mac to batch-convert
the frames to PICT resource format for convenience.

It looks pretty cool, but there's no wizardry involved... just the
willingness to spend a lot of memory for a few seconds of wow.  Of
course, you have 90% of the processor time left to play with, so a
simple compression scheme is no doubt possible to implement to save
some space.

I'll be posting the demo app on daggerware.com as soon as I get back
from California if anyone wants to play with it.

- Edward Keyes
  [EMAIL PROTECTED]


Reply via email to