19.02.2011, 21:25
Cha0z :
asoooo psp ich dacht pc da der code für mich ned nach psp aussieht
hier mal code für dein dings:
Und deine Variable pad ist immer leer hier mal code für dein dings:
Spoiler: (anzeigen)
Code:
#include <pspsdk.h>
#include <pspdebug.h>
#include <pspctrl.h>
PSP_MODULE_INFO("sample", 0, 1, 0);
#define printf pspDebugScreenPrintf
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 its 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()
{
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
printf("Frage: Was ist eine PSP?\n");
printf("A: Eine Konsole (X druecken)\n");
printf("B: Ein Werkzeug (O druecken)\n");
printf("C: Ein Getraenk (/\ druecken)\n");
printf("D: Eine Dosensorte ([] druecken)\n");
while(1){
if (pad.Buttons != 0){
if (pad.Buttons & PSP_CTRL_SQUARE){
printf("Falsch\n");
}
if (pad.Buttons & PSP_CTRL_TRIANGLE){
printf("Falsch\n");
}
if (pad.Buttons & PSP_CTRL_CIRCLE){
printf("Falsch\n");
}
if (pad.Buttons & PSP_CTRL_CROSS){
printf("Richtig\n");
}
}
return 0;
}
So hier mal Code