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