[SPRX] Buttons monitoring for any game!

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

Nostafaru

Moderating the Crunch Bunch.
Retired Staff
Community Elite
Community Veteran
Determined Poster
Active Member
Console ID Poster
Apr 6, 2014
2,020
1,784
443
Hey crunchers :)

This will be a method to use buttons monitoring for what ever game you would like.

What is buttons monitoring ?
--------------------------------
Buttons monitoring is something that detects what button you click. And then it can execute a function. Example :

if(Buttons(Buttons.Clicked == Button.X))
{
iPrintln("X button has been pressed"); //Or any other function you would like it to do.
}


This will be the header :
#include<cell/pad.h>
#include <cell/sysmodule.h>
#define MAX_PAD (1)
void PadRead(uint32_t* pbutton1, uint32_t* pbutton2)
{
int i;
int ret;
CellPadInfo2 pad_info;
static uint32_t old_pad_info=0;
CellPadData pad_data;
uint32_t button1 = 0;
uint32_t button2 = 0;

ret = cellPadGetInfo2(&pad_info);
if (ret != CELL_OK){
//printf("cellPadGetInfo2() error (0x%x).\n", ret);
return;
}

/*E Check info field for monitoring the INTERCEPTED state. */
if((pad_info.system_info & CELL_PAD_INFO_INTERCEPTED) &&
(!(old_pad_info & CELL_PAD_INFO_INTERCEPTED)))
{
//printf ("This program lost the ownership of the game pad data\n");
old_pad_info = pad_info.system_info;
}
else if((!(pad_info.system_info & CELL_PAD_INFO_INTERCEPTED)) &&
(old_pad_info & CELL_PAD_INFO_INTERCEPTED))
{
// printf ("This program got the ownership of the game pad data\n");
old_pad_info = pad_info.system_info;
}

for (i = 0; i < MAX_PAD; i ++)
{
if (pad_info.port_status & CELL_PAD_STATUS_CONNECTED == 0)
continue;

ret = cellPadGetData(i, &pad_data);
if (ret != CELL_PAD_OK || pad_data.len == 0)
continue;

button1 = pad_data.button [CELL_PAD_BTN_OFFSET_DIGITAL1];
button2 = pad_data.button [CELL_PAD_BTN_OFFSET_DIGITAL2];
}
*pbutton1 = button1;
*pbutton2 = button2;
return;
}





You can use it like this :

Initializ :
Code:
#inlcude "pad.h"
extern "C" int main(void)//main entry
{
cellPadInit(MAX_PAD);
}

Buttons detection :
Code:
uint32_t button1,button2;
PadRead(&button1, &button2);//use in thread
if(button2 & CELL_PAD_CTRL_TRIANGLE)
{
print("pad detected");
}
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Chat Bot:
    Duran_1911 is our newest member. Welcome!
  • Chat Bot:
    LilBoat100 has left the room.
  • Chat Bot:
    keonhacaivoto is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    estro101 is our newest member. Welcome!
  • Chat Bot:
    yeclipsex is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    Diabloron is our newest member. Welcome!
  • Chat Bot:
    mr kiki is our newest member. Welcome!
  • Chat Bot:
    NorwayVon is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    cynthia is our newest member. Welcome!
  • Chat Bot:
    LilBoat100 has joined the room.
  • @ LilBoat100:
    been a min
  • @ LilBoat100:
    i have uncharted 3, (digital) my disc aint working for shit lol, so whenever i try finding "LAN Party" its not on digital, only on disc. so if theres like a eboot maybe, or something i can do to activate the LAN Party to play offline, that shit would be dope bro. anyone.
  • @ LilBoat100:
    or maybe if i download it as iso? idk
  • Chat Bot:
    tazl is our newest member. Welcome!
  • Chat Bot:
    LilBoat100 has joined the room.
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    salih01barwari has left the room.
  • Chat Bot:
    ImMike is our newest member. Welcome!
  • Chat Bot:
    ImMike has posted a new reply in the thread "PS4 v3.50 Neighborhood".
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    nhandinhkeonhacaidee is our newest member. Welcome!
      Chat Bot: nhandinhkeonhacaidee is our newest member. Welcome!