iidx,sdvx: disable subscreen overlay if -monitor is in use (#471)

## Link to GitHub Issue, if one exists
#345 

## Description of change
If TDJ / VM mode is active AND user is enabled `-monitor` option (and
the value isn't 0, the primary monitor)

then disable the subscreen overlay, show an error message instead.

We're doing this because both games cannot accept emulated touch input
if `-monitor` option is in use. There is not much point in displaying
the second screen's image, other than to REALLY confuse people when
nothing happens when they click on it.

## Testing
Tested both games with `-monitor`.
This commit is contained in:
bicarus-dev
2025-12-24 17:35:15 -08:00
committed by GitHub
parent 064031bc12
commit 6cd212aac2
8 changed files with 30 additions and 14 deletions
+3 -3
View File
@@ -79,6 +79,7 @@ namespace games::iidx {
char IIDXIO_LED_TICKER[10] = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '\x00'};
bool IIDXIO_LED_TICKER_READONLY = false;
std::mutex IIDX_LED_TICKER_LOCK;
bool IIDX_TDJ_MONITOR_WARNING = false;
// io
static bool HAS_LIBAIO; // this is how we detect iidx27+
@@ -475,9 +476,8 @@ namespace games::iidx {
}
// check -monitor + TDJ mode
if (!GRAPHICS_WINDOWED &&
options->at(launcher::Options::DisplayAdapter).is_active() &&
TDJ_MODE) {
if (!GRAPHICS_WINDOWED && D3D9_ADAPTER.has_value() && TDJ_MODE) {
IIDX_TDJ_MONITOR_WARNING = true;
log_warning(
"iidx",
"\n\n!!! using -monitor option with TDJ is NOT recommended due to known !!!\n"
+1
View File
@@ -33,6 +33,7 @@ namespace games::iidx {
extern char IIDXIO_LED_TICKER[10];
extern bool IIDXIO_LED_TICKER_READONLY;
extern std::mutex IIDX_LED_TICKER_LOCK;
extern bool IIDX_TDJ_MONITOR_WARNING;
constexpr int IIDX_TAPELED_TOTAL = 17;
// data mapping
+6 -9
View File
@@ -52,6 +52,7 @@ namespace games::sdvx {
std::optional<std::string> ASIO_DRIVER = std::nullopt;
// states
bool SHOW_VM_MONITOR_WARNING = false;
static HKEY real_asio_reg_handle = nullptr;
static HKEY real_asio_device_reg_handle = nullptr;
@@ -295,12 +296,10 @@ namespace games::sdvx {
}
#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());
this->VALKYRIE_MODEL = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H';
// check -monitor + UFC mode
if (!GRAPHICS_WINDOWED &&
options->at(launcher::Options::DisplayAdapter).is_active() &&
isValkyrieCabinetMode) {
if (!GRAPHICS_WINDOWED && D3D9_ADAPTER.has_value() && this->VALKYRIE_MODEL) {
SHOW_VM_MONITOR_WARNING = true;
log_warning(
"sdvx",
"\n\n!!! using -monitor option with VM mode is NOT recommended due to !!!\n"
@@ -330,10 +329,9 @@ namespace games::sdvx {
Game::attach();
#ifdef SPICE64 // SDVX5+ specific code
bool isValkyrieCabinetMode = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H';
// LCD handle
if (!isValkyrieCabinetMode) {
if (!this->VALKYRIE_MODEL) {
devicehook_init();
devicehook_add(new games::shared::LCDHandle());
}
@@ -372,8 +370,7 @@ namespace games::sdvx {
nvapi_hook::initialize(avs::game::DLL_INSTANCE);
}
// check for Valkyrie cabinet mode
if (isValkyrieCabinetMode) {
if (this->VALKYRIE_MODEL) {
// hook touch window
// in windowed mode, game can accept mouse input on the second screen
if (!NATIVETOUCH && !GRAPHICS_WINDOWED) {
+9
View File
@@ -23,6 +23,9 @@ namespace games::sdvx {
extern bool BI2X_INITIALIZED;
extern SdvxOverlayPosition OVERLAY_POS;
// states
extern bool SHOW_VM_MONITOR_WARNING;
class SDVXGame : public games::Game {
public:
SDVXGame();
@@ -30,5 +33,11 @@ namespace games::sdvx {
virtual void attach() override;
virtual void post_attach() override;
virtual void detach() override;
private:
// don't be tempted to make this into a public or a global variable
// various modules need to check if VM mode is active and they should
// not depend on the fact that SDVX module is active (since it can be
// inactive on cabs or partial I/O setup)
bool VALKYRIE_MODEL = false;
};
}
+6 -1
View File
@@ -344,8 +344,13 @@ int main_implementation(int argc, char *argv[]) {
GRAPHICS_FORCE_SINGLE_ADAPTER = true;
GRAPHICS_PREVENT_SECONDARY_WINDOW = true;
}
if (options[launcher::Options::DisplayAdapter].is_active()) {
if (options[launcher::Options::DisplayAdapter].is_active() &&
options[launcher::Options::DisplayAdapter].value_uint32() != D3DADAPTER_DEFAULT) {
D3D9_ADAPTER = options[launcher::Options::DisplayAdapter].value_uint32();
// when we fix up adapter numbers, we only fix the first adapter, and not any subsequent
// adapters, so we can't deal with multi-monitor games
GRAPHICS_FORCE_SINGLE_ADAPTER = true;
}
if (options[launcher::Options::CaptureCursor].value_bool()) {
GRAPHICS_CAPTURE_CURSOR = true;
+1 -1
View File
@@ -207,7 +207,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
.name = "monitor",
.desc = "Sets the display that the game will be opened in, for multiple monitors.\n\n"
"0 is the primary monitor, 1 is the second monitor, and so on.\n\n"
"Not all games will respect this. Does not work at all with multi-monitor games like TDJ/UFC. "
"Not all games will respect this. Not recommended for multi-monitor games like Lightning Model / Valkyrie Model modes. "
"Disable Full Screen Optimizations for best results",
.type = OptionType::Integer,
.category = "Graphics (Full Screen)",
+2
View File
@@ -15,6 +15,8 @@ namespace overlay::windows {
this->disabled_message =
"Close this overlay and use the second window.\n"
"If you don't see the window, double check your DLL type and apply TDJ I/O patches as needed.";
} else if (games::iidx::IIDX_TDJ_MONITOR_WARNING) {
this->disabled_message = "TDJ mode subscreen overlay is not compatible with -monitor option";
}
float size = 0.5f;
+2
View File
@@ -13,6 +13,8 @@ namespace overlay::windows {
bool isValkyrieCabinetMode = avs::game::SPEC[0] == 'G' || avs::game::SPEC[0] == 'H';
if (!isValkyrieCabinetMode) {
this->disabled_message = "Valkyrie Model mode is not enabled!";
} else if (games::sdvx::SHOW_VM_MONITOR_WARNING) {
this->disabled_message = "VM mode subscreen overlay is not compatible with -monitor option";
} else if (GRAPHICS_WINDOWED) {
if (GRAPHICS_PREVENT_SECONDARY_WINDOW) {
this->disabled_message = "Subscreen has been disabled by the user (-sdvxnosub).";