Hello all,
I've been porting some of my openGL code with the PSPSDK, and it came to me that compile time/execution turnaround will be much quicker if I enable USB in my programs, then upload the new executable with a script after it is compiled and then maybe hook the booting of the executable to say the 'select' button.
I've integrated the USB example into my proggie, the only problem is that I cannot exit the program cleanly. After I hit the home button and say 'Yes' to exit, it freezes and shuts down the PSP. I've investigated, and the USB demo app has the same problem. I have a feeling it has to do with either kernel thread/ user thread things, or stopping/unloading the USB modules.
Any suggestions, or any direction would be great!
thanks,
dankydoo
usb exiting
in pspinside we do it like this:
that seems to work fine. (atleast pspinside doesnt crash and exits to the vsh cleanly :))
Code: Select all
void initUSBdrivers(void)
{
int exec_pu;
exec_pu=sceKernelLoadModule("flash0:/kd/semawm.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstor.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstormgr.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstorms.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstorboot.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
int ret = 0;
// FIXME: last arg should be NULL (wrong prototype in pspsdk?)
sceUsbStart("USBBusDriver",0,0);
ret = sceUsbStart("USBStor_Driver",0,0);
if(ret)
{
// prototype in pspsdk has only one arg, is that correct?
// sceUsbstorBootSetCapacity(0x00800000,ret);
sceUsbstorBootSetCapacity(0x00800000);
}
}
void exitUSBdrivers(void)
{
sceUsbDeactivate();
// FIXME: last arg should be NULL (wrong prototype in pspsdk?)
sceUsbStop("USBStor_Driver",0,0);
sceUsbStop("USBBusDriver",0,0);
}
MrMr[iCE] posted a codelet doing this in the VFPU thread on Tue Oct 04, 2005 7:24 pm: http://forums.ps2dev.org/viewtopic.php? ... sc&start=0