some work on PSP CLUT
[libpicofe.git] / psp / psp.h
1 #include <pspctrl.h>
2
3 void psp_init(void);
4 void psp_finish(void);
5
6 void psp_msleep(int ms);
7
8 // vram usage map:
9 // 000000-044000 fb0
10 // 044000-088000 fb1
11 // 088000-0cc000 depth (?)
12 // 0cc000-0??000 stuff
13
14 #define VRAMOFFS_FB0    ((void *) 0x00000000)
15 #define VRAMOFFS_FB1    ((void *) 0x00044000)
16 #define VRAMOFFS_DEPTH  ((void *) 0x00088000)
17
18 #define VRAM_FB0        ((void *) 0x44000000)
19 #define VRAM_FB1        ((void *) 0x44044000)
20 #define VRAM_STUFF      ((void *) 0x440cc000)
21
22 #define VRAM_CACHED_STUFF   ((void *) 0x040cc000)
23
24 #define GU_CMDLIST_SIZE (16*1024) // TODO: adjust
25
26 extern unsigned int guCmdList[GU_CMDLIST_SIZE];
27
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
33 unsigned int psp_pad_read(int blocking);
34
35 int psp_get_cpu_clock(void);
36 int psp_set_cpu_clock(int clock);
37
38 /* shorter btn names */
39 #define BTN_UP       PSP_CTRL_UP
40 #define BTN_LEFT     PSP_CTRL_LEFT
41 #define BTN_RIGHT    PSP_CTRL_RIGHT
42 #define BTN_DOWN     PSP_CTRL_DOWN
43 #define BTN_L        PSP_CTRL_LTRIGGER
44 #define BTN_R        PSP_CTRL_RTRIGGER
45 #define BTN_TRIANGLE PSP_CTRL_TRIANGLE
46 #define BTN_CIRCLE   PSP_CTRL_CIRCLE
47 #define BTN_X        PSP_CTRL_CROSS
48 #define BTN_SQUARE   PSP_CTRL_SQUARE
49 #define BTN_SELECT   PSP_CTRL_SELECT
50 #define BTN_START    PSP_CTRL_START
51 #define BTN_NOTE     PSP_CTRL_NOTE
52