2 * (C) GraÅžvydas "notaz" Ignotas, 2006-2010
4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
13 MB_NONE = 1, /* no auto processing */
14 MB_OPT_ONOFF, /* ON/OFF setting */
15 MB_OPT_RANGE, /* [min-max] setting */
16 MB_OPT_CUSTOM, /* custom value */
27 void *var; /* for on-off/range settings */
28 int mask; /* bit to toggle for on/off */
29 signed short min; /* for ranged integer settings, to be sign-extended */
31 unsigned int enabled:1;
32 unsigned int need_to_save:1;
33 unsigned int selectable:1;
34 int (*handler)(int id, int keys);
35 const char * (*generate_name)(int id, int *offs);
40 #define mee_handler_id_h(name, id, handler, help) \
41 { name, MB_NONE, id, NULL, 0, 0, 0, 1, 0, 1, handler, NULL, NULL, help }
43 #define mee_handler_id(name, id, handler) \
44 mee_handler_id_h(name, id, handler, NULL)
46 #define mee_handler(name, handler) \
47 mee_handler_id(name, MA_NONE, handler)
49 #define mee_handler_h(name, handler, help) \
50 mee_handler_id_h(name, MA_NONE, handler, help)
52 #define mee_label(name) \
53 { name, MB_NONE, MA_NONE, NULL, 0, 0, 0, 1, 0, 0, NULL, NULL, NULL, NULL }
55 #define mee_label_mk(id, name_func) \
56 { "", MB_NONE, id, NULL, 0, 0, 0, 1, 0, 0, NULL, name_func, NULL, NULL }
58 #define mee_onoff_h(name, id, var, mask, help) \
59 { name, MB_OPT_ONOFF, id, &(var), mask, 0, 0, 1, 1, 1, NULL, NULL, NULL, help }
61 #define mee_onoff(name, id, var, mask) \
62 mee_onoff_h(name, id, var, mask, NULL)
64 #define mee_range(name, id, var, min, max) \
65 { name, MB_OPT_RANGE, id, &(var), 0, min, max, 1, 1, 1, NULL, NULL, NULL, NULL }
67 #define mee_range_hide(name, id, var, min, max) \
68 { name, MB_OPT_RANGE, id, &(var), 0, min, max, 0, 1, 0, NULL, NULL, NULL, NULL }
70 #define mee_cust_s_h(name, id, need_save, handler, name_func, help) \
71 { name, MB_OPT_CUSTOM, id, NULL, 0, 0, 0, 1, need_save, 1, handler, name_func, NULL, help }
73 #define mee_cust_h(name, id, handler, name_func, help) \
74 mee_cust_s_h(name, id, 1, handler, name_func, help)
76 #define mee_cust(name, id, handler, name_func) \
77 mee_cust_h(name, id, handler, name_func, NULL)
79 #define mee_cust_nosave(name, id, handler, name_func) \
80 mee_cust_s_h(name, id, 0, handler, name_func, NULL)
82 #define mee_onoff_cust(name, id, var, mask, name_func) \
83 { name, MB_OPT_CUSTONOFF, id, &(var), mask, 0, 0, 1, 1, 1, NULL, name_func, NULL, NULL }
85 #define mee_range_cust(name, id, var, min, max, name_func) \
86 { name, MB_OPT_CUSTRANGE, id, &(var), 0, min, max, 1, 1, 1, NULL, name_func, NULL, NULL }
88 #define mee_enum_h(name, id, var, names_list, help) \
89 { name, MB_OPT_ENUM, id, &(var), 0, 0, 0, 1, 1, 1, NULL, NULL, names_list, help }
91 #define mee_enum(name, id, var, names_list) \
92 mee_enum_h(name, id, var, names_list, NULL)
95 { NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL }
103 extern me_bind_action me_ctrl_actions[];
104 extern me_bind_action emuctrl_actions[]; // platform code
106 extern void *g_menubg_src_ptr;
107 extern void *g_menubg_ptr;
108 extern void *g_menuscreen_ptr;
109 #if MSCREEN_SIZE_FIXED
110 #define g_menuscreen_w MSCREEN_WIDTH
111 #define g_menuscreen_h MSCREEN_HEIGHT
113 extern int g_menuscreen_w;
114 extern int g_menuscreen_h;
117 void menu_init(void);
118 void text_out16(int x, int y, const char *texto, ...);
119 void me_update_msg(const char *msg);
121 void menu_romload_prepare(const char *rom_name);
122 void menu_romload_end(void);
124 void menu_loop(void);
125 int menu_loop_tray(void);
127 menu_entry *me_list_get_first(void);
128 menu_entry *me_list_get_next(void);