Hey guys,
This is my first post at these forums. Yesterday I moved from LUA to C and am in need of help.
My code compiles successfully, when I load it up on my PSP I just get a blank screen. My PSP doesnt crash as I can still return to the eloader. Here is my code:
int x = 0;
int y = 0;
sceDisplayWaitVblankStart ();
while (x < 480) {
while (y < 272) {
blitAlphaImageToScreen(0, 0, 480, 272, menubg, x, y);
}
flipScreen();
}
this is a pointer you can't assign to a pointer some data, plus you try to sprintf into the space pointed by buffer which wasn't even alloched so you must change this in this way:
I know it's not what you want to hear, but you really really really should learn C on a PC compiler with a real time debugger before trying on the PSP.
You will save yourself many frustrating late nights. It cannot be understated.
The original code did have storage allocated for buffer because it was initialised, unfortunately, you are not supposed to write to constant strings in C.
ie.
while (x < 480) {
while (y < 272) {
blitAlphaImageToScreen(0, 0, 480, 272, menubg, x, y);
}
flipScreen();
}
he has two while loops and he blits the image to the screen which is 480x272 for an infinite amount of times and if the inside loop accually completed, it would flip the screen each time the outside loop went through.
Not too sure as to why he would want to blit the same image 272*480 times though. Prolly just a noob mistake.
And also, welcome to C/C++. Please try to enjoy yourself