X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Flibretro.c;h=13a4af38dfaa46c4c82690a9c75ceb7c6b614367;hb=252e4935160ab66db53edc2da74ea5967c5eaf5f;hp=23eecf6e25ec5ce5c5249e4f8cbc6a40f8cccf43;hpb=4bfc6b97e6eef32b184403362b49f4aa919b2dcf;p=pcsx_rearmed.git diff --git a/frontend/libretro.c b/frontend/libretro.c index 23eecf6e..13a4af38 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -37,6 +37,7 @@ static void *vout_buf; static int vout_width, vout_height; static int vout_doffs_old, vout_fb_dirty; static bool vout_can_dupe; +static bool duping_enable; static int samples_sent, samples_to_send; static int plugins_opened; @@ -246,11 +247,12 @@ void retro_set_environment(retro_environment_t cb) #ifndef DRC_DISABLE { "rearmed_drc", "Dynamic recompiler; enabled|disabled" }, #endif -#ifdef __ARM_NEON__ +#if defined(__ARM_NEON__) || defined(NEON_PC) { "neon_interlace_enable", "Enable interlacing mode(s); disabled|enabled" }, { "neon_enhancement_enable", "Enhanced resolution (slow); disabled|enabled" }, { "neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" }, #endif + { "pcsx_rearmed_duping_enable", "Frame duping; on|off" }, { NULL, NULL }, }; @@ -800,7 +802,7 @@ static void update_variables(bool in_flight) in_type1 = PSE_PAD_TYPE_ANALOGPAD; } -#ifdef __ARM_NEON__ +#if defined(__ARM_NEON__) || defined(NEON_PC) var.value = "NULL"; var.key = "neon_interlace_enable"; @@ -834,6 +836,18 @@ static void update_variables(bool in_flight) pl_rearmed_cbs.gpu_neon.enhancement_no_main = 1; } #endif + + var.value = "NULL"; + var.key = "pcsx_rearmed_duping_enable"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) + { + if (strcmp(var.value, "off") == 0) + duping_enable = false; + else if (strcmp(var.value, "on") == 0) + duping_enable = true; + } + #ifndef DRC_DISABLE var.value = NULL; var.key = "rearmed_drc"; @@ -901,7 +915,7 @@ void retro_run(void) samples_to_send += is_pal_mode ? 44100 / 50 : 44100 / 60; - video_cb((vout_fb_dirty || !vout_can_dupe) ? vout_buf : NULL, + video_cb((vout_fb_dirty || !vout_can_dupe || !duping_enable) ? vout_buf : NULL, vout_width, vout_height, vout_width * 2); vout_fb_dirty = 0; } @@ -975,7 +989,7 @@ void retro_init(void) exit(1); } - vout_buf = malloc(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2); + posix_memalign(&vout_buf, 16, VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2); if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir) {