troubleshooter: add cases for audio hook and dx9on12 (#408)

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

## Description of change
Add auto-troubleshooter messages for when audio hooks are disabled, and
when 9on12 is turned on by user.

## Testing
Manual verification
This commit is contained in:
bicarus-dev
2025-10-28 16:29:49 -07:00
committed by GitHub
parent ad229dabdb
commit 50691b79f1
3 changed files with 31 additions and 12 deletions
-8
View File
@@ -405,14 +405,6 @@ namespace games::iidx {
// init cfgmgr32 hooks // init cfgmgr32 hooks
cfgmgr32hook_init(avs::game::DLL_INSTANCE); cfgmgr32hook_init(avs::game::DLL_INSTANCE);
// report common errors on iidx31 and above
if (avs::game::is_ext(2023091500, MAXINT) && GRAPHICS_9_ON_12_STATE == DX9ON12_FORCE_ON) {
deferredlogs::defer_error_messages({
"common incompatibility with DX 9on12 + IIDX 31 and above",
" IIDX31+ is known to be incompatible with DX 9on12, leading to blank screen or crashes"
});
}
} }
void IIDXGame::pre_attach() { void IIDXGame::pre_attach() {
@@ -238,14 +238,17 @@ static void log_create_device_failure(HRESULT hresult) {
} }
static bool is_dx9_on_12_enabled() { static bool is_dx9_on_12_enabled() {
bool result = false;
switch (GRAPHICS_9_ON_12_STATE) { switch (GRAPHICS_9_ON_12_STATE) {
case DX9ON12_FORCE_OFF: case DX9ON12_FORCE_OFF:
log_info("graphics::d3d9", "DirectX 9on12: forced OFF by user (-dx9on12)"); log_info("graphics::d3d9", "DirectX 9on12: forced OFF by user (-dx9on12)");
return false; result = false;
break;
case DX9ON12_FORCE_ON: case DX9ON12_FORCE_ON:
log_info("graphics::d3d9", "DirectX 9on12: forced ON by user (-9on12 or -dx9on12)"); log_info("graphics::d3d9", "DirectX 9on12: forced ON by user (-9on12 or -dx9on12)");
return true; result = true;
break;
case DX9ON12_AUTO: case DX9ON12_AUTO:
default: default:
@@ -253,14 +256,33 @@ static bool is_dx9_on_12_enabled() {
log_info( log_info(
"graphics::d3d9", "graphics::d3d9",
"DirectX 9on12: enabled automatically for current game (tip: use -dx9on12 to force on or off)"); "DirectX 9on12: enabled automatically for current game (tip: use -dx9on12 to force on or off)");
return true; result = true;
} else { } else {
log_info( log_info(
"graphics::d3d9", "graphics::d3d9",
"DirectX 9on12: disabled by default, using DX9 (tip: use -dx9on12 to force on or off)"); "DirectX 9on12: disabled by default, using DX9 (tip: use -dx9on12 to force on or off)");
return false; result = false;
} }
break;
} }
if (GRAPHICS_9_ON_12_STATE == DX9ON12_FORCE_ON) {
if (avs::game::is_model("LDJ") && avs::game::is_ext(2023091500, MAXINT)) {
deferredlogs::defer_error_messages({
"dx9on12 was force enabled by user (-dx9on12)",
" IIDX31+ is known to be incompatible with DX 9on12, leading to blank screen or crashes"
" try again with -dx9on12 option set to default value"
});
} else {
deferredlogs::defer_error_messages({
"dx9on12 was force enabled by user (-dx9on12)",
" not very game is compatible with this, and can lead to crashes,"
" try without force enabling this if you are seeing issues"
});
}
}
return result;
} }
static IDirect3D9 *WINAPI Direct3DCreate9_hook(UINT SDKVersion) { static IDirect3D9 *WINAPI Direct3DCreate9_hook(UINT SDKVersion) {
+5
View File
@@ -946,6 +946,11 @@ int main_implementation(int argc, char *argv[]) {
} }
if (options[launcher::Options::DisableAudioHooks].value_bool()) { if (options[launcher::Options::DisableAudioHooks].value_bool()) {
hooks::audio::ENABLED = false; hooks::audio::ENABLED = false;
deferredlogs::defer_error_messages({
"audio hooks are forcibly disabled by user (-audiohookdisable)",
" having hooks disabled means some required audio fixes are not being applied",
" if you have audio-related crashes, you should try again after clearing this option"
});
} }
if (options[launcher::Options::spice2x_DisableVolumeHook].value_bool()) { if (options[launcher::Options::spice2x_DisableVolumeHook].value_bool()) {
hooks::audio::VOLUME_HOOK_ENABLED = false; hooks::audio::VOLUME_HOOK_ENABLED = false;