Code: Select all
#include <pspkernel.h>
#include <pspthreadman.h>
#include <pspdebug.h>
#include <stdio.h>
PSP_MODULE_INFO("Password", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
//PSP_HEAP_SIZE_KB(1024);
#define printf pspDebugScreenPrintf
#define VSHMAIN "flash0:/vsh/module/vshmain_real.prx"
SceUID load_module(const char *path, int flags, int type)
{
SceKernelLMOption option;
SceUID mpid;
/* If the type is 0, then load the module in the kernel partition, otherwise load it
in the user partition. */
if (type == 0) {
mpid = 1;
} else {
mpid = 2;
}
memset(&option, 0, sizeof(option));
option.size = sizeof(option);
option.mpidtext = mpid;
option.mpiddata = mpid;
option.position = 0;
option.access = 1;
return sceKernelLoadModule(path, flags, type > 0 ? &option : NULL);
}
int main_thread(SceSize args, void *argp)
{
pspDebugScreenInit();
printf("Arguement Size = %d\n",args);
SceUID mod;
mod = load_module(VSHMAIN, 0, 0);
if (mod > 0)
{
sceKernelStartModule(mod, args, argp, NULL, NULL);
}
else
{
printf("Start failed %x",mod);
}
sceKernelExitDeleteThread(0);
return 0;
}
int module_start(SceSize args, void *argp)
{
SceUID th;
th = sceKernelCreateThread("main_thread", main_thread, 0x20, 0x10000, 0, NULL);
if (th >= 0)
{
sceKernelStartThread(th, args, argp);
}
return 0;
}
Code: Select all
TARGET = password
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
BUILD_PRX = 1
PSP_FW_VERSION = 390
LIBDIR =
LIBS =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Password
#PSP_EBOOT_ICON="icon0.png"
#PSP_EBOOT_PIC1="pic1.png"
#PSP_EBOOT_SND0="snd0.at3"
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak