From 621b702ed497c1ff360fd356d5724dbc18b6cd49 Mon Sep 17 00:00:00 2001 From: bicarus-dev <202771338+bicarus-dev@users.noreply.github.com> Date: Wed, 7 May 2025 20:43:16 -0700 Subject: [PATCH] loveplus: enable cam access (#318) ## Link to GitHub Issue, if one exists #316 (this does not fix the issue!) ## Description of change Add an option to omit `-noCamera` option. Doing so allows the game to boot and search for a compatible camera using KS API, but will likely fail since we don't know what cameras are compatible. You end up with a camera error during boot, which can be ignored by flipping a switch in the test menu to disable the camera. No hooks are currently done to make the camera work! ## Testing Tested to see that turning this on triggers the camera error. No known camera at the moment. --- src/spice2x/games/loveplus/loveplus.cpp | 12 +++++++++--- src/spice2x/games/loveplus/loveplus.h | 2 ++ src/spice2x/launcher/launcher.cpp | 4 ++++ src/spice2x/launcher/options.cpp | 9 +++++++++ src/spice2x/launcher/options.h | 1 + 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/spice2x/games/loveplus/loveplus.cpp b/src/spice2x/games/loveplus/loveplus.cpp index 3e18878..0d02e63 100644 --- a/src/spice2x/games/loveplus/loveplus.cpp +++ b/src/spice2x/games/loveplus/loveplus.cpp @@ -13,6 +13,8 @@ namespace games::loveplus { + bool CAMERA_ENABLE = false; + // touch stuff static bool TOUCH_ENABLE = false; static bool TOUCH_ATTACHED = false; @@ -117,9 +119,13 @@ namespace games::loveplus { } static LPSTR __stdcall GetCommandLineA_hook() { - static std::string lp_args = "-win -noCamera -noWatchDog -noIOError -noIrda -notarget"; - - return lp_args.data(); + static std::string lp_args = "-win -noWatchDog -noIOError -noIrda -notarget"; + static std::string lp_args_nocamera = lp_args + " -noCamera"; + if (CAMERA_ENABLE) { + return lp_args.data(); + } else { + return lp_args_nocamera.data(); + } } LovePlusGame::LovePlusGame() : Game("LovePlus") { diff --git a/src/spice2x/games/loveplus/loveplus.h b/src/spice2x/games/loveplus/loveplus.h index da6f44f..c4ab927 100644 --- a/src/spice2x/games/loveplus/loveplus.h +++ b/src/spice2x/games/loveplus/loveplus.h @@ -4,6 +4,8 @@ namespace games::loveplus { + extern bool CAMERA_ENABLE; + // touch stuff void touch_update(); diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index 32d94a0..843015a 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -1109,6 +1109,10 @@ int main_implementation(int argc, char *argv[]) { rawinput::MIDI_NOTE_SUSTAIN = options[launcher::Options::MidiNoteSustain].value_uint32(); } + if (options[launcher::Options::LovePlusCamEnable].value_bool()) { + games::loveplus::CAMERA_ENABLE = true; + } + // API debugging if (api_debug && !cfg::CONFIGURATOR_STANDALONE) { API_CONTROLLER = std::make_unique(api_port, api_pass, api_pretty); diff --git a/src/spice2x/launcher/options.cpp b/src/spice2x/launcher/options.cpp index 696ca5d..609cf81 100644 --- a/src/spice2x/launcher/options.cpp +++ b/src/spice2x/launcher/options.cpp @@ -2249,6 +2249,15 @@ static const std::vector OPTION_DEFINITIONS = { .type = OptionType::Bool, .game_name = "Sound Voltex", .category = "Graphics (Windowed)", + }, + { + // LovePlusCamEnable + .title = "LovePlus Camera Enable", + .name = "lovepluscam", + .desc = "Allow game to access camera; camera must be compatible with game", + .type = OptionType::Bool, + .game_name = "LovePlus", + .category = "Game Options", } }; diff --git a/src/spice2x/launcher/options.h b/src/spice2x/launcher/options.h index ff2aa23..0e85a1d 100644 --- a/src/spice2x/launcher/options.h +++ b/src/spice2x/launcher/options.h @@ -240,6 +240,7 @@ namespace launcher { SDVXWindowedSubscreenPosition, SDVXWindowedSubscreenBorderless, SDVXWindowedSubscreenAlwaysOnTop, + LovePlusCamEnable, }; enum class OptionsCategory {