diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index 2f7741f0e..84b7177ac 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -111,6 +111,9 @@ DEFINE_bool(mount_scratch, false, "Enable scratch mount", "Storage"); DEFINE_bool(mount_cache, true, "Enable cache mount", "Storage"); UPDATE_from_bool(mount_cache, 2024, 8, 31, 20, false); +DEFINE_bool(mount_memory_unit, false, "Enable memory unit (MU) mount", + "Storage"); + DECLARE_bool(force_mount_devkit); DECLARE_path(target); // Defined in windowed_app_main_qt.cc diff --git a/src/xenia/cpu/ppc/testing/ppc_testing_main.cc b/src/xenia/cpu/ppc/testing/ppc_testing_main.cc index e56361c06..7c1900c93 100644 --- a/src/xenia/cpu/ppc/testing/ppc_testing_main.cc +++ b/src/xenia/cpu/ppc/testing/ppc_testing_main.cc @@ -39,6 +39,8 @@ DEFINE_bool(mount_scratch, false, "Enable scratch mount", "Storage"); DEFINE_bool(mount_cache, false, "Enable cache mount", "Storage"); +DEFINE_bool(mount_memory_unit, false, "Enable memory unit (MU) mount", + "Storage"); DEFINE_path(test_path, "src/xenia/cpu/ppc/testing/", "Directory scanned for test files.", "Other"); diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index 03150638a..65546792a 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -109,6 +109,7 @@ DECLARE_bool(allow_plugins); DECLARE_bool(mount_scratch); DECLARE_bool(mount_cache); +DECLARE_bool(mount_memory_unit); DECLARE_bool(force_mount_devkit); DEFINE_int32(priority_class, 0, @@ -1688,6 +1689,20 @@ void Emulator::MountStandardDrives() { } } + if (cvars::mount_memory_unit) { + auto mu_device = std::make_unique( + "\\MU", storage_root_ / "mu", false); + if (!mu_device->Initialize()) { + XELOGE("Unable to scan MU path"); + } else { + if (!fs->RegisterDevice(std::move(mu_device))) { + XELOGE("Unable to register MU path"); + } else { + fs->RegisterSymbolicLink("MU:", "\\MU"); + } + } + } + if (cvars::force_mount_devkit) { auto devkit_device = std::make_unique("\\DEVKIT", "devkit", false); diff --git a/src/xenia/kernel/xbdm/xbdm_misc.cc b/src/xenia/kernel/xbdm/xbdm_misc.cc index c400c75ad..df8c023c3 100644 --- a/src/xenia/kernel/xbdm/xbdm_misc.cc +++ b/src/xenia/kernel/xbdm/xbdm_misc.cc @@ -23,6 +23,10 @@ DECLARE_bool(debug); DEFINE_bool(force_mount_devkit, false, "Force devkit mount", "Storage"); +DEFINE_int32(console_type, 0, + "Console Type Identifier: 0 - Development Kit, 1 - Test Kit", + "Kernel"); + namespace xe { namespace kernel { namespace xbdm { @@ -58,6 +62,17 @@ dword_result_t DmGetXboxName_entry(lpstring_t name_ptr, } DECLARE_XBDM_EXPORT1(DmGetXboxName, kDebug, kImplemented) +dword_result_t DmGetConsoleType_entry(lpdword_t console_type_out) { + if (!console_type_out) { + return X_E_INVALIDARG; + } + + *console_type_out = static_cast(cvars::console_type); + + return XBDM_SUCCESSFUL; +} +DECLARE_XBDM_EXPORT1(DmGetConsoleType, kDebug, kImplemented); + dword_result_t DmIsDebuggerPresent_entry() { return static_cast(cvars::debug); } diff --git a/src/xenia/kernel/xbdm/xbdm_misc.h b/src/xenia/kernel/xbdm/xbdm_misc.h index 2abca5de7..f339e418a 100644 --- a/src/xenia/kernel/xbdm/xbdm_misc.h +++ b/src/xenia/kernel/xbdm/xbdm_misc.h @@ -38,6 +38,11 @@ static constexpr char DmXboxName[] = "Xbox360Name"; // clang-format on +enum CONSOLE_TYPE : uint32_t { + DEVELOPMENT_KIT, + TEST_KIT, +}; + enum CONSOLE_MEMORY_CONFIG_STATE : uint32_t { DM_CONSOLEMEMCONFIG_NOADDITIONALMEM, DM_CONSOLEMEMCONFIG_ADDITIONALMEMDISABLED, diff --git a/tools/build/src/test_suite_main.cc b/tools/build/src/test_suite_main.cc index e6674f058..421ab215e 100644 --- a/tools/build/src/test_suite_main.cc +++ b/tools/build/src/test_suite_main.cc @@ -20,6 +20,8 @@ DEFINE_bool(mount_scratch, false, "Enable scratch mount", "Storage"); DEFINE_bool(mount_cache, false, "Enable cache mount", "Storage"); +DEFINE_bool(mount_memory_unit, false, "Enable memory unit (MU) mount", + "Storage"); #define CATCH_CONFIG_RUNNER #include "third_party/catch/single_include/catch2/catch.hpp"