step-frame added to debug
[picodrive.git] / platform / common / menu.h
... / ...
CommitLineData
1// (c) Copyright 2006-2008 notaz, All rights reserved.
2
3
4void menu_init(void);
5void text_out16(int x, int y, const char *texto, ...);
6void smalltext_out16(int x, int y, const char *texto, int color);
7void smalltext_out16_lim(int x, int y, const char *texto, int color, int max);
8void menu_draw_selection(int x, int y, int w);
9void debug_menu_loop(void);
10
11extern char menuErrorMsg[64];
12
13typedef enum
14{
15 MB_NONE = 1, /* no auto processing */
16 MB_ONOFF, /* ON/OFF setting */
17 MB_RANGE, /* [min-max] setting */
18} menu_behavior;
19
20typedef enum
21{
22 MA_NONE = 1,
23 MA_MAIN_RESUME_GAME,
24 MA_MAIN_SAVE_STATE,
25 MA_MAIN_LOAD_STATE,
26 MA_MAIN_RESET_GAME,
27 MA_MAIN_LOAD_ROM,
28 MA_MAIN_OPTIONS,
29 MA_MAIN_CONTROLS,
30 MA_MAIN_CREDITS,
31 MA_MAIN_PATCHES,
32 MA_MAIN_EXIT,
33 MA_OPT_RENDERER,
34 MA_OPT_SCALING,
35 MA_OPT_ACC_TIMING,
36 MA_OPT_ACC_SPRITES,
37 MA_OPT_SHOW_FPS,
38 MA_OPT_FRAMESKIP,
39 MA_OPT_ENABLE_SOUND,
40 MA_OPT_SOUND_QUALITY,
41 MA_OPT_ARM940_SOUND,
42 MA_OPT_6BUTTON_PAD,
43 MA_OPT_REGION,
44 MA_OPT_SRAM_STATES,
45 MA_OPT_CONFIRM_STATES,
46 MA_OPT_SAVE_SLOT,
47 MA_OPT_CPU_CLOCKS,
48 MA_OPT_SCD_OPTS,
49 MA_OPT_ADV_OPTS,
50 MA_OPT_DISP_OPTS, /* psp */
51 MA_OPT_SAVECFG,
52 MA_OPT_SAVECFG_GAME,
53 MA_OPT_LOADCFG,
54 MA_OPT_INTERLACED, /* giz */
55 MA_OPT2_GAMMA,
56 MA_OPT2_A_SN_GAMMA,
57 MA_OPT2_DBLBUFF, /* giz */
58 MA_OPT2_VSYNC,
59 MA_OPT2_ENABLE_Z80,
60 MA_OPT2_ENABLE_YM2612,
61 MA_OPT2_ENABLE_SN76496,
62 MA_OPT2_GZIP_STATES,
63 MA_OPT2_NO_LAST_ROM,
64 MA_OPT2_RAMTIMINGS, /* gp2x */
65 MA_OPT2_SQUIDGEHACK, /* gp2x */
66 MA_OPT2_STATUS_LINE, /* psp */
67 MA_OPT2_NO_FRAME_LIMIT, /* psp */
68 MA_OPT2_SVP_DYNAREC,
69 MA_OPT2_NO_SPRITE_LIM,
70 MA_OPT2_NO_IDLE_LOOPS,
71 MA_OPT2_DONE,
72 MA_OPT3_SCALE, /* psp (all OPT3) */
73 MA_OPT3_HSCALE32,
74 MA_OPT3_HSCALE40,
75 MA_OPT3_PRES_NOSCALE,
76 MA_OPT3_PRES_SCALE43,
77 MA_OPT3_PRES_FULLSCR,
78 MA_OPT3_FILTERING,
79 MA_OPT3_VSYNC,
80 MA_OPT3_GAMMAA,
81 MA_OPT3_BLACKLVL,
82 MA_OPT3_DONE,
83 MA_CDOPT_TESTBIOS_USA,
84 MA_CDOPT_TESTBIOS_EUR,
85 MA_CDOPT_TESTBIOS_JAP,
86 MA_CDOPT_LEDS,
87 MA_CDOPT_CDDA,
88 MA_CDOPT_PCM,
89 MA_CDOPT_READAHEAD,
90 MA_CDOPT_SAVERAM,
91 MA_CDOPT_SCALEROT_CHIP,
92 MA_CDOPT_BETTER_SYNC,
93 MA_CDOPT_DONE,
94} menu_id;
95
96typedef struct
97{
98 char *name;
99 menu_behavior beh;
100 menu_id id;
101 void *var; /* for on-off settings */
102 int mask;
103 signed char min; /* for ranged integer settings, to be sign-extended */
104 signed char max;
105 char enabled;
106 char need_to_save;
107} menu_entry;
108
109typedef struct
110{
111 char *name;
112 int mask;
113} me_bind_action;
114
115extern me_bind_action me_ctrl_actions[12];
116extern me_bind_action emuctrl_actions[]; // platform code
117
118
119typedef void (me_draw_custom_f)(const menu_entry *entry, int x, int y, void *param);
120
121int me_id2offset(const menu_entry *entries, int count, menu_id id);
122void me_enable(menu_entry *entries, int count, menu_id id, int enable);
123int me_count_enabled(const menu_entry *entries, int count);
124menu_id me_index2id(const menu_entry *entries, int count, int index);
125void me_draw(const menu_entry *entries, int count, int x, int y, me_draw_custom_f *cust_draw, void *param);
126int me_process(menu_entry *entries, int count, menu_id id, int is_next);
127
128const char *me_region_name(unsigned int code, int auto_order);
129