move select from evdev to upper level
[picodrive.git] / platform / common / common.h
CommitLineData
f579f7b8 1// platform specific things for common menu code
2
3#ifdef __GP2X__
4#include "../gp2x/gp2x.h"
5
e5ab6faf 6#define PBTN_UP GP2X_UP
7#define PBTN_DOWN GP2X_DOWN
8#define PBTN_LEFT GP2X_LEFT
9#define PBTN_RIGHT GP2X_RIGHT
10
11#define PBTN_NORTH GP2X_Y
12#define PBTN_SOUTH GP2X_X
13#define PBTN_WEST GP2X_A
14#define PBTN_EAST GP2X_B
15#define PBTN_L GP2X_L
16#define PBTN_R GP2X_R
f579f7b8 17
b6820926 18/* menu nav */
19#define PBTN_MOK GP2X_B
20#define PBTN_MBACK GP2X_X
21#define PBTN_MENU GP2X_SELECT
22
f579f7b8 23void gp2x_pd_clone_buffer2(void);
24void menu_darken_bg(void *dst, int pixels, int darker);
25void menu_flip(void);
26
27#define SCREEN_WIDTH 320
28#define SCREEN_HEIGHT 240
29#define SCREEN_BUFFER gp2x_screen
30
f579f7b8 31#define menu_draw_begin() \
32 gp2x_pd_clone_buffer2()
33#define clear_screen() \
34 memset(gp2x_screen, 0, 320*240*2)
35#define darken_screen() \
36 menu_darken_bg(gp2x_screen, 320*240, 0)
37#define menu_draw_end() \
38 menu_flip()
39
40// ------------------------------------
41
42#elif defined(__GIZ__)
43
84100c0f 44#include "../gizmondo/giz.h"
45
e5ab6faf 46#define PBTN_NORTH PBTN_STOP
47#define PBTN_SOUTH PBTN_PLAY
48#define PBTN_WEST PBTN_REW
49#define PBTN_EAST PBTN_FWD
84100c0f 50
84100c0f 51void menu_draw_begin(int use_bgbuff);
52void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
53void menu_draw_end(void);
54
55#define SCREEN_WIDTH 321
56#define SCREEN_HEIGHT 240
57#define SCREEN_BUFFER ((giz_screen != NULL) ? giz_screen : menu_screen)
58extern void *menu_screen;
59extern void *giz_screen;
60
84100c0f 61#define menu_draw_begin() \
62 menu_draw_begin(1)
63#define clear_screen() \
64 memset(SCREEN_BUFFER, 0, SCREEN_WIDTH*SCREEN_HEIGHT*2)
65#define darken_screen() \
66 menu_darken_bg(menu_screen, menu_screen, SCREEN_WIDTH*SCREEN_HEIGHT, 0)
f579f7b8 67
68// ------------------------------------
69
70#elif defined(PSP)
71
72#include "../psp/psp.h"
73
e5ab6faf 74#define PBTN_NORTH PBTN_TRIANGLE
75#define PBTN_SOUTH PBTN_X
76#define PBTN_WEST PBTN_SQUARE
77#define PBTN_EAST PBTN_CIRCLE
f579f7b8 78
f579f7b8 79void menu_draw_begin(void);
80void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
81void menu_draw_end(void);
82
83#define SCREEN_WIDTH 512
84#define SCREEN_HEIGHT 272
85#define SCREEN_BUFFER psp_screen
86
f579f7b8 87#define clear_screen() \
88 memset(SCREEN_BUFFER, 0, SCREEN_WIDTH*SCREEN_HEIGHT*2)
89#define darken_screen() \
90 menu_darken_bg(psp_screen, psp_screen, SCREEN_WIDTH*SCREEN_HEIGHT, 0)
91
3a3947cd 92// ------------------------------------
93
94#elif defined(PANDORA)
95
3b13ec65 96#define PBTN_UP (1 << 0)
97#define PBTN_DOWN (1 << 1)
98#define PBTN_LEFT (1 << 2)
99#define PBTN_RIGHT (1 << 3)
100
101#define PBTN_NORTH (1 << 4)
102#define PBTN_SOUTH (1 << 5)
103#define PBTN_WEST (1 << 6)
104#define PBTN_EAST (1 << 7)
105#define PBTN_L (1 << 8)
106#define PBTN_R (1 << 9)
3a3947cd 107
b6820926 108/* menu nav */
109#define PBTN_MOK PBTN_EAST
110#define PBTN_MBACK PBTN_SOUTH
111#define PBTN_MENU (1 << 10)
112
3a3947cd 113void gp2x_pd_clone_buffer2(void);
114void menu_darken_bg(void *dst, int pixels, int darker);
115void menu_flip(void);
116
b6820926 117extern void *gp2x_screen;
118
e55f0cbb 119#define SCREEN_WIDTH 800
120#define SCREEN_HEIGHT 480
3a3947cd 121#define SCREEN_BUFFER gp2x_screen
122
3a3947cd 123#define menu_draw_begin() \
124 gp2x_pd_clone_buffer2()
125#define clear_screen() \
e55f0cbb 126 memset(gp2x_screen, 0, 800*480*2)
3a3947cd 127#define darken_screen() \
e55f0cbb 128 menu_darken_bg(gp2x_screen, 800*480, 0)
3a3947cd 129#define menu_draw_end() \
130 menu_flip()
131
f579f7b8 132#endif