PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

will this blitting routine work on an ipaq?

Code:
void dsp_render_frame(UINT16 *image,int start,int endw) {
register unsigned short *dst;
register int x,y;
dst = ScreenReal;
for (y = 0; y <240; y++) {
for (x = 0; x < 320; x++)
{
*dst=*image;
dst++;
image++;
}
}
}


I don't have one to test it on. It copies a 320x240 source over in landscape.
If address dst+319 corresponds to pixel (319, 0), then address dst+320 does not necessarily correspond to (0, 1). You must change dst to point to the next row by adding an x pitch to your original address ScreenReal.

You can use *dst=*image if image has the same orientation as dst. I assume it does.

I haven't looked at the specs of ipaq but in some cases you will want to use dst-- instead.
it actually worked
If ScreenReal is the display buffer as provided by GAPI, then you are not drawing to the first line (you should see a single vertical line on the left side of the display in portrait), and you are writing 640 bytes past the end of the display buffer, which I'm surprised does not cause an exception.

Dan East
On the 3800, don't you have to run backwards with dst in this example to access the actual vram, while running forwards accesses the slower vbuffer?
the 38xx has a different routine which decreases the value. If someone could try the the ipaq version (not the 38xx version) and tell me if it works, that would be great. I have a report from sponge that it was working on his ipaq (not sure what model), and from michael that it worked on his 38xx series ipaq.