1 // (c) Copyright 2006-2009 notaz, All rights reserved.
3 #include "port_config.h"
7 MB_NONE = 1, /* no auto processing */
8 MB_OPT_ONOFF, /* ON/OFF setting */
9 MB_OPT_RANGE, /* [min-max] setting */
10 MB_OPT_CUSTOM, /* custom value */
40 MA_OPT_CONFIRM_STATES,
45 MA_OPT_DISP_OPTS, /* psp */
49 MA_OPT_INTERLACED, /* giz */
50 MA_OPT_ROTATION, /* uiq */
51 MA_OPT_TEARING_FIX, /* wiz */
54 MA_OPT2_DBLBUFF, /* giz */
57 MA_OPT2_ENABLE_YM2612,
58 MA_OPT2_ENABLE_SN76496,
61 MA_OPT2_RAMTIMINGS, /* gp2x */
62 MA_OPT2_SQUIDGEHACK, /* gp2x */
63 MA_OPT2_STATUS_LINE, /* psp */
64 MA_OPT2_NO_FRAME_LIMIT, /* psp */
66 MA_OPT2_NO_SPRITE_LIM,
67 MA_OPT2_NO_IDLE_LOOPS,
69 MA_OPT3_SCALE, /* psp (all OPT3) */
84 MA_CDOPT_TESTBIOS_USA,
85 MA_CDOPT_TESTBIOS_EUR,
86 MA_CDOPT_TESTBIOS_JAP,
92 MA_CDOPT_SCALEROT_CHIP,
98 MA_32XOPT_MSH2_CYCLES,
99 MA_32XOPT_SSH2_CYCLES,
115 void *var; /* for on-off/range settings */
116 int mask; /* bit to toggle for on/off */
117 signed short min; /* for ranged integer settings, to be sign-extended */
119 unsigned int enabled:1;
120 unsigned int need_to_save:1;
121 unsigned int selectable:1;
122 int (*handler)(menu_id id, int keys);
123 const char * (*generate_name)(menu_id id, int *offs);
128 #define mee_handler_id(name, id, handler) \
129 { name, MB_NONE, id, NULL, 0, 0, 0, 1, 0, 1, handler, NULL, NULL, NULL }
131 #define mee_handler(name, handler) \
132 mee_handler_id(name, MA_NONE, handler)
134 #define mee_label(name) \
135 { name, MB_NONE, MA_NONE, NULL, 0, 0, 0, 1, 0, 0, NULL, NULL, NULL, NULL }
137 #define mee_label_mk(id, name_func) \
138 { "", MB_NONE, id, NULL, 0, 0, 0, 1, 0, 0, NULL, name_func, NULL, NULL }
140 #define mee_onoff_h(name, id, var, mask, help) \
141 { name, MB_OPT_ONOFF, id, &(var), mask, 0, 0, 1, 1, 1, NULL, NULL, NULL, help }
143 #define mee_onoff(name, id, var, mask) \
144 mee_onoff_h(name, id, var, mask, NULL)
146 #define mee_range(name, id, var, min, max) \
147 { name, MB_OPT_RANGE, id, &(var), 0, min, max, 1, 1, 1, NULL, NULL, NULL, NULL }
149 #define mee_range_hide(name, id, var, min, max) \
150 { name, MB_OPT_RANGE, id, &(var), 0, min, max, 0, 1, 0, NULL, NULL, NULL, NULL }
152 #define mee_cust_s_h(name, id, need_save, handler, name_func, help) \
153 { name, MB_OPT_CUSTOM, id, NULL, 0, 0, 0, 1, need_save, 1, handler, name_func, NULL, help }
155 #define mee_cust_h(name, id, handler, name_func, help) \
156 mee_cust_s_h(name, id, 1, handler, name_func, help)
158 #define mee_cust(name, id, handler, name_func) \
159 mee_cust_h(name, id, handler, name_func, NULL)
161 #define mee_cust_nosave(name, id, handler, name_func) \
162 mee_cust_s_h(name, id, 0, handler, name_func, NULL)
164 #define mee_onoff_cust(name, id, var, mask, name_func) \
165 { name, MB_OPT_CUSTONOFF, id, &(var), mask, 0, 0, 1, 1, 1, NULL, name_func, NULL, NULL }
167 #define mee_range_cust(name, id, var, min, max, name_func) \
168 { name, MB_OPT_CUSTRANGE, id, &(var), 0, min, max, 1, 1, 1, NULL, name_func, NULL, NULL }
170 #define mee_enum_h(name, id, var, names_list, help) \
171 { name, MB_OPT_ENUM, id, &(var), 0, 0, 0, 1, 1, 1, NULL, NULL, names_list, help }
173 #define mee_enum(name, id, var, names_list) \
174 mee_enum_h(name, id, var, names_list, NULL)
177 { NULL, 0, 0, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL }
185 extern me_bind_action me_ctrl_actions[15];
186 extern me_bind_action emuctrl_actions[]; // platform code
188 extern void *g_menubg_src_ptr;
189 extern void *g_menubg_ptr;
190 extern void *g_menuscreen_ptr;
191 #if SCREEN_SIZE_FIXED
192 #define g_menuscreen_w MSCREEN_WIDTH
193 #define g_menuscreen_h MSCREEN_HEIGHT
195 extern int g_menuscreen_w;
196 extern int g_menuscreen_h;
199 void menu_init(void);
200 void text_out16(int x, int y, const char *texto, ...);
201 void me_update_msg(const char *msg);
203 void menu_romload_prepare(const char *rom_name);
204 void menu_romload_end(void);
206 void menu_loop(void);
207 int menu_loop_tray(void);
209 menu_entry *me_list_get_first(void);
210 menu_entry *me_list_get_next(void);