Skip to content

Commit 139c88c

Browse files
committed
Qt: Prevent both gyro and RTC sensors from being enabled at the same time
1 parent 39bb4cf commit 139c88c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Misc:
100100
- Qt: Add warning when a ROM is loaded from a temporary directory
101101
- Qt: Sort shader uniforms based on order in file
102102
- Qt: Allow downgrading across update channels
103+
- Qt: Prevent both gyro and RTC sensors from being enabled at the same time
103104
- Res: Port hq2x and OmniScale shaders from SameBoy
104105
- Res: Port NSO-gba-colors shader (closes mgba.io/i/2834)
105106
- Res: Update gba-colors shader (closes mgba.io/i/2976)

src/platform/qt/OverrideView.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ OverrideView::OverrideView(ConfigController* config, QWidget* parent)
3838
m_ui.hwRumble->setEnabled(!enabled);
3939
});
4040

41+
// These two settings are mutually exclusive and break if both are enabled
42+
connect(m_ui.hwRTC, &QAbstractButton::toggled, this, [this] (bool checked) {
43+
if (checked) {
44+
m_ui.hwGyro->setChecked(false);
45+
}
46+
});
47+
48+
connect(m_ui.hwGyro, &QAbstractButton::toggled, this, [this] (bool checked) {
49+
if (checked) {
50+
m_ui.hwRTC->setChecked(false);
51+
}
52+
});
53+
4154
#ifdef M_CORE_GB
4255
m_ui.gbModel->setItemData(0, GB_MODEL_AUTODETECT);
4356
m_ui.mbc->setItemData(0, GB_MBC_AUTODETECT);
@@ -236,6 +249,9 @@ void OverrideView::gameStarted() {
236249
case mPLATFORM_GBA: {
237250
m_ui.tabWidget->setCurrentWidget(m_ui.tabGBA);
238251
GBA* gba = static_cast<GBA*>(thread->core->board);
252+
QSignalBlocker rtc(m_ui.hwRTC);
253+
QSignalBlocker gyro(m_ui.hwGyro);
254+
239255
m_ui.savetype->setCurrentIndex(gba->memory.savedata.type + 1);
240256
m_ui.hwAutodetect->setChecked(gba->memory.hw.devices & HW_NO_OVERRIDE);
241257
m_ui.hwRTC->setChecked(gba->memory.hw.devices & HW_RTC);

0 commit comments

Comments
 (0)