Can anyone figure this out?
- Code:
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspiofilemgr.h>
#include <pspgu.h>
#include <png.h>
#include <stdlib.h>
#include <string.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include <psppower.h>
#include <psprtc.h>
extern "C"
{
#include "graphics.h"
}
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
PSP_MODULE_INFO("MailasProduct", 0, 1, 1);
/* 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;
}
//GLOBAL VARIABLES
int main(void) {
SetupCallbacks();
initGraphics();
SceCtrlData pad, lastpad;
sceCtrlReadBufferPositive(&lastpad, 1);
int MegaX = 27;
int MegaY = 136;
int ProtoX = 427;
int ProtoY = 136;
Image* MegaImage;
MegaImage = loadImage("./Images/M_Plat.png");
Image* ProtoImage;
ProtoImage = loadImage("./Images/P_Plat.png");
Image* PelletImage;
PelletImage = loadImage("./Images/pellet.png");
Image * Background;
Background = loadImage("./Images/Back.png");
while(1) {
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons != lastpad.Buttons) { // 1
lastpad = pad;
if(pad.Buttons & PSP_CTRL_UP)
{
MegaY-=3;
}
if(pad.Buttons & PSP_CTRL_DOWN)
{
MegaY+=3;
}
} // 2
blitAlphaImageToScreen(0, 0, 480, 272, Background, 0, 0);
blitAlphaImageToScreen(0, 0, 33, 26, MegaImage, MegaX, MegaY);
blitAlphaImageToScreen(0, 0, 24, 25, ProtoImage, ProtoX, ProtoY);
sceDisplayWaitVblankStart();
flipScreen();
}
}
Its all down and my cygwin batch file is able to compile it and everything but it just doesnt want to show on my PSP screen, just shows it as black. Anyone know how to fix?