From 32d876ded1aefc52f839d65570e3e3c43ec04415 Mon Sep 17 00:00:00 2001 From: Takoroka <137927095+Takoroka@users.noreply.github.com> Date: Wed, 28 Oct 2026 07:47:45 -0400 Subject: nx2: read debug switches once; key scripts from a file Several debug switches were read with std::getenv on every macro call, QMD, semaphore write or draw. The UCRT getenv locks and scans the environment, thousands of times a frame; a long EDEN_NX2_KEY_SCRIPT made title 4 crawl at 2 fps. Each is now read once. EDEN_NX2_KEY_SCRIPT=@ reads the script from a file. gdbrsp.py gains 'hits' (log registers, frame chain and object words at breakpoints, following the stopped thread). --- src/video_core/macro.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/video_core/macro.cpp') diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index 06c649260d..e6279deab4 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -1346,7 +1346,8 @@ void MacroEngine::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, u maxwell3d.RefreshParameters(); const auto context = reinterpret_cast(this); static std::unordered_set captured_contexts; - if (std::getenv("EDEN_NATIVE_FRAME_CAPTURE") && captured_contexts.insert(context).second) { + static const bool capture = std::getenv("EDEN_NATIVE_FRAME_CAPTURE") != nullptr; + if (capture && captured_contexts.insert(context).second) { std::ofstream dump("native-graphics-mme-" + std::to_string(context) + ".bin", std::ios::binary); dump.write(reinterpret_cast(native_code.data()), sizeof(native_code)); } @@ -1393,7 +1394,8 @@ void MacroEngine::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, u }); if (!result.success) { native_execution_failed = true; - if (std::getenv("EDEN_NATIVE_DRAW_DIAGNOSTICS")) { + if (static const bool diagnostics = std::getenv("EDEN_NATIVE_DRAW_DIAGNOSTICS") != nullptr; + diagnostics) { std::ofstream dump("native-mme-" + std::to_string(method) + ".bin", std::ios::binary); dump.write(reinterpret_cast(native_code.data()), sizeof(native_code)); } -- cgit v1.2.3