X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Flibretro.c;h=659b3ce4c0644c3ba22bf5e81d1f07e7773f802c;hb=af3eda9d3c7cf1a0901077dfd296966e27c2c3c8;hp=06043e96a4499689b982d4feaea7310fcacd4fb1;hpb=726da67c8bd8163a9b5a67f36c7e715f021df7df;p=pcsx_rearmed.git diff --git a/frontend/libretro.c b/frontend/libretro.c index 06043e96..659b3ce4 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -39,6 +39,8 @@ #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; @@ -55,6 +57,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 +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_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" }, @@ -774,6 +778,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); @@ -992,6 +1011,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); @@ -1470,6 +1492,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 +1624,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