PocketMatrix forums

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

Not a newbie

ApplewoodDev · 21 Jan 2002, 16:33 UTC
Hi Guys.

I've just signed up to this board, but will hopefully be making a lot of posts in the future. I'm a games developer of 15 years standing with a handful of stuff immininent for PPC.

I hate to start off with a request, but I'm wondering if anyone has written an arm assembler routine to translate a linear 320x240x16 software buffer onto the screen in a landscape format (both orientations).

I've had a stab at this, but it's no faster than my C implementation, as it writes a pixel at a time. If someone has code to do this job two pixels at a time, you will be in my gratitude forever.... :)
Hey and welcome to PocketMatrix!
What happened to Amourgeddon?
ApplewoodDev · 21 Jan 2002, 17:18 UTC
Hi man, and thanks :)

Armourgeddon is complete and ready for release - it's down to the publisher now, and I understand things are all set to make a big splash.

It's been renamed now, but I'm not sure if I'm supposed to let it out, so I guess i oughtn't for the time being. Sorry for being all mysterious ! :D
I've done a lot of work in this area, but first let me make sure I understand what you want.

As I read your post, you want to copy from 320x240 to landscape (which is also 320x240)? Wouldn't that just be a call to memcpy?

Most people want to perform a copy/rotation operation from a 240x320 oriented back buffer in system memory to a landscape oriented 320x240 display surface. Is this what you want?
ApplewoodDev · 21 Jan 2002, 18:41 UTC
It would indeed be a straight memcopy, if the target wasn't the GAPI pointer with all its x/y pitch rules.

My engine supports all 3 orientations, and makes the software backbuffer of the correct shape and size to suit,to keep everything logical.

Doing this has a few benefits, the chief one being that the only rotation anywhere in the code is at this final stage.

So, to emphasise, my landscape game is written in code that writes to a 320x240 oriented back buffer, but I need to get this onto the GAPI display either as-is or flipped for lefties.

Hope this helps...
Three different native orientations. Two different game orientations. That's six different blit routines. (on the iPaqs, one of those can be a simple memcpy)

If your assembly version is about the same speed as your C code, and both only move a pixel at a time through the loop, then that's either some pretty snazzy C code, or pretty average assembly language.

Have you tried implementing a two pixel version in C? The routines I wrote to do something similar moved 4 pixels at a time. Two DWORD reads, some bit shifting, then two DWORD writes.

I've found that tearing can become an issue unless your routine writes in the same direction as the display controller accesses display memory. I've also found that reading from system memory sequentially results in the fastest rotation/copy performance, however the tearing is really visible when doing it this way.
ApplewoodDev · 22 Jan 2002, 13:53 UTC
hehe. This is correct. I need two landscape orientations times two versions (h3600 and h3800)hence I'm asking here in case someone has already found the time to do it properly.

I'm just too busy at the mo, but I will do it one day if someone can't beat me to it. I could probably squeeze it in in less time if I wasn't such a newb to arm programming.

I would consider paying a consideration for the work too, as this is for commercial useage.

I've not tried to write a 2-pixel version in C either as yet, but that would be a great start to do an asm conversion off I guess.

As I understand it, tearing is an issue that can't be fixed so am happy to ignore. If you don't read through the source buffer in a reasonably linear fashion (to keep cache coherency) the game will drop to a crawl instead, aiui.

What are your thoughts on this ?