cpu_type removed, system_type added

cpu_state -> cpu_flag
vm::stack_allocator template improved
ppu_cmd type changed to enum, cmd64 type added
This commit is contained in:
Nekotekina 2016-08-09 17:14:41 +03:00
parent 009ac37a7d
commit bdeccd889f
39 changed files with 449 additions and 492 deletions

View file

@ -23,11 +23,10 @@ std::map<u32, bool> g_breakpoints;
u32 InterpreterDisAsmFrame::GetPc() const
{
switch (cpu->type)
switch (g_system)
{
case cpu_type::ppu: return static_cast<ppu_thread*>(cpu)->cia;
case cpu_type::spu: return static_cast<SPUThread*>(cpu)->pc;
case cpu_type::arm: return static_cast<ARMv7Thread*>(cpu)->PC;
case system_type::ps3: return cpu->id >= ppu_thread::id_min ? static_cast<ppu_thread*>(cpu)->cia : static_cast<SPUThread*>(cpu)->pc;
case system_type::psv: return static_cast<ARMv7Thread*>(cpu)->PC;
}
return 0xabadcafe;
@ -137,21 +136,23 @@ void InterpreterDisAsmFrame::OnSelectUnit(wxCommandEvent& event)
if (cpu = (cpu_thread*)event.GetClientData())
{
switch (cpu->type)
switch (g_system)
{
case cpu_type::ppu:
case system_type::ps3:
{
m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
if (cpu->id >= ppu_thread::id_min)
{
m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
}
else
{
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
}
break;
}
case cpu_type::spu:
{
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
break;
}
case cpu_type::arm:
case system_type::psv:
{
m_disasm = std::make_unique<ARMv7DisAsm>(CPUDisAsm_InterpreterMode);
break;
@ -249,7 +250,7 @@ void InterpreterDisAsmFrame::ShowAddr(u32 addr)
}
else
{
const u32 cpu_offset = cpu->type == cpu_type::spu ? static_cast<SPUThread&>(*cpu).offset : 0;
const u32 cpu_offset = g_system == system_type::ps3 && cpu->id < ppu_thread::id_min ? static_cast<SPUThread&>(*cpu).offset : 0;
m_disasm->offset = (u8*)vm::base(cpu_offset);
for (uint i = 0, count = 4; i<m_item_count; ++i, m_pc += count)
{
@ -438,7 +439,7 @@ void InterpreterDisAsmFrame::DoRun(wxCommandEvent& WXUNUSED(event))
{
if (cpu && test(cpu->state & cpu_state_pause))
{
cpu->state -= cpu_state::dbg_pause;
cpu->state -= cpu_flag::dbg_pause;
(*cpu)->lock_notify();
}
}
@ -447,7 +448,7 @@ void InterpreterDisAsmFrame::DoPause(wxCommandEvent& WXUNUSED(event))
{
if (cpu)
{
cpu->state += cpu_state::dbg_pause;
cpu->state += cpu_flag::dbg_pause;
}
}
@ -455,10 +456,10 @@ void InterpreterDisAsmFrame::DoStep(wxCommandEvent& WXUNUSED(event))
{
if (cpu)
{
if (test(cpu_state::dbg_pause, cpu->state.fetch_op([](bs_t<cpu_state>& state)
if (test(cpu_flag::dbg_pause, cpu->state.fetch_op([](bs_t<cpu_flag>& state)
{
state += cpu_state::dbg_step;
state -= cpu_state::dbg_pause;
state += cpu_flag::dbg_step;
state -= cpu_flag::dbg_pause;
})))
{
(*cpu)->lock_notify();