clarify PicoDrive's license
[picodrive.git] / platform / psp / psp.h
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
9 #include <pspctrl.h>
10
11 void psp_init(void);
12 void psp_finish(void);
13
14 void psp_msleep(int ms);
15
16 // vram usage map:
17 // 000000-044000 fb0
18 // 044000-088000 fb1
19 // 088000-0cc000 depth (?)
20 // 0cc000-126000 emu draw buffers: 512*240 + 512*240*2
21
22 #define VRAMOFFS_FB0    0x00000000
23 #define VRAMOFFS_FB1    0x00044000
24 #define VRAMOFFS_DEPTH  0x00088000
25 #define VRAMOFFS_STUFF  0x000cc000
26
27 #define VRAM_FB0        ((void *) (0x44000000+VRAMOFFS_FB0))
28 #define VRAM_FB1        ((void *) (0x44000000+VRAMOFFS_FB1))
29 #define VRAM_STUFF      ((void *) (0x44000000+VRAMOFFS_STUFF))
30
31 #define VRAM_CACHED_STUFF   ((void *) (0x04000000+VRAMOFFS_STUFF))
32
33 #define GU_CMDLIST_SIZE (16*1024)
34
35 extern unsigned int guCmdList[GU_CMDLIST_SIZE];
36 extern int psp_unhandled_suspend;
37
38 void *psp_video_get_active_fb(void);
39 void  psp_video_switch_to_single(void);
40 void  psp_video_flip(int wait_vsync);
41 extern void *psp_screen;
42
43 unsigned int psp_pad_read(int blocking);
44
45 int psp_get_cpu_clock(void);
46 int psp_set_cpu_clock(int clock);
47
48 char *psp_get_status_line(void);
49
50 void psp_wait_suspend(void);
51 void psp_resume_suspend(void);
52
53 /* shorter btn names */
54 #define PBTN_UP       PSP_CTRL_UP
55 #define PBTN_LEFT     PSP_CTRL_LEFT
56 #define PBTN_RIGHT    PSP_CTRL_RIGHT
57 #define PBTN_DOWN     PSP_CTRL_DOWN
58 #define PBTN_L        PSP_CTRL_LTRIGGER
59 #define PBTN_R        PSP_CTRL_RTRIGGER
60 #define PBTN_TRIANGLE PSP_CTRL_TRIANGLE
61 #define PBTN_CIRCLE   PSP_CTRL_CIRCLE
62 #define PBTN_X        PSP_CTRL_CROSS
63 #define PBTN_SQUARE   PSP_CTRL_SQUARE
64 #define PBTN_SELECT   PSP_CTRL_SELECT
65 #define PBTN_START    PSP_CTRL_START
66 #define PBTN_NOTE     PSP_CTRL_NOTE // doesn't seem to work?
67
68 /* fake 'nub' btns */
69 #define PBTN_NUB_UP    (1 << 28)
70 #define PBTN_NUB_RIGHT (1 << 29)
71 #define PBTN_NUB_DOWN  (1 << 30)
72 #define PBTN_NUB_LEFT  (1 << 31)
73