Update to spice2x-25-04-25 (pre-apply)

> broken commit
This commit is contained in:
[ ]
2025-05-07 00:25:31 +09:00
parent 04dee88276
commit c94de456b5
543 changed files with 78491 additions and 91698 deletions
+1 -1
View File
@@ -471,7 +471,7 @@ namespace avs::automap {
ENABLED = true;
// check if optional imports are supported for this avs version
if (!avs::core::property_node_read) {
if (!avs::core::property_node_read || !avs::core::property_get_error) {
log_fatal("automap", "missing optional avs imports which are required for this module to work");
}
+31 -7
View File
@@ -334,8 +334,12 @@ namespace avs {
.avs_fs_close = "XC0bbe97000119",
.avs_fs_dump_mountpoint = "XC0bbe970000c5",
.avs_fs_mount = "XC0bbe97000099",
.avs_fs_fstat = "XC0bbe970000ce",
.avs_fs_lstat = "XC0bbe9700005f",
.avs_fs_read = "XC0bbe97000134",
.avs_fs_opendir = "XC0bbe970000db",
.property_file_write = "property_file_write", // not found
.property_get_error = "property_get_error", // not found
.avs_net_add_protocol = "XC0bbe97000124",
.avs_net_del_protocol = "XC0bbe97000026",
.avs_net_addrinfobyaddr = "XC0bbe970000a4",
@@ -1360,9 +1364,11 @@ namespace avs {
fclose(file);
// error checking
auto err = avs::core::property_get_error(property);
if (err > 0) {
log_fatal("avs-core", "failed to read config file ({}): {}", filename, error_str(err));
if (avs::core::property_get_error) {
auto err = avs::core::property_get_error(property);
if (err > 0) {
log_fatal("avs-core", "failed to read config file ({}): {}", filename, error_str(err));
}
}
// return value
@@ -1467,7 +1473,7 @@ namespace avs {
}
}
bool load_dll() {
void load_dll() {
log_info("avs-core", "loading DLL");
// detect DLL name
@@ -1479,12 +1485,30 @@ namespace avs {
#else
DLL_NAME = "libavs-win32.dll";
#endif
if (!fileutils::file_exists(MODULE_PATH / DLL_NAME)) {
std::string info_str { fmt::format(
"\n\n"
"Failed to find critical avs DLL on disk (avs2-core.dll OR {})\n"
"Looked in the following directory: {}\n"
"\n"
"One of these is required to boot the game. Spice found neither of them. You do not need both, just one, next to your game DLL.\n"
"\n"
"HOW TO FIX:\n"
" * Avoid manually specifying DLL path (-exec) and module directory (-modules); let spice2x auto-detect unless you have a good reason not to\n"
" * Ensure you do NOT have multiple copies of the game DLLs (e.g., in contents and in contents\\modules)\n"
" * It's also possible that you have incomplete game data\n"
" * Do NOT copy over random DLLs from another game installation; DLL must match game version\n"
"\n"
, DLL_NAME, MODULE_PATH.string()) };
log_fatal("avs-ea3", "{}", info_str);
}
}
// load library
DLL_INSTANCE = libutils::load_library(MODULE_PATH / DLL_NAME, false);
DLL_INSTANCE = libutils::load_library(MODULE_PATH / DLL_NAME);
if (!DLL_INSTANCE) {
return false;
return;
}
// check by version string if obtained
@@ -1709,7 +1733,7 @@ namespace avs {
}
// success
return true;
return;
}
static void create_dir(
+2 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <cstddef>
#include <string>
#include <windows.h>
@@ -448,7 +449,7 @@ namespace avs {
// functions
void set_default_heap_size(const std::string &dll_name);
void create_log();
bool load_dll();
void load_dll();
void boot();
void copy_defaults();
void shutdown();
+18
View File
@@ -133,6 +133,24 @@ namespace avs {
#else
DLL_NAME = "libavs-win32-ea3.dll";
#endif
if (!fileutils::file_exists(MODULE_PATH / DLL_NAME)) {
std::string info_str { fmt::format(
"\n\n"
"Failed to find critical ea3 DLL on disk (avs2-ea3.dll OR {})\n"
"Looked in the following directory: {}\n"
"\n"
"One of these is required to boot the game. Spice found neither of them. You do not need both, just one, next to your game DLL.\n"
"\n"
"HOW TO FIX:\n"
" * Avoid manually specifying DLL path (-exec) and module directory (-modules); let spice2x auto-detect unless you have a good reason not to\n"
" * Ensure you do NOT have multiple copies of the game DLLs (e.g., in contents and in contents\\modules)\n"
" * It's also possible that you have incomplete game data\n"
" * Do NOT copy over random DLLs from another game installation; DLL must match game version\n"
"\n"
, DLL_NAME, MODULE_PATH.string()) };
log_fatal("avs-ea3", "{}", info_str);
}
}
// load library
+29 -2
View File
@@ -72,8 +72,35 @@ namespace avs {
log_info("avs-game", "loading DLL '{}'", DLL_NAME);
// load game instance
if (fileutils::verify_header_pe(MODULE_PATH / DLL_NAME)) {
DLL_INSTANCE = libutils::load_library(MODULE_PATH / DLL_NAME);
const auto dll_path = MODULE_PATH / DLL_NAME;
const auto dll_path_s = dll_path.string();
log_info("avs-game", "DLL path: {}", dll_path_s.c_str());
// MAX_PATH is 260
if (130 <= dll_path_s.length()) {
log_warning(
"avs-game",
"PATH TOO LONG WARNING\n\n\n"
"-------------------------------------------------------------------\n"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
"WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING\n"
" PATH TOO LONG \n"
"WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING\n"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
"The path '{}'\n"
" has a length of {}\n"
"Most of these games may behave unexpectedly when the path is too\n"
"long, often resulting in random crashes. Move the game contents to\n"
"a directory with shorter path.\n"
"-------------------------------------------------------------------\n\n",
dll_path_s, dll_path_s.length());
}
if (!fileutils::file_exists(dll_path)) {
log_warning("avs-game", "game DLL could not be found on disk: {}", dll_path.string().c_str());
log_warning("avs-game", "double check -exec and -modules parameters; unless you know what you're doing, leave them blank");
}
if (fileutils::verify_header_pe(dll_path)) {
DLL_INSTANCE = libutils::load_library(dll_path);
}
// load entry points