psp.h 1.9 KB

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