PauSix

PSP User Input ui.c

Feb 13th, 2017
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1.  
  2. #include <pspctrl.h>
  3. #include "ui.h"
  4.  
  5. static SceCtrlData data;
  6. static SceCtrlLatch latch;
  7.  
  8. int getJX() {
  9.     return data.Lx;
  10. }
  11.  
  12. int getJY() {
  13.     return data.Ly;
  14. }
  15.  
  16. void pollPad() {
  17.     sceCtrlReadBufferPositive(&data, 1);
  18. }
  19.  
  20. void pollLatch() {
  21.     sceCtrlReadLatch(&latch);
  22. }
  23.  
  24. int isKeyDown(int key) {
  25.     return (latch.uiMake & key);
  26. }
  27.  
  28. int isKeyUp(int key) {
  29.     return (latch.uiBreak & key);
  30. }
  31.  
  32. int isKeyHold(int key) {
  33.     return (latch.uiPress & key);
  34. }
Add Comment
Please, Sign In to add comment