Random Homebrew: Dreaded Kid
he's out to make the women cry and the men feel bad about themselves.
Friends: Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita

Analog coordinates ???? and something else

Forum rules
Any post not directly related to programming will be moderated.
Do not request people to code something for you.
Avoid posting messages that do not bring anything to the conversation. We want the threads in this subforum to stay focused.

Analog coordinates ???? and something else

Postby kmanev07 » Mon Mar 26, 2012 6:44 pm

Hi, guys i was wondering how to use analog in my apps i mean get X and Y from analog ? also how the fuck i can work in kernel mode so i can check is there any UMD ? :?: :?: :?: :?: :?: also can i have a GIF background ?
kmanev07
 
Posts: 47
Joined: Fri Jun 03, 2011 9:39 am

Re: Analog coordinates ???? and something else

Postby hardhat » Tue Mar 27, 2012 1:57 pm

The current position of the analog stick is available in the SceCtrlData struct. Look here for documentation:

http://psp.jim.sh/pspsdk-doc/structSceCtrlData.html

I'd recommend making a deadzone in the centre of that range though. Since 128 is centred, I usually take the area from 100 to 156 as homed, just so you don't get unintended drift. The amount of dead zone required varys from PSP to PSP so if you want to go above and beyond, you can always make it a config setting.

Code: Select all
int dx=pad.Lx,dy=pad.Ly;
dx-=100;
if(dx>0 && dx<56) dx=0; else if(dx>0) dx-=56;
dy-=100;
if(dy>0 && dy<56) dy=0; else if(dy>0) dy-=56;
int ax=dx;  // from -100 to 100 with the dead zone range all set to 0.
int ay=dy;  // from -100 to 100 with the dead zone range all set to 0.


Something like that is what I use.

You can use a GIF if you like. If you aren't using any special library like OSLib or SDL then you should look into libungif/libgif which works fine on the PSP (and is included with things like devkitPro and minpspw).
Last edited by hardhat on Tue Mar 27, 2012 1:59 pm, edited 1 time in total.
hardhat
 
Posts: 58
Joined: Tue Feb 08, 2011 6:10 pm



Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests