PocketMatrix forums

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

Slightly OT: Fastest rotated blit to the screen

Please forgive the slightly OT. I tried on the regular discussion board and some kind soul directed me here.

I'm working on some blitting code from regular memory to the screen display that rotates on the fly. (This is a full screen blit)

This is the basic code after variable initialization...
Code:

while (y--)
{
pSrc = pSrcTmp;
pDst = pDstTmp;
x = iWidth;
while (x--)
{
*pDst = *pSrc++;
pDst -= destYPitch;
}

pDstTmp += destXPitch;
pSrcTmp -= rowOffset;
}


This routine takes about 10 msec to copy from regular memory to the full 240x320 non-cached display memory. Has anyone got a significantly faster routine then this that they wouldn't mind sharing. A regular non-rotated blit takes about 5 msec.

My experiments have shown that writing 32-bits at a time is much faster then writing 16-bits. I've been thinking of modifying this routine to write 32-bits at a time by have two source pointers from neighboring scanlines. Anyone tried this with success?

Thanks for any info.