BaSs_HaXoR

Sprx Scripts

Aug 15th, 2014
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.70 KB | None | 0 0
  1. /*(qouted Milky4444)
  2. ayyy ngu, so since theres been lots of scripts released for prx modulus i decided to just make a big thread to keep it organized
  3. http[dankz to blb]:
  4. header: [C++] SPRX webRequests - http://adf.ly/rt4sE
  5. add libs:
  6. */
  7.  
  8. $(SCE_PS3_ROOT)\target\ppu\lib\libhttp_stub.a
  9. $(SCE_PS3_ROOT)\target\ppu\lib\libhttp_util_stub.a
  10. $(SCE_PS3_ROOT)\target\ppu\lib\libnet_stub.a
  11.  
  12. //ex:
  13.  
  14. char response[255];
  15. SendRequest("http://www.google.com/", response, 255);
  16. //button monitoring:
  17. //header: http://adf.ly/rt4tg (pad.h) or  http://adf.ly/rt4tO
  18. //init:
  19.  
  20. #inlcude "pad.h"
  21. extern "C" int main(void)//main entry
  22. {
  23. cellPadInit(MAX_PAD);
  24. }
  25.  
  26. /*
  27. analog monitoring:
  28. step 1:
  29. link the pad library to your project:
  30. */
  31.  
  32. $(SCE_PS3_ROOT)\target\ppu\lib\libpadfilter.a
  33.  
  34. /*step2:
  35. go to the sample of pad utility from sony:
  36. */
  37.  
  38. $(SCE_PS3_ROOT)\samples\common\padutil
  39.  
  40. /*step3:
  41. add padutil.h & padutil.cpp to your project
  42. ex:
  43. */
  44.  
  45. #include <cell/pad.h>
  46. #include <cell/padfilter.h>
  47. #include "padutil.h"
  48. void ex(uint32_t* Lx,uint32_t* Rx,uint32_t* Ly,uint32_t* Ry)
  49. {
  50.     CellPadUtilAxis buffR = cellPadUtilGetAxisValue(0, CELL_UTIL_ANALOG_RIGHT);
  51.     CellPadUtilAxis buffL = cellPadUtilGetAxisValue(0, CELL_UTIL_ANALOG_LEFT);
  52.    *Lx = buffL.x;
  53.    *Rx = buffR.x;
  54.    *Ly = buffL.y;
  55.    *Ry = buffR.y;
  56. }
  57. uint32_t lel[4];
  58. extern "C" int main()
  59. {
  60.   ex(&lel[0],&lel[1],&lel[2],&lel[3]);
  61.   if(lel[0] > lel[1])
  62.     printf(":P");
  63.   return 0;
  64. }
  65.  
  66. //printf:
  67.  
  68.  
  69. void printf(int n,...)
  70. {
  71.     void* lol;
  72.     va_list a;
  73.     va_start(a,n);
  74.     lol = va_arg(a,void*);
  75.         uint32_t len;
  76.         system_call_4(403, 0, (uint64_t)lol, 32, (uint64_t) &len);
  77.     va_end(a);
  78. }
  79. //va (short version of sprintf) :
  80.  
  81. void* va(int n,...)
  82. {
  83.     void* buff;
  84.     va_list a;
  85.     va_start(a,n);
  86.     buff =  va_arg(a,void*);
  87.     va_end(a);
  88.     return buff;
  89. }
  90. /*dialog[again dankz to blb]:
  91. Header: [C++] [C++] Dialogs.h - http://pastebin.com/zPWdmgAC
  92. LIB:*/ $(SCE_PS3_ROOT)\target\ppu\lib\libsysutil_stub.a
  93.  
  94. /*HOW TO USE IT
  95. Simple dialog:
  96. */
  97.  
  98. Dialog::msgdialog_mode = Dialog::MODE_STRING_OK;
  99. Dialog::Show("Hey, this is a dialog");
  100.  
  101. //a YES/NO dialog:
  102.  
  103. Dialog::msgdialog_mode = Dialog::MODE_STRING_YESNO;
  104. Dialog::ShowYESNO("[NGU]: ELITE REJECTED, Want to try again?");
  105. while(!Dialog::Finished){} //wait for it to end
  106. bool ret = Dialog::YESNO;  //if true, its YES, else its NO
  107. Dialog::End(); //end the yes/no dialog
  108. The keyboard(still in alpha):
  109. Code:
  110. char retText[32];  //our buffer
  111. Keyboard::oskdialog_mode = Keyboard::MODE_OPEN;
  112. while(Keyboard::oskdialog_mode != Keyboard::MODE_EXIT)
  113. { Keyboard::keyboard(retText, "Title", "Preset Text");} //wait for the keyboard to end and run it meanwhile
  114. Last edited by milky4444; Today at 04:42 AM.
Add Comment
Please, Sign In to add comment