mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 14:50:41 -07:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f857e63d5d | |||
| b462c838f6 | |||
| 4d658bf273 | |||
| 67721c416b | |||
| 0b5f7787be | |||
| a554c8f923 | |||
| 6592191624 | |||
| 164592b16d | |||
| 81f879e7ff |
@@ -18,4 +18,9 @@ dist/*
|
||||
|
||||
external/cv2pdb/*
|
||||
|
||||
.ccache/*
|
||||
.ccache/*
|
||||
|
||||
# Visual Studio
|
||||
.vs
|
||||
out
|
||||
CMakeSettings.json
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
09/18/2025 [spice2x]
|
||||
Polaris Chord windowed mode fixes
|
||||
UI tweaks
|
||||
|
||||
09/17/2025 [spice2x]
|
||||
Polaris Chord I/O fixes, language shim
|
||||
|
||||
09/16/2025 [spice2x]
|
||||
Add Polaris Chord support
|
||||
Tweak ImGUI theme
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace games::mfg {
|
||||
SetEnvironmentVariableA("VFG_CABINET_TYPE", MFG_CABINET_TYPE.c_str());
|
||||
|
||||
// add card reader
|
||||
portName = MFG_CABINET_TYPE == "UKS" ? L"\\\\.\\COM1" : L"\\\\.\\COM3";
|
||||
portName = (MFG_CABINET_TYPE == "UKS") ? std::wstring(L"\\\\.\\COM1") : std::wstring(L"\\\\.\\COM3");
|
||||
acioHandle = new acioemu::ACIOHandle(portName.c_str(), 1);
|
||||
devicehook_init_trampoline();
|
||||
devicehook_add(acioHandle);
|
||||
|
||||
@@ -246,52 +246,66 @@ namespace games::pc {
|
||||
memset(o_DevStatus, 0x00, sizeof(AIO_IOB2_BI2X_AC1__DEVSTATUS));
|
||||
|
||||
auto &buttons = get_buttons();
|
||||
o_DevStatus->Input.CN8_8 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Test]);
|
||||
o_DevStatus->Input.CN8_9 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Service]);
|
||||
o_DevStatus->Input.CN8_10 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::CoinMech]);
|
||||
o_DevStatus->Input.CN15_10 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Headphone]);
|
||||
o_DevStatus->Input.CN15_12 = 0xFF; // Recorder off
|
||||
o_DevStatus->Input.CN8_8 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Test]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN8_9 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Service]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN8_10 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::CoinMech]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN15_10 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Headphone]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN15_12 = 0xFF; // Recorder off; present in I/O test menu but unused in game
|
||||
|
||||
o_DevStatus->Input.CN12_11 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button1]);
|
||||
o_DevStatus->Input.CN12_12 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button2]);
|
||||
o_DevStatus->Input.CN12_13 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button3]);
|
||||
o_DevStatus->Input.CN12_14 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button4]);
|
||||
o_DevStatus->Input.CN12_15 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button5]);
|
||||
o_DevStatus->Input.CN12_16 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button6]);
|
||||
o_DevStatus->Input.CN12_17 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button7]);
|
||||
o_DevStatus->Input.CN12_18 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button8]);
|
||||
o_DevStatus->Input.CN12_19 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button9]);
|
||||
o_DevStatus->Input.CN12_20 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button10]);
|
||||
o_DevStatus->Input.CN12_21 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button11]);
|
||||
o_DevStatus->Input.CN12_22 = !GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button12]);
|
||||
o_DevStatus->Input.CN12_11 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button1]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_12 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button2]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_13 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button3]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_14 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button4]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_15 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button5]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_16 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button6]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_17 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button7]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_18 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button8]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_19 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button9]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_20 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button10]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_21 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button11]) ? 0 : 0xFF;
|
||||
o_DevStatus->Input.CN12_22 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::Button12]) ? 0 : 0xFF;
|
||||
|
||||
auto &analogs = get_analogs();
|
||||
|
||||
// FADER-L
|
||||
float val = 0.f;
|
||||
if (analogs[Analogs::FaderL].isSet()) {
|
||||
float val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderL]) - 0.5f) * 2;
|
||||
o_DevStatus->Input.CN15_7 = val < 0.2f;
|
||||
o_DevStatus->Input.CN15_6 = val > -0.85f && val < 0.35f;
|
||||
o_DevStatus->Input.CN15_5 = val > -0.6f && val < 0.6f;
|
||||
o_DevStatus->Input.CN15_4 = val > -0.35f && val < 0.85f;
|
||||
o_DevStatus->Input.CN15_3 = val > -0.2f;
|
||||
} else {
|
||||
o_DevStatus->Input.CN15_7 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Left]);
|
||||
o_DevStatus->Input.CN15_3 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Right]);
|
||||
o_DevStatus->Input.CN15_5 = !o_DevStatus->Input.CN15_7 && !o_DevStatus->Input.CN15_3;
|
||||
val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderL]) - 0.5f) * 2;
|
||||
}
|
||||
if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Left]) &&
|
||||
GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Right])) {
|
||||
val = 0.f;
|
||||
} else if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Left])) {
|
||||
val = -1.0f;
|
||||
} else if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Right])) {
|
||||
val = +1.0f;
|
||||
}
|
||||
o_DevStatus->Input.CN15_7 = (val < 0.2f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN15_6 = (val > -0.85f && val < 0.35f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN15_5 = (val > -0.6f && val < 0.6f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN15_4 = (val > -0.35f && val < 0.85f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN15_3 = (val > -0.2f) ? 0xFF : 0;
|
||||
|
||||
// FADER-R
|
||||
val = 0.f;
|
||||
if (analogs[Analogs::FaderR].isSet()) {
|
||||
float val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderR]) - 0.5f) * 2;
|
||||
o_DevStatus->Input.CN11_20 = val < 0.2f;
|
||||
o_DevStatus->Input.CN11_19 = val > -0.85f && val < 0.35f;
|
||||
o_DevStatus->Input.CN9_10 = val > -0.6f && val < 0.6f;
|
||||
o_DevStatus->Input.CN9_9 = val > -0.35f && val < 0.85f;
|
||||
o_DevStatus->Input.CN9_8 = val > -0.2f;
|
||||
} else {
|
||||
o_DevStatus->Input.CN11_20 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Left]);
|
||||
o_DevStatus->Input.CN9_8 = GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Right]);
|
||||
o_DevStatus->Input.CN9_10 = !o_DevStatus->Input.CN11_20 && !o_DevStatus->Input.CN9_8;
|
||||
val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderR]) - 0.5f) * 2;
|
||||
}
|
||||
if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Left]) &&
|
||||
GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Right])) {
|
||||
val = 0.f;
|
||||
} else if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Left])) {
|
||||
val = -1.0f;
|
||||
} else if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Right])) {
|
||||
val = +1.0f;
|
||||
}
|
||||
o_DevStatus->Input.CN11_20 = (val < 0.2f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN11_19 = (val > -0.85f && val < 0.35f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN9_10 = (val > -0.6f && val < 0.6f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN9_9 = (val > -0.35f && val < 0.85f) ? 0xFF : 0;
|
||||
o_DevStatus->Input.CN9_8 = (val > -0.2f) ? 0xFF : 0;
|
||||
|
||||
// coin
|
||||
o_DevStatus->Input.Coin1Count = eamuse_coin_get_stock();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,14 @@ std::vector<Button> &games::pc::get_buttons() {
|
||||
}
|
||||
|
||||
std::string games::pc::get_buttons_help() {
|
||||
return "";
|
||||
// keep to max 100 characters wide
|
||||
return
|
||||
" FADER-L FADER-R \n"
|
||||
"\n"
|
||||
" B1 B2 B3 ... B11 B12\n"
|
||||
"\n"
|
||||
" Most menu interactions are on the touch screen; you can use your mouse.\n"
|
||||
;
|
||||
}
|
||||
|
||||
std::vector<Analog> &games::pc::get_analogs() {
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
#include <format>
|
||||
|
||||
#include "bi2x_hook.h"
|
||||
#include "util/detour.h"
|
||||
#include "util/logging.h"
|
||||
#include "util/fileutils.h"
|
||||
#include "util/unity_player.h"
|
||||
#include "util/execexe.h"
|
||||
#include "acioemu/handle.h"
|
||||
#include "misc/wintouchemu.h"
|
||||
#include "hooks/graphics/graphics.h"
|
||||
#include "rawinput/rawinput.h"
|
||||
|
||||
namespace games::pc {
|
||||
std::string PC_INJECT_ARGS = "";
|
||||
@@ -17,6 +20,47 @@ namespace games::pc {
|
||||
static acioemu::ACIOHandle *acioHandle = nullptr;
|
||||
static std::wstring portName = L"COM1";
|
||||
|
||||
static decltype(RegisterRawInputDevices) *RegisterRawInputDevices_orig = nullptr;
|
||||
static decltype(EnumDisplaySettingsW) *EnumDisplaySettingsW_orig = nullptr;
|
||||
static decltype(QueryDisplayConfig) *QueryDisplayConfig_orig = nullptr;
|
||||
|
||||
static BOOL WINAPI RegisterRawInputDevices_hook(PCRAWINPUTDEVICE pRawInputDevices, UINT uiNumDevices, UINT cbSize) {
|
||||
|
||||
// if the caller is spice itself, then pass through.
|
||||
if (pRawInputDevices &&
|
||||
(uiNumDevices > 0) &&
|
||||
(pRawInputDevices[0].hwndTarget == RI_MGR->input_hwnd)) {
|
||||
|
||||
return RegisterRawInputDevices_orig(pRawInputDevices, uiNumDevices, cbSize);
|
||||
}
|
||||
|
||||
// otherwise, it must be the game; prevent the game from registering for raw input
|
||||
// and hijacking WM_INPUT messages.
|
||||
SetLastError(0xDEADBEEF);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL WINAPI EnumDisplaySettingsW_hook(LPCWSTR lpszDeviceName, DWORD iModeNum, DEVMODEW* lpDevMode) {
|
||||
auto result = EnumDisplaySettingsW_orig(lpszDeviceName, iModeNum, lpDevMode);
|
||||
|
||||
// https://docs.unity3d.com/2022.3/Documentation/ScriptReference/Screen-currentResolution.html
|
||||
// "If the player is running in windowed mode, this returns the current dimensions of the game window in pixels and the display refresh rate."
|
||||
// Override it to 1920x1080 to avoid broken UI under Windowed mode
|
||||
if (result && iModeNum == ENUM_CURRENT_SETTINGS) {
|
||||
// Actually make it returns size of the game window, Can I?
|
||||
lpDevMode->dmPelsWidth = 1920;
|
||||
lpDevMode->dmPelsHeight = 1080;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
LONG WINAPI QueryDisplayConfig_hook(UINT32, UINT32*, DISPLAYCONFIG_PATH_INFO*, UINT32*, DISPLAYCONFIG_MODE_INFO*, DISPLAYCONFIG_TOPOLOGY_ID*) {
|
||||
// make unity fallback to EnumDisplaySettingsW as I don't
|
||||
// want to deal with this api which is way more complex
|
||||
return ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
void PCGame::attach() {
|
||||
Game::attach();
|
||||
|
||||
@@ -39,6 +83,13 @@ namespace games::pc {
|
||||
}
|
||||
});
|
||||
|
||||
const auto user32Dll = "user32.dll";
|
||||
detour::trampoline_try(user32Dll, "RegisterRawInputDevices",
|
||||
RegisterRawInputDevices_hook, &RegisterRawInputDevices_orig);
|
||||
detour::trampoline_try(user32Dll, "QueryDisplayConfig",
|
||||
QueryDisplayConfig_hook, &QueryDisplayConfig_orig);
|
||||
detour::trampoline_try(user32Dll, "EnumDisplaySettingsW",
|
||||
EnumDisplaySettingsW_hook, &EnumDisplaySettingsW_orig);
|
||||
|
||||
if (GRAPHICS_SHOW_CURSOR) {
|
||||
unity_utils::force_show_cursor(true);
|
||||
|
||||
@@ -18,6 +18,7 @@ constexpr UINT CODEPAGE_SHIFT_JIS = 932;
|
||||
static decltype(GetACP) *GetACP_orig = nullptr;
|
||||
static decltype(GetOEMCP) *GetOEMCP_orig = nullptr;
|
||||
static decltype(MultiByteToWideChar) *MultiByteToWideChar_orig = nullptr;
|
||||
static decltype(GetLocaleInfoEx) *GetLocaleInfoEx_orig = nullptr;
|
||||
|
||||
#ifdef SPICE64
|
||||
static decltype(GetSystemDefaultLCID) *GetSystemDefaultLCID_orig = nullptr;
|
||||
@@ -119,6 +120,48 @@ static int WINAPI MultiByteToWideChar_hook(
|
||||
cchWideChar);
|
||||
}
|
||||
|
||||
static int WINAPI GetLocaleInfoEx_hook (
|
||||
LPCWSTR lpLocaleName,
|
||||
LCTYPE LCType,
|
||||
LPWSTR lpLCData,
|
||||
int cchData)
|
||||
{
|
||||
|
||||
#if 0
|
||||
if (lpLocaleName == LOCALE_NAME_INVARIANT) {
|
||||
log_misc("hooks::lang", "GetLocaleInfoEx_hook hit (LOCALE_NAME_INVARIANT), {}, {}", LCType, cchData);
|
||||
} else if (lpLocaleName == LOCALE_NAME_SYSTEM_DEFAULT) {
|
||||
log_misc("hooks::lang", "GetLocaleInfoEx_hook hit (LOCALE_NAME_SYSTEM_DEFAULT), {}, {}", LCType, cchData);
|
||||
} else if (lpLocaleName == LOCALE_NAME_USER_DEFAULT) {
|
||||
log_misc("hooks::lang", "GetLocaleInfoEx_hook hit (LOCALE_NAME_USER_DEFAULT), {}, {}", LCType, cchData);
|
||||
} else {
|
||||
log_misc("hooks::lang", "GetLocaleInfoEx_hook hit ({}), {}, {}", ws2s(lpLocaleName), LCType, cchData);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (lpLocaleName == LOCALE_NAME_USER_DEFAULT &&
|
||||
LCType == LOCALE_SISO639LANGNAME &&
|
||||
lpLCData != NULL &&
|
||||
cchData >= 3) {
|
||||
log_misc("hooks::lang",
|
||||
"GetLocaleInfoEx_hook hit (LOCALE_NAME_USER_DEFAULT / LOCALE_SISO639LANGNAME), return `ja`");
|
||||
wcscpy(lpLCData, L"ja");
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (lpLocaleName == LOCALE_NAME_USER_DEFAULT &&
|
||||
LCType == LOCALE_SISO3166CTRYNAME &&
|
||||
lpLCData != NULL &&
|
||||
cchData >= 3) {
|
||||
log_misc("hooks::lang",
|
||||
"GetLocaleInfoEx_hook hit (LOCALE_NAME_USER_DEFAULT / LOCALE_SISO3166CTRYNAME), return `JP`");
|
||||
wcscpy(lpLCData, L"JP");
|
||||
return 3;
|
||||
}
|
||||
|
||||
return GetLocaleInfoEx_orig(lpLocaleName, LCType, lpLCData, cchData);
|
||||
}
|
||||
|
||||
void hooks::lang::early_init() {
|
||||
log_info("hooks::lang", "early initialization");
|
||||
|
||||
@@ -138,6 +181,14 @@ void hooks::lang::early_init() {
|
||||
}
|
||||
#endif
|
||||
|
||||
if (avs::game::is_model("XIF")) {
|
||||
log_info("hooks::lang", "hooking GetLocaleInfoEx");
|
||||
detour::trampoline_try(
|
||||
"kernel32.dll",
|
||||
"GetLocaleInfoEx",
|
||||
GetLocaleInfoEx_hook,
|
||||
&GetLocaleInfoEx_orig);
|
||||
}
|
||||
}
|
||||
|
||||
void hooks::lang::init() {
|
||||
|
||||
@@ -1272,6 +1272,19 @@ int main_implementation(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (options[launcher::Options::GameExecutable].is_active() && !cfg::CONFIGURATOR_STANDALONE) {
|
||||
log_warning(
|
||||
"launcher",
|
||||
"WARNING - user specified -exec option\n\n\n"
|
||||
"!!! !!!\n"
|
||||
"!!! Using -exec option disables all game-specific hooks! !!!\n"
|
||||
"!!! Unless you know exactly what you are doing, clear -exec !!!\n"
|
||||
"!!! and try again. Using -exec by itself will result in weird !!!\n"
|
||||
"!!! errors and loss of functionality. !!!\n"
|
||||
"!!! !!!\n"
|
||||
);
|
||||
}
|
||||
|
||||
if (options[launcher::Options::FullscreenResolution].is_active()) {
|
||||
std::pair<uint32_t, uint32_t> result;
|
||||
if (parse_width_height(options[launcher::Options::FullscreenResolution].value_text(), result)) {
|
||||
@@ -1767,7 +1780,14 @@ int main_implementation(int argc, char *argv[]) {
|
||||
// usage error
|
||||
if (!cfg::CONFIGURATOR_STANDALONE
|
||||
&& (!CHECK_DLL_IGNORE_ARCH)) {
|
||||
log_fatal("launcher", "module auto detection failed.");
|
||||
log_fatal(
|
||||
"launcher",
|
||||
"module auto detection failed!\n\n"
|
||||
"This usually means one of the following:\n\n"
|
||||
" 1. You put spice executables in the wrong place, or\n"
|
||||
" 2. XML files in prop directory are malformed or missing, or\n"
|
||||
" 3. You passed in invalid options (usually, path overrides like -exec)\n\n"
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ static const std::vector<std::string> CATEGORY_ORDER_ADVANCED = {
|
||||
"NFC Card Readers",
|
||||
};
|
||||
static const std::vector<std::string> CATEGORY_ORDER_DEV = {
|
||||
"Paths",
|
||||
"Path Overrides",
|
||||
"Network (Development)",
|
||||
"Audio (Hacks)",
|
||||
"I/O Modules",
|
||||
@@ -53,12 +53,14 @@ bool launcher::USE_CMD_OVERRIDE = false;
|
||||
*/
|
||||
static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
||||
{
|
||||
.title = "Game Executable",
|
||||
.title = "Override Game Executable & Disable Hooks",
|
||||
.name = "exec",
|
||||
.desc = "Path to the game DLL file",
|
||||
.desc = "Path to the game DLL file.\n\n"
|
||||
"This option is typically not needed; leave it empty to allow spice to auto-detect your game.\n\n"
|
||||
"WARNING: this option also disables all game-specific hooks and turns off most I/O modules!",
|
||||
.type = OptionType::Text,
|
||||
.setting_name = "*.dll",
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Open Configurator",
|
||||
@@ -1091,88 +1093,88 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
||||
.category = "Game Options (Advanced)",
|
||||
},
|
||||
{
|
||||
.title = "Modules Folder Path",
|
||||
.title = "Modules Folder Override",
|
||||
.name = "modules",
|
||||
.desc = "Sets a custom path to the modules folder",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Screenshot Folder Path",
|
||||
.title = "Screenshot Folder Override",
|
||||
.name = "screenshotpath",
|
||||
.desc = "Sets a custom path to the screenshots folder",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Configuration Path",
|
||||
.title = "Configuration Path Override",
|
||||
.name = "cfgpath",
|
||||
.desc = "Sets a custom file path for config file. Must be passed via the command line. "
|
||||
"If left empty, %appdata%\\spicetools.xml will be used",
|
||||
.type = OptionType::Text,
|
||||
.setting_name = "(default)",
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
.disabled = true,
|
||||
},
|
||||
{
|
||||
// ScreenResizeConfigPath
|
||||
.title = "Screen Resize Config Path",
|
||||
.title = "Screen Resize Config Path Override",
|
||||
.name = "resizecfgpath",
|
||||
.desc = "Sets a custom file path for screen resize config file. "
|
||||
"If left empty, %appdata%\\spice2x\\spicetools_screen_resize.json will be used",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
// PatchManagerConfigPath
|
||||
.title = "Patch Manager Config Path",
|
||||
.title = "Patch Manager Config Path Override",
|
||||
.name = "patchcfgpath",
|
||||
.desc = "Sets a custom file path for patch manager config file. Can be used to manage 'profiles' for auto-patches. "
|
||||
"If left empty, %appdata%\\spice2x\\spicetools_patch_manager.json will be used",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Intel SDE Folder Path",
|
||||
.title = "Intel SDE Folder",
|
||||
.name = "sde",
|
||||
.desc = "Path to Intel SDE kit path for automatic attaching",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Path to ea3-config.xml",
|
||||
.title = "ea3-config.xml Override",
|
||||
.name = "e",
|
||||
.desc = "Sets a custom path to ea3-config.xml",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Path to app-config.xml",
|
||||
.title = "app-config.xml Override",
|
||||
.name = "a",
|
||||
.desc = "Sets a custom path to app-config.xml",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Path to avs-config.xml",
|
||||
.title = "avs-config.xml Override",
|
||||
.name = "v",
|
||||
.desc = "Sets a custom path to avs-config.xml",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Path to bootstrap.xml",
|
||||
.title = "bootstrap.xml Override",
|
||||
.name = "b",
|
||||
.desc = "Sets a custom path to bootstrap.xml",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "Path to log.txt",
|
||||
.title = "log.txt Override",
|
||||
.name = "y",
|
||||
.desc = "Sets a custom path to log.txt",
|
||||
.type = OptionType::Text,
|
||||
.category = "Paths",
|
||||
.category = "Path Overrides",
|
||||
},
|
||||
{
|
||||
.title = "API TCP Port",
|
||||
|
||||
@@ -230,7 +230,13 @@ namespace overlay::windows {
|
||||
auto const register_fn = reinterpret_cast<decltype(&LdrRegisterDllNotification)>
|
||||
(GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "LdrRegisterDllNotification"));
|
||||
|
||||
auto callback = [] CALLBACK (ULONG reason, PCLDR_DLL_NOTIFICATION_DATA data, PVOID ctx) {
|
||||
auto callback =
|
||||
#ifdef _MSC_VER
|
||||
static_cast<PLDR_DLL_NOTIFICATION_FUNCTION>([]
|
||||
#else
|
||||
[] CALLBACK
|
||||
#endif
|
||||
(ULONG reason, PCLDR_DLL_NOTIFICATION_DATA data, PVOID ctx) {
|
||||
if (reason == LDR_DLL_NOTIFICATION_REASON_LOADED) {
|
||||
auto const dll = strtolower(std::filesystem::path({
|
||||
data->Loaded.FullDllName->Buffer,
|
||||
@@ -241,7 +247,11 @@ namespace overlay::windows {
|
||||
static_cast<PatchManager*>(ctx)->reload_local_patches(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
)
|
||||
#endif
|
||||
;
|
||||
|
||||
if (register_fn && NT_SUCCESS(register_fn(0, callback, this, &ldr_notify_cookie))) {
|
||||
log_info("patchmanager", "registered for DLL load notifications");
|
||||
|
||||
@@ -54,7 +54,6 @@ namespace rawinput {
|
||||
|
||||
HotplugManager *hotplug;
|
||||
std::vector<Device> devices;
|
||||
HWND input_hwnd = nullptr;
|
||||
WNDCLASSEX input_hwnd_class {};
|
||||
std::thread *input_thread = nullptr;
|
||||
std::thread *flush_thread = nullptr;
|
||||
@@ -91,6 +90,8 @@ namespace rawinput {
|
||||
|
||||
public:
|
||||
|
||||
HWND input_hwnd = nullptr;
|
||||
|
||||
RawInputManager();
|
||||
~RawInputManager();
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ std::string peb::entry_name(const LDR_DATA_TABLE_ENTRY* entry) {
|
||||
}
|
||||
|
||||
const PEB* peb::peb_get() {
|
||||
#ifdef SPICE64
|
||||
#ifdef _WIN64
|
||||
return reinterpret_cast<const PEB *>(__readgsqword(0x60));
|
||||
#else
|
||||
return reinterpret_cast<const PEB *>(__readfsdword(0x30));
|
||||
|
||||
Reference in New Issue
Block a user