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
+45 -5
View File
@@ -2,7 +2,9 @@
#include <unordered_map>
#include "cfg/configurator.h"
#include "hooks/graphics/graphics.h"
#include "util/cpuutils.h"
#include "util/detour.h"
#include "util/libutils.h"
#include "util/logging.h"
@@ -38,6 +40,8 @@ namespace games::gitadora {
return 0;
}
#ifdef SPICE64
/*
* Two Channel Audio Mode
* We proxy bmsd2_boot_hook and modify the last parameter which is apparently the channel count.
@@ -49,6 +53,8 @@ namespace games::gitadora {
return bmsd2_boot_orig(a1, a2, a3, 2);
}
#endif
/*
* Command Line Arguments
* We hook this to override specific values.
@@ -152,15 +158,41 @@ namespace games::gitadora {
GitaDoraGame::GitaDoraGame() : Game("GitaDora") {
}
void GitaDoraGame::pre_attach() {
Game::pre_attach();
if (!cfg::CONFIGURATOR_STANDALONE) {
if (CAB_TYPE.has_value()) {
log_info("gitadora", "cab type: {}", CAB_TYPE.value());
} else {
log_warning("gitadora", "cab type: not set");
}
log_info("gitadora", "applying processor affinity workaround to prevent hangs...");
#ifdef SPICE64
// workaround for hang on title screen, on systems with many SMT threads
// exact cause is unknown; most likely a bad assumption in some video decoder
// 0xFF (first 8 LPs) seems to work well for most people
cpuutils::set_processor_affinity(0xFF, false);
#else
// XG versions ran on ancient dual-core AMD systems
// having more cores cause random hangs on song select screen
cpuutils::set_processor_affinity(0x3, false);
// check invalid cab type
if (CAB_TYPE.has_value() && CAB_TYPE.value() == 3) {
log_fatal("gitadora", "Cabinet type 3 (SD2) not supported on XG series");
}
#endif
}
}
void GitaDoraGame::attach() {
Game::attach();
// modules
HMODULE sharepj_module = libutils::try_module("libshare-pj.dll");
HMODULE bmsd_engine_module = libutils::try_module("libbmsd-engine.dll");
HMODULE bmsd_module = libutils::try_module("libbmsd.dll");
HMODULE bmsd2_module = libutils::try_module("libbmsd2.dll");
HMODULE gdme_module = libutils::try_module("libgdme.dll");
HMODULE system_module = libutils::try_module("libsystem.dll");
// patches
@@ -170,8 +202,6 @@ namespace games::gitadora {
sharepj_module, "eam_network_settings_conflict"));
detour::inline_hook((void *) bmsd2_set_windows_volume, libutils::try_proc(
bmsd2_module, "bmsd2_set_windows_volume"));
detour::inline_hook((void *) bmsd2_set_windows_volume, libutils::try_proc(
bmsd2_module, "bmsd2_set_windows_volume"));
detour::inline_hook((void *) sys_code_get_cmdline, libutils::try_proc(
system_module, "sys_code_get_cmdline"));
detour::inline_hook((void *) sys_setting_get_param, libutils::try_proc(
@@ -183,6 +213,10 @@ namespace games::gitadora {
detour::inline_hook((void *) sys_debug_dip_set_param, libutils::try_proc(
system_module, "sys_debug_dip_set_param"));
#ifdef SPICE64
HMODULE gdme_module = libutils::try_module("libgdme.dll");
// window patch
if (GRAPHICS_WINDOWED && !replace_pattern(
gdme_module,
@@ -192,6 +226,9 @@ namespace games::gitadora {
log_warning("gitadora", "windowed mode failed");
}
HMODULE bmsd_engine_module = libutils::try_module("libbmsd-engine.dll");
HMODULE bmsd_module = libutils::try_module("libbmsd.dll");
// two channel mod
if (TWOCHANNEL) {
bmsd2_boot_orig = detour::iat_try("bmsd2_boot", bmsd2_boot_hook, bmsd_module);
@@ -202,5 +239,8 @@ namespace games::gitadora {
log_warning("gitadora", "two channel mode failed");
}
}
#endif
}
}