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