mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
avs: when nvram/raw folder creation fails, show a warning message when the game eventually crashes (#383)
## Link to GitHub Issue, if one exists #345 ## Description of change When the directory specified in the mounttable (in avs-config.xml) lead to bad path, remember this and show a warning message block before the game crashes. ## Testing Tested with simulated bad mounttable set up.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#include "signal.h"
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
#include <windows.h>
|
||||
#include <dbghelp.h>
|
||||
|
||||
#include "avs/core.h"
|
||||
#include "acio/acio.h"
|
||||
#include "external/stackwalker/stackwalker.h"
|
||||
#include "hooks/libraryhook.h"
|
||||
@@ -32,6 +32,8 @@ namespace launcher::signal {
|
||||
|
||||
// states
|
||||
bool SUPERSTEP_SOUND_ERROR = false;
|
||||
bool AVS_DIR_CREATION_FAILURE = false;
|
||||
std::string AVS_SRC_PATH;
|
||||
}
|
||||
|
||||
#define V(variant) case variant: return #variant
|
||||
@@ -121,6 +123,18 @@ static LONG WINAPI TopLevelExceptionFilter(struct _EXCEPTION_POINTERS *Exception
|
||||
log_warning("signal", " fix your audio device, double check your audio options/patches, and try again");
|
||||
}
|
||||
|
||||
if (launcher::signal::AVS_DIR_CREATION_FAILURE) {
|
||||
log_warning("signal",
|
||||
"AVS filesystem initialization failure was previously detected during boot!");
|
||||
log_warning("signal",
|
||||
" ERROR: directory could not be created: {}",
|
||||
launcher::signal::AVS_SRC_PATH.c_str());
|
||||
log_warning("signal",
|
||||
" this crash may have been caused by bad <mounttable> contents in {}",
|
||||
avs::core::CFG_PATH.c_str());
|
||||
log_warning("signal", " fix the XML file and try again");
|
||||
}
|
||||
|
||||
// walk the exception chain
|
||||
struct _EXCEPTION_RECORD *record_cause = ExceptionRecord->ExceptionRecord;
|
||||
while (record_cause != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user