CPU/Recompiler: Use PGXP interpreter for fallback

Fixes holes in geometry with PGXP enabled in Threads of Fate.
This commit is contained in:
Connor McLaughlin 2021-01-01 17:16:54 +10:00
parent 4e87b30b40
commit c9240eea72
3 changed files with 12 additions and 3 deletions

View file

@ -193,7 +193,7 @@ static void ExecuteImpl()
CodeBlock* block = LookupBlock(next_block_key);
if (!block)
{
InterpretUncachedBlock();
InterpretUncachedBlock<pgxp_mode>();
continue;
}
@ -629,8 +629,10 @@ void FastCompileBlockFunction()
CodeBlock* block = LookupBlock(GetNextBlockKey());
if (block)
s_single_block_asm_dispatcher(block->host_code);
else if (g_settings.gpu_pgxp_enable)
InterpretUncachedBlock<PGXPMode::Memory>();
else
InterpretUncachedBlock();
InterpretUncachedBlock<PGXPMode::Disabled>();
}
#endif

View file

@ -126,6 +126,8 @@ void InvalidateBlocksWithPageIndex(u32 page_index);
template<PGXPMode pgxp_mode>
void InterpretCachedBlock(const CodeBlock& block);
template<PGXPMode pgxp_mode>
void InterpretUncachedBlock();
/// Invalidates any code pages which overlap the specified range.

View file

@ -1856,6 +1856,7 @@ template void InterpretCachedBlock<PGXPMode::Disabled>(const CodeBlock& block);
template void InterpretCachedBlock<PGXPMode::Memory>(const CodeBlock& block);
template void InterpretCachedBlock<PGXPMode::CPU>(const CodeBlock& block);
template<PGXPMode pgxp_mode>
void InterpretUncachedBlock()
{
g_state.regs.npc = g_state.regs.pc;
@ -1890,7 +1891,7 @@ void InterpretUncachedBlock()
}
// execute the instruction we previously fetched
ExecuteInstruction<PGXPMode::Disabled>();
ExecuteInstruction<pgxp_mode>();
// next load delay
UpdateLoadDelay();
@ -1905,6 +1906,10 @@ void InterpretUncachedBlock()
}
}
template void InterpretUncachedBlock<PGXPMode::Disabled>();
template void InterpretUncachedBlock<PGXPMode::Memory>();
template void InterpretUncachedBlock<PGXPMode::CPU>();
} // namespace CodeCache
namespace Recompiler::Thunks {