beginnings for Pandora support
[picodrive.git] / platform / common / common.h
... / ...
CommitLineData
1// platform specific things for common menu code
2
3#ifdef __GP2X__
4#include "../gp2x/gp2x.h"
5
6#define BTN_UP GP2X_UP
7#define BTN_DOWN GP2X_DOWN
8#define BTN_LEFT GP2X_LEFT
9#define BTN_RIGHT GP2X_RIGHT
10
11#define BTN_NORTH GP2X_Y
12#define BTN_SOUTH GP2X_X
13#define BTN_WEST GP2X_A
14#define BTN_EAST GP2X_B
15#define BTN_L GP2X_L
16#define BTN_R GP2X_R
17
18unsigned long wait_for_input(unsigned long interesting);
19void gp2x_pd_clone_buffer2(void);
20void menu_darken_bg(void *dst, int pixels, int darker);
21void menu_flip(void);
22
23#define SCREEN_WIDTH 320
24#define SCREEN_HEIGHT 240
25#define SCREEN_BUFFER gp2x_screen
26
27#define read_buttons(which) \
28 wait_for_input(which)
29#define read_buttons_async(which) \
30 (gp2x_joystick_read(0) & (which))
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
44// TODO
45//#include "../gizmondo/giz.h"
46#define SCREEN_WIDTH 321
47#define SCREEN_BUFFER menu_screen
48extern unsigned char *menu_screen;
49
50// ------------------------------------
51
52#elif defined(PSP)
53
54#include "../psp/psp.h"
55
56#define BTN_NORTH BTN_TRIANGLE
57#define BTN_SOUTH BTN_X
58#define BTN_WEST BTN_SQUARE
59#define BTN_EAST BTN_CIRCLE
60
61unsigned long wait_for_input(unsigned int interesting, int is_key_config);
62void menu_draw_begin(void);
63void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
64void menu_draw_end(void);
65
66#define SCREEN_WIDTH 512
67#define SCREEN_HEIGHT 272
68#define SCREEN_BUFFER psp_screen
69
70#define read_buttons(which) \
71 wait_for_input(which, 0)
72#define read_buttons_async(which) \
73 (psp_pad_read(0) & (which))
74#define clear_screen() \
75 memset(SCREEN_BUFFER, 0, SCREEN_WIDTH*SCREEN_HEIGHT*2)
76#define darken_screen() \
77 menu_darken_bg(psp_screen, psp_screen, SCREEN_WIDTH*SCREEN_HEIGHT, 0)
78
79// ------------------------------------
80
81#elif defined(PANDORA)
82
83// TODO
84
85#include "../gp2x/gp2x.h"
86
87#define BTN_UP 0
88#define BTN_DOWN 0
89#define BTN_LEFT 0
90#define BTN_RIGHT 0
91
92#define BTN_NORTH 0
93#define BTN_SOUTH 0
94#define BTN_WEST 0
95#define BTN_EAST 0
96#define BTN_L 0
97#define BTN_R 0
98
99unsigned long wait_for_input(unsigned long interesting);
100void gp2x_pd_clone_buffer2(void);
101void menu_darken_bg(void *dst, int pixels, int darker);
102void menu_flip(void);
103
104#define SCREEN_WIDTH 320
105#define SCREEN_HEIGHT 240
106#define SCREEN_BUFFER gp2x_screen
107
108#define read_buttons(which) \
109 wait_for_input(which)
110#define read_buttons_async(which) \
111 (gp2x_joystick_read(0) & (which))
112#define menu_draw_begin() \
113 gp2x_pd_clone_buffer2()
114#define clear_screen() \
115 memset(gp2x_screen, 0, 320*240*2)
116#define darken_screen() \
117 menu_darken_bg(gp2x_screen, 320*240, 0)
118#define menu_draw_end() \
119 menu_flip()
120
121#endif