![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on [CODING HELP] VSHMAIN.PRX replacement within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I'm trying to make a module to replace vshmain.prx to do some stuff, and then launch the original vshmain_real.prx Code: ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() ¡Éste es Spartaaaaaaa!
|
I'm trying to make a module to replace vshmain.prx to do some stuff, and then launch the original vshmain_real.prx
Code:
#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:
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 And is there any way get my program's arguments in the form SceSize args, void *argp by using only int main(....) instead of creating a module_start(SceSize args, void *argp) and creating another thread? -= Double Post =- I tried it with pspSdkLoadStartModule but it also gives 0x80020148.
__________________
You didn't hear it.
You didn't see it. You won't say nothing to no one, never in your life. You never heard it. How absurd it all seems without any proof. Last edited by Torch; 05-29-2008 at 05:48 AM.. Reason: Automerged Doublepost |
|
|
|
![]() |
| Tags |
| coding , replacement , vshmainprx |
| Thread Tools | |
|
|