+// (c) Copyright 2007 notaz, All rights reserved.
+// Free for non-commercial use.
+
+// For commercial use, separate licencing terms must be obtained.
+
#include <stdio.h>
#include <string.h>
#include <pspkernel.h>
#include <pspsdk.h>
#include <pspaudiocodec.h>
+#include <kubridge.h>
#include "../../Pico/PicoInt.h"
#include "../../Pico/sound/mix.h"
static SceUID load_start_module(const char *prxname)
{
- SceUID mod = pspSdkLoadStartModule(prxname, PSP_MEMORY_PARTITION_KERNEL);
- if (mod < 0)
- lprintf("failed to load %s: %08x\n", prxname, mod);
+ SceUID mod, mod1;
+ int status, ret;
+
+ mod = pspSdkLoadStartModule(prxname, PSP_MEMORY_PARTITION_KERNEL);
+ if (mod < 0) {
+ lprintf("failed to load %s (%08x), trying kuKernelLoadModule\n", prxname, mod);
+ mod1 = kuKernelLoadModule(prxname, 0, NULL);
+ if (mod1 < 0) lprintf("kuKernelLoadModule failed with %08x\n", mod1);
+ else {
+ ret = sceKernelStartModule(mod1, 0, NULL, &status, 0);
+ if (ret < 0) lprintf("sceKernelStartModule failed with %08x\n", ret);
+ else mod = mod1;
+ }
+ }
return mod;
}