Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jul 3, 2023
1 parent 67a51af commit 0ac328d
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions extras/menus/arkMenu/src/usb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ extern "C" {
int pspUsbDeviceFinishDevice();
}

static void load_start_usbdevice(void)
{

static void start_psp_usb(){
int res;

static char* mods[] = {
Expand All @@ -28,39 +26,21 @@ static void load_start_usbdevice(void)
};

for (int i=0; i<6; i++){
printf("loading %s\n", mods[i]);
int mid = kuKernelLoadModule(mods[i], 0, NULL);
printf("mod id: %p\n", mid);
sceKernelStartModule(mid, 0, NULL, NULL, NULL);
}

res = sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
printf("usbStart bus: %p\n", res);
res = sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
printf("usbStart store: %p\n", res);
res = sceUsbActivate(0x1c8);
printf("usbActivate: %p\n", res);
sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
sceUsbActivate(0x1c8);
}

static void stop_unload_usbdevice(void)
{
sceUsbDeactivate(0x1c8);
static void stop_psp_usb(){
sceUsbDeactivate(0x1c8);
sceUsbStop(PSP_USBSTOR_DRIVERNAME, 0, 0);
sceUsbStop(PSP_USBBUS_DRIVERNAME, 0, 0);
}

static void start_psp_usb(){
struct KernelCallArg args;
void* startUsb = (void*)&load_start_usbdevice;
kuKernelCall(startUsb, &args);
}

static void stop_psp_usb(){
struct KernelCallArg args;
void* stopUsb = (void*)&stop_unload_usbdevice;
kuKernelCall(stopUsb, &args);
}

static void start_adrenaline_usb(){
struct KernelCallArg args;
void* startUsb = (void*)sctrlHENFindFunction("ARKCompatLayer", "AdrenalineCtrl", 0x80C0ED7B);
Expand Down

0 comments on commit 0ac328d

Please sign in to comment.