Can't load PRX after unloading.

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

Moderators: cheriff, TyRaNiD

Post Reply
Maku
Posts: 2
Joined: Tue Jun 16, 2009 5:33 pm

Can't load PRX after unloading.

Post by Maku »

I'm working on small prx which will be started from XMB (by overriding a update_plugin.prx). Problem is that after I start it once (plugin prints menu over vsh)I can start it again even that I try to unload the module every time. To get menu showing again it I have to reboot the console, or start and close any game.

Source code:

Code: Select all

#include <pspkernel.h>
#include <pspctrl.h>
#include <stdio.h>
#include <stdlib.h>
#include <pspkerror.h>
 
 
PSP_MODULE_INFO&#40;"Shutdown", 0x800, 1, 0&#41;;
 
int main &#40;int argc, char **argv&#41; //&#40;int argc, char* argv&#91;&#93;&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;

	while&#40;0x80020143 == sceKernelSelfStopUnloadModule&#40;1, 0, NULL&#41;&#41;
	&#123;	
		pspDebugScreenSetXY&#40;1,1&#41;; 
		pspDebugScreenPrintf&#40;"%s", "busy!"&#41;;
		sceKernelDelayThread&#40;10000&#41;;
	&#125;

	return 0;
&#125;
Makefile:

Code: Select all

TARGET = update_plugin
OBJS = main.o

BUILD_PRX=1

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Add more debugging code. See if your module even starts the second time.

There are two functions:
sceKernelSelfStopUnloadModule and another similar one. IIRC one of them doesn't work.
Post Reply