Johan, to clarify:
If I have an offscreen bitmap the same dimensions as the display (and same bpp) then it takes 3ms to copy to the screen buffer using VirtualCopy, VirtualAlloc. However, I also tested with a tile based map. The map was 24x24 tiles, with each tile being 32x32 pixels. This map was then scrolled around randomly - ie. scroll to an edge then reverse direction etc. So to draw approx 75 tiles (with clipping as scrolling was by single pixel) into the offscreen bitmap, and then copy the bitmap to the screen it was taking between 4 and 5 ms. This seems to indicate that copy data to the frame buffer is considerable slower than working in "normal" ram. So the lesson I got from this is that everything should be built in a memory bitmap the same dimensions as the screen and then one simple memcpy to blit the whole lot. Also, my code for copying the tiles used memcpy per line as you mentioned.
I don't think there would be any difference from using the address gapi returns compared to VirtualAlloc/Copy. Wouldn't be surprised if gapi does the same thing.
From my understanding I think any address at 0x80000000 is always cached (or buffered, but not sure of the difference), whereas the range 0xa0000000 is not supposed to be, but not sure if that applies to pocket pcs, as I haven't got it working on that range. The more I am finding out the more I realise how little I know about these things. Are there any electonic engineers out there who can help?
Datasheet on the MQ1178:
- 2 window buffers
- 256kb sram
- usb (not sure why it would have it)
- absolute minimum time to transfer 240x320x2 bytes of data through it's bus is 0.3ms - there's a goal to work towards
- the interesting thing is it supports hardware accelarated rectangular source-copy block transfers, raster operations, line draw, pattern and area fill, clipping, and transparency
I haven't looked up any others yet, but I bet that is how Thierry is getting better than "normal" speeds - probably taking advantage of the hardware acceleration.
Can anyone explain the whole frame buffer, display memory, virtual mapping, etc etc architecture? as I'm really starting to get confused now. If I could understand what all of the terms referred to exactly it would probably really accelerate my learning of all of this stuff.