Anuncios Google

Ayuda con PRX

Buenas, soy relativamente nuevo programando para PSP aunque ya he aprendido lo mio en la uni jejeje. Pero ahora me encuentro ante un problemilla y no tengo ni idea de lo que tengo que hacer.

Estoy haciendo un progrma que se ejecute mientras juego, y mediante una combinacion de botones escriba en un documento de texto "bien" o "mal" seguido de la hora y dia en el que se ha escrito eso. Se compila sin errores ni warnings pero cuando lo itento usar no pasa nada, ni se bloque la consola ni escribe ni hace nada. Es como si no estubiera, he comprobado que este activo se ejecute en las ISOs (en GAME.TXT). La verdad es que os agradeceria mucho que me ayudaseis con esto ya que es bastante urgente, y con un poco de suerte sera alguna chorrada que haya pasado por alto. Aqui teneis el codigo y el makefile, gracias por todo.

#include <pspsdk.h>
#include <pspkernel.h>
#include <psppower.h>
#include <pspctrl.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspthreadman_kernel.h>
#include <stdio.h>
#include <time.h>
 
PSP_MODULE_INFO("app", 0x0800, 0, 1);
PSP_MAIN_THREAD_ATTR(0);
PSP_HEAP_SIZE_KB(1000);
 
int main_thread(SceSize args, void *argp)
{
SceCtrlData currentPad, lastPad;
FILE *fichero;
sceKernelDelayThread(3000000);
sceCtrlReadBufferPositive(&lastPad, 1);
time_t timer = time(NULL);
char b[5] = "Bien ";
char m[4] ="Mal ";
char ret = '\n';
 
while (1)
{
sceCtrlReadBufferPositive(¤tPad, 1);
if(currentPad.Buttons != lastPad.Buttons);
{
lastPad = currentPad;
if(currentPad.Buttons & PSP_CTRL_CROSS)
{
sceKernelDelayThread(1*1000);
if(currentPad.Buttons & PSP_CTRL_LTRIGGER)
{
fichero = fopen("eval.txt","a");
fputs (b, fichero);
fputs (ctime(&timer), fichero);
fputc (ret, fichero);
fclose(fichero);
sceKernelDelayThread(1*1000*1000);
}
}
if(currentPad.Buttons & PSP_CTRL_CIRCLE)
{
sceKernelDelayThread(1*1000);
if(currentPad.Buttons & PSP_CTRL_RTRIGGER)
{
fichero = fopen("eval.txt","a");
fputs (m, fichero);
fputs (ctime(&timer), fichero);
fputc (ret, fichero);
fclose(fichero);
sceKernelDelayThread(1*1000*1000);
}
}
}
}
return 0;
}
 
int module_start(SceSize args, void *argp)
{
int thid;
thid = sceKernelCreateThread("app", main_thread, 0x18, 0x0800, 0, NULL);
if(thid >= 0) sceKernelStartThread(thid, args, argp);
return 0;
}

 

TARGET = prx
OBJS = main.o
BUILD_PRX = 1
 
#USE_PSPSDK_LIBC = 1
 
INCDIR =
LIBDIR =
LIBS =
LDFLAGS =
CFLAGS = -Os -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
 
PSPSDK = $(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak


Anuncios Google