PocketMatrix forums

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

4ms / 17ms Blits?

It's been about about a year or so since I programmed for Pocket PC, and I have the feeling some things may have changed - I'm reading stuff about problems with the MediaQ chip etc?

Anyway, when I programmed the last game, I managed to get fairly consistant blits, if I recall correctly. What I did was I arranged the offscreen buffer to be the same orientation as the screen itself, so I was always copying memory which was in the same cache lines. I had a special hack for the 3800's screen address too.

e.g. on the iPAQ I copied vertical lines at 4 bytes at a time, on the Jornada I copied horizontal lines at 4 bytes at a time. I think it did it in about 4ms on both, leaving about 12ms to render the actual game (to run at 60fps)

(thing is, if Video memory isn't cached, I'm not sure why that mattered... - does it?)

Do you have any advice for offscreen buffers which will work well on newer devices?

What are typical blit/screen flip times these days, and what are the pitfalls?
Kzinti · 09 Dec 2003, 23:17 UTC — 4ms / 17ms Blits?
Dave H wrote:
Anyway, when I programmed the last game, I managed to get fairly consistant blits, if I recall correctly. What I did was I arranged the offscreen buffer to be the same orientation as the screen itself, so I was always copying memory which was in the same cache lines. I had a special hack for the 3800's screen address too.


That is good for the final blit but isn't for image loading and direct pixel manipulations.

Dave H wrote:
(thing is, if Video memory isn't cached, I'm not sure why that mattered... - does it?)


Indeed. It only matters for your offscreen buffer (assuming you allocate it in cacheable RAM).

Dave H wrote:
Do you have any advice for offscreen buffers which will work well on newer devices?


Take a look at PocketHAL: http://pockethal.droneship.com

Dave H wrote:
What are typical blit/screen flip times these days, and what are the pitfalls?


Look at the bottom of this page: http://pockethal.droneship.com/features.html
Dave H · 09 Dec 2003, 23:42 UTC — 4ms / 17ms Blits?
Thierry":20j5glji]

Heh - was just looking at that very page!

About that table, especially the Toshiba E-740 figure... I think I tested my code on a E740 and there didn't seem to be any overhead... Are you sure about the 14.3ms figure? I guess maybe if the game was about 14.3+8ms -> 45 fps maybe I just never spotted it was running slower.

How on earth do you managed to get a flip time of 2.1ms on a iPAQ 3600/3700?
That's brilliant!
My understanding was that 4.7ms was an absolute limit, even with ldmia stmia routines?
Is it some kind of Physical memory direct access or something?
Or have you found a shady DMA function ;)

*Update* - Is this the key?
0x80000000..0x9FFFFFFF - all physical memory, cached
0xA0000000..0xBFFFFFFF - all physical memory, uncached

Do you just subtract 0x20000000 from the GAPI memory address (i.e. to access uncached memory?) I guess that could well be the reason why I saw an increase in matching the horizontal and vertical alignment (i.e. if the *destination* was loading cache lines even though it didn't need to?)
I am directly accessing the StrongARM video controller for faster performances. I am not a liberty of dicussing exactly how.

I can give you one hint: ldmia/stmia is not the fastest way to do the backbuffer blit.