aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu_cmd/yuzu.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 00:24:14 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-28 00:24:14 -0400
commita5e528e2d0bc784ebf24850e5913cece912c685e (patch)
tree8a0323e46528f768dc9fd0b0843419be2892de95 /src/yuzu_cmd/yuzu.cpp
parentf8c8b809e64c57d34837b09cce3b6a7fd8e5295a (diff)
nx2: get title 4 past the difficulty confirm
- MME: implement MME_DMA_READ / MME_DMA_READ_FIFOED (Turing macros read query results into their load FIFO; the conditional-render macro at 0x142 needs it). - vi2 present waits up to 4 s for the frame fence (was 250 ms) so shader compile stalls don't let the game lap its equal-value gate semaphores. - Native QMD: fire the third release slot at word 52, which NVN2 patches for queue-to-queue syncs (compute queue releasing a gate the 3D queue waits on). - Compute class SET_REPORT_SEMAPHORE (0x6c0-0x6c3) releases. - Ampere lowering: AOFFI, any LOP3 truth table, STG RZ, LDG 0x981, IABS, I2FP rounding, IMAD negated addend, SHFL 0x989 (all 77 title-4 shaders lower). - Debug: EDEN_NX2_SEM_WATCH=<addr> traces acquires, releases, method arguments and compute macro emits for one semaphore block; EDEN_NX2_KEY_SCRIPT scripted key presses; per-submit logs moved to TRACE.
Diffstat (limited to 'src/yuzu_cmd/yuzu.cpp')
-rw-r--r--src/yuzu_cmd/yuzu.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 3aaba78fd1..b46534ec9d 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -4,6 +4,9 @@
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#include <vector>
+#include <cstdlib>
+#include <chrono>
#include <cstdio>
#include <iostream>
#include <memory>
@@ -34,6 +37,7 @@
#include "core/hle/service/filesystem/filesystem.h"
#include "core/loader/loader.h"
#include "frontend_common/config.h"
+#include "input_common/drivers/keyboard.h"
#include "input_common/main.h"
#include "network/network.h"
#include "sdl_config.h"
@@ -327,8 +331,50 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
state->system.InitializeDebugger();
return SDL_APP_CONTINUE;
}
+// EDEN_NX2_KEY_SCRIPT="seconds:code,seconds:-code,...": press (code) or release (-code) keyboard
+// keys, by SDL scancode, that many seconds after start. Lets hidden test runs drive menus.
+static void RunKeyScript(InputCommon::InputSubsystem& input_subsystem) {
+ struct KeyEvent {
+ double seconds;
+ int code;
+ };
+ static const std::vector<KeyEvent> script = [] {
+ std::vector<KeyEvent> events;
+ if (const char* text = std::getenv("EDEN_NX2_KEY_SCRIPT")) {
+ std::string list{text};
+ size_t start = 0;
+ while (start < list.size()) {
+ const size_t end = std::min(list.find(',', start), list.size());
+ const std::string item = list.substr(start, end - start);
+ if (const size_t colon = item.find(':'); colon != std::string::npos) {
+ events.push_back({std::stod(item.substr(0, colon)),
+ std::stoi(item.substr(colon + 1))});
+ }
+ start = end + 1;
+ }
+ }
+ return events;
+ }();
+ static const auto begin = std::chrono::steady_clock::now();
+ static size_t next = 0;
+ const double elapsed =
+ std::chrono::duration<double>(std::chrono::steady_clock::now() - begin).count();
+ while (next < script.size() && script[next].seconds <= elapsed) {
+ const int code = script[next].code;
+ LOG_INFO(Frontend, "Key script: {} key {} at {:.1f} s", code < 0 ? "release" : "press",
+ code < 0 ? -code : code, elapsed);
+ if (code < 0) {
+ input_subsystem.GetKeyboard()->ReleaseKey(static_cast<std::size_t>(-code));
+ } else {
+ input_subsystem.GetKeyboard()->PressKey(static_cast<std::size_t>(code));
+ }
+ ++next;
+ }
+}
+
extern "C" SDL_AppResult SDL_AppIterate(void *appstate) {
SdlState *state = (SdlState *)appstate;
+ RunKeyScript(state->input_subsystem);
return state->emu_window && state->emu_window->IsOpen() ? SDL_APP_CONTINUE : SDL_APP_SUCCESS;
}
extern "C" SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) {