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 

error 0x80020148 when starting homebrew

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



Joined: 05 Jul 2008
Posts: 229

PostPosted: Wed Sep 10, 2008 5:26 am    Post subject: error 0x80020148 when starting homebrew Reply with quote

I try to port a Nintendo DS emulator to the psp it compile now without error
generating a EBOOT.BPB but when starting the emulator i've got this
0x80020148 ----> ,unsupportedPRXtype
My psp is a slim running CF4.01M33-2

here is my makefile
Code:

TARGET = pspds
OBJS = armcpu.o fs-linux.o opengl_collector_3Demu.o arm_instructions.o render3D.o bios.o gl_vertex.o ROMReader.o cflash.o GPU.o saves.o cp15.o matrix.o sndsdl.o ctrlssdl.o mc.o SPU.o debug.o MMU.o thumb_instructions.o Disassembler.o NDSSystem.o wifi.o FIFO.o main.o psp_main.o

PSPBIN = $(shell psp-config --psp-prefix)/bin
SDL_CONFIG = $(PSPBIN)/sdl-config
DEFAULT_CFLAGS = $(shell $(SDL_CONFIG) --cflags)
INCDIR =
CFLAGS = -O2 -G0 -Wall $(DEFAULT_CFLAGS)
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

BUILD_PRX = 1
PSP_FW_VERSION = 401
PSP_LARGE_MEMORY = 1
DS_EMULATOR_VERSION=1.0.0

LIBDIR =
LIBS +=  -lpspwlan -lpsppower -lSDL_image -lSDL -lpng -ljpeg -lpspaudio -lpspgu -lpsphprm -lz -lm -lstdc++ -lGL -lpspirkeyb -lpsppower -lpspvfpu -lpsprtc
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = DS-EMULATOR-v$(DS_EMULATOR_VERSION)
PSP_EBOOT_ICON= ds-emulator.png
PSP_EBOOT_PIC1 = ds-emulator-pic.png

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Back to top
View user's profile Send private message Send e-mail MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Sep 10, 2008 7:42 am    Post subject: Reply with quote

Make sure you main file has the module info/et all set for a user-mode prx, like this

Code:
PSP_MODULE_INFO("MyProgram", 0, PSP_VERS, PSP_REVS);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
PSP_HEAP_SIZE_KB(-256);
Back to top
View user's profile Send private message AIM Address
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Wed Sep 10, 2008 4:37 pm    Post subject: Reply with quote

it has
Code:



#include <stdio.h>
#include <zlib.h>
#include "SDL.h"

#include <pspkernel.h>
#include <pspdebug.h>
#include <pspsdk.h>
#include <pspctrl.h>
#include <pspthreadman.h>

#include <pspwlan.h>
#include <pspkernel.h>
#include <psppower.h>

#include <stdlib.h>
#include <stdio.h>



extern int SDL_main(int argc, char *argv[]);



PSP_MODULE_INFO("PSPNDS", PSP_MODULE_USER, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER|PSP_THREAD_ATTR_VFPU);
PSP_HEAP_SIZE_KB(-256);
;

int sdl_psp_exit_callback(int arg1, int arg2, void *common)
{
  sceKernelExitGame();
  return 0;
}

int sdl_psp_callback_thread(SceSize args, void *argp)
{
  int cbid;
  cbid = sceKernelCreateCallback("Exit Callback",
               sdl_psp_exit_callback, NULL);
  sceKernelRegisterExitCallback(cbid);

  sceKernelSleepThreadCB();
  return 0;
}

int sdl_psp_setup_callbacks(void)
{
  int thid = 0;

  sceCtrlSetSamplingCycle(0);
  sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);

  thid = sceKernelCreateThread("update_thread",
             sdl_psp_callback_thread, 0x11, 0xFA0, 0, 0);
  if(thid >= 0)
    sceKernelStartThread(thid, 0, 0);
  return thid;
}



extern void _fini(void);

#ifdef main
#undef main
#endif

void
user_thread(SceSize argss, void *argp)
{
  char *ptr[] = { "emul","ms0:/PSP/GAME/DS/TEST.NDS",NULL };
  int args = 2;

  sdl_psp_setup_callbacks();
 
pspDebugScreenPrintf("\nBefore SDL !\n");
 
// SDL_main(args, ptr);
}

int
main(int argc, char *argv[])
{
  int user_thid;

  pspDebugScreenInit();



  /* Functions registered with atexit() are called in reverse order, so make
     sure that we register sceKernelExitGame() first, so that it's called last. */
  atexit(sceKernelExitGame);
  /* Make sure that _fini() is called before returning to the OS. */
  atexit(_fini);


  pspDebugScreenPrintf("\nLaunch main thread !\n");

  sceKernelDelayThread(1000000);

  user_thid = sceKernelCreateThread( "user_thread",
     (SceKernelThreadEntry)user_thread, 0x11, 256*1024, PSP_THREAD_ATTR_USER, 0 );
  if(user_thid >= 0) {
    sceKernelStartThread(user_thid, 0, 0);
    sceKernelWaitThreadEnd(user_thid, NULL);
  }

  /* Delay 2.5 seconds before returning to the OS. */
  sceKernelDelayThread(2500000);

  return 0;
}
Back to top
View user's profile Send private message Send e-mail MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Sep 11, 2008 6:00 am    Post subject: Reply with quote

You don't need to create a user thread - you ARE a user thread. Remove that code. That code was clearly from a project that used to run in kernel mode, so I'd guess the error is due to some other kernel-mode function still in the code. One common one you saw in a lot of older apps set the general exception vector to trap crashes. That doesn't work in 3.xx/4.xx without a special kernel-mode prx. If you look at the dosbox thread, you'll find such a prx if you want exception trapping in your app.
Back to top
View user's profile Send private message AIM Address
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