1 // platform specific things for common menu code
4 #include "../gp2x/gp2x.h"
6 #define PBTN_UP GP2X_UP
7 #define PBTN_DOWN GP2X_DOWN
8 #define PBTN_LEFT GP2X_LEFT
9 #define PBTN_RIGHT GP2X_RIGHT
11 #define PBTN_NORTH GP2X_Y
12 #define PBTN_SOUTH GP2X_X
13 #define PBTN_WEST GP2X_A
14 #define PBTN_EAST GP2X_B
18 unsigned long wait_for_input(unsigned long interesting);
19 void gp2x_pd_clone_buffer2(void);
20 void menu_darken_bg(void *dst, int pixels, int darker);
23 #define SCREEN_WIDTH 320
24 #define SCREEN_HEIGHT 240
25 #define SCREEN_BUFFER gp2x_screen
27 #define read_buttons(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() \
40 // ------------------------------------
42 #elif defined(__GIZ__)
44 #include "../gizmondo/giz.h"
46 #define PBTN_NORTH PBTN_STOP
47 #define PBTN_SOUTH PBTN_PLAY
48 #define PBTN_WEST PBTN_REW
49 #define PBTN_EAST PBTN_FWD
51 unsigned long wait_for_input(unsigned int interesting);
52 void menu_draw_begin(int use_bgbuff);
53 void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
54 void menu_draw_end(void);
56 #define SCREEN_WIDTH 321
57 #define SCREEN_HEIGHT 240
58 #define SCREEN_BUFFER ((giz_screen != NULL) ? giz_screen : menu_screen)
59 extern void *menu_screen;
60 extern void *giz_screen;
62 #define read_buttons(which) \
64 #define read_buttons_async(which) 0
65 #define menu_draw_begin() \
67 #define clear_screen() \
68 memset(SCREEN_BUFFER, 0, SCREEN_WIDTH*SCREEN_HEIGHT*2)
69 #define darken_screen() \
70 menu_darken_bg(menu_screen, menu_screen, SCREEN_WIDTH*SCREEN_HEIGHT, 0)
72 // ------------------------------------
76 #include "../psp/psp.h"
78 #define PBTN_NORTH PBTN_TRIANGLE
79 #define PBTN_SOUTH PBTN_X
80 #define PBTN_WEST PBTN_SQUARE
81 #define PBTN_EAST PBTN_CIRCLE
83 unsigned long wait_for_input(unsigned int interesting, int is_key_config);
84 void menu_draw_begin(void);
85 void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
86 void menu_draw_end(void);
88 #define SCREEN_WIDTH 512
89 #define SCREEN_HEIGHT 272
90 #define SCREEN_BUFFER psp_screen
92 #define read_buttons(which) \
93 wait_for_input(which, 0)
94 #define read_buttons_async(which) \
95 (psp_pad_read(0) & (which))
96 #define clear_screen() \
97 memset(SCREEN_BUFFER, 0, SCREEN_WIDTH*SCREEN_HEIGHT*2)
98 #define darken_screen() \
99 menu_darken_bg(psp_screen, psp_screen, SCREEN_WIDTH*SCREEN_HEIGHT, 0)
101 // ------------------------------------
103 #elif defined(PANDORA)
107 #include "../gp2x/gp2x.h"
121 unsigned long wait_for_input(unsigned long interesting);
122 void gp2x_pd_clone_buffer2(void);
123 void menu_darken_bg(void *dst, int pixels, int darker);
124 void menu_flip(void);
126 #define SCREEN_WIDTH 800
127 #define SCREEN_HEIGHT 480
128 #define SCREEN_BUFFER gp2x_screen
130 #define read_buttons(which) \
131 wait_for_input(which)
132 #define read_buttons_async(which) \
133 (gp2x_joystick_read(0) & (which))
134 #define menu_draw_begin() \
135 gp2x_pd_clone_buffer2()
136 #define clear_screen() \
137 memset(gp2x_screen, 0, 800*480*2)
138 #define darken_screen() \
139 menu_darken_bg(gp2x_screen, 800*480, 0)
140 #define menu_draw_end() \