Code: Select all
SceCtrlData pad;
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_DOWN)
{
ymod = 1;
}
if (pad.Buttons & PSP_CTRL_RIGHT)
{
xmod = 1;
}
if (pad.Buttons & PSP_CTRL_UP)
{
ymod = -1;
}
if (pad.Buttons & PSP_CTRL_LEFT)
{
xmod = -1;
}
else
{
ymod = 0;
xmod = 0;
}
My problem is it will only respond to PSP_CTRL_LEFT and will respond to PSP_CTRL_UP/DOWN but only when i'm holding LEFT (ie diagonal up and diagonal down, to the left)
So whatever if statment I want to run I just change to LEFT and it will do it, and will do UP and DOWN only when im pressing it with LEFT (i'm assuming it'd do right if it COULD be pressed at the same time as left :P )
It's funky....and this is really frustrating me as it's a pretty simple procedure and according to the 15 different source files i've referenced that also use this statement, well it SHOULD all work fine :(
Any suggestions ?
Thanks in advance...
edit: Seems whichever statement I put at the bottom of the list, before else, works....but only for directions, as I can assign sceKernelExitGame(); to SQUARE with an if statement at the begining or middle or even last and it works every time...same with any other button...strange...