yesterday I've installed the psptoolchain on my Ubuntu 8.04 System. PSP is running 4.01-M33-2, 1.50 kernelpatch installed. Everything worked fine and I was happy...until I compiled my first homebrew. Actually the compilation process worked, but when I tried to run the application (only simple hello world) the psp shows a blackscreen and restarts after 10sec. I found a thread about an issue with a toolchain update, but it should be fixed. I tried to checkout an older Version of the toolchain but the same issue.
I've compiled and tried to run one of the samples, but I'm getting the same problem. When running the homebrews using psplink/usbhost_fs and pcterm there is no output at all. The PSP just shows the string printed by psplink on startup and shuts down after 10sec. Sometimes usbhost_fs recognizes the psp's shut down. Sometimes it dosen't.
So far the problem. I'm a noob in psp programming, if I'm missing some stupid point don't be to harsh to me ;)
Last but not least the code and some output:
Code: Select all
#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("Hello World", 0, 1, 1);
PSP_HEAP_SIZE_KB(20480);
// 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 it 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;
}
int main() {
pspDebugScreenInit();
SetupCallbacks();
pspDebugScreenPrintf("Hello World\n");
sceKernelSleepThread();
return 0;
}
Code: Select all
TARGET = hello
OBJS = main.o
#BUILD_PRX = 1
#PSP_FW_VERSION=371
#PSP_LARGE_MEMORY=1
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hallo Welt
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Code: Select all
make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -c -o main.o main.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib main.o -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o hello.elf
psp-fixup-imports hello.elf
mksfo 'Hallo Welt' PARAM.SFO
psp-strip hello.elf -o hello_strip.elf
pack-pbp EBOOT.PBP PARAM.SFO NULL \
NULL NULL NULL \
NULL hello_strip.elf NULL
[0] 408 bytes | PARAM.SFO
[1] 0 bytes | NULL
[2] 0 bytes | NULL
[3] 0 bytes | NULL
[4] 0 bytes | NULL
[5] 0 bytes | NULL
[6] 79540 bytes | hello_strip.elf
[7] 0 bytes | NULL
rm -f hello_strip.elf
I hope you can help me to find a solution for my problems.