7d7ac93dc22ebe6202dd893e98d2817a8ea049f2
[picodrive.git] / platform / gp2x / menu.c
1 #include "../libpicofe/gp2x/plat_gp2x.h"
2
3 // ------------ gfx options menu ------------
4
5
6 const char *men_scaling_opts[] = { "OFF", "software", "hardware", NULL };
7
8 #define MENU_OPTIONS_GFX \
9         mee_enum      ("Horizontal scaling",       MA_OPT_SCALING,        currentConfig.scaling, men_scaling_opts), \
10         mee_enum      ("Vertical scaling",         MA_OPT_VSCALING,       currentConfig.vscaling, men_scaling_opts), \
11         mee_onoff     ("Tearing Fix",              MA_OPT_TEARING_FIX,    currentConfig.EmuOpt, EOPT_WIZ_TEAR_FIX), \
12         /*mee_onoff     ("A_SN's gamma curve",       MA_OPT2_A_SN_GAMMA,    currentConfig.EmuOpt, EOPT_A_SN_GAMMA),*/ \
13         mee_onoff     ("Vsync",                    MA_OPT2_VSYNC,         currentConfig.EmuOpt, EOPT_VSYNC),
14
15 #define MENU_OPTIONS_ADV \
16         mee_onoff     ("Use second CPU for sound", MA_OPT_ARM940_SOUND,   PicoOpt, POPT_EXT_FM), \
17
18
19 static menu_entry e_menu_adv_options[];
20 static menu_entry e_menu_gfx_options[];
21 static menu_entry e_menu_options[];
22 static menu_entry e_menu_keyconfig[];
23
24 void gp2x_menu_init(void)
25 {
26         /* disable by default.. */
27         me_enable(e_menu_adv_options, MA_OPT_ARM940_SOUND, 0);
28         me_enable(e_menu_gfx_options, MA_OPT_TEARING_FIX, 0);
29         me_enable(e_menu_gfx_options, MA_OPT2_GAMMA, 0);
30         me_enable(e_menu_gfx_options, MA_OPT2_A_SN_GAMMA, 0);
31
32         switch (gp2x_dev_id) {
33         case GP2X_DEV_GP2X:
34                 me_enable(e_menu_adv_options, MA_OPT_ARM940_SOUND, 1);
35                 me_enable(e_menu_gfx_options, MA_OPT2_GAMMA, 1);
36                 me_enable(e_menu_gfx_options, MA_OPT2_A_SN_GAMMA, 1);
37                 break;
38         case GP2X_DEV_WIZ:
39                 me_enable(e_menu_gfx_options, MA_OPT_TEARING_FIX, 1);
40                 break;
41         case GP2X_DEV_CAANOO:
42                 break;
43         default:
44                 break;
45         }
46
47         if (gp2x_dev_id != GP2X_DEV_GP2X)
48                 men_scaling_opts[2] = NULL; /* leave only off and sw */
49
50         if (gp2x_dev_id != GP2X_DEV_CAANOO)
51                 me_enable(e_menu_keyconfig, MA_CTRL_DEADZONE, 0);
52 }
53