mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #12828 from JosJuice/unify-state-variables-2
Clean up Core::GetState
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)
|
||||
|
@ -251,7 +251,7 @@ void BreakpointWidget::UpdateButtonsEnabled()
|
||||
if (!isVisible())
|
||||
return;
|
||||
|
||||
const bool is_initialised = Core::GetState(m_system) != Core::State::Uninitialized;
|
||||
const bool is_initialised = Core::IsRunning(m_system);
|
||||
m_new->setEnabled(is_initialised);
|
||||
m_load->setEnabled(is_initialised);
|
||||
m_save->setEnabled(is_initialised);
|
||||
|
@ -560,7 +560,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