1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

disasm: clamp spu address

This commit is contained in:
elad 2018-02-20 16:36:57 +02:00 committed by Ivan
parent d5b9eb0caa
commit 7c0fd5094e

View File

@ -553,9 +553,12 @@ void debugger_list::ShowAddr(u32 addr)
}
else
{
const u32 cpu_offset = cpu->id_type() != 1 ? static_cast<SPUThread&>(*cpu).offset : 0;
const bool is_spu = cpu->id_type() != 1;
const u32 cpu_offset = is_spu ? static_cast<SPUThread&>(*cpu).offset : 0;
const u32 address_limits = is_spu ? 0x3ffff : ~0;
m_pc &= address_limits;
m_debugFrame->m_disasm->offset = (u8*)vm::base(cpu_offset);
for (uint i = 0, count = 4; i<m_item_count; ++i, m_pc += count)
for (uint i = 0, count = 4; i<m_item_count; ++i, m_pc = (m_pc + count) & address_limits)
{
if (!vm::check_addr(cpu_offset + m_pc, 4))
{