diff --git a/src/spice2x/hooks/graphics/nvenc_hook.cpp b/src/spice2x/hooks/graphics/nvenc_hook.cpp index f885d14..e6135be 100644 --- a/src/spice2x/hooks/graphics/nvenc_hook.cpp +++ b/src/spice2x/hooks/graphics/nvenc_hook.cpp @@ -27,6 +27,8 @@ static BOOL new_preset_guids = false; namespace nvenc_hook { + bool FORCE_DISABLE; + std::optional VIDEO_CQP_STRING_OVERRIDE; std::optional VIDEO_CQP_OVERRIDE; @@ -189,6 +191,11 @@ namespace nvenc_hook { } NVENCSTATUS NVENCAPI NvEncodeAPICreateInstance_hook(NV_ENCODE_API_FUNCTION_LIST *pFunctionList) { + + if (FORCE_DISABLE) { + return NV_ENC_ERR_NO_ENCODE_DEVICE; + } + // log_misc("nvenc_hook", "NvEncodeAPICreateInstance hook hit"); auto status = NvEncodeAPICreateInstance_orig(pFunctionList); diff --git a/src/spice2x/hooks/graphics/nvenc_hook.h b/src/spice2x/hooks/graphics/nvenc_hook.h index 3587276..3d413b8 100644 --- a/src/spice2x/hooks/graphics/nvenc_hook.h +++ b/src/spice2x/hooks/graphics/nvenc_hook.h @@ -1,7 +1,12 @@ #pragma once +#ifdef SPICE64 + namespace nvenc_hook { + extern bool FORCE_DISABLE; extern std::optional VIDEO_CQP_STRING_OVERRIDE; void initialize(); } + +#endif diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index a82f996..0b950ba 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -539,6 +539,9 @@ int main_implementation(int argc, char *argv[]) { if (options[launcher::Options::IIDXRecQuality].is_active()) { nvenc_hook::VIDEO_CQP_STRING_OVERRIDE = options[launcher::Options::IIDXRecQuality].value_text(); } + if (options[launcher::Options::IIDXRecDisable].value_bool()) { + nvenc_hook::FORCE_DISABLE = true; + } #endif if (options[launcher::Options::LoadJubeatModule].value_bool()) { attach_jb = true; diff --git a/src/spice2x/launcher/options.cpp b/src/spice2x/launcher/options.cpp index 4948cc9..29c33d6 100644 --- a/src/spice2x/launcher/options.cpp +++ b/src/spice2x/launcher/options.cpp @@ -2235,7 +2235,7 @@ static const std::vector OPTION_DEFINITIONS = { }, { // IIDXRecQuality - .title = "IIDX NVENC Quality", + .title = "IIDX Recording Quality", .name = "iidxreccqp", .desc = "WARNING: double check if your network allows this & your hardware supports it.\n\n" "For TDJ Play Record feature, specify ConstQP quality settings for NVENC. Lower is higher quality but bigger file.\n\n" @@ -2244,6 +2244,15 @@ static const std::vector OPTION_DEFINITIONS = { .game_name = "Beatmania IIDX", .category = "Game Options (Advanced)", }, + { + // IIDXRecDisable + .title = "IIDX Recording Force Disable", + .name = "iidxnorec", + .desc = "When enabled, this prevents the play record feature from being used", + .type = OptionType::Bool, + .game_name = "Beatmania IIDX", + .category = "Game Options (Advanced)", + }, { // MidiAlgoVer .title = "MIDI Note Input Algorithm", diff --git a/src/spice2x/launcher/options.h b/src/spice2x/launcher/options.h index cc06d40..ff442b6 100644 --- a/src/spice2x/launcher/options.h +++ b/src/spice2x/launcher/options.h @@ -238,6 +238,7 @@ namespace launcher { spice2x_EnableSMXStage, spice2x_EnableSMXDedicab, IIDXRecQuality, + IIDXRecDisable, MidiAlgoVer, MidiNoteSustain, InputRequiresFocus,