| View previous topic :: View next topic |
| Author |
Message |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Mon Mar 30, 2009 6:02 am Post subject: Make plugin work |
|
|
I've never writed a plugin before.
I want to know how to make a simple evil :P plugin which makes the power led goes on and off and on and off... So everone got hypnothised by that little led. But it dont work.
Here is my code:
main.c
| Code: | #include <pspkernel.h>
#include <pspsyscon.h>
PSP_MODULE_INFO("CrazyLedPlugin", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
int main_thread(SceSize args, void *argp)
{
int state = 0;
for(;;)
{
sceSysconCtrlLED(SCE_LED_POWER,state);
if (state) state=0;
else state=1;
sceKernelDelayThread(100000);
}
}
int module_start(SceSize args, void *argp)
{
// Create a thread
SceUID thid = sceKernelCreateThread("CrazyLed", main_thread, 25, 64*1024, 0, NULL);
if(thid >= 0)
{
sceKernelStartThread(thid, args, argp);
}
return 0;
} |
makefile
| Code: | TARGET = CrazyLed
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS =
USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
BUILD_PRX = 1
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak |
Did i do something wrong? _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
MBx
Joined: 22 Mar 2009 Posts: 35
|
Posted: Mon Mar 30, 2009 6:41 am Post subject: |
|
|
| I'm not sure but you may want to try Kernel prx instead of a user prx. |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Mon Mar 30, 2009 7:00 am Post subject: |
|
|
If you didn't notice, he is using a kernel prx already. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
MBx
Joined: 22 Mar 2009 Posts: 35
|
Posted: Mon Mar 30, 2009 7:08 am Post subject: |
|
|
| you are right. I'm sorry! :D |
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Mon Mar 30, 2009 11:52 pm Post subject: |
|
|
I think i did nothing wrong. I had it on while i was playing with PSPTube and i saw the wlan-led goes crazy. so i think i made a plugin which made the wrong led blinking. _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Mar 31, 2009 1:34 am Post subject: |
|
|
To clear things up, sceSysconCtrlLED doesn't actually make the LEDs on or off. It only ALLOWS or DISALLOWS the particular LED to be turned on or off by other apps/system.
Suppose you sceSysconCtrlLED(WLAN, 1), the WLAN LED will not turn on. It only ALLOWS the led to blink when connection is active. Similarily sceSysconCtrlLED(MEMSTICK, 1) won't activate the orange led. It only blink when data is transferred. sceSysconCtrlLED(MEMSTICK, 0) will keep it off even during data transfer. |
|
| Back to top |
|
 |
|