troubleshooter: diagnose ddr codec issues (#503)

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

## Description of change
Turn existing warnings for DDR codec issues into deferred error
messages.

## Testing
Tested DDR World with faked codec issues.
This commit is contained in:
bicarus
2026-01-06 23:20:05 -08:00
committed by GitHub
parent ebf6382e7f
commit b1ee37a066
+25 -10
View File
@@ -8,6 +8,7 @@
#include "hooks/setupapihook.h" #include "hooks/setupapihook.h"
#include "hooks/sleephook.h" #include "hooks/sleephook.h"
#include "hooks/input/dinput8/hook.h" #include "hooks/input/dinput8/hook.h"
#include "util/deferlog.h"
#include "util/utils.h" #include "util/utils.h"
#include "util/libutils.h" #include "util/libutils.h"
#include "util/fileutils.h" #include "util/fileutils.h"
@@ -108,18 +109,32 @@ namespace games::ddr {
log_info("ddr", "`{}` returned {}", cmd, result); log_info("ddr", "`{}` returned {}", cmd, result);
} else { } else {
log_warning("ddr", "`{}` failed, returned {}", cmd, result); log_warning("ddr", "`{}` failed, returned {}", cmd, result);
deferredlogs::defer_error_messages({
"DDR codec registration failure",
fmt::format(" {} failed to register with error {}", filename.string(), result)});
} }
if (!contains_only_ascii(file.path().string())) { static std::once_flag printed;
log_warning( std::call_once(printed, [file]() {
"ddr", if (!contains_only_ascii(file.path().string())) {
"BAD PATH ERROR\n\n\n" log_warning(
"!!! !!!\n" "ddr",
"!!! filesystem path to codec contains non-ASCII characters! !!!\n" "BAD PATH ERROR\n\n"
"!!! this may cause the game to crash! !!!\n" "!!! !!!\n"
"!!! !!!\n" "!!! filesystem path to codec contains non-ASCII characters! !!!\n"
); "!!! this may cause failures when loading codecs, and !!!\n"
} "!!! potentially leading the game to crash! !!!\n"
"!!! !!!\n"
);
deferredlogs::defer_error_messages({
"path to DDR codecs contain non-Latin characters",
" this may lead to movies not playing, white screen issue,",
" game hanging, or potentially a crash",
" move the game to a directory that does not contain non-Latin characters",
" if you encountered any issues"});
}
});
} }
} }
} }