This is becoming a big pain. i put the code as said. and i get these errors.
and my code is:
any help on what i did wrong? from what i see it should work. :huh:
1 error: '$pad' undeclared (first use in this function) 76 pspprogram
2 error: (Each undeclared identifier is reported only once 76 pspprogram
3 error: for each function it appears in.) 76 pspprogram
4 warning: too many arguments for format 88 pspprogram
5 warning: value computed is not used 92 pspprogram
6 warning: value computed is not used 92 pspprogram
7 error: expected ';' before ')' token 92 pspprogram
8 error: expected expression before ')' token 92 pspprogram
9 warning: implicit declaration of function 'sceDisplaywaitVblankStart' 94 pspprogram
10 warning: too many arguments for format 100 pspprogram
2 error: (Each undeclared identifier is reported only once 76 pspprogram
3 error: for each function it appears in.) 76 pspprogram
4 warning: too many arguments for format 88 pspprogram
5 warning: value computed is not used 92 pspprogram
6 warning: value computed is not used 92 pspprogram
7 error: expected ';' before ')' token 92 pspprogram
8 error: expected expression before ')' token 92 pspprogram
9 warning: implicit declaration of function 'sceDisplaywaitVblankStart' 94 pspprogram
10 warning: too many arguments for format 100 pspprogram
and my code is:
[highlight=c]
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
PSP_MODULE_INFO("hello",0,1,1);
#define print pspDebugScreenPrintf
/* 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 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()
{
//start starting
pspDebugScreenInit();
SetupCallbacks();
//do your code!
int counter = 0;
int i = 0;
SceCtrlData pad;
print("Press [X] to start the timer!");
//while loop for [X] button press
while(1)
{
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS)
{
break;
}
}
//while loop for [O] button press
while(1)
{
sceCtrlReadBufferPositive($pad, 1);
if(pad.Buttons & PSP_CTRL_CIRCLE)
{
break;
}
//clear the screen
pspDebugScreenClear();
//new readout. notice "\n" for Newline
print("oki do! now press [O] to stop the timer.\n");
print("Counter: $I", counter);
//add one to "counter"
counter++;
//pause so "HOME" button can work
for(i=0, i<10,i++)
{
sceDisplaywaitVblankStart();
}
}
//clear debug screen
pspDebugScreenClear();
print("Timer finished!\n");
print("Final count: $i", counter);
//make "HOME" work
sceKernelSleepThread();
//return your stuff
return 0;
}
[/highlight]
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
PSP_MODULE_INFO("hello",0,1,1);
#define print pspDebugScreenPrintf
/* 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 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()
{
//start starting
pspDebugScreenInit();
SetupCallbacks();
//do your code!
int counter = 0;
int i = 0;
SceCtrlData pad;
print("Press [X] to start the timer!");
//while loop for [X] button press
while(1)
{
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS)
{
break;
}
}
//while loop for [O] button press
while(1)
{
sceCtrlReadBufferPositive($pad, 1);
if(pad.Buttons & PSP_CTRL_CIRCLE)
{
break;
}
//clear the screen
pspDebugScreenClear();
//new readout. notice "\n" for Newline
print("oki do! now press [O] to stop the timer.\n");
print("Counter: $I", counter);
//add one to "counter"
counter++;
//pause so "HOME" button can work
for(i=0, i<10,i++)
{
sceDisplaywaitVblankStart();
}
}
//clear debug screen
pspDebugScreenClear();
print("Timer finished!\n");
print("Final count: $i", counter);
//make "HOME" work
sceKernelSleepThread();
//return your stuff
return 0;
}
[/highlight]
any help on what i did wrong? from what i see it should work. :huh: