mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Partially revert "Revert "Audit uses of IsRunning and GetState""
This reverts the revert commitbc67fc97c3
, except for the changes in BaseConfigLoader.cpp, which caused the bug that made us revert72cf2bdb87
. PR 12917 contains an improved change to BaseConfigLoader.cpp, which can be merged (or rejected) independently. A few changes have also been made based on review comments.
This commit is contained in:
@ -791,7 +791,7 @@ bool AssemblerWidget::SaveEditor(AsmEditor* editor)
|
||||
|
||||
void AssemblerWidget::OnEmulationStateChanged(Core::State state)
|
||||
{
|
||||
m_inject->setEnabled(state != Core::State::Uninitialized);
|
||||
m_inject->setEnabled(state == Core::State::Running || state == Core::State::Paused);
|
||||
}
|
||||
|
||||
void AssemblerWidget::OnTabClose(int index)
|
||||
|
@ -257,9 +257,9 @@ void BreakpointWidget::UpdateButtonsEnabled()
|
||||
if (!isVisible())
|
||||
return;
|
||||
|
||||
const bool is_initialised = Core::GetState(m_system) != Core::State::Uninitialized;
|
||||
m_load->setEnabled(is_initialised);
|
||||
m_save->setEnabled(is_initialised);
|
||||
const bool is_running = Core::IsRunning(m_system);
|
||||
m_load->setEnabled(is_running);
|
||||
m_save->setEnabled(is_running);
|
||||
}
|
||||
|
||||
void BreakpointWidget::Update()
|
||||
|
@ -565,7 +565,7 @@ void CodeViewWidget::OnContextMenu()
|
||||
QMenu* menu = new QMenu(this);
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
const bool running = Core::GetState(m_system) != Core::State::Uninitialized;
|
||||
const bool running = Core::IsRunning(m_system);
|
||||
const bool paused = Core::GetState(m_system) == Core::State::Paused;
|
||||
|
||||
const u32 addr = GetContextAddress();
|
||||
|
@ -258,7 +258,7 @@ void ThreadWidget::Update()
|
||||
|
||||
auto& system = Core::System::GetInstance();
|
||||
const auto emu_state = Core::GetState(system);
|
||||
if (emu_state == Core::State::Stopping)
|
||||
if (emu_state == Core::State::Stopping || emu_state == Core::State::Uninitialized)
|
||||
{
|
||||
m_thread_table->setRowCount(0);
|
||||
UpdateThreadContext({});
|
||||
|
@ -195,10 +195,11 @@ void WatchWidget::Update()
|
||||
|
||||
QBrush brush = QPalette().brush(QPalette::Text);
|
||||
|
||||
if (!Core::IsRunning(m_system) || !PowerPC::MMU::HostIsRAMAddress(guard, entry.address))
|
||||
const bool core_is_running = Core::IsRunning(m_system);
|
||||
if (!core_is_running || !PowerPC::MMU::HostIsRAMAddress(guard, entry.address))
|
||||
brush.setColor(Qt::red);
|
||||
|
||||
if (Core::IsRunning(m_system))
|
||||
if (core_is_running)
|
||||
{
|
||||
if (PowerPC::MMU::HostIsRAMAddress(guard, entry.address))
|
||||
{
|
||||
|
Reference in New Issue
Block a user