mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fc3aa5818 | |||
| 276874f882 | |||
| 1fdd270480 | |||
| 07cb6048a0 | |||
| 61d79f76b2 | |||
| 7335d07e30 | |||
| 9f99b71112 | |||
| 5c3921a99c | |||
| 9fc397b8bc | |||
| ddc8061268 | |||
| c0698a3872 | |||
| 1ed3521091 | |||
| 0dda920448 | |||
| 5f7580b69e | |||
| 3ef1b3ecaa | |||
| 931811da14 | |||
| 7624ded512 | |||
| a5252939dd | |||
| 808ac0c557 | |||
| 4e138b244e | |||
| 3fcd1bdbc9 |
@@ -80,6 +80,25 @@ if(MSVC)
|
|||||||
|
|
||||||
# enable COMDAT folding for even smaller release builds
|
# enable COMDAT folding for even smaller release builds
|
||||||
add_link_options("$<$<CONFIG:RELEASE,MINSIZEREL>:/OPT:ICF>")
|
add_link_options("$<$<CONFIG:RELEASE,MINSIZEREL>:/OPT:ICF>")
|
||||||
|
|
||||||
|
# always use UTF-8 (fix 4819)
|
||||||
|
add_compile_options("/utf-8")
|
||||||
|
|
||||||
|
# spectre mitigation warning
|
||||||
|
add_compile_options("/wd5045")
|
||||||
|
|
||||||
|
# implicit type convert warnings
|
||||||
|
add_compile_options("/wd4244")
|
||||||
|
add_compile_options("/wd4267")
|
||||||
|
add_compile_options("/wd4305")
|
||||||
|
|
||||||
|
# unreferenced local variable
|
||||||
|
add_compile_options("/wd4101")
|
||||||
|
|
||||||
|
# warning in winbase.h??
|
||||||
|
add_compile_options("/wd5039")
|
||||||
|
|
||||||
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
# disable warnings about using non _s variants like strncpy
|
# disable warnings about using non _s variants like strncpy
|
||||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ void ICCADevice::update_card(int unit) {
|
|||||||
bool kb_insert_press = false;
|
bool kb_insert_press = false;
|
||||||
|
|
||||||
// eamio keypress
|
// eamio keypress
|
||||||
kb_insert_press |= eamuse_get_keypad_state((size_t) unit) & (1 << EAM_IO_INSERT);
|
kb_insert_press |= static_cast<bool>(eamuse_get_keypad_state((size_t) unit) & (1 << EAM_IO_INSERT));
|
||||||
|
|
||||||
// check for card
|
// check for card
|
||||||
if (this->cards[unit] == nullptr && (eamuse_card_insert_consume(this->node_count, unit) || kb_insert_press)) {
|
if (this->cards[unit] == nullptr && (eamuse_card_insert_consume(this->node_count, unit) || kb_insert_press)) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "external/robin_hood.h"
|
#include "external/robin_hood.h"
|
||||||
#include "launcher/logger.h"
|
#include "launcher/logger.h"
|
||||||
|
#include "launcher/signal.h"
|
||||||
#include "util/detour.h"
|
#include "util/detour.h"
|
||||||
#include "util/fileutils.h"
|
#include "util/fileutils.h"
|
||||||
#include "util/libutils.h"
|
#include "util/libutils.h"
|
||||||
@@ -1736,7 +1737,13 @@ namespace avs {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_dir(
|
static void avs_dir_err(const std::filesystem::path &src_path)
|
||||||
|
{
|
||||||
|
launcher::signal::AVS_DIR_CREATION_FAILURE = TRUE;
|
||||||
|
launcher::signal::AVS_SRC_PATH = src_path.string();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void create_avs_dir(
|
||||||
const std::string_view &avs_path,
|
const std::string_view &avs_path,
|
||||||
const std::string_view &src_path)
|
const std::string_view &src_path)
|
||||||
{
|
{
|
||||||
@@ -1745,6 +1752,7 @@ namespace avs {
|
|||||||
auto real_path = std::filesystem::absolute(src_path, err);
|
auto real_path = std::filesystem::absolute(src_path, err);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
avs_dir_err(real_path);
|
||||||
log_warning("avs-core", "failed to resolve '{}' path: {}", avs_path, err.message());
|
log_warning("avs-core", "failed to resolve '{}' path: {}", avs_path, err.message());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1754,7 +1762,9 @@ namespace avs {
|
|||||||
if (created) {
|
if (created) {
|
||||||
log_info("avs-core", "created '{}' at '{}'", avs_path, real_path.string());
|
log_info("avs-core", "created '{}' at '{}'", avs_path, real_path.string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
avs_dir_err(real_path);
|
||||||
log_warning("avs-core", "failed to create '{}' folder at '{}': {}",
|
log_warning("avs-core", "failed to create '{}' folder at '{}': {}",
|
||||||
avs_path,
|
avs_path,
|
||||||
real_path.string(),
|
real_path.string(),
|
||||||
@@ -1815,7 +1825,7 @@ namespace avs {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
create_dir(avs_path, device_path);
|
create_avs_dir(avs_path, device_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_avs_config_fs_table(
|
static void create_avs_config_fs_table(
|
||||||
@@ -1870,7 +1880,7 @@ namespace avs {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
create_dir(dst_path, src_path);
|
create_avs_dir(dst_path, src_path);
|
||||||
} while ((vfs_node = property_node_traversal(vfs_node, TRAVERSE_NEXT_SEARCH_RESULT)));
|
} while ((vfs_node = property_node_traversal(vfs_node, TRAVERSE_NEXT_SEARCH_RESULT)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ namespace avs {
|
|||||||
int HTTP11 = -1;
|
int HTTP11 = -1;
|
||||||
int URL_SLASH = -1;
|
int URL_SLASH = -1;
|
||||||
int PCB_TYPE = -1;
|
int PCB_TYPE = -1;
|
||||||
|
bool EA3_DEBUG_VERBOSE = false;
|
||||||
|
|
||||||
// handle
|
// handle
|
||||||
std::string VERSION_STR = "unknown";
|
std::string VERSION_STR = "unknown";
|
||||||
@@ -412,6 +413,11 @@ namespace avs {
|
|||||||
log_fatal("avs-ea3", "no PCBID set (try using -p to specify PCBID)");
|
log_fatal("avs-ea3", "no PCBID set (try using -p to specify PCBID)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove <debug> since it can expose pcbid in logged requests
|
||||||
|
if (!EA3_DEBUG_VERBOSE) {
|
||||||
|
avs::core::property_search_remove_safe(ea3_config, nullptr, "/ea3/debug/verbose");
|
||||||
|
}
|
||||||
|
|
||||||
// remember IDs
|
// remember IDs
|
||||||
char pcbid_buffer[256] { 0 };
|
char pcbid_buffer[256] { 0 };
|
||||||
char accountid_buffer[256] { 0 };
|
char accountid_buffer[256] { 0 };
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ namespace avs {
|
|||||||
extern int HTTP11;
|
extern int HTTP11;
|
||||||
extern int URL_SLASH;
|
extern int URL_SLASH;
|
||||||
extern int PCB_TYPE;
|
extern int PCB_TYPE;
|
||||||
|
extern bool EA3_DEBUG_VERBOSE;
|
||||||
|
|
||||||
// handle
|
// handle
|
||||||
extern std::string VERSION_STR;
|
extern std::string VERSION_STR;
|
||||||
|
|||||||
@@ -1,3 +1,20 @@
|
|||||||
|
09/30/2025 [spice2x]
|
||||||
|
Prevent verbose debug EA3 logging by default
|
||||||
|
Options UI tweaks
|
||||||
|
|
||||||
|
09/28/2025 [spice2x]
|
||||||
|
IIDX: auto apply ASIO compatibility fix for IIDX32+
|
||||||
|
Misc diagnosability updates
|
||||||
|
|
||||||
|
09/22/2025 [spice2x]
|
||||||
|
Add Polaris Chord lights
|
||||||
|
Add boot.dll to Gitadora patches target
|
||||||
|
Misc fixes
|
||||||
|
|
||||||
|
09/20/2025 [spice2x]
|
||||||
|
Polaris Chord support for knobs/turntables/mouse as fader input
|
||||||
|
Misc fixes
|
||||||
|
|
||||||
09/18/2025 [spice2x]
|
09/18/2025 [spice2x]
|
||||||
Polaris Chord windowed mode fixes
|
Polaris Chord windowed mode fixes
|
||||||
UI tweaks
|
UI tweaks
|
||||||
|
|||||||
+4
@@ -1527,8 +1527,10 @@ FMT_CONSTEXPR auto make_arg(const T& value) -> basic_format_arg<Context> {
|
|||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wdangling-reference"
|
#pragma GCC diagnostic ignored "-Wdangling-reference"
|
||||||
|
#endif
|
||||||
|
|
||||||
// The type template parameter is there to avoid an ODR violation when using
|
// The type template parameter is there to avoid an ODR violation when using
|
||||||
// a fallback formatter in one translation unit and an implicit conversion in
|
// a fallback formatter in one translation unit and an implicit conversion in
|
||||||
@@ -1544,7 +1546,9 @@ FMT_CONSTEXPR FMT_INLINE auto make_arg(const T& val) -> value<Context> {
|
|||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
template <bool IS_PACKED, typename Context, type, typename T,
|
template <bool IS_PACKED, typename Context, type, typename T,
|
||||||
FMT_ENABLE_IF(!IS_PACKED)>
|
FMT_ENABLE_IF(!IS_PACKED)>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace games::ccj {
|
|||||||
bool MOUSE_TRACKBALL_USE_TOGGLE = false;
|
bool MOUSE_TRACKBALL_USE_TOGGLE = false;
|
||||||
uint8_t TRACKBALL_SENSITIVITY = 10;
|
uint8_t TRACKBALL_SENSITIVITY = 10;
|
||||||
|
|
||||||
static HANDLE fakeHandle = (HANDLE)0xDEADBEEF;
|
static HANDLE fakeHandle = (HANDLE)0xDEADBEEFull;
|
||||||
static HWND hWnd = nullptr;
|
static HWND hWnd = nullptr;
|
||||||
static WNDPROC wndProc = nullptr;
|
static WNDPROC wndProc = nullptr;
|
||||||
static std::thread *tbThread = nullptr;
|
static std::thread *tbThread = nullptr;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "games/iidx/legacy_camera.h"
|
#include "games/iidx/legacy_camera.h"
|
||||||
|
|
||||||
|
#include "hooks/audio/audio.h"
|
||||||
#include "hooks/avshook.h"
|
#include "hooks/avshook.h"
|
||||||
#include "hooks/cfgmgr32hook.h"
|
#include "hooks/cfgmgr32hook.h"
|
||||||
#include "hooks/devicehook.h"
|
#include "hooks/devicehook.h"
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
#include "util/memutils.h"
|
#include "util/memutils.h"
|
||||||
#include "util/sigscan.h"
|
#include "util/sigscan.h"
|
||||||
#include "util/utils.h"
|
#include "util/utils.h"
|
||||||
|
#include "launcher/signal.h"
|
||||||
|
|
||||||
#include "external/robin_hood.h"
|
#include "external/robin_hood.h"
|
||||||
|
|
||||||
@@ -232,6 +234,9 @@ namespace games::iidx {
|
|||||||
} else if (data.find(" W:touch: missing trigger:") != std::string::npos) {
|
} else if (data.find(" W:touch: missing trigger:") != std::string::npos) {
|
||||||
out.clear();
|
out.clear();
|
||||||
return true;
|
return true;
|
||||||
|
} else if (data.find("SuperstepSound: Audio device is not available") != std::string::npos) {
|
||||||
|
launcher::signal::SUPERSTEP_SOUND_ERROR = TRUE;
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -372,7 +377,11 @@ namespace games::iidx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hooks::audio::ENABLED) {
|
||||||
apply_audio_hacks();
|
apply_audio_hacks();
|
||||||
|
} else {
|
||||||
|
log_warning("iidx", "skipping audio hooks; disabled by user");
|
||||||
|
}
|
||||||
|
|
||||||
// ASIO device hook
|
// ASIO device hook
|
||||||
RegCloseKey_orig = detour::iat_try(
|
RegCloseKey_orig = detour::iat_try(
|
||||||
@@ -762,26 +771,30 @@ namespace games::iidx {
|
|||||||
0);
|
0);
|
||||||
|
|
||||||
// attempt to detect ASIO support
|
// attempt to detect ASIO support
|
||||||
|
// <=24 : 32-bit only
|
||||||
// 25-26: has neither (no patch needed - WASAPI Exclusive by default)
|
// 25-26: has neither (no patch needed - WASAPI Exclusive by default)
|
||||||
// 27-30: has both (envvar will be respected, ASIO or WASAPI)
|
// 27-30: has both (envvar will be respected, ASIO or WASAPI)
|
||||||
// 31+: only has XONAR (ASIO by default, signature patch can be used to force WASAPI - for now)
|
// 31+: only has XONAR (ASIO by default, signature patch can be used to force WASAPI - for now)
|
||||||
|
|
||||||
if (!has_SOUND_OUTPUT_DEVICE && !has_XONAR_SOUND_CARD) {
|
if (!has_SOUND_OUTPUT_DEVICE && !has_XONAR_SOUND_CARD) {
|
||||||
|
// iidx 25-26
|
||||||
log_info("iidx", "This game only uses WASAPI audio engine");
|
log_info("iidx", "This game only uses WASAPI audio engine");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (has_SOUND_OUTPUT_DEVICE && has_XONAR_SOUND_CARD) {
|
if (has_SOUND_OUTPUT_DEVICE && has_XONAR_SOUND_CARD) {
|
||||||
|
// iidx 27-30
|
||||||
log_info("iidx", "This game accepts SOUND_OUTPUT_DEVICE environment variable");
|
log_info("iidx", "This game accepts SOUND_OUTPUT_DEVICE environment variable");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info("iidx", "This game supports ASIO but does not accept SOUND_OUTPUT_DEVICE environment variable");
|
log_info("iidx", "This game supports ASIO but does not accept SOUND_OUTPUT_DEVICE environment variable");
|
||||||
|
|
||||||
|
// patch game to force wasapi
|
||||||
if (SOUND_OUTPUT_DEVICE_IN_EFFECT.has_value() && SOUND_OUTPUT_DEVICE_IN_EFFECT.value() == "wasapi") {
|
if (SOUND_OUTPUT_DEVICE_IN_EFFECT.has_value() && SOUND_OUTPUT_DEVICE_IN_EFFECT.value() == "wasapi") {
|
||||||
intptr_t result = replace_pattern(
|
intptr_t result = replace_pattern(
|
||||||
avs::game::DLL_INSTANCE,
|
avs::game::DLL_INSTANCE,
|
||||||
"FF5008E8????ECFF83780803740D",
|
"FF5008E8??????FF83780803740D",
|
||||||
"??????BB00000000EB169090????",
|
"??????BB00000000EB169090????",
|
||||||
0, 0);
|
0, 0);
|
||||||
|
|
||||||
@@ -796,6 +809,41 @@ namespace games::iidx {
|
|||||||
"Successfully forced WASAPI as audio engine using signature matching @ 0x{:x}.",
|
"Successfully forced WASAPI as audio engine using signature matching @ 0x{:x}.",
|
||||||
result);
|
result);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log_info("iidx", "Not applying force wasapi patch; game will use ASIO");
|
||||||
|
}
|
||||||
|
|
||||||
|
// patch iidx32+ for asio compatibility
|
||||||
|
// only do this if NOT wasapi (as opposed to checking if it's asio)
|
||||||
|
// the patch is only really needed for (some) non-XONAR devices but since people sometimes disguise
|
||||||
|
// other devices as a XONAR, don't check for the exact string (common ASIO workaround for INF)
|
||||||
|
if (avs::game::is_ext(2024090100, MAXINT) &&
|
||||||
|
!(SOUND_OUTPUT_DEVICE_IN_EFFECT.has_value() && SOUND_OUTPUT_DEVICE_IN_EFFECT.value() == "wasapi")) {
|
||||||
|
|
||||||
|
// in iidx32 final:
|
||||||
|
// ff 50 08 call QWORD PTR [rax+0x8] ; ASIO instance AddRef
|
||||||
|
// 48 8b 4b 08 mov rcx,QWORD PTR [rbx+0x8]
|
||||||
|
// 48 8b 01 mov rax,QWORD PTR [rcx]
|
||||||
|
// ff 50 08 call QWORD PTR [rax+0x8] ; ASIO instance AddRef
|
||||||
|
|
||||||
|
intptr_t result = replace_pattern(
|
||||||
|
avs::game::DLL_INSTANCE,
|
||||||
|
"FF50????????????????FF50??4533C94533C0418D51",
|
||||||
|
"????????????????????909090??????????????????",
|
||||||
|
0, 0);
|
||||||
|
|
||||||
|
if (result == 0) {
|
||||||
|
log_warning(
|
||||||
|
"iidx",
|
||||||
|
"Failed to apply ASIO compatibility fix for iidx32+. "
|
||||||
|
"Unless patches are applied, your ASIO device ({}) may hang or fail to work",
|
||||||
|
ASIO_DRIVER->c_str());
|
||||||
|
} else {
|
||||||
|
log_info(
|
||||||
|
"iidx",
|
||||||
|
"Successfully applied ASIO compatibility fix for iidx32+ using signature matching @ 0x{:x}.",
|
||||||
|
result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -85,12 +85,19 @@ namespace games::iidx {
|
|||||||
&m_pwszSymbolicLink,
|
&m_pwszSymbolicLink,
|
||||||
&m_cchSymbolicLink
|
&m_cchSymbolicLink
|
||||||
);
|
);
|
||||||
if (FAILED(hr)) { goto done; }
|
if (FAILED(hr)) {
|
||||||
|
log_warning("iidx:camhook", "[{}] GetAllocatedString failed with {:#x}", m_name, (ULONG)hr);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
log_misc("iidx:camhook", "[{}] Symlink: {}", m_name, GetSymLink());
|
log_misc("iidx:camhook", "[{}] Symlink: {}", m_name, GetSymLink());
|
||||||
|
|
||||||
// Create the media source object.
|
// Create the media source object.
|
||||||
hr = pActivate->ActivateObject(IID_PPV_ARGS(&m_pSource));
|
hr = pActivate->ActivateObject(IID_PPV_ARGS(&m_pSource));
|
||||||
if (FAILED(hr)) { goto done; }
|
if (FAILED(hr)) {
|
||||||
|
log_warning("iidx:camhook", "[{}] ActivateObject failed with {:#x}", m_name, (ULONG)hr);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
// Retain reference to the camera
|
// Retain reference to the camera
|
||||||
m_pSource->AddRef();
|
m_pSource->AddRef();
|
||||||
@@ -98,13 +105,22 @@ namespace games::iidx {
|
|||||||
|
|
||||||
// Create an attribute store to hold initialization settings.
|
// Create an attribute store to hold initialization settings.
|
||||||
hr = WrappedMFCreateAttributes(&pAttributes, 2);
|
hr = WrappedMFCreateAttributes(&pAttributes, 2);
|
||||||
if (FAILED(hr)) { goto done; }
|
if (FAILED(hr)) {
|
||||||
|
log_warning("iidx:camhook", "[{}] MFCreateAttributes failed with {:#x}", m_name, (ULONG)hr);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
hr = pAttributes->SetUnknown(MF_SOURCE_READER_D3D_MANAGER, pD3DManager);
|
hr = pAttributes->SetUnknown(MF_SOURCE_READER_D3D_MANAGER, pD3DManager);
|
||||||
if (FAILED(hr)) { goto done; }
|
if (FAILED(hr)) {
|
||||||
|
log_warning("iidx:camhook", "[{}] SetUnknown(MF_SOURCE_READER_D3D_MANAGER) failed with {:#x}", m_name, (ULONG)hr);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
hr = pAttributes->SetUINT32(MF_SOURCE_READER_DISABLE_DXVA, FALSE);
|
hr = pAttributes->SetUINT32(MF_SOURCE_READER_DISABLE_DXVA, FALSE);
|
||||||
if (FAILED(hr)) { goto done; }
|
if (FAILED(hr)) {
|
||||||
|
log_warning("iidx:camhook", "[{}] SetUINT32(MF_SOURCE_READER_DISABLE_DXVA) failed with {:#x}", m_name, (ULONG)hr);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Color space conversion
|
// TODO: Color space conversion
|
||||||
// if (SUCCEEDED(hr)) {
|
// if (SUCCEEDED(hr)) {
|
||||||
@@ -120,11 +136,18 @@ namespace games::iidx {
|
|||||||
pAttributes,
|
pAttributes,
|
||||||
&m_pSourceReader
|
&m_pSourceReader
|
||||||
);
|
);
|
||||||
if (FAILED(hr)) { goto done; }
|
if (FAILED(hr)) {
|
||||||
|
log_warning("iidx:camhook", "[{}] MFCreateSourceReaderFromMediaSource failed with {:#x}", m_name, (ULONG)hr);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
log_misc("iidx:camhook", "[{}] Created source reader", m_name);
|
log_misc("iidx:camhook", "[{}] Created source reader", m_name);
|
||||||
|
|
||||||
hr = InitTargetTexture();
|
hr = InitTargetTexture();
|
||||||
if (FAILED(hr)) { goto done; }
|
if (FAILED(hr)) {
|
||||||
|
log_warning("iidx:camhook", "[{}] InitTargetTexture failed with {:#x}", m_name, (ULONG)hr);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
// Camera should be still usable even if camera control is not supported
|
// Camera should be still usable even if camera control is not supported
|
||||||
InitCameraControl();
|
InitCameraControl();
|
||||||
@@ -134,7 +157,7 @@ namespace games::iidx {
|
|||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
log_misc("iidx:camhook", "[{}] Initialized", m_name);
|
log_misc("iidx:camhook", "[{}] Initialized", m_name);
|
||||||
} else {
|
} else {
|
||||||
log_warning("iidx:camhook", "[{}] Failed to create camera: {}", m_name, hr);
|
log_warning("iidx:camhook", "[{}] Failed to create camera: {:#x}", m_name, (ULONG)hr);
|
||||||
}
|
}
|
||||||
SafeRelease(&pAttributes);
|
SafeRelease(&pAttributes);
|
||||||
LeaveCriticalSection(&m_critsec);
|
LeaveCriticalSection(&m_critsec);
|
||||||
@@ -165,7 +188,7 @@ namespace games::iidx {
|
|||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
if (hr != MF_E_NO_MORE_TYPES) {
|
if (hr != MF_E_NO_MORE_TYPES) {
|
||||||
log_warning("iidx:camhook", "[{}] Cannot get media type {} {}", m_name, i, hr);
|
log_warning("iidx:camhook", "[{}] Cannot get media type {} {:#x}", m_name, i, (ULONG)hr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -584,7 +607,7 @@ namespace games::iidx {
|
|||||||
* Return values:
|
* Return values:
|
||||||
* S_OK: this is a "better" media type than the existing one
|
* S_OK: this is a "better" media type than the existing one
|
||||||
* S_FALSE: valid media type, but not "better"
|
* S_FALSE: valid media type, but not "better"
|
||||||
* E_*: invalid meia type
|
* E_*: invalid media type
|
||||||
*/
|
*/
|
||||||
HRESULT IIDXLocalCamera::TryMediaType(IMFMediaType *pType, UINT32 *pBestWidth, double *pBestFrameRate) {
|
HRESULT IIDXLocalCamera::TryMediaType(IMFMediaType *pType, UINT32 *pBestWidth, double *pBestFrameRate) {
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
@@ -595,13 +618,13 @@ namespace games::iidx {
|
|||||||
hr = pType->GetGUID(MF_MT_SUBTYPE, &subtype);
|
hr = pType->GetGUID(MF_MT_SUBTYPE, &subtype);
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
log_warning("iidx:camhook", "[{}] Failed to get subtype: {}", m_name, hr);
|
log_warning("iidx:camhook", "[{}] Failed to get subtype: {:#x}", m_name, (ULONG)hr);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = MFGetAttributeSize(pType, MF_MT_FRAME_SIZE, &width, &height);
|
hr = MFGetAttributeSize(pType, MF_MT_FRAME_SIZE, &width, &height);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
log_warning("iidx:camhook", "[{}] Failed to get frame size: {}", m_name, hr);
|
log_warning("iidx:camhook", "[{}] Failed to get frame size: {:#x}", m_name, (ULONG)hr);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -619,7 +642,7 @@ namespace games::iidx {
|
|||||||
(UINT32*)&frameRate.Denominator
|
(UINT32*)&frameRate.Denominator
|
||||||
);
|
);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
log_warning("iidx:camhook", "[{}] Failed to get frame rate: {}", m_name, hr);
|
log_warning("iidx:camhook", "[{}] Failed to get frame rate: {:#x}", m_name, (ULONG)hr);
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
double frameRateValue = frameRate.Numerator / frameRate.Denominator;
|
double frameRateValue = frameRate.Numerator / frameRate.Denominator;
|
||||||
@@ -696,7 +719,7 @@ namespace games::iidx {
|
|||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
log_misc("iidx:camhook", "[{}] Created texture", m_name);
|
log_misc("iidx:camhook", "[{}] Created texture", m_name);
|
||||||
} else {
|
} else {
|
||||||
log_warning("iidx:camhook", "[{}] Failed to create texture: {}", m_name, hr);
|
log_warning("iidx:camhook", "[{}] Failed to create texture: {:#x}", m_name, (ULONG)hr);
|
||||||
}
|
}
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
@@ -785,7 +808,7 @@ namespace games::iidx {
|
|||||||
FlushDrawCommands();
|
FlushDrawCommands();
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
log_warning("iidx:camhook", "Error in DrawSample {}", hr);
|
log_warning("iidx:camhook", "Error in DrawSample {:#x}", (ULONG)hr);
|
||||||
}
|
}
|
||||||
SafeRelease(&pCameraSurf);
|
SafeRelease(&pCameraSurf);
|
||||||
LeaveCriticalSection(&m_critsec);
|
LeaveCriticalSection(&m_critsec);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace games::otoca {
|
|||||||
bool kb_insert_press = false;
|
bool kb_insert_press = false;
|
||||||
|
|
||||||
// eamio keypress
|
// eamio keypress
|
||||||
kb_insert_press |= eamuse_get_keypad_state(0) & (1 << EAM_IO_INSERT);
|
kb_insert_press |= static_cast<bool>(eamuse_get_keypad_state(0) & (1 << EAM_IO_INSERT));
|
||||||
|
|
||||||
// check for card
|
// check for card
|
||||||
if (CARD_DATA == nullptr && (eamuse_card_insert_consume(1, 0) || kb_insert_press)) {
|
if (CARD_DATA == nullptr && (eamuse_card_insert_consume(1, 0) || kb_insert_press)) {
|
||||||
|
|||||||
@@ -7,8 +7,68 @@
|
|||||||
#include "games/io.h"
|
#include "games/io.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "util/tapeled.h"
|
#include "util/tapeled.h"
|
||||||
|
#include "pc.h"
|
||||||
|
#include "util/utils.h"
|
||||||
|
|
||||||
namespace games::pc {
|
namespace games::pc {
|
||||||
|
bool PC_KNOB_MODE = false;
|
||||||
|
|
||||||
|
constexpr float RELATIVE_DECAY = 0.02f;
|
||||||
|
struct FADER_RELATIVE {
|
||||||
|
// ranges from 0.f to 1.f
|
||||||
|
float previous_raw = 0.5f;
|
||||||
|
|
||||||
|
// ranges from -1.f to +1.f
|
||||||
|
float effective_value = 0.f;
|
||||||
|
};
|
||||||
|
|
||||||
|
FADER_RELATIVE fader_l_relative;
|
||||||
|
FADER_RELATIVE fader_r_relative;
|
||||||
|
|
||||||
|
float calculate_analog_raw_delta(float old_value, float new_value) {
|
||||||
|
// assumed that values are between 0.f and 1.f
|
||||||
|
|
||||||
|
float delta = 0.f;
|
||||||
|
if ((old_value < 0.25f) && (0.75f < new_value)) {
|
||||||
|
// wrapped around: going left
|
||||||
|
delta = -((1.f - new_value) + old_value);
|
||||||
|
|
||||||
|
} else if ((new_value < 0.25f) && (0.75f < old_value)) {
|
||||||
|
// wrapped around: going right
|
||||||
|
delta = (1.f - old_value) + new_value;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
delta = new_value - old_value;
|
||||||
|
}
|
||||||
|
return delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
float apply_decay(float val) {
|
||||||
|
// return to center over time
|
||||||
|
if (RELATIVE_DECAY < val) {
|
||||||
|
return val - RELATIVE_DECAY;
|
||||||
|
} else if (val < -RELATIVE_DECAY) {
|
||||||
|
return val + RELATIVE_DECAY;
|
||||||
|
} else {
|
||||||
|
return 0.f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float get_fader_knob_mode_value(float raw_analog, FADER_RELATIVE &fader) {
|
||||||
|
// add new value...
|
||||||
|
const float delta = calculate_analog_raw_delta(fader.previous_raw, raw_analog);
|
||||||
|
fader.effective_value += (delta * 20.f);
|
||||||
|
fader.previous_raw = raw_analog;
|
||||||
|
|
||||||
|
// capture the result after adding new input value
|
||||||
|
fader.effective_value = CLAMP(fader.effective_value, -1.f, 1.f);
|
||||||
|
const float result = fader.effective_value;
|
||||||
|
|
||||||
|
// post-process for next iteration: apply decay (return to center over time)
|
||||||
|
fader.effective_value = apply_decay(fader.effective_value);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* class definitions
|
* class definitions
|
||||||
@@ -270,8 +330,14 @@ namespace games::pc {
|
|||||||
// FADER-L
|
// FADER-L
|
||||||
float val = 0.f;
|
float val = 0.f;
|
||||||
if (analogs[Analogs::FaderL].isSet()) {
|
if (analogs[Analogs::FaderL].isSet()) {
|
||||||
|
if (PC_KNOB_MODE) {
|
||||||
|
val = get_fader_knob_mode_value(
|
||||||
|
GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderL]),
|
||||||
|
fader_l_relative);
|
||||||
|
} else {
|
||||||
val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderL]) - 0.5f) * 2;
|
val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderL]) - 0.5f) * 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Left]) &&
|
if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Left]) &&
|
||||||
GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Right])) {
|
GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderL_Right])) {
|
||||||
val = 0.f;
|
val = 0.f;
|
||||||
@@ -289,8 +355,14 @@ namespace games::pc {
|
|||||||
// FADER-R
|
// FADER-R
|
||||||
val = 0.f;
|
val = 0.f;
|
||||||
if (analogs[Analogs::FaderR].isSet()) {
|
if (analogs[Analogs::FaderR].isSet()) {
|
||||||
|
if (PC_KNOB_MODE) {
|
||||||
|
val = get_fader_knob_mode_value(
|
||||||
|
GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderR]),
|
||||||
|
fader_r_relative);
|
||||||
|
} else {
|
||||||
val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderR]) - 0.5f) * 2;
|
val = (GameAPI::Analogs::getState(RI_MGR, analogs[Analogs::FaderR]) - 0.5f) * 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Left]) &&
|
if (GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Left]) &&
|
||||||
GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Right])) {
|
GameAPI::Buttons::getState(RI_MGR, buttons[Buttons::FaderR_Right])) {
|
||||||
val = 0.f;
|
val = 0.f;
|
||||||
@@ -343,6 +415,19 @@ namespace games::pc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct PolarisChordLight {
|
||||||
|
int data_index;
|
||||||
|
games::pc::Lights::pc_lights_t light;
|
||||||
|
PolarisChordLight(
|
||||||
|
int data_index, games::pc::Lights::pc_lights_t light) :
|
||||||
|
data_index(data_index), light(light) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
static void set_led_value(games::pc::Lights::pc_lights_t light, uint8_t value) {
|
||||||
|
auto &lights = games::pc::get_lights();
|
||||||
|
GameAPI::Lights::writeLight(RI_MGR, lights.at(light), value / 255.f);
|
||||||
|
}
|
||||||
|
|
||||||
void __fastcall aioIob2Bi2xAC1_SetTapeLedDataPart(AIO_IOB2_BI2X_AC1 *i_pNodeCtl, uint32_t i_TapeLedCh,
|
void __fastcall aioIob2Bi2xAC1_SetTapeLedDataPart(AIO_IOB2_BI2X_AC1 *i_pNodeCtl, uint32_t i_TapeLedCh,
|
||||||
uint32_t i_Offset, uint8_t *i_pData,
|
uint32_t i_Offset, uint8_t *i_pData,
|
||||||
uint32_t i_cntTapeLed, bool i_bReverse) {
|
uint32_t i_cntTapeLed, bool i_bReverse) {
|
||||||
@@ -350,8 +435,82 @@ namespace games::pc {
|
|||||||
return aioIob2Bi2xAC1_SetTapeLedDataPart_orig(i_pNodeCtl, i_TapeLedCh, i_Offset, i_pData, i_cntTapeLed, i_bReverse);
|
return aioIob2Bi2xAC1_SetTapeLedDataPart_orig(i_pNodeCtl, i_TapeLedCh, i_Offset, i_pData, i_cntTapeLed, i_bReverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO implement tape led
|
// log_info(
|
||||||
// there are >200 lights in total, adding each one separately probably isn't the best idea...
|
// "pc",
|
||||||
|
// "lamp [{}] [{}] = {},{},{}, cnt={}",
|
||||||
|
// i_TapeLedCh,
|
||||||
|
// i_Offset,
|
||||||
|
// i_pData[0], i_pData[1], i_pData[2],
|
||||||
|
// i_cntTapeLed);
|
||||||
|
|
||||||
|
// [channel 0]
|
||||||
|
// these are button lamps; there are 12 buttons (columns) with this layout:
|
||||||
|
//
|
||||||
|
// 0 5 8 11 14 16 | 18 20 22 25 28 31
|
||||||
|
// 1 6 9 12 15 17 | 19 21 23 26 29 32
|
||||||
|
// 2 7 10 13 | 24 27 30 33
|
||||||
|
// 3 | 34
|
||||||
|
// 4 | 35
|
||||||
|
//
|
||||||
|
// 36 RGB lamps * 3 = 108 LEDs
|
||||||
|
// each value ranges from [0, 255]
|
||||||
|
// (we only care about the top row)
|
||||||
|
|
||||||
|
static PolarisChordLight button_lights_mapping[] = {
|
||||||
|
{(0 * 3) + 0, games::pc::Lights::pc_lights_t::Button1_R},
|
||||||
|
{(0 * 3) + 1, games::pc::Lights::pc_lights_t::Button1_G},
|
||||||
|
{(0 * 3) + 2, games::pc::Lights::pc_lights_t::Button1_B},
|
||||||
|
|
||||||
|
{(5 * 3) + 0, games::pc::Lights::pc_lights_t::Button2_R},
|
||||||
|
{(5 * 3) + 1, games::pc::Lights::pc_lights_t::Button2_G},
|
||||||
|
{(5 * 3) + 2, games::pc::Lights::pc_lights_t::Button2_B},
|
||||||
|
|
||||||
|
{(8 * 3) + 0, games::pc::Lights::pc_lights_t::Button3_R},
|
||||||
|
{(8 * 3) + 1, games::pc::Lights::pc_lights_t::Button3_G},
|
||||||
|
{(8 * 3) + 2, games::pc::Lights::pc_lights_t::Button3_B},
|
||||||
|
|
||||||
|
{(11 * 3) + 0, games::pc::Lights::pc_lights_t::Button4_R},
|
||||||
|
{(11 * 3) + 1, games::pc::Lights::pc_lights_t::Button4_G},
|
||||||
|
{(11 * 3) + 2, games::pc::Lights::pc_lights_t::Button4_B},
|
||||||
|
|
||||||
|
{(14 * 3) + 0, games::pc::Lights::pc_lights_t::Button5_R},
|
||||||
|
{(14 * 3) + 1, games::pc::Lights::pc_lights_t::Button5_G},
|
||||||
|
{(14 * 3) + 2, games::pc::Lights::pc_lights_t::Button5_B},
|
||||||
|
|
||||||
|
{(16 * 3) + 0, games::pc::Lights::pc_lights_t::Button6_R},
|
||||||
|
{(16 * 3) + 1, games::pc::Lights::pc_lights_t::Button6_G},
|
||||||
|
{(16 * 3) + 2, games::pc::Lights::pc_lights_t::Button6_B},
|
||||||
|
|
||||||
|
{(18 * 3) + 0, games::pc::Lights::pc_lights_t::Button7_R},
|
||||||
|
{(18 * 3) + 1, games::pc::Lights::pc_lights_t::Button7_G},
|
||||||
|
{(18 * 3) + 2, games::pc::Lights::pc_lights_t::Button7_B},
|
||||||
|
|
||||||
|
{(20 * 3) + 0, games::pc::Lights::pc_lights_t::Button8_R},
|
||||||
|
{(20 * 3) + 1, games::pc::Lights::pc_lights_t::Button8_G},
|
||||||
|
{(20 * 3) + 2, games::pc::Lights::pc_lights_t::Button8_B},
|
||||||
|
|
||||||
|
{(22 * 3) + 0, games::pc::Lights::pc_lights_t::Button9_R},
|
||||||
|
{(22 * 3) + 1, games::pc::Lights::pc_lights_t::Button9_G},
|
||||||
|
{(22 * 3) + 2, games::pc::Lights::pc_lights_t::Button9_B},
|
||||||
|
|
||||||
|
{(25 * 3) + 0, games::pc::Lights::pc_lights_t::Button10_R},
|
||||||
|
{(25 * 3) + 1, games::pc::Lights::pc_lights_t::Button10_G},
|
||||||
|
{(25 * 3) + 2, games::pc::Lights::pc_lights_t::Button10_B},
|
||||||
|
|
||||||
|
{(28 * 3) + 0, games::pc::Lights::pc_lights_t::Button11_R},
|
||||||
|
{(28 * 3) + 1, games::pc::Lights::pc_lights_t::Button11_G},
|
||||||
|
{(28 * 3) + 2, games::pc::Lights::pc_lights_t::Button11_B},
|
||||||
|
|
||||||
|
{(31 * 3) + 0, games::pc::Lights::pc_lights_t::Button12_R},
|
||||||
|
{(31 * 3) + 1, games::pc::Lights::pc_lights_t::Button12_G},
|
||||||
|
{(31 * 3) + 2, games::pc::Lights::pc_lights_t::Button12_B},
|
||||||
|
};
|
||||||
|
|
||||||
|
if (i_TapeLedCh == 0 && i_Offset == 0 && i_cntTapeLed == 108) {
|
||||||
|
for (const auto &map : button_lights_mapping) {
|
||||||
|
set_led_value(map.light, i_pData[map.data_index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void __fastcall aioIob2Bi2x_SetTapeLedDataGroup(AIO_IOB2_BI2X_AC1* i_pNodeCtl, uint32_t i_bfGroup) {
|
void __fastcall aioIob2Bi2x_SetTapeLedDataGroup(AIO_IOB2_BI2X_AC1* i_pNodeCtl, uint32_t i_bfGroup) {
|
||||||
|
|||||||
@@ -71,7 +71,55 @@ std::vector<Light> &games::pc::get_lights() {
|
|||||||
&lights,
|
&lights,
|
||||||
"IC Reader R",
|
"IC Reader R",
|
||||||
"IC Reader G",
|
"IC Reader G",
|
||||||
"IC Reader B"
|
"IC Reader B",
|
||||||
|
|
||||||
|
"Button 1 R",
|
||||||
|
"Button 1 G",
|
||||||
|
"Button 1 B",
|
||||||
|
|
||||||
|
"Button 2 R",
|
||||||
|
"Button 2 G",
|
||||||
|
"Button 2 B",
|
||||||
|
|
||||||
|
"Button 3 R",
|
||||||
|
"Button 3 G",
|
||||||
|
"Button 3 B",
|
||||||
|
|
||||||
|
"Button 4 R",
|
||||||
|
"Button 4 G",
|
||||||
|
"Button 4 B",
|
||||||
|
|
||||||
|
"Button 5 R",
|
||||||
|
"Button 5 G",
|
||||||
|
"Button 5 B",
|
||||||
|
|
||||||
|
"Button 6 R",
|
||||||
|
"Button 6 G",
|
||||||
|
"Button 6 B",
|
||||||
|
|
||||||
|
"Button 7 R",
|
||||||
|
"Button 7 G",
|
||||||
|
"Button 7 B",
|
||||||
|
|
||||||
|
"Button 8 R",
|
||||||
|
"Button 8 G",
|
||||||
|
"Button 8 B",
|
||||||
|
|
||||||
|
"Button 9 R",
|
||||||
|
"Button 9 G",
|
||||||
|
"Button 9 B",
|
||||||
|
|
||||||
|
"Button 10 R",
|
||||||
|
"Button 10 G",
|
||||||
|
"Button 10 B",
|
||||||
|
|
||||||
|
"Button 11 R",
|
||||||
|
"Button 11 G",
|
||||||
|
"Button 11 B",
|
||||||
|
|
||||||
|
"Button 12 R",
|
||||||
|
"Button 12 G",
|
||||||
|
"Button 12 B"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,55 @@ namespace games::pc {
|
|||||||
IC_READER_R,
|
IC_READER_R,
|
||||||
IC_READER_G,
|
IC_READER_G,
|
||||||
IC_READER_B,
|
IC_READER_B,
|
||||||
|
|
||||||
|
Button1_R,
|
||||||
|
Button1_G,
|
||||||
|
Button1_B,
|
||||||
|
|
||||||
|
Button2_R,
|
||||||
|
Button2_G,
|
||||||
|
Button2_B,
|
||||||
|
|
||||||
|
Button3_R,
|
||||||
|
Button3_G,
|
||||||
|
Button3_B,
|
||||||
|
|
||||||
|
Button4_R,
|
||||||
|
Button4_G,
|
||||||
|
Button4_B,
|
||||||
|
|
||||||
|
Button5_R,
|
||||||
|
Button5_G,
|
||||||
|
Button5_B,
|
||||||
|
|
||||||
|
Button6_R,
|
||||||
|
Button6_G,
|
||||||
|
Button6_B,
|
||||||
|
|
||||||
|
Button7_R,
|
||||||
|
Button7_G,
|
||||||
|
Button7_B,
|
||||||
|
|
||||||
|
Button8_R,
|
||||||
|
Button8_G,
|
||||||
|
Button8_B,
|
||||||
|
|
||||||
|
Button9_R,
|
||||||
|
Button9_G,
|
||||||
|
Button9_B,
|
||||||
|
|
||||||
|
Button10_R,
|
||||||
|
Button10_G,
|
||||||
|
Button10_B,
|
||||||
|
|
||||||
|
Button11_R,
|
||||||
|
Button11_G,
|
||||||
|
Button11_B,
|
||||||
|
|
||||||
|
Button12_R,
|
||||||
|
Button12_G,
|
||||||
|
Button12_B
|
||||||
|
|
||||||
} pc_lights_t;
|
} pc_lights_t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
namespace games::pc {
|
namespace games::pc {
|
||||||
extern std::string PC_INJECT_ARGS;
|
extern std::string PC_INJECT_ARGS;
|
||||||
extern bool PC_NO_IO;
|
extern bool PC_NO_IO;
|
||||||
|
extern bool PC_KNOB_MODE;
|
||||||
|
|
||||||
class PCGame : public games::Game {
|
class PCGame : public games::Game {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "acioemu/handle.h"
|
#include "acioemu/handle.h"
|
||||||
#include "cfg/configurator.h"
|
#include "cfg/configurator.h"
|
||||||
|
#include "launcher/signal.h"
|
||||||
|
|
||||||
static decltype(RegCloseKey) *RegCloseKey_orig = nullptr;
|
static decltype(RegCloseKey) *RegCloseKey_orig = nullptr;
|
||||||
static decltype(RegEnumKeyA) *RegEnumKeyA_orig = nullptr;
|
static decltype(RegEnumKeyA) *RegEnumKeyA_orig = nullptr;
|
||||||
@@ -209,6 +210,10 @@ namespace games::sdvx {
|
|||||||
out = "";
|
out = "";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (data.find("SuperstepSound: Audio device is not available") != std::string::npos) {
|
||||||
|
launcher::signal::SUPERSTEP_SOUND_ERROR = TRUE;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,13 +141,17 @@ static ULONG WINAPI GetAdaptersInfo_hook(PIP_ADAPTER_INFO pAdapterInfo, PULONG p
|
|||||||
|
|
||||||
static int WINAPI bind_hook(SOCKET s, const struct sockaddr *name, int namelen) {
|
static int WINAPI bind_hook(SOCKET s, const struct sockaddr *name, int namelen) {
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma ide diagnostic ignored "OCDFAInspection"
|
#pragma ide diagnostic ignored "OCDFAInspection"
|
||||||
|
#endif
|
||||||
|
|
||||||
// cast to sockaddr_in
|
// cast to sockaddr_in
|
||||||
struct sockaddr_in *in_name = (struct sockaddr_in *) name;
|
struct sockaddr_in *in_name = (struct sockaddr_in *) name;
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
// override bind to allow all hosts
|
// override bind to allow all hosts
|
||||||
in_name->sin_addr.s_addr = inet_addr("0.0.0.0");
|
in_name->sin_addr.s_addr = inet_addr("0.0.0.0");
|
||||||
|
|||||||
@@ -365,6 +365,9 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::VerboseAVSLogging].value_bool()) {
|
if (options[launcher::Options::VerboseAVSLogging].value_bool()) {
|
||||||
hooks::avs::config::LOG = true;
|
hooks::avs::config::LOG = true;
|
||||||
}
|
}
|
||||||
|
if (options[launcher::Options::AllowEA3Verbose].value_bool()) {
|
||||||
|
avs::ea3::EA3_DEBUG_VERBOSE = true;
|
||||||
|
}
|
||||||
if (options[launcher::Options::spice2x_AutoOrientation].is_active()) {
|
if (options[launcher::Options::spice2x_AutoOrientation].is_active()) {
|
||||||
GRAPHICS_ADJUST_ORIENTATION =
|
GRAPHICS_ADJUST_ORIENTATION =
|
||||||
(graphics_orientation)options[launcher::Options::spice2x_AutoOrientation].value_uint32();
|
(graphics_orientation)options[launcher::Options::spice2x_AutoOrientation].value_uint32();
|
||||||
@@ -1112,6 +1115,9 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
if (options[launcher::Options::PCNoIO].is_active()) {
|
if (options[launcher::Options::PCNoIO].is_active()) {
|
||||||
games::pc::PC_NO_IO = options[launcher::Options::PCNoIO].value_bool();
|
games::pc::PC_NO_IO = options[launcher::Options::PCNoIO].value_bool();
|
||||||
}
|
}
|
||||||
|
if (options[launcher::Options::PCKnobMode].value_bool()) {
|
||||||
|
games::pc::PC_KNOB_MODE = true;
|
||||||
|
}
|
||||||
if (options[launcher::Options::spice2x_EnableSMXStage].value_bool()) {
|
if (options[launcher::Options::spice2x_EnableSMXStage].value_bool()) {
|
||||||
rawinput::ENABLE_SMX_STAGE = true;
|
rawinput::ENABLE_SMX_STAGE = true;
|
||||||
}
|
}
|
||||||
@@ -1964,6 +1970,7 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
libutils::warn_if_dll_exists("nvcuvid.dll");
|
libutils::warn_if_dll_exists("nvcuvid.dll");
|
||||||
libutils::warn_if_dll_exists("nvEncodeAPI64.dll");
|
libutils::warn_if_dll_exists("nvEncodeAPI64.dll");
|
||||||
libutils::warn_if_dll_exists("msvcr100.dll");
|
libutils::warn_if_dll_exists("msvcr100.dll");
|
||||||
|
libutils::warn_if_dll_exists("dsound.dll");
|
||||||
|
|
||||||
// complain loudly & early about dll load ordering issue
|
// complain loudly & early about dll load ordering issue
|
||||||
libutils::check_duplicate_dlls();
|
libutils::check_duplicate_dlls();
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.name = "r",
|
.name = "r",
|
||||||
.desc = "Set custom SOFTID override",
|
.desc = "Set custom SOFTID override",
|
||||||
.type = OptionType::Text,
|
.type = OptionType::Text,
|
||||||
.category = "Network (Development)",
|
.category = "Development",
|
||||||
.sensitive = true,
|
.sensitive = true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -554,10 +554,11 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Game Options",
|
.category = "Game Options",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.title = "IIDX BIO2 Firmware",
|
.title = "IIDX BIO2 Firmware Update",
|
||||||
.name = "iidxbio2fw",
|
.name = "iidxbio2fw",
|
||||||
.desc = "Enables BIO2 firmware updates",
|
.desc = "Enables BIO2 firmware updates. WARNING - can cause semi-permanent change to your I/O board",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
|
.hidden = true,
|
||||||
.game_name = "Beatmania IIDX",
|
.game_name = "Beatmania IIDX",
|
||||||
.category = "Game Options (Advanced)",
|
.category = "Game Options (Advanced)",
|
||||||
},
|
},
|
||||||
@@ -1049,7 +1050,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// LoadCCJModule
|
// LoadCCJModule
|
||||||
.title = "Force Load Chase Chase Jokers",
|
.title = "Force Load Chase Chase Jokers Module",
|
||||||
.name = "ccj",
|
.name = "ccj",
|
||||||
.desc = "manually enable Chase Chase Jokers module",
|
.desc = "manually enable Chase Chase Jokers module",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
@@ -1058,7 +1059,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// LoadQKSModule
|
// LoadQKSModule
|
||||||
.title = "Force Load QuizKnock STADIUM",
|
.title = "Force Load QuizKnock STADIUM Module",
|
||||||
.name = "qks",
|
.name = "qks",
|
||||||
.desc = "manually enable QuizKnock STADIUM module",
|
.desc = "manually enable QuizKnock STADIUM module",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
@@ -1067,7 +1068,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// LoadMFGModule
|
// LoadMFGModule
|
||||||
.title = "Force Load Mahjong Fight Girl",
|
.title = "Force Load Mahjong Fight Girl Module",
|
||||||
.name = "mfg",
|
.name = "mfg",
|
||||||
.desc = "manually enable Mahjong Fight Girl module",
|
.desc = "manually enable Mahjong Fight Girl module",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
@@ -1076,7 +1077,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// LoadPCModule
|
// LoadPCModule
|
||||||
.title = "Force Load Polaris Chord",
|
.title = "Force Load Polaris Chord Module",
|
||||||
.name = "pc",
|
.name = "pc",
|
||||||
.desc = "manually enable Polaris Chord module",
|
.desc = "manually enable Polaris Chord module",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
@@ -1085,7 +1086,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// LoadMusecaModule
|
// LoadMusecaModule
|
||||||
.title = "Force Load Museca",
|
.title = "Force Load Museca Module",
|
||||||
.name = "museca",
|
.name = "museca",
|
||||||
.desc = "manually enable Museca module",
|
.desc = "manually enable Museca module",
|
||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
@@ -1135,11 +1136,11 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Path Overrides",
|
.category = "Path Overrides",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.title = "Intel SDE Folder",
|
.title = "Intel SDE",
|
||||||
.name = "sde",
|
.name = "sde",
|
||||||
.desc = "Path to Intel SDE kit path for automatic attaching",
|
.desc = "Path to Intel SDE kit path for automatic attaching",
|
||||||
.type = OptionType::Text,
|
.type = OptionType::Text,
|
||||||
.category = "Path Overrides",
|
.category = "Development",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.title = "ea3-config.xml Override",
|
.title = "ea3-config.xml Override",
|
||||||
@@ -1544,10 +1545,13 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.title = "Spice Audio Hook Backend",
|
.title = "Spice Audio Hook Backend",
|
||||||
.name = "audiobackend",
|
.name = "audiobackend",
|
||||||
.desc = "Selects the audio backend to use when spice audio hook is enabled, overriding exclusive WASAPI. "
|
.desc = "Selects the audio backend to use when spice audio hook is enabled, overriding exclusive WASAPI. "
|
||||||
" Does nothing for games that do not output to exclusive WASAPI",
|
"Does nothing for games that do not output to exclusive WASAPI",
|
||||||
.type = OptionType::Enum,
|
.type = OptionType::Enum,
|
||||||
.category = "Audio",
|
.category = "Audio",
|
||||||
.elements = {{"asio", "ASIO"}, {"waveout", "waveOut"}},
|
.elements = {
|
||||||
|
{"asio", "ASIO"},
|
||||||
|
{"waveout", "broken, do not use"}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.title = "Spice Audio Hook ASIO Driver ID",
|
.title = "Spice Audio Hook ASIO Driver ID",
|
||||||
@@ -1672,6 +1676,16 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
.category = "Debug Log",
|
.category = "Debug Log",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// AllowEA3Verbose
|
||||||
|
.title = "Allow EA3 Verbose Debug Logging",
|
||||||
|
.name = "ea3verbose",
|
||||||
|
.desc = "This option is only useful for network developers; leave this OFF.\n\n"
|
||||||
|
"By default, ea3/debug/verbose node is removed by spice to prevent exposing PCBID in the logs. "
|
||||||
|
"When this is enabled, ea3/debug/verbose node in the XML will be kept and exposed to the game",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.category = "Debug Log",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.title = "Disable Colored Output",
|
.title = "Disable Colored Output",
|
||||||
.name = "nocolor",
|
.name = "nocolor",
|
||||||
@@ -1806,6 +1820,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Game Options (Advanced)"
|
.category = "Game Options (Advanced)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// PCArgs
|
||||||
.title = "PC Arguments Override",
|
.title = "PC Arguments Override",
|
||||||
.name = "pcargs",
|
.name = "pcargs",
|
||||||
.desc = "Command line arguments passed to the game.",
|
.desc = "Command line arguments passed to the game.",
|
||||||
@@ -1815,6 +1830,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.category = "Game Options (Advanced)",
|
.category = "Game Options (Advanced)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// PCNoIO
|
||||||
.title = "PC Disable IO Emulation",
|
.title = "PC Disable IO Emulation",
|
||||||
.name = "pcnoio",
|
.name = "pcnoio",
|
||||||
.desc = "Disables BI2X hooks for PC",
|
.desc = "Disables BI2X hooks for PC",
|
||||||
@@ -1823,6 +1839,15 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.game_name = "Polaris Chord",
|
.game_name = "Polaris Chord",
|
||||||
.category = "Game Options (Advanced)"
|
.category = "Game Options (Advanced)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// PCKnobMode
|
||||||
|
.title = "PC Fader Knobs Mode",
|
||||||
|
.name = "pcknobs",
|
||||||
|
.desc = "Allows SDVX knobs and IIDX turntables to be bound as Polaris Chord faders",
|
||||||
|
.type = OptionType::Bool,
|
||||||
|
.game_name = "Polaris Chord",
|
||||||
|
.category = "Game Options",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// spice2x_LightsOverallBrightness
|
// spice2x_LightsOverallBrightness
|
||||||
.title = "Lights Brightness Adjustment",
|
.title = "Lights Brightness Adjustment",
|
||||||
@@ -2364,7 +2389,7 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = {
|
|||||||
.type = OptionType::Bool,
|
.type = OptionType::Bool,
|
||||||
.category = "Development",
|
.category = "Development",
|
||||||
.disabled = true,
|
.disabled = true,
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::vector<std::string> &launcher::get_categories(Options::OptionsCategory category) {
|
const std::vector<std::string> &launcher::get_categories(Options::OptionsCategory category) {
|
||||||
@@ -2445,7 +2470,7 @@ std::unique_ptr<std::vector<Option>> launcher::parse_options(int argc, char *arg
|
|||||||
} else {
|
} else {
|
||||||
// validate it is an integer
|
// validate it is an integer
|
||||||
try {
|
try {
|
||||||
std::stoull(argv[i], nullptr, 16);
|
auto _ = std::stoull(argv[i], nullptr, 16);
|
||||||
} catch (const std::exception &ex) {
|
} catch (const std::exception &ex) {
|
||||||
log_fatal("options", "parameter for -{} is not a hex number: {}", alias, argv[i]);
|
log_fatal("options", "parameter for -{} is not a hex number: {}", alias, argv[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ namespace launcher {
|
|||||||
DebugCreateFile,
|
DebugCreateFile,
|
||||||
VerboseGraphicsLogging,
|
VerboseGraphicsLogging,
|
||||||
VerboseAVSLogging,
|
VerboseAVSLogging,
|
||||||
|
AllowEA3Verbose,
|
||||||
DisableColoredOutput,
|
DisableColoredOutput,
|
||||||
DisableACPHook,
|
DisableACPHook,
|
||||||
DisableSignalHandling,
|
DisableSignalHandling,
|
||||||
@@ -205,6 +206,7 @@ namespace launcher {
|
|||||||
MFGNoIO,
|
MFGNoIO,
|
||||||
PCArgs,
|
PCArgs,
|
||||||
PCNoIO,
|
PCNoIO,
|
||||||
|
PCKnobMode,
|
||||||
spice2x_LightsOverallBrightness,
|
spice2x_LightsOverallBrightness,
|
||||||
spice2x_WindowBorder,
|
spice2x_WindowBorder,
|
||||||
spice2x_WindowSize,
|
spice2x_WindowSize,
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#include "signal.h"
|
#include "signal.h"
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
|
|
||||||
|
#include "avs/core.h"
|
||||||
|
#include "avs/game.h"
|
||||||
#include "acio/acio.h"
|
#include "acio/acio.h"
|
||||||
#include "external/stackwalker/stackwalker.h"
|
#include "external/stackwalker/stackwalker.h"
|
||||||
#include "hooks/libraryhook.h"
|
#include "hooks/libraryhook.h"
|
||||||
@@ -29,6 +30,11 @@ namespace launcher::signal {
|
|||||||
// settings
|
// settings
|
||||||
bool DISABLE = false;
|
bool DISABLE = false;
|
||||||
bool USE_VEH_WORKAROUND = false;
|
bool USE_VEH_WORKAROUND = false;
|
||||||
|
|
||||||
|
// states
|
||||||
|
bool SUPERSTEP_SOUND_ERROR = false;
|
||||||
|
bool AVS_DIR_CREATION_FAILURE = false;
|
||||||
|
std::string AVS_SRC_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define V(variant) case variant: return #variant
|
#define V(variant) case variant: return #variant
|
||||||
@@ -98,6 +104,22 @@ static LONG WINAPI TopLevelExceptionFilter(struct _EXCEPTION_POINTERS *Exception
|
|||||||
// print signal
|
// print signal
|
||||||
log_warning("signal", "exception raised: {}", exception_code(ExceptionRecord));
|
log_warning("signal", "exception raised: {}", exception_code(ExceptionRecord));
|
||||||
|
|
||||||
|
std::string err;
|
||||||
|
switch (ExceptionRecord->ExceptionCode) {
|
||||||
|
case EXCEPTION_ILLEGAL_INSTRUCTION:
|
||||||
|
err = "Illegal instruction: either your CPU is too old (e.g., does not support "
|
||||||
|
"SSE4.2 or AVX2 but perhaps the game requires it); or, a bad patch was applied.";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!err.empty()) {
|
||||||
|
log_warning(
|
||||||
|
"signal",
|
||||||
|
"likely cause for your error based on the exception code:\n {}",
|
||||||
|
err.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
// check ACIO init failures
|
// check ACIO init failures
|
||||||
if (acio::IO_INIT_IN_PROGRESS) {
|
if (acio::IO_INIT_IN_PROGRESS) {
|
||||||
log_warning(
|
log_warning(
|
||||||
@@ -111,6 +133,25 @@ static LONG WINAPI TopLevelExceptionFilter(struct _EXCEPTION_POINTERS *Exception
|
|||||||
" RivaTuner Statistics Server (RTSS), MSI Afterburner, kernel mode anti-cheat");
|
" RivaTuner Statistics Server (RTSS), MSI Afterburner, kernel mode anti-cheat");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (launcher::signal::SUPERSTEP_SOUND_ERROR) {
|
||||||
|
log_warning("signal", "audio initialization error was previously detected during boot!");
|
||||||
|
log_warning("signal", " (W:SuperstepSound: Audio device is not available!!!)");
|
||||||
|
log_warning("signal", " this crash is most likely related to audio init failure");
|
||||||
|
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
|
// walk the exception chain
|
||||||
struct _EXCEPTION_RECORD *record_cause = ExceptionRecord->ExceptionRecord;
|
struct _EXCEPTION_RECORD *record_cause = ExceptionRecord->ExceptionRecord;
|
||||||
while (record_cause != nullptr) {
|
while (record_cause != nullptr) {
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace launcher::signal {
|
namespace launcher::signal {
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
extern bool DISABLE;
|
extern bool DISABLE;
|
||||||
extern bool USE_VEH_WORKAROUND;
|
extern bool USE_VEH_WORKAROUND;
|
||||||
|
extern bool SUPERSTEP_SOUND_ERROR;
|
||||||
|
extern bool AVS_DIR_CREATION_FAILURE;
|
||||||
|
extern std::string AVS_XML_PATH;
|
||||||
|
extern std::string AVS_SRC_PATH;
|
||||||
|
|
||||||
//void print_stacktrace();
|
//void print_stacktrace();
|
||||||
void attach();
|
void attach();
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ static void __cdecl cardunit_update() {
|
|||||||
bool kb_insert_press = false;
|
bool kb_insert_press = false;
|
||||||
|
|
||||||
// eamio keypress
|
// eamio keypress
|
||||||
kb_insert_press |= eamuse_get_keypad_state(unit) & (1 << EAM_IO_INSERT);
|
kb_insert_press |= static_cast<bool>(eamuse_get_keypad_state(unit) & (1 << EAM_IO_INSERT));
|
||||||
|
|
||||||
// update card inserts
|
// update card inserts
|
||||||
if (eamuse_card_insert_consume((int) EXTDEV_CARDUNIT_COUNT, unit) ||
|
if (eamuse_card_insert_consume((int) EXTDEV_CARDUNIT_COUNT, unit) ||
|
||||||
|
|||||||
@@ -2633,11 +2633,11 @@ namespace overlay::windows {
|
|||||||
|
|
||||||
// check hidden option
|
// check hidden option
|
||||||
if (!this->options_show_hidden && option.value.empty()) {
|
if (!this->options_show_hidden && option.value.empty()) {
|
||||||
|
|
||||||
// skip hidden entries
|
// skip hidden entries
|
||||||
if (definition.hidden) {
|
if (definition.hidden) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for game exclusivity
|
// check for game exclusivity
|
||||||
if (!definition.game_name.empty()) {
|
if (!definition.game_name.empty()) {
|
||||||
@@ -2645,7 +2645,6 @@ namespace overlay::windows {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// filter
|
// filter
|
||||||
if (filter != nullptr) {
|
if (filter != nullptr) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
|
#include "avs/game.h"
|
||||||
#include "games/io.h"
|
#include "games/io.h"
|
||||||
#include "cfg/screen_resize.h"
|
#include "cfg/screen_resize.h"
|
||||||
#include "hooks/graphics/backends/d3d9/d3d9_backend.h"
|
#include "hooks/graphics/backends/d3d9/d3d9_backend.h"
|
||||||
@@ -88,13 +89,32 @@ namespace overlay::windows {
|
|||||||
void GenericSubScreen::touch_transform(const ImVec2 xy_in, LONG *x_out, LONG *y_out) {}
|
void GenericSubScreen::touch_transform(const ImVec2 xy_in, LONG *x_out, LONG *y_out) {}
|
||||||
|
|
||||||
void GenericSubScreen::build_content() {
|
void GenericSubScreen::build_content() {
|
||||||
|
this->flags |= ImGuiWindowFlags_NoBackground;
|
||||||
|
|
||||||
if (this->disabled_message.has_value()) {
|
if (this->disabled_message.has_value()) {
|
||||||
this->flags &= ~ImGuiWindowFlags_NoBackground;
|
this->flags &= ~ImGuiWindowFlags_NoBackground;
|
||||||
ImGui::TextColored(YELLOW, "%s", this->disabled_message.value().c_str());
|
ImGui::TextColored(YELLOW, "%s", this->disabled_message.value().c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->draw_texture();
|
this->draw_texture();
|
||||||
|
|
||||||
|
if (!this->texture) {
|
||||||
|
this->flags &= ~ImGuiWindowFlags_NoBackground;
|
||||||
|
ImGui::TextColored(YELLOW, "Failed to acquire surface texture for subscreen.");
|
||||||
|
if (avs::game::is_model("LDJ")) {
|
||||||
|
ImGui::TextColored(
|
||||||
|
YELLOW,
|
||||||
|
"Ensure that you are using the correct DLL type, \n"
|
||||||
|
"or patch the DLL to properly enable TDJ mode.");
|
||||||
|
} else if (avs::game::is_model("KFC")) {
|
||||||
|
ImGui::TextColored(
|
||||||
|
YELLOW,
|
||||||
|
"Ensure that you did not accidentally enable a patch \n"
|
||||||
|
"that turns off subscreen rendering.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if OVERLAYDBG
|
#if OVERLAYDBG
|
||||||
if (this->status_message.has_value()) {
|
if (this->status_message.has_value()) {
|
||||||
log_warning("sub::overlay", "{}", this->status_message.value().c_str());
|
log_warning("sub::overlay", "{}", this->status_message.value().c_str());
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace overlay::windows {
|
|||||||
if (GRAPHICS_IIDX_WSUB) {
|
if (GRAPHICS_IIDX_WSUB) {
|
||||||
this->disabled_message =
|
this->disabled_message =
|
||||||
"Close this overlay and use the second window.\n"
|
"Close this overlay and use the second window.\n"
|
||||||
"Or, turn on -iidxnosub to use the overlay instead.";
|
"If you don't see the window, double check your DLL type and apply TDJ I/O patches as needed.";
|
||||||
this->draws_window = false;
|
this->draws_window = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace overlay::windows {
|
|||||||
{"arkmmd.dll", {"gamemmd.dll"}},
|
{"arkmmd.dll", {"gamemmd.dll"}},
|
||||||
{"arkklp.dll", {"lpac.dll"}},
|
{"arkklp.dll", {"lpac.dll"}},
|
||||||
{"arknck.dll", {"weac.dll"}},
|
{"arknck.dll", {"weac.dll"}},
|
||||||
{"gdxg.dll", {"game.dll", "libshare-pj.dll"}}
|
{"gdxg.dll", {"game.dll", "libshare-pj.dll", "boot.dll"}}
|
||||||
};
|
};
|
||||||
|
|
||||||
static size_t url_recent_idx = -1;
|
static size_t url_recent_idx = -1;
|
||||||
|
|||||||
@@ -106,8 +106,10 @@ bool detour::inline_restore(void *address, char *data) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma ide diagnostic ignored "OCDFAInspection"
|
#pragma ide diagnostic ignored "OCDFAInspection"
|
||||||
|
#endif
|
||||||
|
|
||||||
static void *pe_offset(void *ptr, size_t offset) {
|
static void *pe_offset(void *ptr, size_t offset) {
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
@@ -282,7 +284,9 @@ void **detour::iat_find_proc(const char *iid_name, void *proc, HMODULE module) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
void *detour::iat_try(const char *function, void *new_func, HMODULE module, const char *iid_name) {
|
void *detour::iat_try(const char *function, void *new_func, HMODULE module, const char *iid_name) {
|
||||||
|
|
||||||
|
|||||||
@@ -29,19 +29,17 @@ std::filesystem::path libutils::module_file_name(HMODULE module) {
|
|||||||
|
|
||||||
static inline void load_library_fail(const std::string &file_name, bool fatal) {
|
static inline void load_library_fail(const std::string &file_name, bool fatal) {
|
||||||
std::string info_str { fmt::format(
|
std::string info_str { fmt::format(
|
||||||
"\n\nPlease check if {} exists and the permissions are fine.\n"
|
"DLL failed to load - this is a common error. Please carefully read ALL of the following steps for a fix:\n"
|
||||||
"\n"
|
" 1. Confirm if the file ({}) exists on the disk and check the file permissions.\n"
|
||||||
"* If the problem still persists, try installing things on this list:\n"
|
" 2. Follow this link and install DLL prerequisites on this list:\n"
|
||||||
" https://github.com/spice2x/spice2x.github.io/wiki/DLL-Dependencies \n"
|
" https://github.com/spice2x/spice2x.github.io/wiki/DLL-Dependencies \n"
|
||||||
"\n"
|
" 3. Still have problems after installing from above and rebooting PC?\n"
|
||||||
"* Still have problems after installing from above and rebooting PC?\n"
|
" a. Avoid manually specifying DLL path (-exec) and module directory (-modules); let spice2x auto-detect unless you have a good reason not to\n"
|
||||||
" Avoid manually specifying DLL path (-exec) and module directory (-modules); let spice2x auto-detect unless you have a good reason not to\n"
|
" b. Ensure you do NOT have multiple copies of the game DLLs (e.g., in contents and in contents\\modules)\n"
|
||||||
" Ensure you do NOT have multiple copies of the game DLLs (e.g., in contents and in contents\\modules)\n"
|
" c. Certain games require specific NVIDIA DLLs when running with AMD/Intel GPUs (hint: look inside stub directory for DLLs)\n"
|
||||||
" Certain games require specific NVIDIA DLLs when running with AMD/Intel GPUs (hint: look inside stub directory for DLLs)\n"
|
" 4. (For advanced users) if none of the above helps, find the missing dependency using:\n"
|
||||||
"\n"
|
" a. https://github.com/lucasg/Dependencies (recommended for most) \n"
|
||||||
"* (For advanced users) if none of the above helps, find the missing dependency using:\n"
|
" b. http://www.dependencywalker.com/ (for old OS) \n"
|
||||||
" https://github.com/lucasg/Dependencies (recommended for most) \n"
|
|
||||||
" http://www.dependencywalker.com/ (for old OS) \n"
|
|
||||||
, file_name) };
|
, file_name) };
|
||||||
if (fatal) {
|
if (fatal) {
|
||||||
log_fatal("libutils", "{}", info_str);
|
log_fatal("libutils", "{}", info_str);
|
||||||
|
|||||||
Reference in New Issue
Block a user