Merge pull request #6661 from sepalani/host_va

HLE_VarArgs: PowerPC::HostRead_F64 used
This commit is contained in:
Mat M 2018-04-17 10:16:05 -04:00 committed by GitHub
commit 908e00556e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 11 deletions

View File

@ -51,17 +51,11 @@ u32 HLE::SystemVABI::VAListStruct::GetGPR(u32 gpr) const
double HLE::SystemVABI::VAListStruct::GetFPR(u32 fpr) const double HLE::SystemVABI::VAListStruct::GetFPR(u32 fpr) const
{ {
double value = 0.0;
if (!m_has_fpr_area || fpr < 1 || fpr > 8) if (!m_has_fpr_area || fpr < 1 || fpr > 8)
{ {
ERROR_LOG(OSHLE, "VAListStruct at %08x doesn't have FPR%d!", m_address, fpr); ERROR_LOG(OSHLE, "VAListStruct at %08x doesn't have FPR%d!", m_address, fpr);
return 0.0;
} }
else
{
const u32 fpr_address = Common::AlignUp(GetFPRArea() + 8 * (fpr - 1), 8); const u32 fpr_address = Common::AlignUp(GetFPRArea() + 8 * (fpr - 1), 8);
const u64 integral = PowerPC::HostRead_U64(fpr_address); return PowerPC::HostRead_F64(fpr_address);
std::memcpy(&value, &integral, sizeof(double));
}
return value;
} }

View File

@ -115,8 +115,7 @@ public:
else else
{ {
m_stack = Common::AlignUp(m_stack, 8); m_stack = Common::AlignUp(m_stack, 8);
const u64 integral = PowerPC::HostRead_U64(m_stack); value = PowerPC::HostRead_F64(m_stack);
std::memcpy(&value, &integral, sizeof(double));
m_stack += 8; m_stack += 8;
} }