So, I've got a little problem in my code, here it is (this is not the entire code) :
Code: Select all
int main(int args, char** argv)
{
.....
DisplayThread = sceKernelCreateThread("...", Display_Thread, 0x18, 0x10000, PSP_THREAD_ATTR_USER, NULL);
sceKernelStartThread(DisplayThread, 0, 0);
int i;
while(1)
{
Ctrl(); //Control
}
return 0;
}
void Ctrl()
{
if (pad.Buttons & SelectKey && !(oldPad.Buttons & SelectKey))
{
....
sceKernelStartModule(usbcam,
strlen("ms0:/usbCam.prx")+1,"ms0:/UsbCam.prx", NULL, NULL);
sceKernelSuspendThread(DisplayThread); //I suspend my display thread to blit my module correctly
}
if (pad.Buttons & CancelKey && !(oldPad.Buttons & CancelKey))
{
....
sceKernelStopModule(usbcam,strlen("ms0:/usbCam.prx")+1,"ms0:/UsbCam.prx", NULL, NULL);
sceKernelResumeThread(DisplayThread); // Now I can Resume my Thread
}
... //Other controls ...
I don't know if I'm very clear ^^ In fact, as soon as I stop the module, the controls don't work.
Thanks in advance :p
PS:Sorry for my bad English