This is my first post in this forum, so please be patient with me!
I'm trying to run an Homebrew from my own program, but it won't work!
I've implemented the systemctrl.h from the 3.71 M33 SDK, which has the sctrlKernelLoadExecVSHMs2()-function, but when I try to compile the code, I get this errors:
Code: Select all
$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=
390 -c -o main.o main.c
In file included from main.c:4:
./include/systemctrl.h:189: error: expected ')' before '*' token
./include/systemctrl.h:230: error: expected '=', ',', ';', 'asm' or '__attribute
__' before 'sctrlHENSetStartModuleHandler'
make: *** [main.o] Error 1
I took the code from here: http://forums.ps2dev.org/viewtopic.php?t=9247
main.c:
Code: Select all
#include <pspkernel.h>
#include <pspdebug.h>
#include <string.h>
#include "./include/systemctrl.h"
PSP_MODULE_INFO("Hello World", 0, 1, 1);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
void execEboot(char *target)
{
struct SceKernelLoadExecVSHParam param;
memset(¶m, 0, sizeof(param));
param.key = "game";
param.size = sizeof(param);
param.args = strlen(target)+1;
param.argp = target;
sctrlKernelLoadExecVSHMs2(target, ¶m);
}
int main() {
SetupCallbacks();
pspDebugScreenInit();
printf("Hello World");
execEboot("ms0:/PSP/GAME/PSPTube/EBOOT.PBP");
sceKernelSleepThread();
return 0;
}
Code: Select all
TARGET = hello
OBJS = main.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World
PSP_FW_VERSION = 390
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
vista200