hlide wrote:and are you sure about your syscalls ? their arguments ?
hlide is right :)
Let's take the SDK prototypes:
SceUID sceKernelCreateThread (const char *name, SceKernelThreadEntry entry, int initPriority, int stackSize, SceUInt attr, SceKernelThreadOptParam *option)
int sceKernelStartThread (SceUID thid, SceSize arglen, void *argp)
So, you need to have a0, a1, a2, a3, a4 and a5 for createthread, and then feed the return register (v0 in mnemonic, no? r2 in non-mnemonic :P) into the a0 of startthread, and set a1 and a2 to 0 if you don't give params.
would give something like this:
Code: Select all
.............
_start:
# Create Thread
move $a0, _thread_name (the label of the thread name
move $a1, _main_thread_func (the label of the function)
move $a2, 20 (priority)
move $a3, 4000 (stack)
move $a4, 0 (attribute)
syscall _sceKernelCreateThread
move $a5, 0 (options)
# Start Thread
move $a1, $zero
move $a2, $zero
syscall _sceKernelStartThread
move $a0, $v0
.............