diff --git a/src/input_ps5.cpp b/src/input_ps5.cpp index ba86419..456f38a 100644 --- a/src/input_ps5.cpp +++ b/src/input_ps5.cpp @@ -83,6 +83,8 @@ #include "command.h" #include "configuration.h" #include "core_option_manager.h" +#include "core.h" +#include "core_info.h" #include "menu/menu_driver.h" #if defined(HAVE_SLANG) #include "gfx/video_shader_parse.h" @@ -1085,6 +1087,15 @@ void run_script_actions() noexcept const int slot = settings->ints.state_slot; if (action.slot >= 0) settings->ints.state_slot = action.slot; + { + // What a state needs, in the trace: why a load that logs nothing returns false + char why[320]; + char path[512] = ""; + runloop_get_current_savestate_path(path, sizeof(path)); + std::snprintf(why, sizeof(why), "input: state check: core supports savestate=%d serialize_size=%zu path=%s", + core_info_current_supports_savestate() ? 1 : 0, core_serialize_size(), path); + ps5_input_trace(why); + } const bool ok = command_event(save ? CMD_EVENT_SAVE_STATE : CMD_EVENT_LOAD_STATE, nullptr); settings->ints.state_slot = slot; diff --git a/src/ps5_framegen_menu.c b/src/ps5_framegen_menu.c index 1137102..4c7dd27 100644 --- a/src/ps5_framegen_menu.c +++ b/src/ps5_framegen_menu.c @@ -43,6 +43,9 @@ float ps5_fg_target_fps = 119.88f; float ps5_fg_dbg_t = 1.0f; /* 1: the core cannot keep its own rate, so frames are shown as it makes them (the driver reads it) */ int ps5_fg_floor; +/* For the FPS counter (gfx/video_driver.c): 1 while frames are being generated; the presents a second over the last window */ +int ps5_fg_active; +float ps5_fg_presents_per_s; /* The loaded core's frame rate, kept by the video setup (patches/series, 0121) for the driver's cadence check */ float ps5_fg_core_fps; @@ -195,8 +198,8 @@ void ps5_fg_osd(bool plan, unsigned subframes, unsigned period, unsigned width, char text[200]; settings_t *settings = config_get_ptr(); struct timespec t; - if (!settings->bools.video_framegen_osd) - return; + const bool show_osd = settings->bools.video_framegen_osd; + ps5_fg_active = plan && settings->bools.video_framegen && !ps5_fg_floor && pictures >= 2; presents++; clock_gettime(CLOCK_MONOTONIC, &t); { @@ -275,11 +278,12 @@ void ps5_fg_osd(bool plan, unsigned subframes, unsigned period, unsigned width, gap_n[1], gap_n[1] ? gap_sum[1] / (double)gap_n[1] : 0.0, gap_max[1], gap_off[1]); memset(gap_n, 0, sizeof(gap_n)); memset(gap_sum, 0, sizeof(gap_sum)); memset(gap_max, 0, sizeof(gap_max)); memset(gap_off, 0, sizeof(gap_off)); + ps5_fg_presents_per_s = (float)((double)presents / seconds); presents = 0; last_generated = generated; last = t; } - if (++osd_calls % 120) + if (!show_osd || ++osd_calls % 120) return; ps5_fg_current(&now); if (!now.enable) diff --git a/tools/apply-port-patches.py b/tools/apply-port-patches.py index 46da99a..ad4a93e 100755 --- a/tools/apply-port-patches.py +++ b/tools/apply-port-patches.py @@ -4389,13 +4389,17 @@ EDITS += [('configuration.h', ('gfx/video_driver.c', ' last_fps = TIME_TO_FPS(curr_time, new_time, new_frames);\n new_frames = 0;\n', ' last_fps = TIME_TO_FPS(curr_time, new_time, new_frames);\n' - ' /* patches/series, 0121: each game frame is presented shader_subframes times (frame generation): ' - 'the rate shown is the rate of\n' - ' * the frames the display gets */\n' - ' if (video_info.shader_subframes > 1)\n' - ' last_fps *= (float)video_info.shader_subframes;\n' + ' /* patches/series, 0121: with frame generation on, the rate shown is the rate of the pictures the display\n' + ' * gets (the presents a second the generator counted); otherwise it is the core\'s own new frames a second,\n' + ' * not the display\'s: a 30 fps game shown twice each is 30 */\n' + ' {\n' + ' extern int ps5_fg_active;\n' + ' extern float ps5_fg_presents_per_s;\n' + ' if (ps5_fg_active && ps5_fg_presents_per_s > 1.0f)\n' + ' last_fps = ps5_fg_presents_per_s;\n' + ' }\n' ' new_frames = 0;\n', - 'patches/series, 0121: each game frame is presented shader_subframes times'), + 'patches/series, 0121: with frame generation on, the rate shown'), ('retroarch.c', ' unsigned shader_subframes = settings->uints.video_shader_subframes;\n' ' bool vrr_runloop_enable = settings->bools.vrr_runloop_enable;\n'