diff --git a/src/libretro/libretro.cpp b/src/libretro/libretro.cpp index 3450a2a6..382c4d07 100644 --- a/src/libretro/libretro.cpp +++ b/src/libretro/libretro.cpp @@ -33,31 +33,37 @@ #include "../gb/gbSGB.h" #include "../gb/gbSound.h" +#define FRAMERATE (16777216.0 / 280896.0) // 59.73 +#define SAMPLERATE 32768.0 + static retro_log_printf_t log_cb; static retro_video_refresh_t video_cb; static retro_input_poll_t poll_cb; static retro_input_state_t input_cb; static retro_environment_t environ_cb; -retro_audio_sample_batch_t audio_batch_cb; static retro_set_rumble_state_t rumble_cb; +retro_audio_sample_batch_t audio_batch_cb; static char retro_system_directory[2048]; static char biosfile[4096]; -static float sndFiltering = 0.5f; -static bool sndInterpolation = true; static bool can_dupe = false; -static bool usebios = false; + +// core options +static bool option_sndInterpolation = true; +static bool option_useBios = false; +static bool option_colorizerHack = false; +static bool option_forceRTCenable = false; +static bool option_showAdvancedOptions = false; +static double option_sndFiltering = 0.5; +static unsigned option_gbPalette = 0; + static unsigned retropad_device[4] = {0}; -static const double FramesPerSecond = (16777216.0 / 280896.0); // 59.73 -static const long SampleRate = 32768; -static unsigned width = gbaWidth; -static unsigned height = gbaHeight; +static unsigned systemWidth = gbaWidth; +static unsigned systemHeight = gbaHeight; static EmulatedSystem* core = NULL; static IMAGE_TYPE type = IMAGE_UNKNOWN; -static unsigned current_gbPalette = 0; -static bool opt_colorizer_hack = false; -static bool opt_forceRTCenable = false; +// global vars uint16_t systemColorMap16[0x10000]; uint32_t systemColorMap32[0x10000]; int RGB_LOW_BITS_MASK = 0; @@ -203,18 +209,13 @@ static void set_gbPalette(void) if (gbCgbMode || gbSgbMode) return; - const uint16_t *pal = defaultGBPalettes[current_gbPalette].data; + const uint16_t *pal = defaultGBPalettes[option_gbPalette].data; for (int i = 0; i < 8; i++) { uint16_t val = pal[i]; gbPalette[i] = val; } } -static void set_gbColorCorrection(int value) -{ - gbColorOption = value; -} - static bool gb_hasrtc(void) { switch (gbRomType) { @@ -543,17 +544,23 @@ void retro_get_system_info(struct retro_system_info *info) void retro_get_system_av_info(struct retro_system_av_info *info) { - float aspect = (3.0f / 2.0f); - if (type == IMAGE_GB) - aspect = !gbBorderOn ? (10.0 / 9.0) : (8.0 / 7.0); + double aspect = (3.0f / 2.0f); + unsigned maxWidth = gbaWidth; + unsigned maxHeight = gbaHeight; - info->geometry.base_width = width; - info->geometry.base_height = height; - info->geometry.max_width = width; - info->geometry.max_height = height; + if (type == IMAGE_GB) { + aspect = !gbBorderOn ? (10.0 / 9.0) : (8.0 / 7.0); + maxWidth = sgbWidth; + maxHeight = sgbHeight; + } + + info->geometry.base_width = systemWidth; + info->geometry.base_height = systemHeight; + info->geometry.max_width = maxWidth; + info->geometry.max_height = maxHeight; info->geometry.aspect_ratio = aspect; - info->timing.fps = FramesPerSecond; - info->timing.sample_rate = (double)SampleRate; + info->timing.fps = FRAMERATE; + info->timing.sample_rate = SAMPLERATE; } void retro_init(void) @@ -572,10 +579,18 @@ void retro_init(void) snprintf(retro_system_directory, sizeof(retro_system_directory), "%s", dir); #ifdef FRONTEND_SUPPORTS_RGB565 + systemColorDepth = 16; + systemRedShift = 11; + systemGreenShift = 6; + systemBlueShift = 0; enum retro_pixel_format rgb565 = RETRO_PIXEL_FORMAT_RGB565; if (environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb565) && log_cb) log_cb(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n"); #else + systemColorDepth = 32; + systemRedShift = 19; + systemGreenShift = 11; + systemBlueShift = 3; enum retro_pixel_format rgb8888 = RETRO_PIXEL_FORMAT_XRGB8888; if (environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb8888) && log_cb) log_cb(RETRO_LOG_INFO, "Frontend supports XRGB8888 - will use that instead of XRGB1555.\n"); @@ -588,7 +603,6 @@ void retro_init(void) rumble_cb = rumble.set_rumble_state; } else rumble_cb = NULL; - } static const char *gbGetCartridgeType(void) @@ -802,7 +816,7 @@ static void load_image_preferences(void) if (flashSize == SIZE_FLASH512 || flashSize == SIZE_FLASH1M) flashSetSize(flashSize); - if (opt_forceRTCenable) + if (option_forceRTCenable) rtcEnabled = true; rtcEnable(rtcEnabled); @@ -825,25 +839,6 @@ static void load_image_preferences(void) log("mirroringEnable : %s.\n", mirroringEnable ? "Yes" : "No"); } -static void update_colormaps(void) -{ -#ifdef FRONTEND_SUPPORTS_RGB565 - systemColorDepth = 16; - systemRedShift = 11; - systemGreenShift = 6; - systemBlueShift = 0; -#else - systemColorDepth = 32; - systemRedShift = 19; - systemGreenShift = 11; - systemBlueShift = 3; -#endif - - utilUpdateSystemColorMaps(false); - - log("Color Depth = %d\n", systemColorDepth); -} - #ifdef _WIN32 static const char SLASH = '\\'; #else @@ -855,16 +850,16 @@ static void gba_init(void) log("Loading VBA-M Core (GBA)...\n"); load_image_preferences(); - soundSetSampleRate(SampleRate); + soundSetSampleRate(SAMPLERATE); - if (usebios) { + if (option_useBios) { snprintf(biosfile, sizeof(biosfile), "%s%c%s", retro_system_directory, SLASH, "gba_bios.bin"); log("Loading bios: %s\n", biosfile); } - CPUInit(biosfile, usebios); + CPUInit(biosfile, option_useBios); - width = gbaWidth; - height = gbaHeight; + systemWidth = gbaWidth; + systemHeight = gbaHeight; CPUReset(); } @@ -877,32 +872,32 @@ static void gb_init(void) gbGetHardwareType(); - setColorizerHack(opt_colorizer_hack); + setColorizerHack(option_colorizerHack); // Disable bios loading when using Colorizer hack - if (opt_colorizer_hack) - usebios = false; + if (option_colorizerHack) + option_useBios = false; - if (usebios) { + if (option_useBios) { snprintf(biosfile, sizeof(biosfile), "%s%c%s", retro_system_directory, SLASH, biosname[gbCgbMode]); log("Loading bios: %s\n", biosfile); } - gbCPUInit(biosfile, usebios); + gbCPUInit(biosfile, option_useBios); if (gbBorderOn) { - width = gbBorderLineSkip = sgbWidth; - height = sgbHeight; + systemWidth = gbBorderLineSkip = sgbWidth; + systemHeight = sgbHeight; gbBorderColumnSkip = (sgbWidth - gbWidth) >> 1; gbBorderRowSkip = (sgbHeight - gbHeight) >> 1; } else { - width = gbBorderLineSkip = gbWidth; - height = gbHeight; + systemWidth = gbBorderLineSkip = gbWidth; + systemHeight = gbHeight; gbBorderColumnSkip = gbBorderRowSkip = 0; } - gbSoundSetSampleRate(SampleRate); + gbSoundSetSampleRate(SAMPLERATE); gbSoundSetDeclicking(1); gbReset(); // also resets sound; @@ -942,12 +937,6 @@ static void gb_init(void) log("Game supports SGB functions\n"); } -static void gba_soundchanged(void) -{ - soundInterpolation = sndInterpolation; - soundFiltering = sndFiltering; -} - void retro_deinit(void) { emulating = 0; @@ -964,8 +953,8 @@ void retro_reset(void) #define MAX_PLAYERS 4 #define MAX_BUTTONS 10 #define TURBO_BUTTONS 2 -static bool turbo_enable = false; -static unsigned turbo_delay = 3; +static bool option_turboEnable = false; +static unsigned option_turboDelay = 3; static unsigned turbo_delay_counter[MAX_PLAYERS][TURBO_BUTTONS] = {{0}, {0}}; static const unsigned binds[MAX_BUTTONS] = { RETRO_DEVICE_ID_JOYPAD_A, @@ -989,19 +978,19 @@ static void systemGbBorderOff(void); static void systemUpdateSolarSensor(int level); static uint8_t sensorDarkness = 0xE8; static uint8_t sensorDarknessLevel = 0; // so we can adjust sensor from gamepad -static int astick_deadzone; -static int gyro_sensitivity, tilt_sensitivity; -static bool swap_astick; +static int option_analogDeadzone; +static int option_gyroSensitivity, option_tiltSensitivity; +static bool option_swapAnalogSticks; static void update_variables(bool startup) { + struct retro_variable var = {0}; + char key[256] = {0}; + int disabled_layers = 0; + int sound_enabled = 0x30F; bool sound_changed = false; - char key[256]; - struct retro_variable var; + var.key = key; - - int disabled_layers=0; - strcpy(key, "vbam_layer_x"); for (int i = 0; i < 8; i++) { key[strlen("vbam_layer_")] = '1' + i; @@ -1014,7 +1003,6 @@ static void update_variables(bool startup) layerEnable = DISPCNT & layerSettings; CPUUpdateRenderBuffers(false); - int sound_enabled = 0x30F; strcpy(key, "vbam_sound_x"); for (unsigned i = 0; i < 6; i++) { key[strlen("vbam_sound_")] = '1' + i; @@ -1032,9 +1020,9 @@ static void update_variables(bool startup) var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - bool newval = (strcmp(var.value, "enabled") == 0); - if (sndInterpolation != newval) { - sndInterpolation = newval; + bool newval = (!strcmp(var.value, "enabled")); + if (option_sndInterpolation != newval) { + option_sndInterpolation = newval; sound_changed = true; } } @@ -1043,32 +1031,30 @@ static void update_variables(bool startup) var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - float newval = atof(var.value) * 0.1f; - if (sndFiltering != newval) { - sndFiltering = newval; + double newval = atof(var.value) * 0.1f; + if (option_sndFiltering != newval) { + option_sndFiltering = newval; sound_changed = true; } } if (sound_changed) { - //Update interpolation and filtering values - gba_soundchanged(); + soundInterpolation = option_sndInterpolation; + soundFiltering = option_sndFiltering; } var.key = "vbam_usebios"; var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - bool newval = (strcmp(var.value, "enabled") == 0); - usebios = newval; + option_useBios = (!strcmp(var.value, "enabled")) ? true : false; } var.key = "vbam_forceRTCenable"; var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - bool newval = (strcmp(var.value, "enabled") == 0) ? true : false; - opt_forceRTCenable = newval; + option_forceRTCenable = (!strcmp(var.value, "enabled")) ? true : false; } var.key = "vbam_solarsensor"; @@ -1088,11 +1074,10 @@ static void update_variables(bool startup) gbBorderOn = 0; gbBorderAutomatic = 1; } - else if (strcmp(var.value, "enabled") == 0) { + else if (!strcmp(var.value, "enabled")) { gbBorderAutomatic = 0; gbBorderOn = 1; - } - else { // disabled + } else { // disabled gbBorderOn = 0; gbBorderAutomatic = 0; } @@ -1102,8 +1087,7 @@ static void update_variables(bool startup) if (gbBorderOn) { systemGbBorderOn(); gbSgbRenderBorder(); - } - else + } else systemGbBorderOff(); } } @@ -1130,96 +1114,116 @@ static void update_variables(bool startup) var.value = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { - if (strcmp(var.value, "enabled") == 0) - opt_colorizer_hack = true; - else - opt_colorizer_hack = false; + option_colorizerHack = (!strcmp(var.value, "enabled")) ? true : false; } var.key = "vbam_turboenable"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - bool val = !strcmp(var.value, "enabled"); - turbo_enable = val; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + option_turboEnable = (!strcmp(var.value, "enabled")) ? true : false; } var.key = "vbam_turbodelay"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - turbo_delay = atoi(var.value); + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + option_turboDelay = atoi(var.value); } var.key = "vbam_astick_deadzone"; var.value = NULL; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - astick_deadzone = (int)(atoi(var.value) * 0.01f * 0x8000); + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + option_analogDeadzone = (int)(atof(var.value) * 0.01 * 0x8000); } var.key = "vbam_tilt_sensitivity"; var.value = NULL; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - tilt_sensitivity = atoi(var.value); + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + option_tiltSensitivity = atoi(var.value); } var.key = "vbam_gyro_sensitivity"; var.value = NULL; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - gyro_sensitivity = atoi(var.value); + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + option_gyroSensitivity = atoi(var.value); } var.key = "vbam_swap_astick"; var.value = NULL; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - swap_astick = (bool)(!strcmp(var.value, "enabled")); + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + option_swapAnalogSticks = (!strcmp(var.value, "enabled")) ? true : false; } var.key = "vbam_palettes"; var.value = NULL; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - unsigned lastpal = current_gbPalette; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + unsigned lastpal = option_gbPalette; if (!strcmp(var.value, "black and white")) - current_gbPalette = 0; + option_gbPalette = 0; else if (!strcmp(var.value, "blue sea")) - current_gbPalette = 1; + option_gbPalette = 1; else if (!strcmp(var.value, "dark knight")) - current_gbPalette = 2; + option_gbPalette = 2; else if (!strcmp(var.value, "green forest")) - current_gbPalette = 3; + option_gbPalette = 3; else if (!strcmp(var.value, "hot desert")) - current_gbPalette = 4; + option_gbPalette = 4; else if (!strcmp(var.value, "pink dreams")) - current_gbPalette = 5; + option_gbPalette = 5; else if (!strcmp(var.value, "wierd colors")) - current_gbPalette = 6; + option_gbPalette = 6; else if (!strcmp(var.value, "original gameboy")) - current_gbPalette = 7; + option_gbPalette = 7; else if (!strcmp(var.value, "gba sp")) - current_gbPalette = 8; + option_gbPalette = 8; - if (lastpal != current_gbPalette) + if (lastpal != option_gbPalette) set_gbPalette(); } var.key = "vbam_gbcoloroption"; var.value = NULL; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - int val = (!strcmp(var.value, "enabled")) ? 1 : 0; - set_gbColorCorrection(val); + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + gbColorOption = (!strcmp(var.value, "enabled")) ? 1 : 0; + } + + var.key = "vbam_show_advanced_options"; + var.value = NULL; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { + bool newval = (!strcmp(var.value, "enabled")) ? true : false; + if ((option_showAdvancedOptions != newval) || startup) { + option_showAdvancedOptions = newval; + struct retro_core_option_display option_display; + unsigned i; + char options[][13] = { + "vbam_sound_1", + "vbam_sound_2", + "vbam_sound_3", + "vbam_sound_4", + "vbam_sound_5", + "vbam_sound_6", + "vbam_layer_1", + "vbam_layer_2", + "vbam_layer_3", + "vbam_layer_4", + "vbam_layer_5", + "vbam_layer_6", + "vbam_layer_7", + "vbam_layer_8" + }; + option_display.visible = option_showAdvancedOptions; + for (i = 0; i < (sizeof(options) / sizeof(options[0])); i++) { + option_display.key = options[i]; + environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); + } + } } // Hide some core options depending on rom image type @@ -1233,10 +1237,8 @@ static void update_variables(bool startup) "vbam_showborders", "vbam_gbcoloroption" }; - char gba_options[5][22] = { + char gba_options[3][22] = { "vbam_solarsensor", - "vbam_sound_5", - "vbam_sound_6", "vbam_gyro_sensitivity", "vbam_forceRTCenable" }; @@ -1251,7 +1253,7 @@ static void update_variables(bool startup) // Show or hide GBA only options option_display.visible = (type == IMAGE_GBA) ? 1 : 0; - for (i = 0; i < 5; i++) + for (i = 0; i < 3; i++) { option_display.key = gba_options[i]; environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display); @@ -1271,9 +1273,9 @@ static void updateInput_MotionSensors(void) int16_t analog[3], astick_data[3]; double scaled_range, radius, angle; unsigned tilt_retro_device_index = - swap_astick ? RETRO_DEVICE_INDEX_ANALOG_LEFT : RETRO_DEVICE_INDEX_ANALOG_RIGHT; + option_swapAnalogSticks ? RETRO_DEVICE_INDEX_ANALOG_LEFT : RETRO_DEVICE_INDEX_ANALOG_RIGHT; unsigned gyro_retro_device_index = - swap_astick ? RETRO_DEVICE_INDEX_ANALOG_RIGHT : RETRO_DEVICE_INDEX_ANALOG_LEFT; + option_swapAnalogSticks ? RETRO_DEVICE_INDEX_ANALOG_RIGHT : RETRO_DEVICE_INDEX_ANALOG_LEFT; // Tilt sensor section analog[0] = input_cb(0, RETRO_DEVICE_ANALOG, @@ -1285,12 +1287,12 @@ static void updateInput_MotionSensors(void) radius = sqrt(analog[0] * analog[0] + analog[1] * analog[1]); angle = atan2(analog[1], analog[0]); - if (radius > astick_deadzone) { + if (radius > option_analogDeadzone) { // Re-scale analog stick range to negate deadzone (makes slow movements possible) - radius = (radius - astick_deadzone) * - ((float)ASTICK_MAX/(ASTICK_MAX - astick_deadzone)); + radius = (radius - option_analogDeadzone) * + ((float)ASTICK_MAX/(ASTICK_MAX - option_analogDeadzone)); // Tilt sensor range is from from 1897 to 2197 - radius *= 150.0 / ASTICK_MAX * (tilt_sensitivity / 100.0); + radius *= 150.0 / ASTICK_MAX * (option_tiltSensitivity / 100.0); // Convert back to cartesian coordinates astick_data[0] = +(int16_t)ROUND(radius * cos(angle)); astick_data[1] = -(int16_t)ROUND(radius * sin(angle)); @@ -1304,17 +1306,17 @@ static void updateInput_MotionSensors(void) analog[2] = input_cb(0, RETRO_DEVICE_ANALOG, gyro_retro_device_index, RETRO_DEVICE_ID_ANALOG_X); - if ( analog[2] < -astick_deadzone ) { + if ( analog[2] < -option_analogDeadzone ) { // Re-scale analog stick range - scaled_range = (-analog[2] - astick_deadzone) * - ((float)ASTICK_MAX / (ASTICK_MAX - astick_deadzone)); + scaled_range = (-analog[2] - option_analogDeadzone) * + ((float)ASTICK_MAX / (ASTICK_MAX - option_analogDeadzone)); // Gyro sensor range is +/- 1800 - scaled_range *= 1800.0 / ASTICK_MAX * (gyro_sensitivity / 100.0); + scaled_range *= 1800.0 / ASTICK_MAX * (option_gyroSensitivity / 100.0); astick_data[2] = -(int16_t)ROUND(scaled_range); - } else if ( analog[2] > astick_deadzone ) { - scaled_range = (analog[2] - astick_deadzone) * - ((float)ASTICK_MAX / (ASTICK_MAX - astick_deadzone)); - scaled_range *= (1800.0 / ASTICK_MAX * (gyro_sensitivity / 100.0)); + } else if ( analog[2] > option_analogDeadzone ) { + scaled_range = (analog[2] - option_analogDeadzone) * + ((float)ASTICK_MAX / (ASTICK_MAX - option_analogDeadzone)); + scaled_range *= (1800.0 / ASTICK_MAX * (option_gyroSensitivity / 100.0)); astick_data[2] = +(int16_t)ROUND(scaled_range); } else astick_data[2] = 0; @@ -1496,7 +1498,7 @@ bool retro_load_game(const struct retro_game_info *game) } update_variables(true); - update_colormaps(); + utilUpdateSystemColorMaps(false); soundInit(); if (type == IMAGE_GBA) { @@ -1654,8 +1656,8 @@ bool systemCanChangeSoundQuality(void) void systemDrawScreen(void) { - unsigned pitch = width * (systemColorDepth >> 3); - video_cb(pix, width, height, pitch); + unsigned pitch = systemWidth * (systemColorDepth >> 3); + video_cb(pix, systemWidth, systemHeight, pitch); } void systemFrame(void) @@ -1665,9 +1667,9 @@ void systemFrame(void) void systemGbBorderOn(void) { - bool changed = ((width != sgbWidth) || (height != sgbHeight)); - width = gbBorderLineSkip = sgbWidth; - height = sgbHeight; + bool changed = ((systemWidth != sgbWidth) || (systemHeight != sgbHeight)); + systemWidth = gbBorderLineSkip = sgbWidth; + systemHeight = sgbHeight; gbBorderColumnSkip = (sgbWidth - gbWidth) >> 1; gbBorderRowSkip = (sgbHeight - gbHeight) >> 1; @@ -1682,9 +1684,9 @@ void systemGbBorderOn(void) static void systemGbBorderOff(void) { - bool changed = ((width != gbWidth) || (height != gbHeight)); - width = gbBorderLineSkip = gbWidth; - height = gbHeight; + bool changed = ((systemWidth != gbWidth) || (systemHeight != gbHeight)); + systemWidth = gbBorderLineSkip = gbWidth; + systemHeight = gbHeight; gbBorderColumnSkip = gbBorderRowSkip = 0; struct retro_system_av_info avinfo; @@ -1730,14 +1732,14 @@ uint32_t systemReadJoypad(int which) for (i = 0; i < buttons; i++) J |= input_cb(which, RETRO_DEVICE_JOYPAD, 0, binds[i]) << i; - if (turbo_enable) { + if (option_turboEnable) { /* Handle Turbo A & B buttons */ for (i = 0; i < TURBO_BUTTONS; i++) { if (input_cb(which, RETRO_DEVICE_JOYPAD, 0, turbo_binds[i])) { if (!turbo_delay_counter[which][i]) J |= 1 << i; turbo_delay_counter[which][i]++; - if (turbo_delay_counter[which][i] > turbo_delay) + if (turbo_delay_counter[which][i] > option_turboDelay) /* Reset the toggle if delay value is reached */ turbo_delay_counter[which][i] = 0; } else diff --git a/src/libretro/libretro_core_options.h b/src/libretro/libretro_core_options.h index 20b5c424..47b13b85 100644 --- a/src/libretro/libretro_core_options.h +++ b/src/libretro/libretro_core_options.h @@ -29,7 +29,7 @@ extern "C" { struct retro_core_option_definition option_defs_us[] = { { "vbam_solarsensor", - "Solar sensor level", + "Solar Sensor Level", "Adjusts simulated solar level in Boktai games. L2/R2 buttons can also be used to quickly change levels.", { { "0", NULL }, @@ -49,7 +49,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_usebios", - "Use BIOS file if available (Restart)", + "Use Official BIOS (If Available)", "Use official BIOS when available. Core needs to be restarted for changes to apply.", { { "disabled", NULL }, @@ -60,7 +60,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_forceRTCenable", - "Force enable RTC", + "Force-Enable RTC", "Forces the internal real-time clock to be enabled regardless of rom. Usuable for rom patches that requires clock to be enabled (aka Pokemon).", { { "disabled", NULL }, @@ -103,7 +103,7 @@ struct retro_core_option_definition option_defs_us[] = { { "vbam_palettes", "(GB) Color Palette", - "Set Game Boy palettes.", + "Set Game Boy palettes to use.", { { "black and white", NULL }, { "blue sea", NULL }, @@ -120,7 +120,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_gbHardware", - "(GB) Emulated Hardware", + "(GB) Emulated Hardware (Needs Restart)", "Sets the Game Boy hardware type to emulate. Restart core to apply.", { { "gbc", "Game Boy Color" }, @@ -293,9 +293,20 @@ struct retro_core_option_definition option_defs_us[] = { }, "disabled" }, + { + "vbam_show_advanced_options", + "Show Advanced Options", + "Show advanced options which can enable or disable sound channels and graphics layers.", + { + { "disabled", NULL }, + { "enabled", NULL }, + { NULL, NULL }, + }, + "disabled" + }, { "vbam_sound_1", - "Sound channel 1", + "Sound Channel 1", "Enables or disables tone & sweep sound channel.", { { "disabled", NULL }, @@ -304,9 +315,9 @@ struct retro_core_option_definition option_defs_us[] = { }, "enabled" }, -{ + { "vbam_sound_2", - "Sound channel 2", + "Sound Channel 2", "Enables or disables tone sound channel.", { { "disabled", NULL }, @@ -317,7 +328,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_sound_3", - "Sound channel 3", + "Sound Channel 3", "Enables or disables wave output sound channel.", { { "disabled", NULL }, @@ -328,7 +339,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_sound_4", - "Sound channel 4", + "Sound Channel 4", "Enables or disables noise audio channel.", { { "disabled", NULL }, @@ -339,7 +350,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_sound_5", - "Sound DMA channel A", + "Sound DMA Channel A", "Enables or disables DMA sound channel A.", { { "disabled", NULL }, @@ -350,7 +361,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_sound_6", - "Sound DMA channel B", + "Sound DMA Channel B", "Enables or disables DMA sound channel B.", { { "disabled", NULL }, @@ -361,7 +372,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_1", - "Show background layer 1", + "Show Background Layer 1", "Shows or hides background layer 1.", { { "disabled", NULL }, @@ -372,7 +383,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_2", - "Show background layer 2", + "Show Background Layer 2", "Shows or hides background layer 2.", { { "disabled", NULL }, @@ -383,7 +394,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_3", - "Show background layer 3", + "Show Background Layer 3", "Shows or hides background layer 3.", { { "disabled", NULL }, @@ -394,7 +405,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_4", - "Show background layer 4", + "Show Background Layer 4", "Shows or hides background layer 4.", { { "disabled", NULL }, @@ -405,7 +416,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_5", - "Show sprite layer", + "Show Sprite Layer", "Shows or hides sprite layer.", { { "disabled", NULL }, @@ -416,7 +427,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_6", - "Show window layer 1", + "Show Window Layer 1", "Shows or hides window layer 1.", { { "disabled", NULL }, @@ -427,7 +438,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_7", - "Show window layer 2", + "Show Window Layer 2", "Shows or hides window layer 2.", { { "disabled", NULL }, @@ -438,7 +449,7 @@ struct retro_core_option_definition option_defs_us[] = { }, { "vbam_layer_8", - "Show sprite window layer", + "Show Sprite Window Layer", "Shows or hides sprite window layer.", { { "disabled", NULL },