int scePower_0442D852(int unknown); void ThreadsStatChange( bool stat, SceUID thlist[], int thnum ); int stop_flag; SceUID st_thlist_first[MAX_NUMBER_OF_THREADS]; int st_thnum_first; SceUID thlist[MAX_NUMBER_OF_THREADS]; int thnum;
// Variables que usaremos para leer las puslaciones y activar/desactivar el USB SceCtrlData pad, lastpad; int USB = deactivate, lastUSB = deactivate;
///******************* HILO PRINCIPAL *******************/// int main_thread(SceSize argc, void* argp) { while(1) // Ciclo del plugin { sceKernelGetThreadmanIdList( SCE_KERNEL_TMID_Thread, thlist, MAX_NUMBER_OF_THREADS, &thnum ); // PULSACIONES sceCtrlReadBufferPositive(&pad, 1); // Leemos las pulsaciones if(pad.Buttons != lastpad.Buttons) { lastpad = pad; if(pad.Buttons & PSP_CTRL_LTRIGGER) // GATILLO L se desactiva el USB { pspDebugScreenSetBackColor(0xFF00F3F3); pspDebugScreenSetTextColor(0xFF000000); pspDebugScreenInit(); pspDebugScreenSetXY(10,10); pspDebugScreenKprintf("Status: %d", USB); pspDebugScreenSetXY(10,12); pspDebugScreenKprintf("Desea salir ?"); pspDebugScreenSetXY(10,14); pspDebugScreenKprintf("YES = O, No = X"); sceKernelSuspendAllUserThreads(); if(pad.Buttons & PSP_CTRL_CIRCLE) { pspDebugScreenSetXY(10,16); pspDebugScreenKprintf("YES = O"); ThreadsStatChange( true, thlist, thnum ); } else if(pad.Buttons & PSP_CTRL_CROSS) { pspDebugScreenSetXY(10,16); pspDebugScreenKprintf("No = X"); } } } sceKernelDelayThread(50000); } return 0; }
///******************* DEFINICIÓN DEL HILO *******************/// int module_start(SceSize args, void *argp) { int thid = sceKernelCreateThread("SampleGUI", main_thread, 0x30, 0x1000, 0, NULL); if(thid >= 0) sceKernelStartThread(thid, args, argp);
return 0; } void ThreadsStatChange( bool stat, SceUID thlist[], int thnum ) { int ( *request_stat_func )( SceUID ) = NULL; int i, j; SceUID selfid = sceKernelGetThreadId();
PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build_prx.mak
el problema esque después de que se activa con gatiilo L y lo desactivo con gatillo L + Circulo no puedo entrar a video ni musica ni nada se paran todos los threads y no se que sea por favor ayuda ya no se que hacer
No tiene los permisos requeridos para ver los archivos adjuntos a este mensaje.
Última edición por asmb el 18 May 2011, 22:50, editado 1 vez en total.
A lo que me refiero es que le pongas tabulaciones donde deben ir, y además usar la etiqueta [code] para que no pierda el formato. Y eso es aquí y en Marte
Saludos y suerte
PD: tal y como lo has hecho
El bucle while que tienes no es válido para PSP. Debes insertar código que permita a otros hilos ejecutarse (como por ejemplo el sceKernelDelayThread que tienes fuera del while). La PSP no tiene multitarea/multihilo real, por tanto cada tarea/hilo debe ceder tiempo de ejecución para otros, especialmente el kernel, ya que si pasa X tiempo sin que se ejecute ningún hilo kernel el chip Syscon apagará la consola.
m0skit0, como fueron tus inicios en la Scene de PSP??? Cabe la posibilidad de ejecutar plugins mediante alguna aplicación extra, aunque solo sea de manera temporal?
Un saludo.
* PlayStation 3 128Gb SSD Firmware 4.82 * PSNetwork: Azagra_Mac
Todos los plugins corren en modo Kernel? ninguno en modo User?
Que consejo podrias darme, tengo mucho interesas en la scene, auqnue tengo conocimientos de programacion en C, me falta algo. De hay que te preguntaba como fueron tus inicios, por donde empezaste, jeje.
un saludo compi
* PlayStation 3 128Gb SSD Firmware 4.82 * PSNetwork: Azagra_Mac