Disasm: do not allow to access previous instructions in non-interpreter mode

This commit is contained in:
Eladash 2020-10-31 13:29:50 +02:00 committed by Ivan
parent 5e8419af0d
commit c2c559f8d9
3 changed files with 8 additions and 3 deletions

View File

@ -16,6 +16,11 @@ u32 SPUDisAsm::disasm(u32 pc)
std::pair<bool, v128> SPUDisAsm::try_get_const_value(u32 reg, u32 pc) const
{
if (m_mode != CPUDisAsm_InterpreterMode)
{
return {};
}
if (pc == umax)
{
pc = dump_pc;

View File

@ -3144,7 +3144,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point)
void spu_recompiler_base::dump(const spu_program& result, std::string& out)
{
SPUDisAsm dis_asm(CPUDisAsm_InterpreterMode);
SPUDisAsm dis_asm(CPUDisAsm_DumpMode);
dis_asm.offset = reinterpret_cast<const u8*>(result.data.data()) - result.lower_bound;
std::string hash;

View File

@ -1764,8 +1764,8 @@ void Emulator::Resume()
// Print and reset debug data collected
if (m_state == system_state::paused && g_cfg.core.ppu_debug)
{
PPUDisAsm dis_asm(CPUDisAsm_InterpreterMode);
dis_asm.offset = vm::g_base_addr;
PPUDisAsm dis_asm(CPUDisAsm_DumpMode);
dis_asm.offset = vm::g_sudo_addr;
std::string dump;