PocketMatrix forums

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

Jornada 525 GAPI workaround

How does one get GAPI to work properly on a J525? When I try to use it, what seems to be a one pixel-wide strip of colors appears in the left side of the screen, and no other part of the screen seems to even be written to.
Are you using correct x pixel pitch?
Hi,

It is not a very nice display to work with as it is only 256 colors, however, the following code may be of some use to you.
Code:


unsigned char* dst = (unsigned char*)pvDisplay;
unsigned short* src = GetBackBuffer();
for ( int y = 0; y < 320; y++ )
{
for ( int x = 0; x < 240; x++ )
{
unsigned short color = *src;
int r = (color & (3 << 14)) >> 9;
int g = (color & (7 << 8)) >> 5;
int b = (color & (3 << 3)) >> 3;
*dst = r + g + b;
dst++;
src++;
}
}


Where the function GetBackBuffer() returns a pointer to your back buffer and pvDisplay is

unsigned short* pvDisplay=(unsigned short*)GXBeginDraw();

I hope this helps
Bad