Merge pull request #321 from negativeExponent/core_options

Minimize core options shown by default
This commit is contained in:
hizzlekizzle
2020-02-14 22:15:52 -06:00
committed by GitHub
2 changed files with 168 additions and 90 deletions

View File

@@ -103,6 +103,8 @@ unsigned dendy = 0;
static unsigned systemRegion = 0; static unsigned systemRegion = 0;
static unsigned opt_region = 0; static unsigned opt_region = 0;
static unsigned opt_showAdvSoundOptions = 0;
static unsigned opt_showAdvSystemOptions = 0;
int FCEUnetplay; int FCEUnetplay;
#ifdef PSP #ifdef PSP
@@ -1010,11 +1012,11 @@ static const keymap turbomap[] = {
static void set_apu_channels(int chan) static void set_apu_channels(int chan)
{ {
FSettings.SquareVolume[1] = 256 * ((chan >> 0) & 1); FSettings.SquareVolume[1] = (chan & 1) ? 256 : 0;
FSettings.SquareVolume[0] = 256 * ((chan >> 1) & 1); FSettings.SquareVolume[0] = (chan & 2) ? 256 : 0;
FSettings.TriangleVolume = 256 * ((chan >> 2) & 1); FSettings.TriangleVolume = (chan & 3) ? 256 : 0;
FSettings.NoiseVolume = 256 * ((chan >> 3) & 1); FSettings.NoiseVolume = (chan & 4) ? 256 : 0;
FSettings.PCMVolume = 256 * ((chan >> 4) & 1); FSettings.PCMVolume = (chan & 5) ? 256 : 0;
} }
static void check_variables(bool startup) static void check_variables(bool startup)
@@ -1301,10 +1303,9 @@ static void check_variables(bool startup)
} }
} }
#ifdef DEBUG
var.key = key; var.key = key;
enable_apu = 0; enable_apu = 0xff;
strcpy(key, "fceumm_apu_x"); strcpy(key, "fceumm_apu_x");
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
@@ -1313,15 +1314,73 @@ static void check_variables(bool startup)
var.value = NULL; var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && !strcmp(var.value, "disabled")) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && !strcmp(var.value, "disabled"))
{ {
enable_apu |= (1 << i); enable_apu &= ~(1 << i);
} }
} }
set_apu_channels(enable_apu ^ 0xff); set_apu_channels(enable_apu);
#else
set_apu_channels(0xff);
#endif
update_dipswitch(); update_dipswitch();
var.key = "fceumm_show_adv_system_options";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
unsigned newval = (!strcmp(var.value, "enabled")) ? 1 : 0;
if ((opt_showAdvSystemOptions != newval) || startup)
{
opt_showAdvSystemOptions = newval;
struct retro_core_option_display option_display;
unsigned i;
unsigned size;
char options_list[][25] = {
"fceumm_overclocking",
"fceumm_ramstate",
"fceumm_nospritelimit",
"fceumm_up_down_allowed",
"fceumm_show_crosshair"
};
option_display.visible = opt_showAdvSystemOptions;
size = sizeof(options_list) / sizeof(options_list[0]);
for (i = 0; i < size; i++)
{
option_display.key = options_list[i];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
}
}
}
var.key = "fceumm_show_adv_sound_options";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
unsigned newval = (!strcmp(var.value, "enabled")) ? 1 : 0;
if ((opt_showAdvSoundOptions != newval) || startup)
{
opt_showAdvSoundOptions = newval;
struct retro_core_option_display option_display;
unsigned i;
unsigned size;
char options_list[][25] = {
"fceumm_sndvolume",
"fceumm_sndquality",
"fceumm_swapduty",
"fceumm_apu_1",
"fceumm_apu_2",
"fceumm_apu_3",
"fceumm_apu_4",
"fceumm_apu_5"
};
option_display.visible = opt_showAdvSoundOptions;
size = sizeof(options_list) / sizeof(options_list[0]);
for (i = 0; i < size; i++)
{
option_display.key = options_list[i];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
}
}
}
} }
static int mzx = 0, mzy = 0; static int mzx = 0, mzy = 0;

View File

@@ -31,7 +31,7 @@ extern "C" {
struct retro_core_option_definition option_defs_common[] = { struct retro_core_option_definition option_defs_common[] = {
{ {
"fceumm_region", "fceumm_region",
"Region Override", "Region",
"Force core to use NTSC, PAL or Dendy region timings.", "Force core to use NTSC, PAL or Dendy region timings.",
{ {
{ "Auto", NULL }, { "Auto", NULL },
@@ -43,15 +43,39 @@ struct retro_core_option_definition option_defs_common[] = {
"Auto", "Auto",
}, },
{ {
"fceumm_aspect", "fceumm_overclocking",
"Preferred aspect ratio", "Overclock",
"Choose preferred aspect ratio.", "Enables or disables overclocking which can reduce slowdowns in some games. Postrender method is more compatible with every game with Vblank more effective for games like Contra Force.",
{ {
{ "8:7 PAR", NULL }, { "disabled", NULL },
{ "4:3", NULL }, { "2x-Postrender", NULL },
{ "2x-VBlank", NULL },
{ NULL, NULL}, { NULL, NULL},
}, },
"8:7 PAR", "disabled",
},
{
"fceumm_ramstate",
"RAM Power-On Fill (Needs Restart)",
"Choose RAM startup during power up. Some games rely on initial ram values for random generator as an example.",
{
{ "fill $ff", "$FF" },
{ "fill $00", "$00" },
{ "random", "random" },
{ NULL, NULL},
},
"fill $ff",
},
{
"fceumm_nospritelimit",
"No Sprite Limit",
"Removes the 8-per-scanline hardware limit. This reduces sprite flickering but can cause some games to glitch since some use this for effects.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL},
},
"disabled",
}, },
{ {
"fceumm_palette", "fceumm_palette",
@@ -82,17 +106,16 @@ struct retro_core_option_definition option_defs_common[] = {
"default", "default",
}, },
{ {
"fceumm_up_down_allowed", "fceumm_aspect",
"Allow Opposing Directions", "Aspect Ratio",
"Allows simultaneous UP+DOWN or LEFT+RIGHT button combinations which can create different effects in some games.", "Choose preferred aspect ratio.",
{ {
{ "disabled", NULL }, { "8:7 PAR", NULL },
{ "enabled", NULL }, { "4:3", NULL },
{ NULL, NULL}, { NULL, NULL},
}, },
"disabled", "8:7 PAR",
}, },
#ifdef PSP #ifdef PSP
{ {
"fceumm_overscan", "fceumm_overscan",
@@ -108,7 +131,7 @@ struct retro_core_option_definition option_defs_common[] = {
#else #else
{ {
"fceumm_overscan_h", "fceumm_overscan_h",
"Crop Overscan (Horizontal)", "Crop Horizontal Overscan",
"Removes 8 pixel from left and right side of the screen to simulate overscan seen on standard CRT television.", "Removes 8 pixel from left and right side of the screen to simulate overscan seen on standard CRT television.",
{ {
{ "disabled", NULL }, { "disabled", NULL },
@@ -119,7 +142,7 @@ struct retro_core_option_definition option_defs_common[] = {
}, },
{ {
"fceumm_overscan_v", "fceumm_overscan_v",
"Crop Overscan (Vertical)", "Crop Vertical Overscan",
"Removes 8 pixel from the top and bottom of the screen to simulate overscan seen on standard CRT television.", "Removes 8 pixel from the top and bottom of the screen to simulate overscan seen on standard CRT television.",
{ {
{ "disabled", NULL }, { "disabled", NULL },
@@ -128,54 +151,11 @@ struct retro_core_option_definition option_defs_common[] = {
}, },
"enabled", "enabled",
}, },
#endif #endif /* overscan options */
{ {
"fceumm_nospritelimit", "fceumm_up_down_allowed",
"No Sprite Limit", "Allow Opposing Directions",
"Removes the 8-per-scanline hardware limit. This reduces sprite flickering but can cause some games to glitch since some use this for effects.", "Allows simultaneous UP+DOWN or LEFT+RIGHT button combinations which can create different effects in some games.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL},
},
"disabled",
},
{
"fceumm_sndvolume",
"Sound Volume",
"Change master volume level",
{
{ "0", NULL },
{ "1", NULL },
{ "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL},
},
"7",
},
{
"fceumm_sndquality",
"Sound Quality",
"Enable higher quality sounds in exchange for more processing power required",
{
{ "Low", NULL },
{ "High", NULL },
{ "Very High", NULL },
{ NULL, NULL},
},
"Low",
},
{
"fceumm_swapduty",
"Swap Duty Cycles",
"Simulates the sound from famiclones has the pulse wave channels duty cycle bits reversed.",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@@ -237,30 +217,48 @@ struct retro_core_option_definition option_defs_common[] = {
"enabled", "enabled",
}, },
{ {
"fceumm_overclocking", "fceumm_sndquality",
"Overclocking", "Sound Quality",
"Enables or disables overclocking which can reduce slowdowns in some games. Postrender method is more compatible with every game with Vblank more effective for games like Contra Force.", "Enable higher quality sounds in exchange for more processing power required",
{ {
{ "disabled", NULL }, { "Low", NULL },
{ "2x-Postrender", NULL }, { "High", NULL },
{ "2x-VBlank", NULL }, { "Very High", NULL },
{ NULL, NULL},
},
"Low",
},
{
"fceumm_swapduty",
"Swap Duty Cycles",
"Simulates the sound from famiclones has the pulse wave channels duty cycle bits reversed.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL}, { NULL, NULL},
}, },
"disabled", "disabled",
}, },
{ {
"fceumm_ramstate", "fceumm_sndvolume",
"RAM power up state (Restart)", "Master Volume",
"Choose RAM startup during power up. Some games rely on initial ram values for random generator as an example.", "Change master volume level",
{ {
{ "fill $ff", NULL }, { "0", NULL },
{ "fill $00", NULL }, { "1", NULL },
{ "random", NULL }, { "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL}, { NULL, NULL},
}, },
"fill $ff", "7",
}, },
#ifdef DEBUG
{ {
"fceumm_apu_1", "fceumm_apu_1",
"Channel 1 (Square 1)", "Channel 1 (Square 1)",
@@ -316,7 +314,28 @@ struct retro_core_option_definition option_defs_common[] = {
}, },
"enabled", "enabled",
}, },
#endif {
"fceumm_show_adv_system_options",
"Show Advanced System Options",
"Show advanced system options and tweaks.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"fceumm_show_adv_sound_options",
"Show Advanced Sound Options",
"Show advanced sound options and tweaks.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{ NULL, NULL, NULL, { {0} }, NULL }, { NULL, NULL, NULL, { {0} }, NULL },
}; };