From b580cc4f026c8b1facbf794f39fb3a06238dd484 Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Mon, 23 Jan 2017 18:44:28 -0800 Subject: Add option to display bootlogo --- frontend/libretro.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 06043e9..9e2d031 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -55,6 +55,7 @@ static int vout_width, vout_height; static int vout_doffs_old, vout_fb_dirty; static bool vout_can_dupe; static bool duping_enable; +static bool found_bios; static int plugins_opened; static int is_pal_mode; @@ -458,6 +459,7 @@ void retro_set_environment(retro_environment_t cb) { "pcsx_rearmed_neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" }, #endif { "pcsx_rearmed_duping_enable", "Frame duping; on|off" }, + { "pcsx_rearmed_show_bios_bootlogo", "Show Bios Bootlogo; on|off" }, { "pcsx_rearmed_spu_reverb", "Sound: Reverb; on|off" }, { "pcsx_rearmed_spu_interpolation", "Sound: Interpolation; simple|gaussian|cubic|off" }, { "pcsx_rearmed_pe2_fix", "Parasite Eve 2/Vandal Hearts 1/2 Fix; disabled|enabled" }, @@ -1470,6 +1472,20 @@ 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) + { + if (strcmp(var.value, "on") == 0) + rebootemu = 1; + } + } + } } static int min(int a, int b) @@ -1588,7 +1604,8 @@ void retro_init(void) const char *dir; char path[256]; int i, ret; - bool found_bios = false; + + found_bios = false; #ifdef __MACH__ // magic sauce to make the dynarec work on iOS -- cgit v1.2.3 From 59f37d7f8672d1915c834511802ea07c8ba2a3c8 Mon Sep 17 00:00:00 2001 From: orbea Date: Tue, 24 Jan 2017 12:48:44 -0800 Subject: return false if info is NULL inside retro_load_game --- frontend/libretro.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 9e2d031..76f0b44 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -994,6 +994,9 @@ strcasestr(const char *s, const char*find) bool retro_load_game(const struct retro_game_info *info) { + if (!info) + return false; + size_t i; bool is_m3u = (strcasestr(info->path, ".m3u") != NULL); -- cgit v1.2.3 From 47624ecf3cef8397f63dd8de9b7d6e112ab275c9 Mon Sep 17 00:00:00 2001 From: iLag Date: Tue, 24 Jan 2017 13:56:59 -0800 Subject: Enable support for multiline cheats. All non hexdec characters will be read as delimiters and reformatted for PCSX's preferred format. --- frontend/libretro.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 9e2d031..0c0ed3e 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -39,6 +39,9 @@ #define PORTS_NUMBER 8 +#define ISHEXDEC ((buf[cursor]>='0') && (buf[cursor]<='9')) || ((buf[cursor]>='a') && (buf[cursor]<='f')) || ((buf[cursor]>='A') && (buf[cursor]<='F')) + + //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key int rebootemu = 0; @@ -776,6 +779,21 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) // cheat funcs are destructive, need a copy.. strncpy(buf, code, sizeof(buf)); buf[sizeof(buf) - 1] = 0; + + //Prepare buffered cheat for PCSX's AddCheat fucntion. + int cursor=0; + int nonhexdec=0; + while (buf[cursor]){ + if (!(ISHEXDEC)){ + if (++nonhexdec%2){ + buf[cursor]=' '; + } else { + buf[cursor]='\n'; + } + } + cursor++; + } + if (index < NumCheats) ret = EditCheat(index, "", buf); @@ -783,7 +801,7 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) ret = AddCheat("", buf); if (ret != 0) - SysPrintf("Failed to set cheat %#u\n", index); + SysPrintf("Failed to set cheat %#u: %s\n", index, code); else if (index < NumCheats) Cheats[index].Enabled = enabled; } -- cgit v1.2.3 From 4dbb320e3d1cf3e9d99a91ef5f76255b62bed406 Mon Sep 17 00:00:00 2001 From: iLag Date: Tue, 24 Jan 2017 14:01:45 -0800 Subject: Cleanup a bit more. --- frontend/libretro.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 0c0ed3e..10e9694 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -41,7 +41,6 @@ #define ISHEXDEC ((buf[cursor]>='0') && (buf[cursor]<='9')) || ((buf[cursor]>='a') && (buf[cursor]<='f')) || ((buf[cursor]>='A') && (buf[cursor]<='F')) - //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key int rebootemu = 0; @@ -801,7 +800,7 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code) ret = AddCheat("", buf); if (ret != 0) - SysPrintf("Failed to set cheat %#u: %s\n", index, code); + SysPrintf("Failed to set cheat %#u\n", index); else if (index < NumCheats) Cheats[index].Enabled = enabled; } -- cgit v1.2.3 From b629f6cc08ec0220c622ccee3382d86ab6e1650d Mon Sep 17 00:00:00 2001 From: orbea Date: Tue, 24 Jan 2017 15:49:46 -0800 Subject: Revert "return false if info is NULL inside retro_load_game" --- frontend/libretro.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 659b3ce..10e9694 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1011,9 +1011,6 @@ strcasestr(const char *s, const char*find) bool retro_load_game(const struct retro_game_info *info) { - if (!info) - return false; - size_t i; bool is_m3u = (strcasestr(info->path, ".m3u") != NULL); -- cgit v1.2.3 From 76996fc381bab16add67413cb7f96797517b5098 Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Tue, 7 Feb 2017 11:08:15 -0800 Subject: Fix buggy option being on by default --- frontend/libretro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 10e9694..fcabfc5 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -42,7 +42,7 @@ #define ISHEXDEC ((buf[cursor]>='0') && (buf[cursor]<='9')) || ((buf[cursor]>='a') && (buf[cursor]<='f')) || ((buf[cursor]>='A') && (buf[cursor]<='F')) //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key -int rebootemu = 0; +static int rebootemu = 0; static retro_video_refresh_t video_cb; static retro_input_poll_t input_poll_cb; @@ -461,7 +461,7 @@ void retro_set_environment(retro_environment_t cb) { "pcsx_rearmed_neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" }, #endif { "pcsx_rearmed_duping_enable", "Frame duping; on|off" }, - { "pcsx_rearmed_show_bios_bootlogo", "Show Bios Bootlogo; on|off" }, + { "pcsx_rearmed_show_bios_bootlogo", "Show Bios Bootlogo(Breaks some games); off|on" }, { "pcsx_rearmed_spu_reverb", "Sound: Reverb; on|off" }, { "pcsx_rearmed_spu_interpolation", "Sound: Interpolation; simple|gaussian|cubic|off" }, { "pcsx_rearmed_pe2_fix", "Parasite Eve 2/Vandal Hearts 1/2 Fix; disabled|enabled" }, -- cgit v1.2.3 From 0a6520c3fee25dded241427f16df844cea79182f Mon Sep 17 00:00:00 2001 From: Sérgio Benjamim Date: Sat, 11 Feb 2017 18:08:13 -0200 Subject: Use disabled/enabled instead, like other core settings. --- frontend/libretro.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index fcabfc5..87dcb2d 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -460,9 +460,9 @@ void retro_set_environment(retro_environment_t cb) { "pcsx_rearmed_neon_enhancement_enable", "Enhanced resolution (slow); disabled|enabled" }, { "pcsx_rearmed_neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" }, #endif - { "pcsx_rearmed_duping_enable", "Frame duping; on|off" }, - { "pcsx_rearmed_show_bios_bootlogo", "Show Bios Bootlogo(Breaks some games); off|on" }, - { "pcsx_rearmed_spu_reverb", "Sound: Reverb; on|off" }, + { "pcsx_rearmed_duping_enable", "Frame duping; enabled|disabled" }, + { "pcsx_rearmed_show_bios_bootlogo", "Show Bios Bootlogo(Breaks some games); disabled|enabled" }, + { "pcsx_rearmed_spu_reverb", "Sound: Reverb; enabled|disabled" }, { "pcsx_rearmed_spu_interpolation", "Sound: Interpolation; simple|gaussian|cubic|off" }, { "pcsx_rearmed_pe2_fix", "Parasite Eve 2/Vandal Hearts 1/2 Fix; disabled|enabled" }, { "pcsx_rearmed_inuyasha_fix", "InuYasha Sengoku Battle Fix; disabled|enabled" }, @@ -1397,9 +1397,9 @@ static void update_variables(bool in_flight) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) { - if (strcmp(var.value, "off") == 0) + if (strcmp(var.value, "disabled") == 0) duping_enable = false; - else if (strcmp(var.value, "on") == 0) + else if (strcmp(var.value, "enabled") == 0) duping_enable = true; } @@ -1435,9 +1435,9 @@ static void update_variables(bool in_flight) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) { - if (strcmp(var.value, "off") == 0) + if (strcmp(var.value, "disabled") == 0) spu_config.iUseReverb = false; - else if (strcmp(var.value, "on") == 0) + else if (strcmp(var.value, "enabled") == 0) spu_config.iUseReverb = true; } @@ -1498,7 +1498,7 @@ static void update_variables(bool in_flight) var.key = "pcsx_rearmed_show_bios_bootlogo"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) { - if (strcmp(var.value, "on") == 0) + if (strcmp(var.value, "enabled") == 0) rebootemu = 1; } } -- cgit v1.2.3 From 9ae7e341101d8f840d0a98e168fe055e93668487 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Thu, 2 Mar 2017 09:40:25 +0100 Subject: fix implicit-function-declaration warnings/errors. --- frontend/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/main.c b/frontend/main.c index 89e96e4..6887dd1 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -772,7 +772,7 @@ int emu_save_state(int slot) return ret; ret = SaveState(fname); -#ifdef HAVE_PRE_ARMV7 /* XXX GPH hack */ +#if defined(HAVE_PRE_ARMV7) && !defined(_3DS) /* XXX GPH hack */ sync(); #endif SysPrintf("* %s \"%s\" [%d]\n", -- cgit v1.2.3 From 9096ba886c2c72055d93b7cf9f8f76a2c721c0bd Mon Sep 17 00:00:00 2001 From: aliaspider Date: Thu, 2 Mar 2017 12:10:30 +0100 Subject: define PATH_MAX if needed. --- frontend/libretro.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 87dcb2d..4d56356 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -932,6 +932,10 @@ static struct retro_disk_control_callback disk_control = { #define SLASH '/' #endif +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + static char base_dir[PATH_MAX]; static bool read_m3u(const char *file) -- cgit v1.2.3 From 53e4a7e5cb46ad8589825ec95e15b56614cc54d9 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Fri, 10 Mar 2017 07:24:33 +0100 Subject: libretro: Remove reset in retro_run() hack Removes a hack breaking deserialization when running retro_reset(), retro_unserialize() and retro_run() in this order, as it silently resets the core just after setting its state. --- frontend/libretro.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 4d56356..8382b65 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1308,9 +1308,7 @@ size_t retro_get_memory_size(unsigned id) void retro_reset(void) { - //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key - rebootemu = 1; - //SysReset(); + SysReset(); } static const unsigned short retro_psx_map[] = { @@ -1517,11 +1515,6 @@ static int min(int a, int b) void retro_run(void) { int i; - //SysReset must be run while core is running,Not in menu (Locks up Retroarch) - if(rebootemu != 0){ - rebootemu = 0; - SysReset(); - } input_poll_cb(); -- cgit v1.2.3 From 06facfd2bdc99af1770eb1661373aa39b2abc39b Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 3 Apr 2017 22:32:58 -0400 Subject: Fix running on CTR: dyncache mmap doesn't specify MAP_FIXED anymore --- frontend/3ds/sys/mman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/3ds/sys/mman.h b/frontend/3ds/sys/mman.h index e295b89..61dde6c 100644 --- a/frontend/3ds/sys/mman.h +++ b/frontend/3ds/sys/mman.h @@ -32,7 +32,7 @@ static inline void* mmap(void *addr, size_t len, int prot, int flags, int fd, of void* addr_out; if((prot == (PROT_READ | PROT_WRITE | PROT_EXEC)) && - (flags == (MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS))) + (flags == (MAP_PRIVATE | MAP_ANONYMOUS))) { if(__ctr_svchax) { -- cgit v1.2.3 From d9e770393ef9f049a40e34c06b12f0e3435dce46 Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Wed, 5 Apr 2017 14:50:53 -0700 Subject: These are needed to reset on systems without a keyboard. It is also not a bug that load state after pushing reset still resets, this is the only way to make it work for now. On mac it will actually crash the OS and make you reboot. --- frontend/libretro.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 8382b65..4d56356 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1308,7 +1308,9 @@ size_t retro_get_memory_size(unsigned id) void retro_reset(void) { - SysReset(); + //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key + rebootemu = 1; + //SysReset(); } static const unsigned short retro_psx_map[] = { @@ -1515,6 +1517,11 @@ static int min(int a, int b) void retro_run(void) { int i; + //SysReset must be run while core is running,Not in menu (Locks up Retroarch) + if(rebootemu != 0){ + rebootemu = 0; + SysReset(); + } input_poll_cb(); -- cgit v1.2.3