From 66b3de8e5c1f8f3663d124ffd87eebafb1f7f7a2 Mon Sep 17 00:00:00 2001 From: bicarus-dev <202771338+bicarus-dev@users.noreply.github.com> Date: Fri, 9 May 2025 09:48:00 -0700 Subject: [PATCH] loveplus: add printer options (#325) ## Link to GitHub Issue, if one exists n/a ## Description of change Add the same options as SDVX printer. ## Testing Tested all options with LP. --- src/spice2x/games/shared/printer.cpp | 2 +- src/spice2x/launcher/launcher.cpp | 25 +++++++++++++-- src/spice2x/launcher/options.cpp | 46 ++++++++++++++++++++++++++-- src/spice2x/launcher/options.h | 5 +++ 4 files changed, 73 insertions(+), 5 deletions(-) diff --git a/src/spice2x/games/shared/printer.cpp b/src/spice2x/games/shared/printer.cpp index 6a1b019..f0bc742 100644 --- a/src/spice2x/games/shared/printer.cpp +++ b/src/spice2x/games/shared/printer.cpp @@ -294,7 +294,7 @@ namespace games::shared { // error if (!clear) { - log_fatal("sdvx", "could not find path"); + log_fatal("printer", "could not find path"); } return "DUMMY"; diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index 843015a..f7c0289 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -662,21 +662,42 @@ int main_implementation(int argc, char *argv[]) { if (options[launcher::Options::SDVXPrinterEmulation].value_bool()) { attach_cpusbxpkm_printer = true; } - if (options[launcher::Options::SDVXPrinterOutputOverwrite].value_bool()) { + + // printer overwrite + if (options[launcher::Options::SDVXPrinterOutputOverwrite].value_bool() || + options[launcher::Options::LovePlusPrinterOutputOverwrite].value_bool()) { games::shared::PRINTER_OVERWRITE_FILE = true; } + + // printer output path for (auto &path : options[launcher::Options::SDVXPrinterOutputPath].values_text()) { games::shared::PRINTER_PATH.push_back(path); } + for (auto &path : options[launcher::Options::LovePlusPrinterOutputPath].values_text()) { + games::shared::PRINTER_PATH.push_back(path); + } + + // printer file format for (auto &path : options[launcher::Options::SDVXPrinterOutputFormat].values_text()) { games::shared::PRINTER_FORMAT.push_back(path); } + for (auto &path : options[launcher::Options::LovePlusPrinterOutputFormat].values_text()) { + games::shared::PRINTER_FORMAT.push_back(path); + } + + // printer JPG quality if (options[launcher::Options::SDVXPrinterJPGQuality].is_active()) { games::shared::PRINTER_JPG_QUALITY = options[launcher::Options::SDVXPrinterJPGQuality].value_uint32(); + } else if (options[launcher::Options::LovePlusPrinterJPGQuality].is_active()) { + games::shared::PRINTER_JPG_QUALITY = options[launcher::Options::LovePlusPrinterJPGQuality].value_uint32(); } - if (options[launcher::Options::SDVXPrinterOutputClear].value_bool()) { + + // printer output clear + if (options[launcher::Options::SDVXPrinterOutputClear].value_bool() || + options[launcher::Options::LovePlusPrinterOutputClear].value_bool()) { games::shared::PRINTER_CLEAR = true; } + if (options[launcher::Options::HTTP11].is_active()) { avs::ea3::HTTP11 = options[launcher::Options::HTTP11].value_uint32(); } diff --git a/src/spice2x/launcher/options.cpp b/src/spice2x/launcher/options.cpp index 609cf81..95e2001 100644 --- a/src/spice2x/launcher/options.cpp +++ b/src/spice2x/launcher/options.cpp @@ -694,7 +694,7 @@ static const std::vector OPTION_DEFINITIONS = { { .title = "SDVX Printer Output Format", .name = "printerformat", - .desc = "Path to folder where images will be stored", + .desc = "File format for printer output", .type = OptionType::Text, .setting_name = "(png/bmp/tga/jpg)", .game_name = "Sound Voltex", @@ -2258,7 +2258,49 @@ static const std::vector OPTION_DEFINITIONS = { .type = OptionType::Bool, .game_name = "LovePlus", .category = "Game Options", - } + }, + { + .title = "LovePlus Printer Output Path", + .name = "lpprinterpath", + .desc = "Path to folder where images will be stored", + .type = OptionType::Text, + .game_name = "LovePlus", + .category = "Game Options (Advanced)", + }, + { + .title = "LovePlus Printer Output Clear", + .name = "lpprinterclear", + .desc = "Clean up saved images in the output directory on startup", + .type = OptionType::Bool, + .game_name = "LovePlus", + .category = "Game Options (Advanced)", + }, + { + .title = "LovePlus Printer Output Overwrite", + .name = "lpprinteroverwrite", + .desc = "Always overwrite the same file in output directory", + .type = OptionType::Bool, + .game_name = "LovePlus", + .category = "Game Options (Advanced)", + }, + { + .title = "LovePlus Printer Output Format", + .name = "lpprinterformat", + .desc = "File format for printer output", + .type = OptionType::Text, + .setting_name = "(png/bmp/tga/jpg)", + .game_name = "LovePlus", + .category = "Game Options (Advanced)", + }, + { + .title = "LovePlus Printer JPG Quality", + .name = "lpprinterjpgquality", + .desc = "Quality setting in percent if JPG format is used", + .type = OptionType::Integer, + .setting_name = "(0-100)", + .game_name = "LovePlus", + .category = "Game Options (Advanced)", + }, }; const std::vector &launcher::get_categories(Options::OptionsCategory category) { diff --git a/src/spice2x/launcher/options.h b/src/spice2x/launcher/options.h index 0e85a1d..b3e1c86 100644 --- a/src/spice2x/launcher/options.h +++ b/src/spice2x/launcher/options.h @@ -241,6 +241,11 @@ namespace launcher { SDVXWindowedSubscreenBorderless, SDVXWindowedSubscreenAlwaysOnTop, LovePlusCamEnable, + LovePlusPrinterOutputPath, + LovePlusPrinterOutputClear, + LovePlusPrinterOutputOverwrite, + LovePlusPrinterOutputFormat, + LovePlusPrinterJPGQuality, }; enum class OptionsCategory {