mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
[Kernel] Check XAM is attached using bounding path
This commit is contained in:
parent
a9fb32a2fd
commit
e66028f0ff
|
|
@ -589,6 +589,7 @@ X_STATUS Emulator::LaunchXexFile(const std::filesystem::path& path) {
|
||||||
file_system_->RegisterSymbolicLink("font:", mount_path);
|
file_system_->RegisterSymbolicLink("font:", mount_path);
|
||||||
|
|
||||||
auto module = kernel_state_->LoadUserModule("xam.xex");
|
auto module = kernel_state_->LoadUserModule("xam.xex");
|
||||||
|
|
||||||
if (!module) {
|
if (!module) {
|
||||||
module = kernel_state_->LoadUserModule("$flash_xam.xex");
|
module = kernel_state_->LoadUserModule("$flash_xam.xex");
|
||||||
}
|
}
|
||||||
|
|
@ -596,6 +597,7 @@ X_STATUS Emulator::LaunchXexFile(const std::filesystem::path& path) {
|
||||||
if (module) {
|
if (module) {
|
||||||
result = kernel_state_->FinishLoadingUserModule(module, false);
|
result = kernel_state_->FinishLoadingUserModule(module, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,22 @@ uint32_t UserModule::title_id() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string UserModule::bounding_filename() const {
|
||||||
|
std::string bounding_filename = "";
|
||||||
|
|
||||||
|
if (module_format_ != kModuleFormatXex) {
|
||||||
|
return bounding_filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
xex2_opt_bound_path* bounding_path = nullptr;
|
||||||
|
if (xex_module()->GetOptHeader(XEX_HEADER_BOUNDING_PATH, &bounding_path)) {
|
||||||
|
bounding_filename =
|
||||||
|
utf8::find_base_name_from_guest_path(std::string(bounding_path->path));
|
||||||
|
}
|
||||||
|
|
||||||
|
return bounding_filename;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t UserModule::disc_number() const {
|
uint32_t UserModule::disc_number() const {
|
||||||
if (module_format_ != kModuleFormatXex) {
|
if (module_format_ != kModuleFormatXex) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ class UserModule : public XModule {
|
||||||
uint32_t guest_xex_header() const { return guest_xex_header_; }
|
uint32_t guest_xex_header() const { return guest_xex_header_; }
|
||||||
// The title ID in the xex header or 0 if this is not a xex.
|
// The title ID in the xex header or 0 if this is not a xex.
|
||||||
uint32_t title_id() const;
|
uint32_t title_id() const;
|
||||||
|
std::string bounding_filename() const;
|
||||||
uint32_t disc_number() const;
|
uint32_t disc_number() const;
|
||||||
bool is_multi_disc_title() const;
|
bool is_multi_disc_title() const;
|
||||||
|
|
||||||
|
|
@ -68,7 +69,7 @@ class UserModule : public XModule {
|
||||||
bool is_dll_module() const { return is_dll_module_; }
|
bool is_dll_module() const { return is_dll_module_; }
|
||||||
bool is_attached() const {
|
bool is_attached() const {
|
||||||
// Special case for skipping real XAM initialization as it will fail.
|
// Special case for skipping real XAM initialization as it will fail.
|
||||||
if (name_ == "xam" || name_ == "$flash_xam") {
|
if (bounding_filename() == "xam") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return is_attached_;
|
return is_attached_;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue