I copied my test.prx file to the root of the memstick ms0:/test.prx and then added that line to the following DevHook files (after the /kd/isofs.prx line),
ms0://dh/260/flash0/kd/pspbtcnf.txt
ms0://dh/260/flash0/kd/pspbtcnf_game.txt
My prx did nothing before I added this to the top of the source and after I did that it started crashing...
PSP_MODULE_INFO("PRX Test", 0x1000, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
Can anyone see what i'm doing wrong here... Here's the main.c file,
Code: Select all
#include <pspctrl.h>
#include <pspkernel.h>
#include <stdio.h>
PSP_MODULE_INFO("PRX Test", 0x1000, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
int MainThread (SceSize args, void *argp) {
SceCtrlData pad;
int i;
FILE* fp;
while (1) {
sceCtrlPeekBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS) {
fp = fopen("ms0:/test.txt","w+");
if (fp) {
fprintf(fp,"Pressed X");
}
fclose(fp);
}
for (i=0; i<5; i++) {
sceDisplayWaitVblankStart();
}
}
return 0;
}
int module_start(SceSize args, void *argp) {
SceUID thid;
thid = sceKernelCreateThread("PRX_Test", MainThread, 0x18, 0x1000, 0, NULL);
if (thid >= 0) sceKernelStartThread(thid, args, argp);
return 0;
}
int module_stop(void) {
return 0;
}
Code: Select all
TARGET = test
OBJS = main.o
BUILD_PRX=1
USE_PSPSDK_LIBC=1
USE_PSPSDK_LIBS=1
#USE_KERNEL_LIBC=1
#USE_KERNEL_LIBS=1
PRX_EXPORTS=exports.exp
INCDIR =
CFLAGS = -Os -G0 -Wall -fno-strict-aliasing -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS = -mno-crt0 -nostartfiles
LIBS =
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Code: Select all
# Define the exports for the prx
PSP_BEGIN_EXPORTS
# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC(module_start)
PSP_EXPORT_VAR(module_info)
PSP_EXPORT_FUNC(module_stop)
PSP_EXPORT_END
PSP_END_EXPORTS