/*Version 1 Hello World*/
#include <lv2/process.h>
#include <psl1ght/lv2/thread.h>
#include <sysmodule/sysmodule.h>
#include <sysutil/events.h>
#include <stdio.h>
#include <string.h>
#include "graphics.h"
void release_all();
int running = 1;
volatile int my_socket=-1;
volatile int flag_exit=0;
static void thread_start(u64 arg)
{
while(running ){
sys_ppu_thread_yield();
scr_flip();
sysCheckCallback();
}
//you must call this, kthx
sys_ppu_thread_exit(0);
}
static void sys_callback(uint64_t status, uint64_t param, void* userdata) {
switch (status) {
case EVENT_REQUEST_EXITAPP:
if(my_socket!=-1) {
flag_exit=1;
close(my_socket);
my_socket=-1;
}
release_all();
sysProcessExit(1);
break;
default:
break;
}
}
sys_ppu_thread_t thread1_id;
void release_all() {
u64 retval;
sysUnregisterCallback(EVENT_SLOT0);
running= 0;
sys_ppu_thread_join(thread1_id, &retval);
SysUnloadModule(SYSMODULE_JPGDEC);
}
int main(int argc, const char* argv[], const char* envp[])
{
scr_init();
u64 thread_arg = 0x1337;
u64 priority = 1500;
size_t stack_size = 0x1000;
char *thread_name = "";
sys_ppu_thread_create( &thread1_id, thread_start, thread_arg, priority, stack_size, THREAD_JOINABLE, thread_name);
// register exit callback
sysRegisterCallback(EVENT_SLOT0, sys_callback, NULL);/*salir con el boton home*/
char ti[]="------- HELLO WORLD ------";
s_printf ("%s", ti);
while (1) {}
sleep(2);
return 0;
}
Parece que entra pero en segundos se sale... Que le ocurre?
Puede ser por el SDK?
Gracias.