virtual memory block reads/writes properly fail if address is out of bounds.

Fixes Solar v2.1 http://puu.sh/8ScXK.jpg
This commit is contained in:
Michael Yu 2014-05-18 23:12:28 -07:00
parent 0d0df4b491
commit 9e791da7bd
5 changed files with 73 additions and 44 deletions

View file

@ -322,20 +322,28 @@ void RSXDebugger::GoToGet(wxCommandEvent& event)
{
if (!RSXReady()) return;
CellGcmControl* ctrl = (CellGcmControl*)&Memory[Emu.GetGSManager().GetRender().m_ctrlAddress];
m_addr = Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->get);
t_addr->SetValue(wxString::Format("%08x", m_addr));
UpdateInformation();
event.Skip();
u64 realAddr;
if (Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->get, realAddr)) {
m_addr = realAddr; // WARNING: Potential Truncation? Cast from u64 to u32
t_addr->SetValue(wxString::Format("%08x", m_addr));
UpdateInformation();
event.Skip();
}
// TODO: We should probably throw something?
}
void RSXDebugger::GoToPut(wxCommandEvent& event)
{
if (!RSXReady()) return;
CellGcmControl* ctrl = (CellGcmControl*)&Memory[Emu.GetGSManager().GetRender().m_ctrlAddress];
m_addr = Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->put);
t_addr->SetValue(wxString::Format("%08x", m_addr));
UpdateInformation();
event.Skip();
u64 realAddr;
if (Memory.RSXIOMem.getRealAddr(Memory.RSXIOMem.GetStartAddr() + ctrl->put, realAddr)) {
m_addr = realAddr; // WARNING: Potential Truncation? Cast from u64 to u32
t_addr->SetValue(wxString::Format("%08x", m_addr));
UpdateInformation();
event.Skip();
}
// TODO: We should probably throw something?
}
void RSXDebugger::UpdateInformation()