1 // (c) Copyright 2006-2009 notaz, All rights reserved.
5 MB_NONE = 1, /* no auto processing */
6 MB_OPT_ONOFF, /* ON/OFF setting */
7 MB_OPT_RANGE, /* [min-max] setting */
8 MB_OPT_CUSTOM, /* custom value */
19 void *var; /* for on-off/range settings */
20 int mask; /* bit to toggle for on/off */
21 signed short min; /* for ranged integer settings, to be sign-extended */
23 unsigned int enabled:1;
24 unsigned int need_to_save:1;
25 unsigned int selectable:1;
26 int (*handler)(int id, int keys);
27 const char * (*generate_name)(int id, int *offs);
32 #define mee_handler_id(name, id, handler) \
33 { name, MB_NONE, id, NULL, 0, 0, 0, 1, 0, 1, handler, NULL, NULL, NULL }
35 #define mee_handler(name, handler) \
36 mee_handler_id(name, MA_NONE, handler)
38 #define mee_label(name) \
39 { name, MB_NONE, MA_NONE, NULL, 0, 0, 0, 1, 0, 0, NULL, NULL, NULL, NULL }
41 #define mee_label_mk(id, name_func) \
42 { "", MB_NONE, id, NULL, 0, 0, 0, 1, 0, 0, NULL, name_func, NULL, NULL }
44 #define mee_onoff_h(name, id, var, mask, help) \
45 { name, MB_OPT_ONOFF, id, &(var), mask, 0, 0, 1, 1, 1, NULL, NULL, NULL, help }
47 #define mee_onoff(name, id, var, mask) \
48 mee_onoff_h(name, id, var, mask, NULL)
50 #define mee_range(name, id, var, min, max) \
51 { name, MB_OPT_RANGE, id, &(var), 0, min, max, 1, 1, 1, NULL, NULL, NULL, NULL }
53 #define mee_range_hide(name, id, var, min, max) \
54 { name, MB_OPT_RANGE, id, &(var), 0, min, max, 0, 1, 0, NULL, NULL, NULL, NULL }
56 #define mee_cust_s_h(name, id, need_save, handler, name_func, help) \
57 { name, MB_OPT_CUSTOM, id, NULL, 0, 0, 0, 1, need_save, 1, handler, name_func, NULL, help }
59 #define mee_cust_h(name, id, handler, name_func, help) \
60 mee_cust_s_h(name, id, 1, handler, name_func, help)
62 #define mee_cust(name, id, handler, name_func) \
63 mee_cust_h(name, id, handler, name_func, NULL)
65 #define mee_cust_nosave(name, id, handler, name_func) \
66 mee_cust_s_h(name, id, 0, handler, name_func, NULL)
68 #define mee_onoff_cust(name, id, var, mask, name_func) \
69 { name, MB_OPT_CUSTONOFF, id, &(var), mask, 0, 0, 1, 1, 1, NULL, name_func, NULL, NULL }
71 #define mee_range_cust(name, id, var, min, max, name_func) \
72 { name, MB_OPT_CUSTRANGE, id, &(var), 0, min, max, 1, 1, 1, NULL, name_func, NULL, NULL }
74 #define mee_enum_h(name, id, var, names_list, help) \
75 { name, MB_OPT_ENUM, id, &(var), 0, 0, 0, 1, 1, 1, NULL, NULL, names_list, help }
77 #define mee_enum(name, id, var, names_list) \
78 mee_enum_h(name, id, var, names_list, NULL)
81 { NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL }
89 extern me_bind_action me_ctrl_actions[];
90 extern me_bind_action emuctrl_actions[]; // platform code
92 extern void *g_menubg_src_ptr;
93 extern void *g_menubg_ptr;
94 extern void *g_menuscreen_ptr;
95 #if MSCREEN_SIZE_FIXED
96 #define g_menuscreen_w MSCREEN_WIDTH
97 #define g_menuscreen_h MSCREEN_HEIGHT
99 extern int g_menuscreen_w;
100 extern int g_menuscreen_h;
103 void menu_init(void);
104 void text_out16(int x, int y, const char *texto, ...);
105 void me_update_msg(const char *msg);
107 void menu_romload_prepare(const char *rom_name);
108 void menu_romload_end(void);
110 void menu_loop(void);
111 int menu_loop_tray(void);
113 menu_entry *me_list_get_first(void);
114 menu_entry *me_list_get_next(void);