diff --git a/src/xenia/cpu/ppc/ppc_emit_control.cc b/src/xenia/cpu/ppc/ppc_emit_control.cc index 15c990339..4db762606 100644 --- a/src/xenia/cpu/ppc/ppc_emit_control.cc +++ b/src/xenia/cpu/ppc/ppc_emit_control.cc @@ -609,6 +609,10 @@ int InstrEmit_mfspr(PPCHIRBuilder& f, const InstrData& i) { // TBU v = f.Shr(f.LoadClock(), 32); break; + case 287: + // PVR + v = f.LoadConstantUint64(0x710800); + break; default: XEINSTRNOTIMPLEMENTED(); return 1; diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index b1d976c9e..ca230ec60 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -270,24 +270,32 @@ X_STATUS Emulator::LaunchXexFile(std::wstring path) { // and then get that symlinked to game:\, so // -> game:\foo.xex - auto mount_path = "\\Device\\Harddisk0\\Partition0"; + // Register local directory as some commonly used mount paths + std::string mount_paths[] = { + "\\Device\\Harddisk0\\Partition0", + "\\Device\\Harddisk0\\Partition1", + "\\Device\\Harddisk0\\Partition1\\DEVKIT", + "\\Device\\LauncherData", + "\\SystemRoot", + }; - // Register the local directory in the virtual filesystem. auto parent_path = xe::find_base_path(path); - auto device = - std::make_unique(mount_path, parent_path, true); - if (!device->Initialize()) { - XELOGE("Unable to scan host path"); - return X_STATUS_NO_SUCH_FILE; - } - if (!file_system_->RegisterDevice(std::move(device))) { - XELOGE("Unable to register host path"); - return X_STATUS_NO_SUCH_FILE; + for (auto path : mount_paths) { + auto device = + std::make_unique(path, parent_path, true); + if (!device->Initialize()) { + XELOGE("Unable to scan host path"); + return X_STATUS_NO_SUCH_FILE; + } + if (!file_system_->RegisterDevice(std::move(device))) { + XELOGE("Unable to register host path as %s", path.c_str()); + return X_STATUS_NO_SUCH_FILE; + } } // Create symlinks to the device. - file_system_->RegisterSymbolicLink("game:", mount_path); - file_system_->RegisterSymbolicLink("d:", mount_path); + file_system_->RegisterSymbolicLink("game:", mount_paths[0]); + file_system_->RegisterSymbolicLink("d:", mount_paths[0]); // Get just the filename (foo.xex). auto file_name = xe::find_name_from_path(path); diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc index 44483bcf3..0adb82673 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_modules.cc @@ -19,6 +19,9 @@ DEFINE_int32(game_language, 1, "The language for the game to run in. 1=EN / 2=JP / 3=DE / 4=FR / " "5=ES / 6=IT / 7=KR / 8=CN", "General"); + +DEFINE_bool(xconfig_initial_setup, false, + "Enable the dashboard initial setup/OOBE", "Kernel"); namespace xe { namespace kernel { @@ -37,7 +40,10 @@ X_STATUS xeExGetXConfigSetting(uint16_t category, uint16_t setting, case 0x0002: // XCONFIG_SECURED_CATEGORY switch (setting) { - case 0x0002: // XCONFIG_SECURED_AV_REGION + case 0x0001: // XCONFIG_SECURED_MAC_ADDRESS (6 bytes) + return X_STATUS_SUCCESS; // Just return, easier than setting up code + // for different size configs + case 0x0002: // XCONFIG_SECURED_AV_REGION setting_size = 4; xe::store_and_swap(value, 0x00001000); // USA/Canada break; @@ -71,7 +77,10 @@ X_STATUS xeExGetXConfigSetting(uint16_t category, uint16_t setting, case 0x000C: // XCONFIG_USER_RETAIL_FLAGS setting_size = 4; // TODO(benvanik): get this value. - xe::store_and_swap(value, 0); + + // 0x40 = dashboard initial setup complete + xe::store_and_swap(value, + cvars::xconfig_initial_setup ? 0 : 0x40); break; case 0x000E: // XCONFIG_USER_COUNTRY // Halo: Reach sub_82804888 - min 0x5, max 0x6E. @@ -79,6 +88,16 @@ X_STATUS xeExGetXConfigSetting(uint16_t category, uint16_t setting, // TODO(benvanik): get this value. value[0] = 5; break; + case 0x000F: // XCONFIG_USER_PC_FLAGS (parental control?) + setting_size = 1; + value[0] = 0; + break; + case 0x0010: // XCONFIG_USER_SMB_CONFIG (0x100 byte string) + // Just set the start of the buffer to 0 so that callers + // don't error from an un-inited buffer + setting_size = 4; + xe::store_and_swap(value, 0); + break; default: assert_unhandled_case(setting); return X_STATUS_INVALID_PARAMETER_2;