CPU/CodeCache: Dynamically compute BIOS memory access timing
The timings can change if the game does so. Instead of forcing the blocks to recompile, we can just manually multiply size * word_time. Improves stability of Nightmare Creatures booting, and fixes corrupted text in Formula Circus when using the cached interpreter.
This commit is contained in:
@@ -77,8 +77,7 @@ void CPU::NewRec::Compiler::BeginBlock()
|
||||
GenerateBlockProtectCheck(ram_ptr, shadow_ptr, m_block->size * sizeof(Instruction));
|
||||
}
|
||||
|
||||
if (m_block->uncached_fetch_ticks > 0 || m_block->icache_line_count > 0)
|
||||
GenerateICacheCheckAndUpdate();
|
||||
GenerateICacheCheckAndUpdate();
|
||||
|
||||
if (g_settings.bios_tty_logging)
|
||||
{
|
||||
@@ -1719,6 +1718,14 @@ void CPU::NewRec::Compiler::TruncateBlock()
|
||||
iinfo->is_last_instruction = true;
|
||||
}
|
||||
|
||||
const TickCount* CPU::NewRec::Compiler::GetFetchMemoryAccessTimePtr() const
|
||||
{
|
||||
const TickCount* ptr =
|
||||
Bus::GetMemoryAccessTimePtr(m_block->pc & PHYSICAL_MEMORY_ADDRESS_MASK, MemoryAccessSize::Word);
|
||||
AssertMsg(ptr, "Address has dynamic fetch ticks");
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void CPU::NewRec::Compiler::FlushForLoadStore(const std::optional<VirtualMemoryAddress>& address, bool store,
|
||||
bool use_fastmem)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user