1 // platform specific things for common menu code
4 #include "../gp2x/gp2x.h"
7 #define BTN_DOWN GP2X_DOWN
8 #define BTN_LEFT GP2X_LEFT
9 #define BTN_RIGHT GP2X_RIGHT
11 #define BTN_NORTH GP2X_Y
12 #define BTN_SOUTH GP2X_X
13 #define BTN_WEST GP2X_A
14 #define BTN_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__)
45 //#include "../gizmondo/giz.h"
46 #define SCREEN_WIDTH 321
47 #define SCREEN_BUFFER menu_screen
48 extern unsigned char *menu_screen;
50 // ------------------------------------
54 #include "../psp/psp.h"
56 #define BTN_NORTH BTN_TRIANGLE
57 #define BTN_SOUTH BTN_X
58 #define BTN_WEST BTN_SQUARE
59 #define BTN_EAST BTN_CIRCLE
61 unsigned long wait_for_input(unsigned int interesting, int is_key_config);
62 void menu_draw_begin(void);
63 void menu_darken_bg(void *dst, const void *src, int pixels, int darker);
64 void menu_draw_end(void);
66 #define SCREEN_WIDTH 512
67 #define SCREEN_HEIGHT 272
68 #define SCREEN_BUFFER psp_screen
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)