forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

debugger

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Mon Jun 05, 2006 7:51 pm    Post subject: debugger Reply with quote

hi folks,

EDIT:

when i put this code into my project:
Code:
   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
_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Mon Jun 05, 2006 9:30 pm    Post subject: Reply with quote

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?
_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Mon Jun 05, 2006 10:08 pm    Post subject: Reply with quote

fixed that also :) however still have a problem

if i set
Code:
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
_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Tue Jun 06, 2006 6:26 am    Post subject: Reply with quote

the exception handler NEEDS kernel mode so
userland wont work
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
Ghoti



Joined: 31 Dec 2005
Posts: 288

PostPosted: Tue Jun 06, 2006 6:39 am    Post subject: Reply with quote

yes but when i give zero with function:

Code:
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:
// -----------------------------------------
//
// 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);
   }




_________________
My PSP games:

Boxy II: http://www.ghoti.nl/boxyii.php
Elementals: http://www.ghoti.nl/Elementals.php
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group