However the only thing I get is a black screen. Can anyone spot any obvious mistakes:
Code: Select all
#include <pspkernel.h>
#include <pspdisplay.h>
PSP_MODULE_INFO("Gfx Test", 0, 1, 1);
unsigned int frameBuf[512*272];
/* 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 main()
{
int x,y;
SetupCallbacks();
for(x=0;x<480;x++)
{
for(y=0;y<272;y++)
{
frameBuf[y*512+x]=(x&255)+((y&255)*256);
}
}
sceDisplaySetMode(0,480,272);
sceDisplaySetFrameBuf((char*)frameBuf, 512, PSP_DISPLAY_PIXEL_FORMAT_8888, PSP_DISPLAY_SETBUF_IMMEDIATE);
sceKernelSleepThread();
return 0;
}