mirror of https://github.com/mgba-emu/mgba.git
Qt: Revamp BIOS handling
This commit is contained in:
parent
f4a61f91d4
commit
7ed4f38bdd
|
@ -84,6 +84,8 @@ void mCoreConfigSetOverrideIntValue(struct mCoreConfig*, const char* key, int va
|
|||
void mCoreConfigSetOverrideUIntValue(struct mCoreConfig*, const char* key, unsigned value);
|
||||
void mCoreConfigSetOverrideFloatValue(struct mCoreConfig*, const char* key, float value);
|
||||
|
||||
void mCoreConfigCopyValue(struct mCoreConfig* config, const struct mCoreConfig* src, const char* key);
|
||||
|
||||
void mCoreConfigMap(const struct mCoreConfig* config, struct mCoreOptions* opts);
|
||||
void mCoreConfigLoadDefaults(struct mCoreConfig* config, const struct mCoreOptions* opts);
|
||||
|
||||
|
|
|
@ -306,6 +306,14 @@ void mCoreConfigSetOverrideFloatValue(struct mCoreConfig* config, const char* ke
|
|||
ConfigurationSetFloatValue(&config->overridesTable, config->port, key, value);
|
||||
}
|
||||
|
||||
void mCoreConfigCopyValue(struct mCoreConfig* config, const struct mCoreConfig* src, const char* key) {
|
||||
const char* value = mCoreConfigGetValue(src, key);
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
mCoreConfigSetValue(config, key, value);
|
||||
}
|
||||
|
||||
void mCoreConfigMap(const struct mCoreConfig* config, struct mCoreOptions* opts) {
|
||||
_lookupCharValue(config, "bios", &opts->bios);
|
||||
_lookupCharValue(config, "shader", &opts->shader);
|
||||
|
|
|
@ -103,6 +103,8 @@ static void _GBCoreLoadConfig(struct mCore* core, const struct mCoreConfig* conf
|
|||
gb->audio.masterVolume = core->opts.volume;
|
||||
}
|
||||
gb->video.frameskip = core->opts.frameskip;
|
||||
mCoreConfigCopyValue(&core->config, config, "gb.bios");
|
||||
mCoreConfigCopyValue(&core->config, config, "gbc.bios");
|
||||
|
||||
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
||||
struct GBCore* gbcore = (struct GBCore*) core;
|
||||
|
@ -238,8 +240,8 @@ static void _GBCoreReset(struct mCore* core) {
|
|||
}
|
||||
|
||||
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
||||
struct VFile* bios = NULL;
|
||||
if (core->opts.useBios) {
|
||||
if (!gb->biosVf && core->opts.useBios) {
|
||||
struct VFile* bios = NULL;
|
||||
bool found = false;
|
||||
if (core->opts.bios) {
|
||||
bios = VFileOpen(core->opts.bios, O_RDONLY);
|
||||
|
@ -251,8 +253,31 @@ static void _GBCoreReset(struct mCore* core) {
|
|||
}
|
||||
}
|
||||
if (!found) {
|
||||
char path[PATH_MAX];
|
||||
GBDetectModel(gb);
|
||||
const char* configPath;
|
||||
|
||||
switch (gb->model) {
|
||||
case GB_MODEL_DMG:
|
||||
case GB_MODEL_SGB: // TODO
|
||||
configPath = mCoreConfigGetValue(&core->config, "gb.bios");
|
||||
break;
|
||||
case GB_MODEL_CGB:
|
||||
case GB_MODEL_AGB:
|
||||
configPath = mCoreConfigGetValue(&core->config, "gbc.bios");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
bios = VFileOpen(configPath, O_RDONLY);
|
||||
if (bios && GBIsBIOS(bios)) {
|
||||
found = true;
|
||||
} else if (bios) {
|
||||
bios->close(bios);
|
||||
bios = NULL;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
char path[PATH_MAX];
|
||||
mCoreConfigDirectory(path, PATH_MAX);
|
||||
switch (gb->model) {
|
||||
case GB_MODEL_DMG:
|
||||
|
@ -267,10 +292,16 @@ static void _GBCoreReset(struct mCore* core) {
|
|||
break;
|
||||
};
|
||||
bios = VFileOpen(path, O_RDONLY);
|
||||
if (bios && GBIsBIOS(bios)) {
|
||||
found = true;
|
||||
} else if (bios) {
|
||||
bios->close(bios);
|
||||
bios = NULL;
|
||||
}
|
||||
}
|
||||
if (bios) {
|
||||
GBLoadBIOS(gb, bios);
|
||||
}
|
||||
}
|
||||
if (bios) {
|
||||
GBLoadBIOS(gb, bios);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -135,6 +135,8 @@ static void _GBACoreLoadConfig(struct mCore* core, const struct mCoreConfig* con
|
|||
}
|
||||
}
|
||||
|
||||
mCoreConfigCopyValue(&core->config, config, "gba.bios");
|
||||
|
||||
#ifndef DISABLE_THREADING
|
||||
mCoreConfigGetIntValue(config, "threadedVideo", &gbacore->threadedVideo);
|
||||
#endif
|
||||
|
@ -280,19 +282,43 @@ static void _GBACoreReset(struct mCore* core) {
|
|||
}
|
||||
|
||||
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
||||
struct VFile* bios = 0;
|
||||
if (core->opts.useBios) {
|
||||
if (!core->opts.bios) {
|
||||
if (!gba->biosVf && core->opts.useBios) {
|
||||
struct VFile* bios = NULL;
|
||||
bool found = false;
|
||||
if (core->opts.bios) {
|
||||
bios = VFileOpen(core->opts.bios, O_RDONLY);
|
||||
if (bios && GBAIsBIOS(bios)) {
|
||||
found = true;
|
||||
} else if (bios) {
|
||||
bios->close(bios);
|
||||
bios = NULL;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
const char* configPath = mCoreConfigGetValue(&core->config, "gba.bios");
|
||||
bios = VFileOpen(configPath, O_RDONLY);
|
||||
if (bios && GBAIsBIOS(bios)) {
|
||||
found = true;
|
||||
} else if (bios) {
|
||||
bios->close(bios);
|
||||
bios = NULL;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
char path[PATH_MAX];
|
||||
mCoreConfigDirectory(path, PATH_MAX);
|
||||
strncat(path, PATH_SEP "gba_bios.bin", PATH_MAX - strlen(path));
|
||||
bios = VFileOpen(path, O_RDONLY);
|
||||
} else {
|
||||
bios = VFileOpen(core->opts.bios, O_RDONLY);
|
||||
if (bios && GBIsBIOS(bios)) {
|
||||
found = true;
|
||||
} else if (bios) {
|
||||
bios->close(bios);
|
||||
bios = NULL;
|
||||
}
|
||||
}
|
||||
if (bios) {
|
||||
GBALoadBIOS(gba, bios);
|
||||
}
|
||||
}
|
||||
if (bios) {
|
||||
GBALoadBIOS(gba, bios);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -394,9 +394,6 @@ void GameController::openGame(bool biosOnly) {
|
|||
if (m_fname.isEmpty()) {
|
||||
biosOnly = true;
|
||||
}
|
||||
if (biosOnly && (!m_useBios || m_bios.isNull())) {
|
||||
return;
|
||||
}
|
||||
if (isLoaded()) {
|
||||
// We need to delay if the game is still cleaning up
|
||||
QTimer::singleShot(10, this, SLOT(openGame()));
|
||||
|
@ -405,14 +402,17 @@ void GameController::openGame(bool biosOnly) {
|
|||
cleanGame();
|
||||
}
|
||||
|
||||
m_threadContext.core = nullptr;
|
||||
if (!biosOnly) {
|
||||
if (m_vf) {
|
||||
m_threadContext.core = mCoreFindVF(m_vf);
|
||||
} else {
|
||||
m_threadContext.core = mCoreFind(m_fname.toUtf8().constData());
|
||||
}
|
||||
#ifdef M_CORE_GBA
|
||||
} else {
|
||||
m_threadContext.core = GBACoreCreate();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!m_threadContext.core) {
|
||||
|
@ -429,12 +429,17 @@ void GameController::openGame(bool biosOnly) {
|
|||
m_threadContext.sync.audioWait = m_audioSync;
|
||||
}
|
||||
m_threadContext.core->init(m_threadContext.core);
|
||||
mCoreInitConfig(m_threadContext.core, nullptr);
|
||||
|
||||
unsigned width, height;
|
||||
m_threadContext.core->desiredVideoDimensions(m_threadContext.core, &width, &height);
|
||||
m_drawContext = new uint32_t[width * height];
|
||||
m_frontBuffer = new uint32_t[width * height];
|
||||
|
||||
if (m_config) {
|
||||
mCoreLoadForeignConfig(m_threadContext.core, m_config);
|
||||
}
|
||||
|
||||
QByteArray bytes;
|
||||
if (!biosOnly) {
|
||||
bytes = m_fname.toUtf8();
|
||||
|
@ -447,28 +452,21 @@ void GameController::openGame(bool biosOnly) {
|
|||
} else {
|
||||
bytes = m_bios.toUtf8();
|
||||
}
|
||||
if (bytes.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
char dirname[PATH_MAX];
|
||||
separatePath(bytes.constData(), dirname, m_threadContext.core->dirs.baseName, 0);
|
||||
mDirectorySetAttachBase(&m_threadContext.core->dirs, VDirOpen(dirname));
|
||||
|
||||
m_threadContext.core->setVideoBuffer(m_threadContext.core, m_drawContext, width);
|
||||
|
||||
if (!m_bios.isNull() && m_useBios) {
|
||||
VFile* bios = VFileDevice::open(m_bios, O_RDONLY);
|
||||
if (bios && !m_threadContext.core->loadBIOS(m_threadContext.core, bios, 0)) {
|
||||
bios->close(bios);
|
||||
}
|
||||
}
|
||||
|
||||
m_inputController->recalibrateAxes();
|
||||
memset(m_drawContext, 0xF8, width * height * 4);
|
||||
|
||||
m_threadContext.core->setAVStream(m_threadContext.core, m_stream);
|
||||
|
||||
if (m_config) {
|
||||
mCoreLoadForeignConfig(m_threadContext.core, m_config);
|
||||
}
|
||||
|
||||
if (!biosOnly) {
|
||||
mCoreAutoloadSave(m_threadContext.core);
|
||||
if (!m_patch.isNull()) {
|
||||
|
@ -488,14 +486,16 @@ void GameController::openGame(bool biosOnly) {
|
|||
}
|
||||
}
|
||||
|
||||
void GameController::loadBIOS(const QString& path) {
|
||||
void GameController::loadBIOS(int platform, const QString& path) {
|
||||
if (m_bios == path) {
|
||||
return;
|
||||
}
|
||||
m_bios = path;
|
||||
if (m_gameOpen) {
|
||||
if (m_gameOpen && this->platform() == platform) {
|
||||
closeGame();
|
||||
m_bios = path;
|
||||
openGame();
|
||||
} else if (!m_gameOpen) {
|
||||
m_bios = path;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ signals:
|
|||
public slots:
|
||||
void loadGame(const QString& path);
|
||||
void loadGame(VFile* vf, const QString& base);
|
||||
void loadBIOS(const QString& path);
|
||||
void loadBIOS(int platform, const QString& path);
|
||||
void loadSave(const QString& path, bool temporary = true);
|
||||
void yankPak();
|
||||
void replaceGame(const QString& path);
|
||||
|
|
|
@ -127,7 +127,15 @@ SettingsView::SettingsView(ConfigController* controller, InputController* inputC
|
|||
}
|
||||
#endif
|
||||
|
||||
connect(m_ui.biosBrowse, SIGNAL(clicked()), this, SLOT(selectBios()));
|
||||
connect(m_ui.gbaBiosBrowse, &QPushButton::clicked, [this]() {
|
||||
selectBios(m_ui.gbaBios);
|
||||
});
|
||||
connect(m_ui.gbBiosBrowse, &QPushButton::clicked, [this]() {
|
||||
selectBios(m_ui.gbBios);
|
||||
});
|
||||
connect(m_ui.gbcBiosBrowse, &QPushButton::clicked, [this]() {
|
||||
selectBios(m_ui.gbcBios);
|
||||
});
|
||||
|
||||
GBAKeyEditor* editor = new GBAKeyEditor(inputController, InputController::KEYBOARD, QString(), this);
|
||||
m_ui.stackedWidget->addWidget(editor);
|
||||
|
@ -162,15 +170,17 @@ SettingsView::SettingsView(ConfigController* controller, InputController* inputC
|
|||
m_ui.tabs->addItem("Shortcuts");
|
||||
}
|
||||
|
||||
void SettingsView::selectBios() {
|
||||
void SettingsView::selectBios(QLineEdit* bios) {
|
||||
QString filename = GBAApp::app()->getOpenFileName(this, tr("Select BIOS"));
|
||||
if (!filename.isEmpty()) {
|
||||
m_ui.bios->setText(filename);
|
||||
bios->setText(filename);
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsView::updateConfig() {
|
||||
saveSetting("bios", m_ui.bios);
|
||||
saveSetting("gba.bios", m_ui.gbaBios);
|
||||
saveSetting("gb.bios", m_ui.gbBios);
|
||||
saveSetting("gbc.bios", m_ui.gbcBios);
|
||||
saveSetting("useBios", m_ui.useBios);
|
||||
saveSetting("skipBios", m_ui.skipBios);
|
||||
saveSetting("audioBuffers", m_ui.audioBufferSize);
|
||||
|
@ -240,11 +250,14 @@ void SettingsView::updateConfig() {
|
|||
m_controller->write();
|
||||
|
||||
emit pathsChanged();
|
||||
emit biosLoaded(m_ui.bios->text());
|
||||
emit biosLoaded(PLATFORM_GBA, m_ui.gbaBios->text());
|
||||
}
|
||||
|
||||
void SettingsView::reloadConfig() {
|
||||
loadSetting("bios", m_ui.bios);
|
||||
loadSetting("bios", m_ui.gbaBios);
|
||||
loadSetting("gba.bios", m_ui.gbaBios);
|
||||
loadSetting("gb.bios", m_ui.gbBios);
|
||||
loadSetting("gbc.bios", m_ui.gbcBios);
|
||||
loadSetting("useBios", m_ui.useBios);
|
||||
loadSetting("skipBios", m_ui.skipBios);
|
||||
loadSetting("audioBuffers", m_ui.audioBufferSize);
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#include <QDialog>
|
||||
|
||||
#include <mgba/core/core.h>
|
||||
|
||||
#include "ui_SettingsView.h"
|
||||
|
||||
namespace QGBA {
|
||||
|
@ -23,13 +25,13 @@ public:
|
|||
SettingsView(ConfigController* controller, InputController* inputController, ShortcutController* shortcutController, QWidget* parent = nullptr);
|
||||
|
||||
signals:
|
||||
void biosLoaded(const QString&);
|
||||
void biosLoaded(int platform, const QString&);
|
||||
void audioDriverChanged();
|
||||
void displayDriverChanged();
|
||||
void pathsChanged();
|
||||
|
||||
private slots:
|
||||
void selectBios();
|
||||
void selectBios(QLineEdit*);
|
||||
void updateConfig();
|
||||
void reloadConfig();
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>548</width>
|
||||
<height>431</height>
|
||||
<width>650</width>
|
||||
<height>450</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -23,13 +23,6 @@
|
|||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QListWidget" name="tabs">
|
||||
<property name="sizePolicy">
|
||||
|
@ -45,7 +38,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="currentRow">
|
||||
<number>0</number>
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -59,7 +52,7 @@
|
|||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Savestates</string>
|
||||
<string>BIOS</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -69,12 +62,19 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="stackedWidgetPage1">
|
||||
<widget class="QWidget" name="av">
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||
|
@ -110,7 +110,7 @@
|
|||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<property name="currentText" stdset="0">
|
||||
<string>1536</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
|
@ -176,7 +176,7 @@
|
|||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<property name="currentText" stdset="0">
|
||||
<string>44100</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
|
@ -384,110 +384,108 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="stackedWidgetPage2">
|
||||
<widget class="QWidget" name="emulation">
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>BIOS file:</string>
|
||||
<string>Fast forward speed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="bios">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<widget class="QDoubleSpinBox" name="fastForwardRatio">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>×</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>20.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="biosBrowse">
|
||||
<widget class="QCheckBox" name="fastForwardUnbounded">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
<string>Unbounded</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="useBios">
|
||||
<property name="text">
|
||||
<string>Use BIOS file if found</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="skipBios">
|
||||
<property name="text">
|
||||
<string>Skip BIOS intro</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="rewind">
|
||||
<property name="text">
|
||||
<string>Fast forward speed</string>
|
||||
<string>Enable rewind</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="fastForwardRatio">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>×</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>20.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.500000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="fastForwardUnbounded">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Unbounded</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
<string>Rewind history:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="rewindCapacity">
|
||||
<property name="maximum">
|
||||
<number>3600</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>frames</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="allowOpposingDirections">
|
||||
<property name="text">
|
||||
<string>Allow opposing input directions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="suspendScreensaver">
|
||||
<property name="text">
|
||||
<string>Suspend screensaver</string>
|
||||
|
@ -497,21 +495,21 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="7" column="1">
|
||||
<widget class="QCheckBox" name="pauseOnFocusLost">
|
||||
<property name="text">
|
||||
<string>Pause when inactive</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Idle loops</string>
|
||||
<string>Idle loops:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="idleOptimization">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -530,28 +528,21 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QCheckBox" name="allowOpposingDirections">
|
||||
<property name="text">
|
||||
<string>Allow opposing input directions</string>
|
||||
<item row="9" column="0" colspan="2">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<layout class="QFormLayout" name="formLayout_4">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>Save extra data</string>
|
||||
<string>Savestate extra data:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="saveStateScreenshot">
|
||||
<property name="text">
|
||||
<string>Screenshot</string>
|
||||
|
@ -561,7 +552,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="saveStateSave">
|
||||
<property name="text">
|
||||
<string>Save data</string>
|
||||
|
@ -571,7 +562,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="saveStateCheats">
|
||||
<property name="text">
|
||||
<string>Cheat codes</string>
|
||||
|
@ -581,21 +572,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Load extra data</string>
|
||||
<string>Load extra data:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="13" column="1">
|
||||
<widget class="QCheckBox" name="loadStateScreenshot">
|
||||
<property name="text">
|
||||
<string>Screenshot</string>
|
||||
|
@ -605,54 +589,120 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QCheckBox" name="loadStateSave">
|
||||
<property name="text">
|
||||
<string>Save data</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="15" column="1">
|
||||
<widget class="QCheckBox" name="loadStateCheats">
|
||||
<property name="text">
|
||||
<string>Cheat codes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="rewind">
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="bios">
|
||||
<layout class="QFormLayout" name="formLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Enable rewind</string>
|
||||
<string>GB BIOS file:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Rewind history:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="rewindCapacity">
|
||||
<property name="maximum">
|
||||
<number>3600</number>
|
||||
<widget class="QLineEdit" name="gbBios">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<widget class="QPushButton" name="gbBiosBrowse">
|
||||
<property name="text">
|
||||
<string>frames</string>
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="useBios">
|
||||
<property name="text">
|
||||
<string>Use BIOS file if found</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="skipBios">
|
||||
<property name="text">
|
||||
<string>Skip BIOS intro</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="gbaBios">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="gbaBiosBrowse">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>GBA BIOS file:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>GBC BIOS file:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_30">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="gbcBios">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="gbcBiosBrowse">
|
||||
<property name="text">
|
||||
<string>Browse</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -660,7 +710,7 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page">
|
||||
<widget class="QWidget" name="paths">
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::FieldsStayAtSizeHint</enum>
|
||||
|
@ -970,21 +1020,5 @@
|
|||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fastForwardUnbounded</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>fastForwardRatio</receiver>
|
||||
<slot>setDisabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>338</x>
|
||||
<y>163</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>327</x>
|
||||
<y>135</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
|
|
@ -288,10 +288,6 @@ void Window::reloadConfig() {
|
|||
m_display->lockAspectRatio(opts->lockAspectRatio);
|
||||
m_display->filter(opts->resampleVideo);
|
||||
|
||||
if (opts->bios) {
|
||||
m_controller->loadBIOS(opts->bios);
|
||||
}
|
||||
|
||||
m_inputController.setScreensaverSuspendable(opts->suspendScreensaver);
|
||||
}
|
||||
|
||||
|
@ -412,18 +408,6 @@ void Window::multiplayerChanged() {
|
|||
}
|
||||
}
|
||||
|
||||
void Window::selectBIOS() {
|
||||
QString filename = GBAApp::app()->getOpenFileName(this, tr("Select BIOS"));
|
||||
if (!filename.isEmpty()) {
|
||||
QFileInfo info(filename);
|
||||
m_config->setOption("bios", info.canonicalFilePath());
|
||||
m_config->updateOption("bios");
|
||||
m_config->setOption("useBios", true);
|
||||
m_config->updateOption("useBios");
|
||||
m_controller->loadBIOS(info.canonicalFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
void Window::selectPatch() {
|
||||
QString filename = GBAApp::app()->getOpenFileName(this, tr("Select patch"), tr("Patches (*.ips *.ups *.bps)"));
|
||||
if (!filename.isEmpty()) {
|
||||
|
@ -453,7 +437,7 @@ void Window::exportSharkport() {
|
|||
|
||||
void Window::openSettingsWindow() {
|
||||
SettingsView* settingsWindow = new SettingsView(m_config, &m_inputController, m_shortcutController);
|
||||
connect(settingsWindow, SIGNAL(biosLoaded(const QString&)), m_controller, SLOT(loadBIOS(const QString&)));
|
||||
connect(settingsWindow, SIGNAL(biosLoaded(int, const QString&)), m_controller, SLOT(loadBIOS(int, const QString&)));
|
||||
connect(settingsWindow, SIGNAL(audioDriverChanged()), m_controller, SLOT(reloadAudioDriver()));
|
||||
connect(settingsWindow, SIGNAL(displayDriverChanged()), this, SLOT(mustRestart()));
|
||||
connect(settingsWindow, SIGNAL(pathsChanged()), this, SLOT(reloadConfig()));
|
||||
|
@ -905,15 +889,19 @@ void Window::setupMenu(QMenuBar* menubar) {
|
|||
addControlledAction(fileMenu, fileMenu->addAction(tr("Load ROM in archive..."), this, SLOT(selectROMInArchive())),
|
||||
"loadROMInArchive");
|
||||
|
||||
addControlledAction(fileMenu, fileMenu->addAction(tr("Load &BIOS..."), this, SLOT(selectBIOS())), "loadBIOS");
|
||||
|
||||
QAction* loadTemporarySave = new QAction(tr("Load temporary save..."), fileMenu);
|
||||
connect(loadTemporarySave, &QAction::triggered, [this]() { this->selectSave(true); });
|
||||
m_gameActions.append(loadTemporarySave);
|
||||
addControlledAction(fileMenu, loadTemporarySave, "loadTemporarySave");
|
||||
|
||||
addControlledAction(fileMenu, fileMenu->addAction(tr("Load &patch..."), this, SLOT(selectPatch())), "loadPatch");
|
||||
addControlledAction(fileMenu, fileMenu->addAction(tr("Boot BIOS"), m_controller, SLOT(bootBIOS())), "bootBIOS");
|
||||
|
||||
QAction* bootBIOS = new QAction(tr("Boot BIOS"), fileMenu);
|
||||
connect(bootBIOS, &QAction::triggered, [this]() {
|
||||
m_controller->loadBIOS(PLATFORM_GBA, m_config->getOption("gba.bios"));
|
||||
m_controller->bootBIOS();
|
||||
});
|
||||
addControlledAction(fileMenu, bootBIOS, "bootBIOS");
|
||||
|
||||
addControlledAction(fileMenu, fileMenu->addAction(tr("Replace ROM..."), this, SLOT(replaceROM())), "replaceROM");
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ public slots:
|
|||
void selectROMInArchive();
|
||||
#endif
|
||||
void selectSave(bool temporary);
|
||||
void selectBIOS();
|
||||
void selectPatch();
|
||||
void enterFullScreen();
|
||||
void exitFullScreen();
|
||||
|
|
Loading…
Reference in New Issue