SceUID moduid;
int start;
unsigned int y;
pspSdkInstallNoDeviceCheckPatch();
pspSdkInstallNoPlainModuleCheckPatch();
y = sceUmdCheckMedium(0);
if (!(y)) sceUmdWaitDriveStat(UMD_WAITFORDISC);
sceUmdActivate(1,"disc0:");
sceUmdWaitDriveStat(UMD_WAITFORINIT);
if ((moduid = sceKernelLoadModule("disc0:/PSP_GAME/SYSDIR/BOOT.BIN", 0, 1)) & 0x80000000)
{
printf("Error %08X loading module.\n", moduid);
}
if ((start = sceKernelStartModule(moduid, 0, NULL, NULL, NULL)) & 0x80000000)
{
printf("Error %08X starting module.\n", start);
I get the 800200d9 error which I think means that the psp couldn't allocate enough memory or something like that. My app runs in kernel mode if that makes any difference. Does anyone know what to do?
Thanks in Advance!
btw. I can't use sceKernelLoadExec() since that one unloads my app totaly. I want my app to still run in the background like mphgl does.
Ghozt wrote:
I get the 800200d9 error which I think means that the psp couldn't allocate enough memory or something like that. My app runs in kernel mode if that makes any difference. Does anyone know what to do?
.
moonlight wrote:
PSP_HEAP_SIZE_KB(0); may help it.
By adding PSP_HEAP_SIZE_KB(0); causes my app to freeze when I try to start it ( the first thing in my main function is loading and displaying a .png picture from the ms if that makes any difference)
btw. Weltall: I told you my app runs in kernel mode.
moonlight wrote:
PSP_HEAP_SIZE_KB(0); may help it.
By adding PSP_HEAP_SIZE_KB(0); causes my app to freeze when I try to start it ( the first thing in my main function is loading and displaying a .png picture from the ms if that makes any difference)
yes, that makes a lot of difference, as libpng use allocation functions that need heap memory.
moonlight wrote:yes, that makes a lot of difference, as libpng use allocation functions that need heap memory.
Is there any other way I can do it?? ( I have thought of doing it from a prx but I don't think I can load prx since the load/start module doesn't work because of libpng. )
So there is no way to use load/startModule and using libpng?? Is there any other similar function that you can use too boot a UMD without unloading your own program??
PSP_HEAP_SIZE_KB(0);
will not work you need some heap :P
/* Define the main thread's heap size (optional) */
/**
* ELF:
* Elf default is (Max) available memory block
*
* PRX:
* when making a prx, user mode prx default
* heap size is (64K) if youd like to use more
* change below
*/
PSP_HEAP_SIZE_KB(size_kb);
recommended size for kernel module:
PSP_HEAP_SIZE_KB(32);
The issue here is that if you're planning on making a loader that runs games from UMD, those games will never return. So both programs will be loaded and running at the same time after you start it.
If you're displaying an image, you cant afford to 'steal' that memory from the game you're trying to run, so you need to use sceKernelCreateFPL / DeleteFPL, etc. Create a memory pool big enough for your bitmaps so that you NEVER call new/malloc, and then when you run your UMD game, you have to delete the memory pool.
Since other libraries (libpng) may use new/malloc (and probably do) you pretty much cant use them unless you override new/delete & malloc/free. not fun!
I also think its a little strange that you're trying to run a game from UMD... as theres no point to this.... you can run the game directly from the PSP OS!!!
CyberBill wrote:The issue here is that if you're planning on making a loader that runs games from UMD, those games will never return. So both programs will be loaded and running at the same time after you start it.
If you're displaying an image, you cant afford to 'steal' that memory from the game you're trying to run, so you need to use sceKernelCreateFPL / DeleteFPL, etc. Create a memory pool big enough for your bitmaps so that you NEVER call new/malloc, and then when you run your UMD game, you have to delete the memory pool.
Since other libraries (libpng) may use new/malloc (and probably do) you pretty much cant use them unless you override new/delete & malloc/free. not fun!
I also think its a little strange that you're trying to run a game from UMD... as theres no point to this.... you can run the game directly from the PSP OS!!!
If I just wanted to run the game I could have used sceKenelLoadExec() but since that unloads my program I can't do anything special ( like haveing the usb activated while playing etc.)