psp.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // (c) Copyright 2007 notaz, All rights reserved.
  2. // Free for non-commercial use.
  3. // For commercial use, separate licencing terms must be obtained.
  4. #include <pspctrl.h>
  5. void psp_init(void);
  6. void psp_finish(void);
  7. void psp_msleep(int ms);
  8. // vram usage map:
  9. // 000000-044000 fb0
  10. // 044000-088000 fb1
  11. // 088000-0cc000 depth (?)
  12. // 0cc000-126000 emu draw buffers: 512*240 + 512*240*2
  13. #define VRAMOFFS_FB0 0x00000000
  14. #define VRAMOFFS_FB1 0x00044000
  15. #define VRAMOFFS_DEPTH 0x00088000
  16. #define VRAMOFFS_STUFF 0x000cc000
  17. #define VRAM_FB0 ((void *) (0x44000000+VRAMOFFS_FB0))
  18. #define VRAM_FB1 ((void *) (0x44000000+VRAMOFFS_FB1))
  19. #define VRAM_STUFF ((void *) (0x44000000+VRAMOFFS_STUFF))
  20. #define VRAM_CACHED_STUFF ((void *) (0x04000000+VRAMOFFS_STUFF))
  21. #define GU_CMDLIST_SIZE (16*1024)
  22. extern unsigned int guCmdList[GU_CMDLIST_SIZE];
  23. extern int psp_unhandled_suspend;
  24. void *psp_video_get_active_fb(void);
  25. void psp_video_switch_to_single(void);
  26. void psp_video_flip(int wait_vsync);
  27. extern void *psp_screen;
  28. unsigned int psp_pad_read(int blocking);
  29. int psp_get_cpu_clock(void);
  30. int psp_set_cpu_clock(int clock);
  31. char *psp_get_status_line(void);
  32. void psp_wait_suspend(void);
  33. void psp_resume_suspend(void);
  34. /* shorter btn names */
  35. #define PBTN_UP PSP_CTRL_UP
  36. #define PBTN_LEFT PSP_CTRL_LEFT
  37. #define PBTN_RIGHT PSP_CTRL_RIGHT
  38. #define PBTN_DOWN PSP_CTRL_DOWN
  39. #define PBTN_L PSP_CTRL_LTRIGGER
  40. #define PBTN_R PSP_CTRL_RTRIGGER
  41. #define PBTN_TRIANGLE PSP_CTRL_TRIANGLE
  42. #define PBTN_CIRCLE PSP_CTRL_CIRCLE
  43. #define PBTN_X PSP_CTRL_CROSS
  44. #define PBTN_SQUARE PSP_CTRL_SQUARE
  45. #define PBTN_SELECT PSP_CTRL_SELECT
  46. #define PBTN_START PSP_CTRL_START
  47. #define PBTN_NOTE PSP_CTRL_NOTE // doesn't seem to work?
  48. /* fake 'nub' btns */
  49. #define PBTN_NUB_UP (1 << 28)
  50. #define PBTN_NUB_RIGHT (1 << 29)
  51. #define PBTN_NUB_DOWN (1 << 30)
  52. #define PBTN_NUB_LEFT (1 << 31)