mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5641e06a19 | |||
| 88ec6dbcee | |||
| 1b614c94a7 | |||
| 37c5913f69 | |||
| 2eca668593 | |||
| aec1da9d16 |
@@ -288,6 +288,21 @@ namespace games::mfc {
|
|||||||
MFCGame::MFCGame() : Game("Mahjong Fight Club") {
|
MFCGame::MFCGame() : Game("Mahjong Fight Club") {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool spam_remover(void *user, const std::string &data, logger::Style style, std::string &out) {
|
||||||
|
if (data.empty() || data[0] != '[') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (data.find("W:mutex: lock: mid 00000000 != AVS_DTYPE_MUTEX") != std::string::npos) {
|
||||||
|
out = "";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (data.find("W:mutex: unlock: mid 00000000 != AVS_DTYPE_MUTEX") != std::string::npos) {
|
||||||
|
out = "";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void MFCGame::attach() {
|
void MFCGame::attach() {
|
||||||
Game::attach();
|
Game::attach();
|
||||||
|
|
||||||
@@ -308,6 +323,13 @@ namespace games::mfc {
|
|||||||
auto allinone_module = libutils::try_module("allinone.dll");
|
auto allinone_module = libutils::try_module("allinone.dll");
|
||||||
auto system_module = libutils::try_module("system.dll");
|
auto system_module = libutils::try_module("system.dll");
|
||||||
|
|
||||||
|
// Mahjong Fight Club - 2025?
|
||||||
|
// they removed allinone.dll and moved i/o into system.dll
|
||||||
|
if (allinone_module == nullptr) {
|
||||||
|
log_misc("mfc", "using system.dll instead of allinone.dll for i/o hooks");
|
||||||
|
allinone_module = system_module;
|
||||||
|
}
|
||||||
|
|
||||||
// network fix
|
// network fix
|
||||||
detour::iat_try("?nic_dhcp_maybe_exist@@YAEXZ", nic_dhcp_maybe_exist, system_module);
|
detour::iat_try("?nic_dhcp_maybe_exist@@YAEXZ", nic_dhcp_maybe_exist, system_module);
|
||||||
|
|
||||||
@@ -378,5 +400,7 @@ namespace games::mfc {
|
|||||||
detour::inline_hook((void *) mouse_utl_step, libutils::try_proc(
|
detour::inline_hook((void *) mouse_utl_step, libutils::try_proc(
|
||||||
allinone_module, "?mouse_utl_step@@YAXXZ"));
|
allinone_module, "?mouse_utl_step@@YAXXZ"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger::hook_add(spam_remover, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,6 +215,15 @@ namespace games::sdvx {
|
|||||||
deferredlogs::defer_error_messages(deferredlogs::SUPERSTEP_SOUND_ERROR_MESSAGE);
|
deferredlogs::defer_error_messages(deferredlogs::SUPERSTEP_SOUND_ERROR_MESSAGE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (data.find("W:ea3-pos: ea3_report_posev: no such node:") != std::string::npos) {
|
||||||
|
deferredlogs::defer_error_messages({
|
||||||
|
"bad prop\\ea3-config.xml detected by game",
|
||||||
|
std::string(" ") + data,
|
||||||
|
" this will most likely cause Server Busy errors in certain conditions",
|
||||||
|
" follow the FAQ to fix your ea3-config.xml and try again"
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <ntstatus.h>
|
#include <ntstatus.h>
|
||||||
|
|
||||||
#include "avs/game.h"
|
#include "avs/game.h"
|
||||||
|
#include "games/iidx/iidx.h"
|
||||||
#include "util/detour.h"
|
#include "util/detour.h"
|
||||||
#include "util/logging.h"
|
#include "util/logging.h"
|
||||||
#include "util/utils.h"
|
#include "util/utils.h"
|
||||||
@@ -22,6 +23,7 @@ static decltype(GetLocaleInfoEx) *GetLocaleInfoEx_orig = nullptr;
|
|||||||
|
|
||||||
#ifdef SPICE64
|
#ifdef SPICE64
|
||||||
static decltype(GetSystemDefaultLCID) *GetSystemDefaultLCID_orig = nullptr;
|
static decltype(GetSystemDefaultLCID) *GetSystemDefaultLCID_orig = nullptr;
|
||||||
|
static decltype(IsDBCSLeadByte) *IsDBCSLeadByte_orig = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static NTSTATUS NTAPI RtlMultiByteToUnicodeN_hook(
|
static NTSTATUS NTAPI RtlMultiByteToUnicodeN_hook(
|
||||||
@@ -162,6 +164,17 @@ static int WINAPI GetLocaleInfoEx_hook (
|
|||||||
return GetLocaleInfoEx_orig(lpLocaleName, LCType, lpLCData, cchData);
|
return GetLocaleInfoEx_orig(lpLocaleName, LCType, lpLCData, cchData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SPICE64
|
||||||
|
|
||||||
|
static BOOL WINAPI IsDBCSLeadByte_hook (
|
||||||
|
BYTE TestChar
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return IsDBCSLeadByteEx(CODEPAGE_SHIFT_JIS, TestChar);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void hooks::lang::early_init() {
|
void hooks::lang::early_init() {
|
||||||
log_info("hooks::lang", "early initialization");
|
log_info("hooks::lang", "early initialization");
|
||||||
|
|
||||||
@@ -189,6 +202,19 @@ void hooks::lang::early_init() {
|
|||||||
GetLocaleInfoEx_hook,
|
GetLocaleInfoEx_hook,
|
||||||
&GetLocaleInfoEx_orig);
|
&GetLocaleInfoEx_orig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SPICE64
|
||||||
|
// for TDJ subscreen search keyboard
|
||||||
|
if (avs::game::is_model("LDJ") && games::iidx::TDJ_MODE) {
|
||||||
|
log_info("hooks::lang", "hooking IsDBCSLeadByte");
|
||||||
|
detour::trampoline_try(
|
||||||
|
"kernel32.dll",
|
||||||
|
"IsDBCSLeadByte",
|
||||||
|
IsDBCSLeadByte_hook,
|
||||||
|
&IsDBCSLeadByte_orig);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void hooks::lang::init() {
|
void hooks::lang::init() {
|
||||||
|
|||||||
@@ -1262,18 +1262,19 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
for (const auto &option : options) {
|
for (const auto &option : options) {
|
||||||
if (option.conflicting && option.get_definition().type != OptionType::Bool) {
|
if (option.conflicting && option.get_definition().type != OptionType::Bool) {
|
||||||
conflicts += 1;
|
conflicts += 1;
|
||||||
|
const auto& value = option.get_definition().sensitive ? "*****" : option.value;
|
||||||
if (launcher::USE_CMD_OVERRIDE) {
|
if (launcher::USE_CMD_OVERRIDE) {
|
||||||
log_warning(
|
log_warning(
|
||||||
"launcher",
|
"launcher",
|
||||||
"multiple values for -{}, command line args take precedence: {}",
|
"multiple values for -{}, command line args take precedence: {}",
|
||||||
option.get_definition().name,
|
option.get_definition().name,
|
||||||
option.value);
|
value);
|
||||||
} else {
|
} else {
|
||||||
log_warning(
|
log_warning(
|
||||||
"launcher",
|
"launcher",
|
||||||
"multiple values for -{}, spicecfg values take precedence: {}",
|
"multiple values for -{}, spicecfg values take precedence: {}",
|
||||||
option.get_definition().name,
|
option.get_definition().name,
|
||||||
option.value);
|
value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1676,6 +1677,14 @@ int main_implementation(int argc, char *argv[]) {
|
|||||||
attach_io = true;
|
attach_io = true;
|
||||||
attach_mfc = true;
|
attach_mfc = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Mahjong Fight Club - 2025?
|
||||||
|
// they removed allinone.dll and moved i/o into system.dll
|
||||||
|
} else if (check_dll("system.dll") && fileutils::file_exists("data/mfc.ini")) {
|
||||||
|
avs::game::DLL_NAME = "system.dll";
|
||||||
|
attach_io = true;
|
||||||
|
attach_mfc = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FutureTomTom
|
// FutureTomTom
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ developers when you can. Sources should be included, have fun!
|
|||||||
|
|
||||||
spice2x fork maintainers:
|
spice2x fork maintainers:
|
||||||
* sp2xdev team
|
* sp2xdev team
|
||||||
|
* the lab
|
||||||
|
|
||||||
SpiceTools original contributors:
|
SpiceTools original contributors:
|
||||||
* cube, felix, dinsfire, nolm, s2, crazyredmachine (jotaro44), mon, nibs
|
* cube, felix, dinsfire, nolm, s2, crazyredmachine (jotaro44), mon, nibs
|
||||||
|
|||||||
Reference in New Issue
Block a user