psp.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include <pspctrl.h>
  2. void psp_init(void);
  3. void psp_finish(void);
  4. void psp_msleep(int ms);
  5. // vram usage map:
  6. // 000000-044000 fb0
  7. // 044000-088000 fb1
  8. // 088000-0cc000 depth (?)
  9. // 0cc000-126000 emu draw buffers: 512*240 + 512*240*2
  10. #define VRAMOFFS_FB0 0x00000000
  11. #define VRAMOFFS_FB1 0x00044000
  12. #define VRAMOFFS_DEPTH 0x00088000
  13. #define VRAMOFFS_STUFF 0x000cc000
  14. #define VRAM_FB0 ((void *) (0x44000000+VRAMOFFS_FB0))
  15. #define VRAM_FB1 ((void *) (0x44000000+VRAMOFFS_FB1))
  16. #define VRAM_STUFF ((void *) (0x44000000+VRAMOFFS_STUFF))
  17. #define VRAM_CACHED_STUFF ((void *) (0x04000000+VRAMOFFS_STUFF))
  18. #define GU_CMDLIST_SIZE (16*1024)
  19. extern unsigned int guCmdList[GU_CMDLIST_SIZE];
  20. void *psp_video_get_active_fb(void);
  21. void psp_video_switch_to_single(void);
  22. void psp_video_flip(int wait_vsync);
  23. extern void *psp_screen;
  24. unsigned int psp_pad_read(int blocking);
  25. int psp_get_cpu_clock(void);
  26. int psp_set_cpu_clock(int clock);
  27. /* shorter btn names */
  28. #define BTN_UP PSP_CTRL_UP
  29. #define BTN_LEFT PSP_CTRL_LEFT
  30. #define BTN_RIGHT PSP_CTRL_RIGHT
  31. #define BTN_DOWN PSP_CTRL_DOWN
  32. #define BTN_L PSP_CTRL_LTRIGGER
  33. #define BTN_R PSP_CTRL_RTRIGGER
  34. #define BTN_TRIANGLE PSP_CTRL_TRIANGLE
  35. #define BTN_CIRCLE PSP_CTRL_CIRCLE
  36. #define BTN_X PSP_CTRL_CROSS
  37. #define BTN_SQUARE PSP_CTRL_SQUARE
  38. #define BTN_SELECT PSP_CTRL_SELECT
  39. #define BTN_START PSP_CTRL_START
  40. #define BTN_NOTE PSP_CTRL_NOTE // doesn't seem to work?