all repos — mgba @ abee4b05214d17a1b2efb3737c19e1134eae2dd9

mGBA Game Boy Advance Emulator

Qt: Fix overrides getting discarded (fixes #1354)
Vicki Pfau vi@endrift.com
Thu, 14 Mar 2019 18:33:08 -0700
commit

abee4b05214d17a1b2efb3737c19e1134eae2dd9

parent

a3e1576f9774cc66e355dd093694037f744e4214

2 files changed, 28 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -8,6 +8,7 @@ Other fixes:

- Qt: More app metadata fixes - Qt: Fix load recent from archive (fixes mgba.io/i/1325) - LR35902: Fix disassembly of several CB-prefix instructions + - Qt: Fix overrides getting discarded (fixes mgba.io/i/1354) Misc: - Qt: Add missing HEVC NVENC option (fixes mgba.io/i/1323) - Qt: Improve camera initialization
M src/platform/qt/CoreController.cppsrc/platform/qt/CoreController.cpp

@@ -835,8 +835,33 @@ m_threadContext.core->opts.mute = fakeBool;

m_threadContext.impl->sync.fpsTarget = m_fpsTarget; setSync(true); } - // XXX: Have a way of just updating opts - m_threadContext.core->loadConfig(m_threadContext.core, &m_threadContext.core->config); + // XXX: Have a way of just updating volume + switch (platform()) { +#ifdef M_CORE_GBA + case PLATFORM_GBA: { + GBA* gba = static_cast<GBA*>(m_threadContext.core->board); + if (m_threadContext.core->opts.mute) { + gba->audio.masterVolume = 0; + } else { + gba->audio.masterVolume = m_threadContext.core->opts.volume; + } + break; + } +#endif +#ifdef M_CORE_GB + case PLATFORM_GB: { + GB* gb = static_cast<GB*>(m_threadContext.core->board); + if (m_threadContext.core->opts.mute) { + gb->audio.masterVolume = 0; + } else { + gb->audio.masterVolume = m_threadContext.core->opts.volume; + } + break; + } +#endif + default: + break; + } } CoreController::Interrupter::Interrupter(CoreController* parent, bool fromThread)