Hiya Kalms,
I had a look at the code, I think the c2p_rect.s is close to what I need.
To give you some background, this is my currently my main render loop:
static byte *chunkyBackBuffer;
chunkyBackBuffer = (byte*)AllocMem(64000, MEMF_FAST);
void updateBackBuffer(byte *chunkyPixels, int x, int y, int w, int h) {
byte *dst;
dst = (byte*) chunkyBackBuffer + y*320 + x;
do {
CopyMemQuick(chunkyPixels, dst, w);
dst += 320;
chunkyPixels += 320;
} while (--h);
}
This method can be called multiple times for each update of the game 'world' eg. sometimes it is just the dirty rectangles and sometimes it is a full screen redraw (in which case it will only be called once obviously).
I then call this method once per render loop to shown the updated screen.
video_which = 1 - video_which; // render to the hidden bitmap
c2p1x1_cpu3blit1_queue_stub(chunkyBackBuffer, video_raster[video_which]);
A flip task is then generated by the C2P routine to show the updated screen.
This is not a very efficient way of doing things when only part of the screen gets updated and it seems to currently result in about 12fps on my 030 50mhz machine (320x200 8bit).
What I would like to do is something like this:
void updateBackBuffer(byte *chunkyPixels, int x, int y, int w, int h) {
if (gameEngine->fullScreenRedraw) {
c2p1x1_cpu3blit1_queue_stub(chunkyPixels, video_raster[video_which]);
} else {
C2p_Rect(chunkyPixels, video_raster[video_which], x, y, w, h);
}
}
And then manually trigger the screen flip task if I need to each loop.