PocketMatrix forums

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

My game isn't running on PPC's!

Ok, I wanted to test my game on a PPC, but it didn't work. It showed a message like: Some important files are missing or you don't have enough space. Got to settings->system->...

But the PPC had 23 mb program space and I'd copied both GX.dll and FMODCE.dll on the device. Because I can't remeber the functions name which returns the actual path, I've copied all files in the My Device folder. That works on the emulator, but not on the PPC. (All files like dll's and exe are compiled for the right processor)
simonjacobs · 27 Feb 2002, 14:15 UTC
If you want any help at all you might want to post the FULL error message you get.

I'm happy to try and help you, but I dont have any psychic powers so please describe the problem in a bit more detail :)
I have some more questions. Did you let eVC++ download the app to the PPC, or did you just do it yourself?

It is a possibility that you are using a DLL in emulation that is out of date on your PPC.

Also, provide Make/Model/OS/Chipset info
Thanx for your replies. I think I solved the problem:

short int PrecomputedRGBData[256][256][256];

If I delete this line, the game works.
1. Is it possible that there's an array limit (like 1024 KB)?
2. How could I faster convert RGB to the PPC format than discribed in the MS GAPI tutorial?
ehh, this array looks like 256*256*256*2 bytes.. ehhh, that's huge...32mb actually.. now how many PPCs could handle that?:)

well converting a 24bpp value to 16bpp value (that's what you need?) is pretty simple and it was covered on those forums few times already. Please look around previous post here or in phantom;s forum and you will find it.

Hope that's what you need.
Ohhpps... I calculated 8 megs, 32 is huge...

I searched around in the forums but I didn't find what i need. What I'm doing is this:

Code:

for (int t1=0; t1<256; t1++)
{
for (int t2=0; t2<256; t2++)
{
for (int t3=0; t3<256; t3++)
{

if (g_gxdp.ffFormat | kfDirect565)
{ComputedRGB[t1][t2][t3] = (unsigned short)((t1 & 0xF8)<<8) | ((t2 & 0xFC)<<3) | ((t3 >>3));}
else if (g_gxdp.ffFormat | kfDirect555) {ComputedRGB[t1][t2][t3] = (unsigned short) ((t1 & 0xF8)<<7) | ((t2 & 0xF8)<<2) | (t3 >>3);}
}
}
}



and then plotting pixels:
Code:

*screenbuffer=ComputedRGB[red][green][blue];

That makes it much faster than computing in relatime.
There isn't a limit to array sizes, but there is a limit to the amount of memory available for the stack. Your app was running out of stack space. You can increase that in the link settings, but as MirekCz said, a 32 MB array is unreasonable. If something like that were coded for a PC (which can actually handle a 32 MB array), you would dynamically allocate that memory off the heap:
Code:

short *PrecomputedRGBData=malloc(256*256*256*sizeof(short));

//Do stuff with array

free(PrecomputedRGBData);

Dan East
daywalker why do you precompute the 24->16bpp code? I would guess it's pretty fast and precomputing it won't give you anything. You might want to migrate with your code to 16bpp for the whole game thru.(Under PPC)
If you're set on using a LUT, then here's a more reasonable method which would split the difference between memory requirement and performance.

Your LUT contains 256*256*256 elements, but only 32*64*32 unique values. So use the shifted RGB value as the index instead:

*screenbuffer=ComputedRGB[red>>3][green>>2][blue>>3];

Of course you would build the LUT appropriately. That technique would require a LUT of 131 kb, with 32*64*32 elements.

Dan East
Thanx, I was using the the precomputed data for my particle effects only, so it seems to be the best way to convert it at startup. My textures are automaticelly converted.