A.D.A. Amiga Demoscene Archive

        Welcome guest!




log in with SceneID


Demos Amiga Demoscene Archive Forum / Coding / Memory copy algorithm comments please...


Author Message
#1 - Posted: 14 Jan 2010 00:22 - Edited
Reply Quote

In this game-port that I'm working on there is some code that copies dirty rectangles to a chunky buffer and sometimes to update the entire screen (it's not my code BTW). Can anyone give me a faster assembly based version or any general speed-up comments (for plain C), it's for 030+ and AGA only 320x200 8 bit display.

static byte *backBuffer;
backBuffer = (byte*)AllocMem(64000, MEMF_FAST);

void updateBackBuffer(byte *src, int x, int y, int w, int h) {

byte *dst;

// Addresse du pixel en dst
dst = (byte*)backBuffer + y*320 + x;

do {
CopyMem(src, dst, w);
dst += 320;
src += 320;
} while (--h);
#2 - Posted: 14 Jan 2010 23:58
Reply Quote
Just copy larger chunks of data at once?
#3 - Posted: 15 Jan 2010 04:10 - Edited
Reply Quote

Can you give me an example please?

Also, would an assembler version give me a good performance boost (I'm using a very old version of gcc that came with StormC V4).



  Please log in to comment





A.D.A. Amiga Demoscene Archive, Version 3.0