void MyExceptionHandler(PspDebugRegBlock * regs)
{
// I always felt BSODs were more interesting that white on black
pspDebugScreenSetBackColor(0x00FF0000);
pspDebugScreenSetTextColor(0xFFFFFFFF);
//pspDebugScreenClear();
pspDebugScreenSetXY(0, 17);
pspDebugScreenPrintf("\nI regret to inform you your psp has just crashed\n");
pspDebugScreenPrintf("Exception Details:\n");
pspDebugDumpException(regs);
pspDebugScreenSetBackColor(0x00000000);
}
then for some reason my game won't start and i only get a blackscreen.
first i have the callbacks, then the main function and as last this function.
i don't do anything with this piece of code yet so i really don't get it
hmm the above code doesn't create a problem anymore, but the following does:
I have this debugger installed and now my controls don't seem to work anymore i can only press 1 button once and after that it doesn't work anymore. It did however before i put in the debuggercode from above. what can i do about it?
then my errorhandlerinstaller halts.
if i give an 0 instead of the PSP_THREAD_ATTR_USER then it doesn't crash but then i can only press a button only once :S
then it goes into my gamescreen but every button can only be pressed once... it just can't handle more input, when i press home my cross button doesn't work either because i have allready pressed it once it is very strange here is the total code maybe i have a wrong setting for it?
// -----------------------------------------
//
// This is the main file of the Boxy II game
//
// The game is a clone of lumines.
//
// -----------------------------------------
// -----------------------------------------
//
// INCLUDES
//
// -----------------------------------------
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <debugger.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include <stdlib.h>
#include <psputils.h>
#include <dirent.h>
#include "graphics.h"
#include <psprtc.h>
#include <time.h>
#include <ghtTimeFunctions.h>
#include <Game.h>
#include <psppower.h>
#include <ghtmusic.h>
//#include <pspmodulemgr.h>
// MODULE INITIALISATION
PSP_MODULE_INFO("Boxy 2", 0x1000, 1, 1);
//PSP_MAIN_THREAD_ATTR(0);
//PSP_MODULE_INFO("Boxy 2", 0x0000, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER | THREAD_ATTR_VFPU);
// -----------------------------------------
//
// Declerations
//
// -----------------------------------------
int tmp1;
int tmp2;
int tmp3;
char sBuffer[100];
void MyExceptionHandler(PspDebugRegBlock * regs);
// -----------------------------------------
//
// Exit callback function
//
// -----------------------------------------
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
// -----------------------------------------
//
// Callback thread function
//
// -----------------------------------------
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 function
//
// -----------------------------------------
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); //als er foutenzijn dan kan het hieraanliggen
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
// -----------------------------------------
//
// Main function
//
// Loads stuff and call the menu
//
// -----------------------------------------
int main (void)
{
// set the speed better
scePowerSetClockFrequency(333, 333, 166);
// init the debug screen functions
pspDebugScreenInit();
// setup the callbacks
SetupCallbacks();
//debug error handler
//pspDebugInstallErrorHandler(MyExceptionHandler);
//pspDebugInstallErrorHandler(NULL);
//init graphics
initGraphics();
// init the timers
InitTimer();
// init the musicplayer
MusicPlayerInit();
// run the game
GameMainMenu();
return 0;
}
// -----------------------------------------
//
// MyExceptionHandler function
//
// used for debugging
//
// -----------------------------------------
void MyExceptionHandler(PspDebugRegBlock * regs)
{
// I always felt BSODs were more interesting that white on black
pspDebugScreenSetBackColor(0x00FF0000);
pspDebugScreenSetTextColor(0xFFFFFFFF);
//pspDebugScreenClear();
pspDebugScreenSetXY(0, 17);
pspDebugScreenPrintf("\nI regret to inform you your psp has just crashed\n");
pspDebugScreenPrintf("Exception Details:\n");
pspDebugDumpException(regs);
pspDebugScreenSetBackColor(0x00000000);
}