[XAM] Added Message: XTitleGetDeploymentType

This commit is contained in:
Gliniak 2024-02-12 22:09:19 +01:00
parent 354d42135d
commit 5ade4a1288
4 changed files with 30 additions and 15 deletions

View File

@ -445,7 +445,9 @@ X_STATUS Emulator::LaunchXexFile(const std::filesystem::path& path) {
// Launch the game.
auto fs_path = "game:\\" + xe::path_to_utf8(file_name);
return CompleteLaunch(path, fs_path);
X_STATUS result = CompleteLaunch(path, fs_path);
kernel_state_->deployment_type_ = XDeploymentType::kHardDrive;
return result;
}
X_STATUS Emulator::LaunchDiscImage(const std::filesystem::path& path) {
@ -455,7 +457,7 @@ X_STATUS Emulator::LaunchDiscImage(const std::filesystem::path& path) {
if (result == X_STATUS_NOT_FOUND && !cvars::launch_module.empty()) {
return LaunchDefaultModule(path);
}
kernel_state_->deployment_type_ = XDeploymentType::kOpticalDisc;
return result;
}
@ -466,7 +468,7 @@ X_STATUS Emulator::LaunchDiscArchive(const std::filesystem::path& path) {
if (result == X_STATUS_NOT_FOUND && !cvars::launch_module.empty()) {
return LaunchDefaultModule(path);
}
kernel_state_->deployment_type_ = XDeploymentType::kOpticalDisc;
return result;
}
@ -477,15 +479,16 @@ X_STATUS Emulator::LaunchStfsContainer(const std::filesystem::path& path) {
if (result == X_STATUS_NOT_FOUND && !cvars::launch_module.empty()) {
return LaunchDefaultModule(path);
}
kernel_state_->deployment_type_ = XDeploymentType::kGoD;
return result;
}
X_STATUS Emulator::LaunchDefaultModule(const std::filesystem::path& path) {
cvars::launch_module = "";
std::string module_path = FindLaunchModule();
return CompleteLaunch(path, module_path);
X_STATUS result = CompleteLaunch(path, module_path);
kernel_state_->deployment_type_ = XDeploymentType::kHardDrive;
return result;
}
X_STATUS Emulator::InstallContentPackage(const std::filesystem::path& path) {

View File

@ -297,6 +297,7 @@ class KernelState {
bool Restore(ByteStream* stream);
uint32_t notification_position_ = 2;
XDeploymentType deployment_type_ = XDeploymentType::kUnknown;
uint32_t GetKeTimestampBundle();
@ -305,11 +306,13 @@ class KernelState {
uint32_t CreateKeTimestampBundle();
void UpdateKeTimestampBundle();
void BeginDPCImpersonation(cpu::ppc::PPCContext* context, DPCImpersonationScope& scope);
void BeginDPCImpersonation(cpu::ppc::PPCContext* context,
DPCImpersonationScope& scope);
void EndDPCImpersonation(cpu::ppc::PPCContext* context,
DPCImpersonationScope& end_scope);
void EmulateCPInterruptDPC(uint32_t interrupt_callback,uint32_t interrupt_callback_data, uint32_t source,
void EmulateCPInterruptDPC(uint32_t interrupt_callback,
uint32_t interrupt_callback_data, uint32_t source,
uint32_t cpu);
private:
@ -354,11 +357,12 @@ class KernelState {
uint32_t ke_timestamp_bundle_ptr_ = 0;
std::unique_ptr<xe::threading::HighResolutionTimer> timestamp_timer_;
cpu::backend::GuestTrampolineGroup kernel_trampoline_group_;
//fixed address referenced by dashboards. Data is currently unknown
// fixed address referenced by dashboards. Data is currently unknown
uint32_t strange_hardcoded_page_ = 0x8E038634 & (~0xFFFF);
uint32_t strange_hardcoded_location_ = 0x8E038634;
friend class XObject;
public:
uint32_t dash_context_ = 0;
std::unordered_map<XObject::Type, uint32_t>

View File

@ -90,14 +90,15 @@ X_HRESULT XamApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
}
case 0x00022005: {
struct message_data {
xe::be<uint32_t> unk_00; // ? output_ptr ?
xe::be<uint32_t> unk_04; // ? value/jump to? ?
xe::be<uint32_t> deployment_type_ptr;
xe::be<uint32_t> overlapped_ptr;
}* data = reinterpret_cast<message_data*>(buffer);
assert_true(buffer_length == sizeof(message_data));
auto unk = memory_->TranslateVirtual<xe::be<uint32_t>*>(data->unk_00);
auto adr = *unk;
XELOGD("XamApp(0x00022005)(%.8X, %.8X)", (uint32_t)data->unk_00,
(uint32_t)data->unk_04);
auto deployment_type =
memory_->TranslateVirtual<uint32_t*>(data->deployment_type_ptr);
*deployment_type = static_cast<uint32_t>(kernel_state_->deployment_type_);
XELOGD("XTitleGetDeploymentType({:08X}, {:08X}",
data->deployment_type_ptr, data->overlapped_ptr);
return X_E_SUCCESS;
}
}

View File

@ -439,6 +439,13 @@ enum class XContentType : uint32_t {
kCommunityGame = 0x02000000,
};
enum class XDeploymentType : uint32_t {
kOpticalDisc = 0,
kHardDrive = 1, // Like extracted?
kGoD = 2,
kUnknown = 0xFF,
};
} // namespace xe
// clang-format on