CPU: Correct bits for CAUSE.CE, EPC for fetch

This commit is contained in:
Connor McLaughlin
2019-10-04 02:26:37 +10:00
parent 48563c74cf
commit eddd2c1990
5 changed files with 80 additions and 37 deletions

View File

@ -109,12 +109,12 @@ bool CPU::Core::DoAlignmentCheck(VirtualMemoryAddress address)
{
if constexpr (size == MemoryAccessSize::HalfWord)
{
if ((address & UINT32_C(1)) == 0)
if (Common::IsAlignedPow2(address, 2))
return true;
}
else if constexpr (size == MemoryAccessSize::Word)
{
if ((address & UINT32_C(3)) == 0)
if (Common::IsAlignedPow2(address, 4))
return true;
}
else