moonlight wrote:You are not calling original functions, wo aht you would expect?
Your GetState and Stop functions should call original functions for this to work.
The PSP crashes with the original functions, with the same Mashphealt's code, why moonlight?
The usb stop function should be like this. The original function must be executed between the k1 stuff. This doesn't matter in the GetState one.
int USB_Stop(const char* driverName, int size, void *args)
{
int k1 = pspSdkSetK1(0);
sceDisplaySetBrightness(curBrightness, 0);
int ret = sceUsbStop(driverName, size, args)
pspSdkSetK1(k1);
return ret;
}
moonlight wrote:The psp stop function should be like this. The original function must be executed between the k1 stuff. This doesn't matter in the GetState one.
int USB_Stop(const char* driverName, int size, void *args)
{
int k1 = pspSdkSetK1(0);
sceDisplaySetBrightness(curBrightness, 0);
int ret = sceUsbStop(driverName, size, args)
pspSdkSetK1(k1);
return ret;
}
int USB_Stop(const char* driverName, int size, void *args)
{
int k1 = pspSdkSetK1(0);
sceDisplaySetBrightness(curBrightness, 0);
int ret = sceUsbStop(driverName, size, args);
pspSdkSetK1(k1);
return ret;
}
A suggestion, When you ask for something post the entire code, the makefile and give more infos, I can't see your actual code...
Anyway if I'm right you want to hook the usb load?
To do this use the m33 module handler, is better then hook some functions I think...
Sorry for my english...