Merge branch 'master' into linux_windowing
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2020 Ben Vanik. All rights reserved. *
|
||||
* Copyright 2021 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
@@ -249,12 +249,11 @@ int XexModule::ApplyPatch(XexModule* module) {
|
||||
|
||||
// Patch base XEX header
|
||||
uint32_t original_image_size = module->image_size();
|
||||
uint32_t header_target_size = patch_header->delta_headers_target_offset +
|
||||
patch_header->delta_headers_source_size;
|
||||
uint32_t header_target_size = patch_header->size_of_target_headers;
|
||||
|
||||
if (!header_target_size) {
|
||||
header_target_size =
|
||||
patch_header->size_of_target_headers; // unsure which is more correct..
|
||||
header_target_size = patch_header->delta_headers_target_offset +
|
||||
patch_header->delta_headers_source_size;
|
||||
}
|
||||
|
||||
size_t mem_size = module->xex_header_mem_.size();
|
||||
@@ -899,9 +898,9 @@ bool XexModule::Load(const std::string_view name, const std::string_view path,
|
||||
const void* xex_addr, size_t xex_length) {
|
||||
auto src_header = reinterpret_cast<const xex2_header*>(xex_addr);
|
||||
|
||||
if (src_header->magic == 'XEX1') {
|
||||
if (src_header->magic == kXEX1Signature) {
|
||||
xex_format_ = kFormatXex1;
|
||||
} else if (src_header->magic == 'XEX2') {
|
||||
} else if (src_header->magic == kXEX2Signature) {
|
||||
xex_format_ = kFormatXex2;
|
||||
} else {
|
||||
return false;
|
||||
@@ -967,6 +966,16 @@ bool XexModule::LoadContinue() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Parse any "unsafe" headers into safer variants
|
||||
xex2_opt_generic_u32* alternate_titleids;
|
||||
if (GetOptHeader(xex2_header_keys::XEX_HEADER_ALTERNATE_TITLE_IDS,
|
||||
&alternate_titleids)) {
|
||||
auto count = alternate_titleids->count();
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
opt_alternate_title_ids_.push_back(alternate_titleids->values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Scan and find the low/high addresses.
|
||||
// All code sections are continuous, so this should be easy.
|
||||
auto heap = memory()->LookupHeap(base_address_);
|
||||
|
||||
Reference in New Issue
Block a user