From 39ea2c46fc087233ef11b7cde539ae38b5329723 Mon Sep 17 00:00:00 2001 From: Schindler Date: Thu, 19 Nov 2026 00:35:04 -0500 Subject: [PATCH] 30 Hz logic only in fights, not on the Story Mode world map Above 30 fps, 'Depart on a journey' in Story Mode hung on a dark blue screen: the world map runs on the battle overlay with its walker as an actor, so battle_running() was true and 30 Hz logic switched on there; going on to the menu overlay then never came back. Reproduced at 60, 120 and 240 fps (not at 30, not with PSPRECOMP_LOGIC30=0). l30_active() now also needs a fighter in the battle object (*0x089D6A10 +0x38 / +0x3C, empty on the world map; from VCKing101's notes, https://github.com/VCKing101/Dissidia012-pc). After the fix 60, 120 and 240 fps reach the world map, and a Quick Battle still switches 30 Hz logic on. Logs '[FPS] 30 Hz logic on (fight)' / 'off'. Co-Authored-By: Claude Opus 5.5 --- psprecomp/games/dissidia/runtime/framerate.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/psprecomp/games/dissidia/runtime/framerate.cpp b/psprecomp/games/dissidia/runtime/framerate.cpp index 3820dbd..50edc4e 100644 --- a/psprecomp/games/dissidia/runtime/framerate.cpp +++ b/psprecomp/games/dissidia/runtime/framerate.cpp @@ -2463,12 +2463,22 @@ bool dissidia_fighter_human(uint32_t a) { float dissidia_frame_ticks() { return g_ticks; } // 30 Hz logic applies once the fight is past its intro (7 s of battle: the intro sequence did not finish with drawn-only frames in it) namespace { +// A fight, not the Story Mode world map: the world map runs on the battle overlay too, with its walker as an actor, but its battle +// object (*0x089D6A10) has no fighters at +0x38 / +0x3C (VCKing101's notes, github.com/VCKing101/Dissidia012-pc, +// docs/port/analog-movement.md). With 30 Hz logic there, going from the world map into its menu overlay hung on a dark blue screen +// at every rate above 30 (19 Nov 2026: "Depart on a journey" in Story Mode). +bool in_fight() { + const uint32_t bo = r32(0x089D6A10u); + return ok(bo) && (r32(bo + 0x38u) || r32(bo + 0x3Cu)); +} bool l30_active() { static bool on = false; static const bool from_clock = std::getenv("PSPRECOMP_L30_FROM_CLOCK") != nullptr; // experiment: only from the test clock on - const bool want = g_logic30 && g_rate > 30 && overlay_id() == 1 && (from_clock ? g_gt_started : battle_running()); + const bool want = g_logic30 && g_rate > 30 && overlay_id() == 1 && (from_clock ? g_gt_started : battle_running()) && in_fight(); if (want && !on) { g_l30_frame = 0; g_l30_logic_now = true; g_l30_dec_frame = ~0ull; g_l30_due_ms = 0; g_l30_end_ms = 0; } - on = want || (on && g_logic30 && g_rate > 30 && overlay_id() == 1 && battle_running()); + const bool was = on; + on = want || (on && g_logic30 && g_rate > 30 && overlay_id() == 1 && battle_running() && in_fight()); + if (on != was) std::fprintf(stderr, "[FPS] 30 Hz logic %s\n", on ? "on (fight)" : "off"); return on; } } // namespace