X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Flibretro.c;h=7f331574df168c11f0c2614443af6cf75a618c40;hb=e5241564f4444496f51f4de9bf533b1d910449ec;hp=cf875beb4bf16c2b90b91d5b13b93ec85a24c79c;hpb=91da8e32287f181a870140fdcc8fcdac7bafdebe;p=pcsx_rearmed.git diff --git a/frontend/libretro.c b/frontend/libretro.c index cf875beb..7f331574 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -145,7 +145,9 @@ int in_mouse[8][2]; int multitap1 = 0; int multitap2 = 0; int in_enable_vibration = 1; -int in_enable_crosshair[2] = { 0, 0 }; +static int in_enable_crosshair[2] = { 0, 0 }; +static bool in_dualshock_toggle_enable = 0; +static bool in_dualshock_toggling = 0; // NegCon adjustment parameters // > The NegCon 'twist' action is somewhat awkward when mapped @@ -2011,6 +2013,14 @@ static void update_variables(bool in_flight) in_enable_vibration = 1; } + var.value = NULL; + var.key = "pcsx_rearmed_analog_toggle"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + in_dualshock_toggle_enable = (strcmp(var.value, "enabled") == 0); + } + var.value = NULL; var.key = "pcsx_rearmed_dithering"; @@ -2240,6 +2250,7 @@ static void update_variables(bool in_flight) spu_config.iUseInterpolation = 0; } +#if P_HAVE_PTHREAD var.value = NULL; var.key = "pcsx_rearmed_spu_thread"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) @@ -2249,7 +2260,9 @@ static void update_variables(bool in_flight) else spu_config.iUseThread = 0; } +#endif +#if 0 // currently disabled, see USE_READ_THREAD in libpcsxcore/cdriso.c if (P_HAVE_PTHREAD) { var.value = NULL; var.key = "pcsx_rearmed_async_cd"; @@ -2272,6 +2285,7 @@ static void update_variables(bool in_flight) } } } +#endif var.value = NULL; var.key = "pcsx_rearmed_noxadecoding"; @@ -2573,6 +2587,18 @@ static void update_variables(bool in_flight) mouse_sensitivity = atof(var.value); } + if (found_bios) + { + var.value = NULL; + var.key = "pcsx_rearmed_show_bios_bootlogo"; + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + Config.SlowBoot = 0; + if (strcmp(var.value, "enabled") == 0) + Config.SlowBoot = 1; + } + } + if (in_flight) { // inform core things about possible config changes @@ -2590,27 +2616,6 @@ static void update_variables(bool in_flight) /* dfinput_activate(); */ } - else - { - //not yet running - - //bootlogo display hack - if (found_bios) - { - var.value = NULL; - var.key = "pcsx_rearmed_show_bios_bootlogo"; - if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) - { - Config.SlowBoot = 0; - rebootemu = 0; - if (strcmp(var.value, "enabled") == 0) - { - Config.SlowBoot = 1; - rebootemu = 1; - } - } - } - } update_option_visibility(); } @@ -2868,10 +2873,14 @@ static void update_input_mouse(int port, int ret) static void update_input(void) { - // reset all keystate, query libretro for keystate + int16_t analog_combo = + (1 << RETRO_DEVICE_ID_JOYPAD_L) | + (1 << RETRO_DEVICE_ID_JOYPAD_R) | + (1 << RETRO_DEVICE_ID_JOYPAD_SELECT); int i; int j; + // reset all keystate, query libretro for keystate for (i = 0; i < PORTS_NUMBER; i++) { int16_t ret = 0; @@ -2908,7 +2917,23 @@ static void update_input(void) update_input_mouse(i, ret); break; default: - // Query digital inputs + // dualshock ANALOG toggle? + if (type == PSE_PAD_TYPE_ANALOGPAD && in_dualshock_toggle_enable + && (ret & analog_combo) == analog_combo) + { + if (!in_dualshock_toggling) + { + int state = padToggleAnalog(i); + char msg[32]; + snprintf(msg, sizeof(msg), "ANALOG %s", state ? "ON" : "OFF"); + show_notification(msg, 800, 1); + in_dualshock_toggling = true; + } + return; + } + in_dualshock_toggling = false; + + // Set digital inputs for (j = 0; j < RETRO_PSX_MAP_LEN; j++) if (ret & (1 << j)) in_keystate[i] |= retro_psx_map[j];