[Kernel] Fixed issue with unsupported deployment type by games.
Thanks Emoose for code for checking title_id type
This commit is contained in:
parent
0fcdc12cb9
commit
5ca173cd4f
|
@ -534,7 +534,14 @@ X_STATUS Emulator::LaunchXexFile(const std::filesystem::path& path) {
|
||||||
// Launch the game.
|
// Launch the game.
|
||||||
auto fs_path = "game:\\" + xe::path_to_utf8(file_name);
|
auto fs_path = "game:\\" + xe::path_to_utf8(file_name);
|
||||||
X_STATUS result = CompleteLaunch(path, fs_path);
|
X_STATUS result = CompleteLaunch(path, fs_path);
|
||||||
kernel_state_->deployment_type_ = XDeploymentType::kHardDrive;
|
|
||||||
|
if (XSUCCEEDED(result)) {
|
||||||
|
kernel_state_->deployment_type_ = XDeploymentType::kHardDrive;
|
||||||
|
if (!kernel_state_->is_title_system_type(title_id())) {
|
||||||
|
// Assumption that any loaded game is loaded as a disc.
|
||||||
|
kernel_state_->deployment_type_ = XDeploymentType::kOpticalDisc;
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,7 +582,14 @@ X_STATUS Emulator::LaunchDefaultModule(const std::filesystem::path& path) {
|
||||||
cvars::launch_module = "";
|
cvars::launch_module = "";
|
||||||
std::string module_path = FindLaunchModule();
|
std::string module_path = FindLaunchModule();
|
||||||
X_STATUS result = CompleteLaunch(path, module_path);
|
X_STATUS result = CompleteLaunch(path, module_path);
|
||||||
kernel_state_->deployment_type_ = XDeploymentType::kHardDrive;
|
|
||||||
|
if (XSUCCEEDED(result)) {
|
||||||
|
kernel_state_->deployment_type_ = XDeploymentType::kHardDrive;
|
||||||
|
if (!kernel_state_->is_title_system_type(title_id())) {
|
||||||
|
// Assumption that any loaded game is loaded as a disc.
|
||||||
|
kernel_state_->deployment_type_ = XDeploymentType::kOpticalDisc;
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,18 @@ uint32_t KernelState::title_id() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool KernelState::is_title_system_type(uint32_t title_id) {
|
||||||
|
if (!title_id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((title_id & 0xFF000000) == 0x58000000u) {
|
||||||
|
return (title_id & 0xFF0000) != 0x410000; // if 'X' but not 'XA' (XBLA)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (title_id >> 16) == 0xFFFE;
|
||||||
|
}
|
||||||
|
|
||||||
util::XdbfGameData KernelState::title_xdbf() const {
|
util::XdbfGameData KernelState::title_xdbf() const {
|
||||||
return module_xdbf(executable_module_);
|
return module_xdbf(executable_module_);
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,7 @@ class KernelState {
|
||||||
vfs::VirtualFileSystem* file_system() const { return file_system_; }
|
vfs::VirtualFileSystem* file_system() const { return file_system_; }
|
||||||
|
|
||||||
uint32_t title_id() const;
|
uint32_t title_id() const;
|
||||||
|
static bool is_title_system_type(uint32_t title_id);
|
||||||
util::XdbfGameData title_xdbf() const;
|
util::XdbfGameData title_xdbf() const;
|
||||||
util::XdbfGameData module_xdbf(object_ref<UserModule> exec_module) const;
|
util::XdbfGameData module_xdbf(object_ref<UserModule> exec_module) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue