final src and Makefile adjustments for PSP release
[picodrive.git] / platform / psp / psp.h
1 // (c) Copyright 2007 notaz, All rights reserved.
2 // Free for non-commercial use.
3
4 // For commercial use, separate licencing terms must be obtained.
5
6 #include <pspctrl.h>
7
8 void psp_init(void);
9 void psp_finish(void);
10
11 void psp_msleep(int ms);
12
13 // vram usage map:
14 // 000000-044000 fb0
15 // 044000-088000 fb1
16 // 088000-0cc000 depth (?)
17 // 0cc000-126000 emu draw buffers: 512*240 + 512*240*2
18
19 #define VRAMOFFS_FB0    0x00000000
20 #define VRAMOFFS_FB1    0x00044000
21 #define VRAMOFFS_DEPTH  0x00088000
22 #define VRAMOFFS_STUFF  0x000cc000
23
24 #define VRAM_FB0        ((void *) (0x44000000+VRAMOFFS_FB0))
25 #define VRAM_FB1        ((void *) (0x44000000+VRAMOFFS_FB1))
26 #define VRAM_STUFF      ((void *) (0x44000000+VRAMOFFS_STUFF))
27
28 #define VRAM_CACHED_STUFF   ((void *) (0x04000000+VRAMOFFS_STUFF))
29
30 #define GU_CMDLIST_SIZE (16*1024)
31
32 extern unsigned int guCmdList[GU_CMDLIST_SIZE];
33
34 void *psp_video_get_active_fb(void);
35 void  psp_video_switch_to_single(void);
36 void  psp_video_flip(int wait_vsync);
37 extern void *psp_screen;
38
39 unsigned int psp_pad_read(int blocking);
40
41 int psp_get_cpu_clock(void);
42 int psp_set_cpu_clock(int clock);
43
44 char *psp_get_status_line(void);
45
46 /* shorter btn names */
47 #define BTN_UP       PSP_CTRL_UP
48 #define BTN_LEFT     PSP_CTRL_LEFT
49 #define BTN_RIGHT    PSP_CTRL_RIGHT
50 #define BTN_DOWN     PSP_CTRL_DOWN
51 #define BTN_L        PSP_CTRL_LTRIGGER
52 #define BTN_R        PSP_CTRL_RTRIGGER
53 #define BTN_TRIANGLE PSP_CTRL_TRIANGLE
54 #define BTN_CIRCLE   PSP_CTRL_CIRCLE
55 #define BTN_X        PSP_CTRL_CROSS
56 #define BTN_SQUARE   PSP_CTRL_SQUARE
57 #define BTN_SELECT   PSP_CTRL_SELECT
58 #define BTN_START    PSP_CTRL_START
59 #define BTN_NOTE     PSP_CTRL_NOTE // doesn't seem to work?
60
61 /* fake 'nub' btns */
62 #define BTN_NUB_UP    (1 << 28)
63 #define BTN_NUB_RIGHT (1 << 29)
64 #define BTN_NUB_DOWN  (1 << 30)
65 #define BTN_NUB_LEFT  (1 << 31)
66