mdx: fix io mode bio2 boot crash (#435)

## Link to GitHub Issue, if one exists
n/a

## Description of change
Currently when 'bio2' specified on 'io' parameter of app-config the game
crashed due to security code check.
These codes changes security code to corresponding one and adds fake
BIO2 entry to satisfy BIO2 check.

## Testing
Tested with MDX-003 and J:I:B ident.
The game boots and A3 now displays gold cab theme and displays MATCHING
GROUP, MATCHING SIDE on NETWORK OPTIONS test mode menu.
This commit is contained in:
duel0213
2025-12-09 03:16:16 +09:00
committed by GitHub
parent 4e86cb16a2
commit 62c30d8895
2 changed files with 40 additions and 13 deletions
+6
View File
@@ -452,9 +452,15 @@ namespace avs {
security_code << "*"; security_code << "*";
} }
security_code << EA3_MODEL; security_code << EA3_MODEL;
if (strcmp(EA3_MODEL, "MDX") == 0 && strcmp(EA3_SPEC, "I") == 0) {
security_code << "E";
security_code << "B";
security_code << "B";
} else {
security_code << EA3_DEST; security_code << EA3_DEST;
security_code << EA3_SPEC; security_code << EA3_SPEC;
security_code << EA3_REV; security_code << EA3_REV;
}
std::string security_code_str = security_code.str(); std::string security_code_str = security_code.str();
log_info("avs-ea3", "security code: {}", security_code_str); log_info("avs-ea3", "security code: {}", security_code_str);
+30 -9
View File
@@ -2,6 +2,8 @@
#include "acioemu/handle.h" #include "acioemu/handle.h"
#include "avs/game.h" #include "avs/game.h"
#include "hooks/avshook.h"
#include "hooks/cfgmgr32hook.h"
#include "hooks/devicehook.h" #include "hooks/devicehook.h"
#include "hooks/setupapihook.h" #include "hooks/setupapihook.h"
#include "hooks/sleephook.h" #include "hooks/sleephook.h"
@@ -183,10 +185,37 @@ namespace games::ddr {
// init device hook // init device hook
devicehook_init(); devicehook_init();
// init SETUP API
setupapihook_init(avs::game::DLL_INSTANCE);
// DDR ACE actually uses another DLL for things
if (game_mdx != nullptr) {
setupapihook_init(game_mdx);
}
// add fake devices // add fake devices
if (avs::game::DLL_NAME == "arkmdxbio2.dll") { if (avs::game::DLL_NAME == "arkmdxbio2.dll") {
devicehook_add(new acioemu::ACIOHandle(L"COM1")); devicehook_add(new acioemu::ACIOHandle(L"COM1"));
} else if(avs::game::DLL_NAME == "arkmdxp4.dll") {
if (avs::game::SPEC[0] == 'I') {
// settings (bio2)
SETUPAPI_SETTINGS settingsbio2 {};
const char property2[] = "BIO2(VIDEO)";
settingsbio2.class_guid[0] = 0x4D36E978;
settingsbio2.class_guid[1] = 0x11CEE325;
settingsbio2.class_guid[2] = 0x8C1BF;
settingsbio2.class_guid[3] = 0x1803E12B;
memcpy(settingsbio2.property_devicedesc, property2, sizeof(property2));
setupapihook_add(settingsbio2);
// cfgmgr (bio2)
CFGMGR32_HOOK_SETTING settingbio2 {};
settingbio2.device_id = "USB\\VID_1CCF&PID_804C";
settingbio2.device_node_id = "USB\\VID_1CCF&PID_804C&MI_00\\?&????????&?&????";
cfgmgr32hook_init(avs::game::DLL_INSTANCE);
cfgmgr32hook_add(settingbio2);
}
} else if (avs::game::DLL_NAME == "arkmdxp4.dll") {
devicehook_add(new DDRP4IOHandle()); devicehook_add(new DDRP4IOHandle());
} else { } else {
devicehook_add(new DDRFOOTHandle()); devicehook_add(new DDRFOOTHandle());
@@ -228,14 +257,6 @@ namespace games::ddr {
memcpy(settingsp4io.property_devicedesc, settings_property, strlen(settings_property) + 1); memcpy(settingsp4io.property_devicedesc, settings_property, strlen(settings_property) + 1);
memcpy(settingsp4io.interface_detail, settings_detail_p4io, sizeof(settings_detail_p4io)); memcpy(settingsp4io.interface_detail, settings_detail_p4io, sizeof(settings_detail_p4io));
// init SETUP API
setupapihook_init(avs::game::DLL_INSTANCE);
// DDR ACE actually uses another DLL for things
if (game_mdx != nullptr) {
setupapihook_init(game_mdx);
}
// add settings // add settings
setupapihook_add(settings1); setupapihook_add(settings1);
setupapihook_add(settings2); setupapihook_add(settings2);