1
0
mirror of synced 2024-11-24 15:10:16 +01:00

Various fixes

This commit is contained in:
esuo1198 2024-03-07 22:19:41 +09:00
parent c28679d057
commit fe19c709e7
5 changed files with 55 additions and 44 deletions

3
dist/config.toml vendored
View File

@ -25,3 +25,6 @@ data = { serial = "", type = 0, song_no = [] }
[drum]
wait_period = 4
[controller]
analog = false

View File

@ -39,7 +39,7 @@ Keybindings P2_LEFT_BLUE = {};
Keybindings P2_LEFT_RED = {};
Keybindings P2_RIGHT_RED = {};
Keybindings P2_RIGHT_BLUE = {};
CardKeybindings *QRCODE_CARDS = new CardKeybindings[] {
CardKeybindings *QRCODE_CARDS = new CardKeybindings[]{
{.keybindings = {.keycodes = {'W'}}, .card = "BNTTCNID1"},
{.keybindings = {.keycodes = {'E'}}, .card = "BNTTCNID2"},
};
@ -118,9 +118,7 @@ bnusio_GetAnalogIn (u8 which) {
u16 analogValue;
if (useTaikoController) {
analogValue = (u16)(32768 * ControllerAxisIsDown (analogBindings[which]));
if (analogValue > 100) {
return analogValue;
}
if (analogValue > 100) return analogValue;
return 0;
}
auto button = analogButtons[which];
@ -243,6 +241,7 @@ u16 __fastcall bnusio_GetCoin (i32 a1) {
patches::Qr::Update ();
if (attachCallback) attachCallback (0, 0, attachData);
return coin_count;
}
@ -335,9 +334,7 @@ Init () {
auto taikoController = openConfigSection (config, "controller");
if (taikoController) {
useTaikoController = readConfigBool (taikoController, "analog", useTaikoController);
if (useTaikoController) {
printf("Using analog input mode. All the keyboard drum inputs have been disabled.\n");
}
if (useTaikoController) printf ("Using analog input mode. All the keyboard drum inputs have been disabled.\n");
}
toml_free (config);
}

View File

@ -9,9 +9,10 @@ std::vector<HMODULE> plugins;
const char *server = "127.0.0.1";
const char *port = "54430";
const char *chassisId = "000000000000";
const char *chassisId = "284111080000";
const char *shopId = "TAIKO ARCADE LOADER";
const char *gameVerNum = "00.00";
char fullAddress[256] = {'\0'};
char accessCode1[21] = "00000000000000000001";
char accessCode2[21] = "00000000000000000002";
char chipId1[33] = "00000000000000000000000000000001";
@ -108,6 +109,10 @@ DllMain (HMODULE module, DWORD reason, LPVOID reserved) {
chassisId = readConfigString (amauth, "chassis_id", chassisId);
shopId = readConfigString (amauth, "shop_id", shopId);
gameVerNum = readConfigString (amauth, "game_ver", gameVerNum);
std::strcat (fullAddress, server);
std::strcat (fullAddress, ":");
std::strcat (fullAddress, port);
}
auto patches = openConfigSection (config, "patches");
if (patches) version = readConfigString (patches, "version", version);

View File

@ -21,6 +21,7 @@ extern const char *port;
extern const char *chassisId;
extern const char *shopId;
extern const char *gameVerNum;
extern char fullAddress[256];
namespace patches::AmAuth {
const GUID IID_CAuth{0x045A5150, 0xD2B3, 0x4590, {0xA3, 0x8B, 0xC1, 0x15, 0x86, 0x78, 0xE1, 0xAC}};
@ -397,14 +398,14 @@ public:
// printf("IAuth_GetVersionInfo called\n");
memset (version, 0, sizeof (*version));
strcpy_s (version->game_rev, "1");
strcpy_s (version->auth_type, "CHARGE_NORMAL");
strcpy_s (version->game_id, "S122");
strcpy_s (version->auth_type, "ALL.NET");
strcpy_s (version->game_id, "SBWY");
strcpy_s (version->game_ver, "12.20");
strcpy_s (version->game_cd, "TAL0");
strcpy_s (version->game_cd, "S121");
strcpy_s (version->cacfg_game_ver, gameVerNum);
strcpy_s (version->game_board_type, "0");
strcpy_s (version->game_board_id, "PCB");
strcpy_s (version->auth_url, server);
strcpy_s (version->auth_url, fullAddress);
return 0;
}
@ -421,8 +422,8 @@ public:
virtual int32_t IAuth_GetAuthServerResp (amcus_auth_server_resp_t *resp) {
// printf("IAuth_GetAuthServerResp called\n");
memset (resp, 0, sizeof (*resp));
strcpy_s (resp->uri, server);
strcpy_s (resp->host, server);
strcpy_s (resp->uri, fullAddress);
strcpy_s (resp->host, fullAddress);
strcpy_s (resp->shop_name, shopId);
strcpy_s (resp->shop_nickname, shopId);
@ -460,12 +461,6 @@ public:
// printf("IAuth_GetMuchaAuthResponse called\n");
memset (arr, 0, sizeof (*arr));
char fullAddress[256] = {'\0'};
std::strcat (fullAddress, server);
std::strcat (fullAddress, ":");
std::strcat (fullAddress, port);
strcpy_s (arr->shop_name, sizeof (arr->shop_name), shopId);
strcpy_s (arr->shop_name_en, sizeof (arr->shop_name_en), shopId);
strcpy_s (arr->shop_nickname, sizeof (arr->shop_nickname), shopId);

View File

@ -5,6 +5,13 @@ namespace patches::JP_APR_2023 {
HOOK_DYNAMIC (char, __fastcall, AMFWTerminate, i64) { return 0; }
HOOK_DYNAMIC (i64, __fastcall, curl_easy_setopt, i64 a1, i64 a2, i64 a3, i64 a4, i64 a5) {
// printf ("garmc curl_easy_setopt\n");
originalcurl_easy_setopt (a1, 64, 0, 0, 0);
originalcurl_easy_setopt (a1, 81, 0, 0, 0);
return originalcurl_easy_setopt (a1, a2, a3, a4, a5);
}
void
Init () {
i32 xRes = 1920;
@ -52,7 +59,7 @@ Init () {
WRITE_MEMORY (ASLR (0x140CD4DC0), char, ".\\Setting1.bin");
WRITE_MEMORY (ASLR (0x140CD4DB0), char, ".\\Setting2.bin");
WRITE_MEMORY (ASLR (0x140C95B40), char, ".\\TournamentData\\PlayData\\TournamentPlayData.dat");
WRITE_MEMORY (ASLR (0x140CD4DC0), char, ".\\TournamentData\\InfoData\\TournamentInfoData.dat");
WRITE_MEMORY (ASLR (0x140C95BB0), char, ".\\TournamentData\\InfoData\\TournamentInfoData.dat");
WRITE_MEMORY (ASLR (0x140CC0508), char, ".\\Garmc\\BillingData\\GarmcBillingData.dat");
WRITE_MEMORY (ASLR (0x140CC0580), char, ".\\Garmc\\ErrorLogData\\GarmcOErrorLogData.dat");
WRITE_MEMORY (ASLR (0x140CC05E0), char, ".\\Garmc\\BillingNetIdLocationId\\GarmcBillingNetIdLocationId.dat");
@ -72,6 +79,10 @@ Init () {
auto amHandle = (u64)GetModuleHandle ("AMFrameWork.dll");
INSTALL_HOOK_DYNAMIC (AMFWTerminate, (void *)(amHandle + 0x42DE0));
// Redirect garmc requests
auto garmcHandle = (u64)GetModuleHandle ("garmc.dll");
INSTALL_HOOK_DYNAMIC (curl_easy_setopt, (void *)(garmcHandle + 0x1FBBB0));
patches::Qr::Init ();
patches::AmAuth::Init ();
}