Advertisement
PauSix

PSP Hello World main.c

Feb 13th, 2017
995
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. // include psp headers
  2. #include <pspkernel.h>
  3. #include <pspdebug.h>
  4. #include <pspdisplay.h>
  5.  
  6. // include our callback
  7. #include "../common/callback.h"
  8.  
  9.  
  10. // configure PSP stuff
  11. #define VERS    1
  12. #define REVS    0
  13.  
  14. PSP_MODULE_INFO("HelloWorld", PSP_MODULE_USER, VERS, REVS);
  15. PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
  16.  
  17.  
  18. // make printing easier on us
  19. #define printf pspDebugScreenPrintf
  20.  
  21.  
  22. int main(int argc, char** argv)
  23. {
  24.     // basic init
  25.     setupExitCallback();
  26.     pspDebugScreenInit();
  27.    
  28.     // while this program is alive
  29.     while(isRunning()) {
  30.         sceDisplayWaitVblankStart(); // wait for vblank
  31.         pspDebugScreenClear(); // reset where we draw
  32.         pspDebugScreenSetXY(0, 0); // reset where we draw
  33.         printf("Hello World!"); // print some text
  34.     }
  35.    
  36.     // exit
  37.     sceKernelExitGame();
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement