From 5947779502c03bcf10db16dc34a20deb683ad028 Mon Sep 17 00:00:00 2001
From: bicarus-dev <202771338+bicarus-dev@users.noreply.github.com>
Date: Thu, 4 Dec 2025 21:57:36 -0800
Subject: [PATCH] iidx,sdvx: warn user when using -monitor with TDJ/UFC mode
(#431)
## Link to GitHub Issue, if one exists
#345
## Description of change
Warn user via warning message in log + auto-troubleshooter entry when
-monitor option is used in full screen with TDJ and UFC mode.
This covers yet another case where TDJ subscreen does not respond to
mouse clicks (because the game expects them to come through the primary
display). For UFC, -monitor usually results in a failure to create DX
adapter.
## Testing
Manual verification with TDJ/UFC modes and two monitors.
---
src/spice2x/games/iidx/iidx.cpp | 28 +++++++++++++++++++++++++-
src/spice2x/games/sdvx/sdvx.cpp | 35 ++++++++++++++++++++++++++++++++-
2 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/src/spice2x/games/iidx/iidx.cpp b/src/spice2x/games/iidx/iidx.cpp
index 0e4baa3..97018b7 100644
--- a/src/spice2x/games/iidx/iidx.cpp
+++ b/src/spice2x/games/iidx/iidx.cpp
@@ -451,7 +451,7 @@ namespace games::iidx {
"!!! please do the following instead: !!!\n"
"!!! !!!\n"
"!!! Revert your changes to XML file so it says !!!\n"
- "!!! LDJ !!!\n"
+ "!!! LDJ !!!\n"
"!!! !!!\n"
"!!! In SpiceCfg, enable 'IIDX TDJ Mode' or provide -iidxtdj flag !!!\n"
"!!! in command line !!!\n"
@@ -463,6 +463,32 @@ namespace games::iidx {
log_fatal("iidx", "BAD MODEL NAME ERROR - TDJ specified, must be LDJ instead");
}
+
+ // check -monitor + TDJ mode
+ if (!GRAPHICS_WINDOWED &&
+ options->at(launcher::Options::DisplayAdapter).is_active() &&
+ TDJ_MODE) {
+ log_warning(
+ "iidx",
+ "\n\n!!! using -monitor option with TDJ is NOT recommended due to known !!!\n"
+ "!!! compatibility issues with the game !!!\n"
+ "!!! !!!\n"
+ "!!! * game may launch in wrong resolution or refresh rate !!!\n"
+ "!!! * touch / mouse input may stop working in subscreen / overlay !!!\n"
+ "!!! !!!\n"
+ "!!! recommendation is to NOT use -monitor and instead set the !!!\n"
+ "!!! primary monitor in Windows settings before launching the game !!!\n\n"
+ );
+
+ deferredlogs::defer_error_messages({
+ "-monitor option is NOT recommended when running with TDJ mode",
+ " due to known compatibility issues with the game:",
+ " * game may launch in wrong resolution or refresh rate",
+ " * touch / mouse input may stop working in subscreen / overlay",
+ " recommended fix is to NOT use -monitor and instead set the primary",
+ " monitor in Windows settings before launching the game"
+ });
+ }
}
void IIDXGame::detach() {
diff --git a/src/spice2x/games/sdvx/sdvx.cpp b/src/spice2x/games/sdvx/sdvx.cpp
index 7bae398..e25eae7 100644
--- a/src/spice2x/games/sdvx/sdvx.cpp
+++ b/src/spice2x/games/sdvx/sdvx.cpp
@@ -4,6 +4,7 @@
#include "avs/game.h"
#include "games/shared/lcdhandle.h"
+#include "games/io.h"
#include "hooks/audio/audio.h"
#include "hooks/graphics/graphics.h"
#include "hooks/devicehook.h"
@@ -12,6 +13,7 @@
#include "hooks/powrprof.h"
#include "hooks/sleephook.h"
#include "hooks/winuser.h"
+#include "launcher/options.h"
#include "touch/touch.h"
#include "util/deferlog.h"
#include "util/detour.h"
@@ -290,7 +292,38 @@ namespace games::sdvx {
log_fatal(
"sdvx",
"BAD MODEL NAME ERROR - model name set to UFC, must be KFC instead");
- }
+ }
+
+#ifdef SPICE64 // SDVX5+ specific code
+ bool isValkyrieCabinetMode = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H';
+ auto options = games::get_options(eamuse_get_game());
+ // check -monitor + UFC mode
+ if (!GRAPHICS_WINDOWED &&
+ options->at(launcher::Options::DisplayAdapter).is_active() &&
+ isValkyrieCabinetMode) {
+ log_warning(
+ "sdvx",
+ "\n\n!!! using -monitor option with VM mode is NOT recommended due to !!!\n"
+ "!!! known compatibility issues with the game !!!\n"
+ "!!! !!!\n"
+ "!!! * game may launch in wrong resolution or refresh rate !!!\n"
+ "!!! * touch / mouse input may stop working in subscreen / overlay !!!\n"
+ "!!! !!!\n"
+ "!!! recommendation is to NOT use -monitor and instead set the !!!\n"
+ "!!! primary monitor in Windows settings before launching the game !!!\n\n"
+ );
+
+ deferredlogs::defer_error_messages({
+ "-monitor option is NOT recommended when running with Valkyrie mode",
+ " due to known compatibility issues with the game:",
+ " * game may launch in wrong resolution or refresh rate",
+ " * touch / mouse input may stop working in subscreen / overlay",
+ " recommended fix is to NOT use -monitor and instead set the primary",
+ " monitor in Windows settings before launching the game"
+ });
+ }
+#endif
+
}
void SDVXGame::attach() {