i'm aware there is alot of library list in other thread.
but how can i use them ?
i search every source code (nem's hello world for example) but can't find it in .c/.h file. but found it @ ASM Code.
anyone can explain this ? i understand ASM a little (very very little)
how can i link C/H file to an ASM code ?
thanks.
Library Usage Help (Newbie)
you can find very simple code sample, like plot a dot, display pic, etc... that i code to help coder to start at http://www.psp.to/download.php
hope it will help you a few.
AloneTrio
hope it will help you a few.
AloneTrio
ok, need help here..
i tried a few hours to use button/pad but didn't work.
i copy/paste RIN's (GBC emulator) PAD.H as follow
typedef struct _ctrl_data
{
u32 frame;
u32 buttons;
u8 analog[4];
u32 unused;
} ctrl_data_t;
and create variable name "pad"
in my xmain (main function), i code :
sceCtrlInit(0); //same as RIN's
while(1) { // always run
sceCtrlRead(pad, 1);
if (pad.buttons == CTRL_UP)
pgPrint(1,1, color, "UP Button");
}
but it didn't respon anything.
any suggestion ? (sorry if i'm not clear describing it)
i tried a few hours to use button/pad but didn't work.
i copy/paste RIN's (GBC emulator) PAD.H as follow
typedef struct _ctrl_data
{
u32 frame;
u32 buttons;
u8 analog[4];
u32 unused;
} ctrl_data_t;
and create variable name "pad"
in my xmain (main function), i code :
sceCtrlInit(0); //same as RIN's
while(1) { // always run
sceCtrlRead(pad, 1);
if (pad.buttons == CTRL_UP)
pgPrint(1,1, color, "UP Button");
}
but it didn't respon anything.
any suggestion ? (sorry if i'm not clear describing it)
There are many possible errors. If you have declared "pad" not as a pointer, you have to write "sceCtrlRead(&pad, 1)" (note the "&"). And if you are using nem's original code, you have to call pgScreenFlipV() after the pgPrint. And would be better to call "sceCtrlSetAnalogMode(0)" after the "sceCtrlInit(0)", to be sure you are in digital mode. And finally you should mask the buttons you need:ils wrote:and create variable name "pad"
in my xmain (main function), i code :
sceCtrlInit(0); //same as RIN's
while(1) { // always run
sceCtrlRead(pad, 1);
if (pad.buttons == CTRL_UP)
pgPrint(1,1, color, "UP Button");
}
but it didn't respon anything.
any suggestion ?
Code: Select all
sceCtrlInit(0);
sceCtrlSetAnalogMode(0);
ctrl_data_t ctrl;
while(1) {
sceCtrlRead(&ctrl, 1);
if (ctrl.buttons & CTRL_UP) {
pgPrint4(0, 0, 0xffff, "UP Button");
pgScreenFlipV();
break;
}
}
sceKernelSleepThread();