debugger

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

debugger

Post by Ghoti »

hi folks,

EDIT:

when i put this code into my project:

Code: Select all

	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
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

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?
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

fixed that also :) however still have a problem

if i set

Code: Select all

PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
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
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

the exception handler NEEDS kernel mode so
userland wont work
10011011 00101010 11010111 10001001 10111010
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

yes but when i give zero with function:

Code: Select all

PSP_MAIN_THREAD_ATTR(0);
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?

Code: Select all

// -----------------------------------------
//
// 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&#40;"Boxy 2", 0x1000, 1, 1&#41;;
	//PSP_MAIN_THREAD_ATTR&#40;0&#41;;
	//PSP_MODULE_INFO&#40;"Boxy 2", 0x0000, 1, 1&#41;;
	PSP_MAIN_THREAD_ATTR&#40;PSP_THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;
	

// -----------------------------------------
//
// Declerations
//
// -----------------------------------------

	int tmp1;
	int tmp2;
	int tmp3;
	char sBuffer&#91;100&#93;;

	void MyExceptionHandler&#40;PspDebugRegBlock * regs&#41;;


// -----------------------------------------
//
// Exit callback function
//
// -----------------------------------------

	int exit_callback&#40;int arg1, int arg2, void *common&#41; &#123;
			  sceKernelExitGame&#40;&#41;;
			  return 0;
	&#125;


// -----------------------------------------
//
// Callback thread function
//
// -----------------------------------------

	int CallbackThread&#40;SceSize args, void *argp&#41; &#123;
			  int cbid;

			  cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
			  sceKernelRegisterExitCallback&#40;cbid&#41;;

			  sceKernelSleepThreadCB&#40;&#41;;

			  return 0;
	&#125;

// -----------------------------------------
//
// Sets up the callback thread and returns its thread id function
//
// -----------------------------------------

	int SetupCallbacks&#40;void&#41; &#123;
			  int thid = 0;

			  thid = sceKernelCreateThread&#40;"update_thread", CallbackThread, 0x11, 0xFA0, 0, 0&#41;;   //als er foutenzijn dan  kan het hieraanliggen
			  if&#40;thid >= 0&#41; &#123;
						sceKernelStartThread&#40;thid, 0, 0&#41;;
			  &#125;

			  return thid;
	&#125; 




// -----------------------------------------
//
// Main function
//
// Loads stuff and call the menu
//
// -----------------------------------------

	int main &#40;void&#41;
	&#123;

		// set the speed better
		scePowerSetClockFrequency&#40;333, 333, 166&#41;;

		// init the debug screen functions
		pspDebugScreenInit&#40;&#41;;

		// setup the callbacks
		SetupCallbacks&#40;&#41;;

		//debug error handler
		//pspDebugInstallErrorHandler&#40;MyExceptionHandler&#41;;
		//pspDebugInstallErrorHandler&#40;NULL&#41;;
		
		//init graphics
		initGraphics&#40;&#41;;

		// init the timers
		InitTimer&#40;&#41;;

		// init the musicplayer
		MusicPlayerInit&#40;&#41;;

		// run the game
		GameMainMenu&#40;&#41;;

		
		return 0;
	&#125;

// -----------------------------------------
//
// MyExceptionHandler function
//
// used for debugging
//
// -----------------------------------------
	void MyExceptionHandler&#40;PspDebugRegBlock * regs&#41;
	&#123;
		// I always felt BSODs were more interesting that white on black
		pspDebugScreenSetBackColor&#40;0x00FF0000&#41;;
		pspDebugScreenSetTextColor&#40;0xFFFFFFFF&#41;;
		//pspDebugScreenClear&#40;&#41;;

		pspDebugScreenSetXY&#40;0, 17&#41;;
		pspDebugScreenPrintf&#40;"\nI regret to inform you your psp has just crashed\n"&#41;;
		pspDebugScreenPrintf&#40;"Exception Details&#58;\n"&#41;;
		pspDebugDumpException&#40;regs&#41;;
		pspDebugScreenSetBackColor&#40;0x00000000&#41;;
	&#125;



Post Reply