okay, i have tested, it show all images...
but, now, i have a new problem...
hire is my code...
i don't know, what is wrong?
after
the psp LCD is black, and it goes to the XMB...
Code:
Code: Select all
#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspumd.h>
#include <string.h>
#include <stdlib.h>
#include "wait.h"
#include "graphics.h"
#include "framebuffer.h"
#include <png.h>
PSP_MODULE_INFO("lol", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
#define printf pspDebugScreenPrintf
void dump_threadstatus(void);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread,
0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int x = 0;
int y = 0;
int ox;
int oy;
int i;
void splash(void) {
Image* splash;
splash = loadImage("images/splash.png");
if (!splash)
{
printf(" Couldn't load splash!\n");
sceKernelExitGame();
}
sceDisplayWaitVblankStart();
blitImageToScreen(0 ,0 ,480 , 272, splash, 0, 0);
flipScreen();
wait(240);
}
void load(void)
{
Image* load[22];
load[0] = loadImage("images/load/1.png");
load[1] = loadImage("images/load/2.png");
load[2] = loadImage("images/load/3.png");
load[3] = loadImage("images/load/4.png");
load[4] = loadImage("images/load/5.png");
load[5] = loadImage("images/load/6.png");
load[6] = loadImage("images/load/7.png");
load[7] = loadImage("images/load/8.png");
load[8] = loadImage("images/load/9.png");
load[9] = loadImage("images/load/10.png");
load[10] = loadImage("images/load/11.png");
load[11] = loadImage("images/load/12.png");
load[12] = loadImage("images/load/13.png");
load[13] = loadImage("images/load/14.png");
load[14] = loadImage("images/load/15.png");
load[15] = loadImage("images/load/16.png");
load[16] = loadImage("images/load/17.png");
load[17] = loadImage("images/load/18.png");
load[18] = loadImage("images/load/19.png");
load[19] = loadImage("images/load/20.png");
load[20] = loadImage("images/load/21.png");
load[21] = loadImage("images/load/22.png");
for(i=0;i<22;i++)
{
if (!load[i])
{
printf(" Couldn't load: load!\n");
sceKernelExitGame();
}
}
for(i=0;i<22;i++)
{
blitImageToScreen(0 ,0 ,479 , 271, load[i], 0, 0);
sceDisplayWaitVblankStart();
flipScreen();
sceKernelDelayThread(1*1000*1000);
}
}
void border(void)
{
Image* border;
border = loadImage("images/border.png");
if (!border)
{
printf(" Couldn't load border.png!\n");
sceKernelExitGame();
}
sceDisplayWaitVblankStart();
blitImageToScreen(0 ,0 ,480 , 272, border, 0, 0);
flipScreen();
}
int main(void)
{
SceCtrlData pad;
Image* cursor;
pspDebugScreenInit();
pspDebugScreenSetBackColor(0xFFFFFFFF);
pspDebugScreenSetTextColor(0);
SetupCallbacks();
initGraphics();
sceCtrlSetSamplingMode(1);
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
cursor = loadImage("images/cursor.png");
if (!cursor)
{
printf(" Couldn't load cursor.png!\n");
sceKernelExitGame();
}
splash();
load();
Image* lines[20];
lines[0] = loadImage("images/lines/1.png");
lines[1] = loadImage("images/lines/2.png");
lines[2] = loadImage("images/lines/3.png");
lines[3] = loadImage("images/lines/4.png");
lines[4] = loadImage("images/lines/5.png");
lines[5] = loadImage("images/lines/6.png");
lines[6] = loadImage("images/lines/7.png");
lines[7] = loadImage("images/lines/8.png");
lines[8] = loadImage("images/lines/9.png");
lines[9] = loadImage("images/lines/10.png");
lines[10] = loadImage("images/lines/11.png");
lines[11] = loadImage("images/lines/12.png");
lines[12] = loadImage("images/lines/13.png");
lines[13] = loadImage("images/lines/14.png");
lines[14] = loadImage("images/lines/15.png");
lines[15] = loadImage("images/lines/16.png");
lines[16] = loadImage("images/lines/17.png");
lines[17] = loadImage("images/lines/18.png");
lines[18] = loadImage("images/lines/19.png");
lines[19] = loadImage("images/lines/20.png");
for(i=0;i<20;i++)
{
if (!lines[i])
{
printf(" Couldn't load: lines[i]!\n");
sceKernelExitGame();
}
}
//border();
blitAlphaImageToScreen(0 ,0 , 10, 10, cursor, x, y);
sceDisplayWaitVblankStart();
flipScreen();
for(i=0;i<20;i++)
{
blitImageToScreen(0 ,0 ,479 , 271, lines[i], 0, 0);
sceDisplayWaitVblankStart();
flipScreen();
sceKernelDelayThread(1*1000*1000);
while(1)
{
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CIRCLE) sceKernelExitGame();
if (pad.Lx > 150) x++;
if (pad.Lx < 110) x--;
if (pad.Ly > 150) y++;
if (pad.Ly < 110) y--;
if (x < 0) x = 0;
else if (x > 479) x = 479;
if (y < 0) y = 0;
else if (y > 271) y = 271;
if(x != ox || y != oy)
{
blitImageToScreen(0 ,0 , 480, 272, lines[i], 0, 0);
blitAlphaImageToScreen(0 ,0 , 10, 10, cursor, x, y);
sceDisplayWaitVblankStart();
flipScreen();
}
ox = x;
oy = y;
}
if(i==20) i=0;
}
return 0;
}
i dont know, how i must load the animated background...
i have tried this....but i think it dont work...
but so far, i didn't come ^^
because after "splash" the psp goto the XMB...