mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 17:58:37 +12:00
idm->g_fxo
This commit is contained in:
parent
ded9d73ce4
commit
ede12f65c5
2 changed files with 34 additions and 13 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include "Emu/RSX/RSXThread.h"
|
#include "Emu/RSX/RSXThread.h"
|
||||||
#include "Emu/RSX/rsx_utils.h"
|
#include "Emu/RSX/rsx_utils.h"
|
||||||
#include "Emu/IdManager.h"
|
#include "Emu/IdManager.h"
|
||||||
|
#include "Emu/System.h"
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
|
@ -589,6 +590,14 @@ memory_viewer_panel::memory_viewer_panel(QWidget* parent, std::shared_ptr<CPUDis
|
||||||
|
|
||||||
idm::remove_verify<memory_viewer_handle>(id, handle_ptr);
|
idm::remove_verify<memory_viewer_handle>(id, handle_ptr);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!g_fxo->try_get<memory_viewer_fxo>())
|
||||||
|
{
|
||||||
|
g_fxo->init<memory_viewer_fxo>();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& fxo = g_fxo->get<memory_viewer_fxo>();
|
||||||
|
fxo.last_opened = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_viewer_panel::~memory_viewer_panel()
|
memory_viewer_panel::~memory_viewer_panel()
|
||||||
|
@ -1247,20 +1256,23 @@ void memory_viewer_panel::ShowImage(QWidget* parent, u32 addr, color_format form
|
||||||
|
|
||||||
void memory_viewer_panel::ShowAtPC(u32 pc)
|
void memory_viewer_panel::ShowAtPC(u32 pc)
|
||||||
{
|
{
|
||||||
const u32 id = idm::last_id();
|
if (Emu.IsStopped())
|
||||||
auto handle_ptr = idm::get_unlocked<memory_viewer_handle>(id);
|
|
||||||
|
|
||||||
if (!handle_ptr)
|
|
||||||
{
|
|
||||||
idm::make<memory_viewer_handle>(nullptr, nullptr, pc);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (const auto* fxo = g_fxo->try_get<memory_viewer_fxo>())
|
||||||
|
{
|
||||||
|
if (auto* panel = fxo->last_opened)
|
||||||
|
{
|
||||||
|
panel->SetPC(pc);
|
||||||
|
panel->raise();
|
||||||
|
panel->scroll(0);
|
||||||
|
if (!panel->isVisible())
|
||||||
|
{
|
||||||
|
panel->show();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_ptr->m_mvp->SetPC(pc);
|
idm::make<memory_viewer_handle>(nullptr, nullptr, pc);
|
||||||
handle_ptr->m_mvp->raise();
|
|
||||||
handle_ptr->m_mvp->scroll(0);
|
|
||||||
if (!handle_ptr->m_mvp->isVisible())
|
|
||||||
{
|
|
||||||
handle_ptr->m_mvp->show();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,3 +139,12 @@ struct memory_viewer_handle
|
||||||
public:
|
public:
|
||||||
const std::add_pointer_t<memory_viewer_panel> m_mvp;
|
const std::add_pointer_t<memory_viewer_panel> m_mvp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct memory_viewer_fxo
|
||||||
|
{
|
||||||
|
memory_viewer_panel* last_opened = nullptr;
|
||||||
|
|
||||||
|
memory_viewer_fxo() = default;
|
||||||
|
memory_viewer_fxo(const memory_viewer_fxo&) = delete;
|
||||||
|
memory_viewer_fxo& operator=(const memory_viewer_fxo&) = delete;
|
||||||
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue