
Originally Posted by
flare
Is there any chance you could share with a few others or post more here xwolfi, as I am very interested in the help you were offering Slynk
here you go. I wrote up what I learned. I also included my source which is very loosely based off of the breakout code:
http://psx-scene.com/forums/f6/lachr...eleased-68272/ (Lachrymose BreakOutX 0.2 Released)
but I stripped it down as much as I could.
///////////////////////////////////////////
///////////////////////////////////////////
First thing's first, xwolfi wrote a tutorial here in french:
[TUTO HOMEBREW] Faire son premier homebrew, et surtout le comprendre - Metagames
And I got a rundown of libpthread, which is used for multithreading (plenty of tutorials online for this though).
I was told how to make apps not restart your ps3 when you exit the program, which I included in my source, and I wrote up a controller input tutorial below based off of the info I was provided. ^^
-------------------------------------------------
To use input in your application, you'll have to #include <cell/pad/libpad.h>
and make an instance of CellPadData
Code:
struct CellPadData padData;
Before your loop call:
In your loop, make a chek with:
Code:
cellPadGetData(controller_port_number, &PadData);
first you want to test if padData.len > 0
if so, then you can check for what was pressed using the following format:
Code:
padData.button[num] & CELL_PAD_CTRL_
ex.
if(padData.button[2] & CELL_PAD_CTRL_LEFT)
{
//move left
}
bellow are all the codes for the controller in a more easy to read format than the sdk details:
button[2]
CELL_PAD_CTRL_LEFT
CELL_PAD_CTRL_DOWN
CELL_PAD_CTRL_RIGHT
CELL_PAD_CTRL_UP
CELL_PAD_CTRL_START
CELL_PAD_CTRL_R3
CELL_PAD_CTRL_L3
CELL_PAD_CTRL_SELECT
button[3]
CELL_PAD_CTRL_SQUARE
CELL_PAD_CTRL_CROSS
CELL_PAD_CTRL_CIRCLE
CELL_PAD_CTRL_TRIANGLE
CELL_PAD_CTRL_R1
CELL_PAD_CTRL_L1
CELL_PAD_CTRL_R2
CELL_PAD_CTRL_L2
button[4]
//holds the right analog stick's x direction
//0x0000 all the way to the Left
//0x00FF all the way to the Right
button[5]
//holds the right analog stick's y direction
//0x0000 all the way Up
//0x00FF all the way Down
button[6]
//holds the left analog stick's x direction
//0x0000 all the way to the Left
//0x00FF all the way to the Right
button[7]
//holds the left analog stick's y direction
//0x0000 all the way Up
//0x00FF all the way Down
button[8]
//holds Pressure-sensitive (Right)
//0x0000 - 0x00FF
button[9]
//holds Pressure-sensitive (Left)
//0x0000 - 0x00FF
button[10]
//holds Pressure-sensitive (Up)
//0x0000 - 0x00FF
button[11]
//holds Pressure-sensitive (Down)
//0x0000 - 0x00FF
button[12]
//holds Pressure-sensitive (Triangle)
//0x0000 - 0x00FF
button[13]
//holds Pressure-sensitive (Circle)
//0x0000 - 0x00FF
button[14]
//holds Pressure-sensitive (Cross)
//0x0000 - 0x00FF
button[15]
//holds Pressure-sensitive (Square)
//0x0000 - 0x00FF
button[16]
//holds Pressure-sensitive (L1)
//0x0000 - 0x00FF
button[17]
//holds Pressure-sensitive (R1)
//0x0000 - 0x00FF
button[18]
//holds Pressure-sensitive (L2)
//0x0000 - 0x00FF
button[19]
//holds Pressure-sensitive (R2)
//0x0000 - 0x00FF
button[20]
//holds Pressure-sensitive (X Axis)
//0x0000 - 0x03FF
button[21]
//holds Pressure-sensitive (Y Axis)
//0x0000 - 0x03FF
button[22]
//holds Pressure-sensitive (Z Axis)
//0x0000 - 0x03FF
button[23]
//holds Pressure-sensitive (Angular Rate)
//0x0000 - 0x03FF
After you're done, make sure to clear the buffer with:
cellPadClearBuf(controller_port_number);