Advertisement
Joren

[SPRX] Local Button Monitoring

Jan 28th, 2015
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. /*
  2. All of this has been discovered by looking at the PS3 SDK libs and header files.
  3. This can be used on any game/homebrew.
  4. This doesn't use in-game addresses/offsets.
  5. This is LOCAL only.
  6.  
  7. Credits:
  8. TrueBlueGaryOPA - PS3 3.70 SDK (Software Development Kit)
  9.  
  10. */
  11.  
  12. #include <cell/pad.h>
  13.  
  14. #define PAD_LEFT (1 << 7)
  15. #define PAD_RIGHT (1 << 5)
  16. #define PAD_DOWN (1 << 6)
  17. #define PAD_UP (1 << 4)
  18. #define PAD_CROSS (1 << 14)
  19. #define PAD_SQUARE (1 << 15)
  20. #define PAD_CIRCLE (1 << 13)
  21. #define PAD_TRIANGLE (1 << 12)
  22. #define PAD_R1 (1 << 11)
  23. #define PAD_R2 (1 << 9)
  24. #define PAD_R3 (1 << 2)
  25. #define PAD_L1 (1 << 10)
  26. #define PAD_L2 (1 << 8)
  27. #define PAD_L3 (1 << 1)
  28. #define PAD_START (1 << 3)
  29. #define PAD_SELECT (1 << 0)
  30.  
  31. CellPadData PadData;
  32.  
  33. uint32_t GetKey(void)
  34. {
  35.     uint32_t _padBuf;
  36.     cellPadGetData(0, &PadData);
  37.     _padBuf = PadData.button[3];
  38.     _padBuf = (_padBuf << 8) + PadData.button[2];
  39.     return _padBuf;
  40. }
  41.  
  42. /*How to use: */
  43.  
  44. if(GetKey()==(PAD_DOWN))
  45. {
  46.     /*is pressing DOWN on the DPAD*/
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement