diff options
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/qt_sdl/AudioSettingsDialog.cpp | 18 | ||||
-rw-r--r-- | src/frontend/qt_sdl/AudioSettingsDialog.h | 5 | ||||
-rw-r--r-- | src/frontend/qt_sdl/AudioSettingsDialog.ui | 20 | ||||
-rw-r--r-- | src/frontend/qt_sdl/EmuSettingsDialog.ui | 6 | ||||
-rw-r--r-- | src/frontend/qt_sdl/PlatformConfig.cpp | 4 | ||||
-rw-r--r-- | src/frontend/qt_sdl/PlatformConfig.h | 1 | ||||
-rw-r--r-- | src/frontend/qt_sdl/ROMInfoDialog.cpp | 10 | ||||
-rw-r--r-- | src/frontend/qt_sdl/ROMInfoDialog.ui | 54 | ||||
-rw-r--r-- | src/frontend/qt_sdl/WifiSettingsDialog.cpp | 4 | ||||
-rw-r--r-- | src/frontend/qt_sdl/WifiSettingsDialog.ui | 4 | ||||
-rw-r--r-- | src/frontend/qt_sdl/main.cpp | 11 | ||||
-rw-r--r-- | src/frontend/qt_sdl/main.h | 1 |
12 files changed, 95 insertions, 43 deletions
diff --git a/src/frontend/qt_sdl/AudioSettingsDialog.cpp b/src/frontend/qt_sdl/AudioSettingsDialog.cpp index f47a62a..5ac178a 100644 --- a/src/frontend/qt_sdl/AudioSettingsDialog.cpp +++ b/src/frontend/qt_sdl/AudioSettingsDialog.cpp @@ -38,8 +38,15 @@ AudioSettingsDialog::AudioSettingsDialog(QWidget* parent) : QDialog(parent), ui( ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); + oldInterp = Config::AudioInterp; oldVolume = Config::AudioVolume; + ui->cbInterpolation->addItem("None"); + ui->cbInterpolation->addItem("Linear"); + ui->cbInterpolation->addItem("Cosine"); + ui->cbInterpolation->addItem("Cubic"); + ui->cbInterpolation->setCurrentIndex(Config::AudioInterp); + ui->slVolume->setValue(Config::AudioVolume); grpMicMode = new QButtonGroup(this); @@ -73,11 +80,22 @@ void AudioSettingsDialog::on_AudioSettingsDialog_accepted() void AudioSettingsDialog::on_AudioSettingsDialog_rejected() { + Config::AudioInterp = oldInterp; Config::AudioVolume = oldVolume; closeDlg(); } +void AudioSettingsDialog::on_cbInterpolation_currentIndexChanged(int idx) +{ + // prevent a spurious change + if (ui->cbInterpolation->count() < 4) return; + + Config::AudioInterp = ui->cbInterpolation->currentIndex(); + + emit updateAudioSettings(); +} + void AudioSettingsDialog::on_slVolume_valueChanged(int val) { Config::AudioVolume = val; diff --git a/src/frontend/qt_sdl/AudioSettingsDialog.h b/src/frontend/qt_sdl/AudioSettingsDialog.h index 5d98540..5139975 100644 --- a/src/frontend/qt_sdl/AudioSettingsDialog.h +++ b/src/frontend/qt_sdl/AudioSettingsDialog.h @@ -51,10 +51,14 @@ public: currentDlg = nullptr; } +signals: + void updateAudioSettings(); + private slots: void on_AudioSettingsDialog_accepted(); void on_AudioSettingsDialog_rejected(); + void on_cbInterpolation_currentIndexChanged(int idx); void on_slVolume_valueChanged(int val); void onChangeMicMode(int mode); void on_btnMicWavBrowse_clicked(); @@ -62,6 +66,7 @@ private slots: private: Ui::AudioSettingsDialog* ui; + int oldInterp; int oldVolume; QButtonGroup* grpMicMode; }; diff --git a/src/frontend/qt_sdl/AudioSettingsDialog.ui b/src/frontend/qt_sdl/AudioSettingsDialog.ui index e57b6c5..e329523 100644 --- a/src/frontend/qt_sdl/AudioSettingsDialog.ui +++ b/src/frontend/qt_sdl/AudioSettingsDialog.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>482</width> - <height>230</height> + <height>256</height> </rect> </property> <property name="sizePolicy"> @@ -29,14 +29,14 @@ <string>Audio output</string> </property> <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> + <item row="1" column="0"> <widget class="QLabel" name="label"> <property name="text"> <string>Volume:</string> </property> </widget> </item> - <item row="0" column="1"> + <item row="1" column="1"> <widget class="QSlider" name="slVolume"> <property name="whatsThis"> <string><html><head/><body><p>Controls the volume of the audio output.</p></body></html></string> @@ -52,6 +52,20 @@ </property> </widget> </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Interpolation:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="cbInterpolation"> + <property name="whatsThis"> + <string><html><head/><body><p>Applies interpolation to audio samples for better quality. Option &quot;None&quot; is accurate to DS hardware.</p></body></html></string> + </property> + </widget> + </item> </layout> </widget> </item> diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.ui b/src/frontend/qt_sdl/EmuSettingsDialog.ui index 4291539..e670c88 100644 --- a/src/frontend/qt_sdl/EmuSettingsDialog.ui +++ b/src/frontend/qt_sdl/EmuSettingsDialog.ui @@ -354,21 +354,21 @@ <item row="2" column="0"> <widget class="QCheckBox" name="chkJITBranchOptimisations"> <property name="text"> - <string>Branch Optimisations</string> + <string>Branch optimisations</string> </property> </widget> </item> <item row="3" column="0"> <widget class="QCheckBox" name="chkJITLiteralOptimisations"> <property name="text"> - <string>Literal Optimisations</string> + <string>Literal optimisations</string> </property> </widget> </item> <item row="4" column="0"> <widget class="QCheckBox" name="chkJITFastMemory"> <property name="text"> - <string>Fast Memory</string> + <string>Fast memory</string> </property> </widget> </item> diff --git a/src/frontend/qt_sdl/PlatformConfig.cpp b/src/frontend/qt_sdl/PlatformConfig.cpp index faf9284..40f55ba 100644 --- a/src/frontend/qt_sdl/PlatformConfig.cpp +++ b/src/frontend/qt_sdl/PlatformConfig.cpp @@ -69,6 +69,7 @@ int DirectLAN; int SavestateRelocSRAM; +int AudioInterp; int AudioVolume; int MicInputType; char MicWavPath[1024]; @@ -177,6 +178,7 @@ ConfigEntry PlatformConfigFile[] = {"SavStaRelocSRAM", 0, &SavestateRelocSRAM, 0, NULL, 0}, + {"AudioInterp", 0, &AudioInterp, 0, NULL, 0}, {"AudioVolume", 0, &AudioVolume, 256, NULL, 0}, {"MicInputType", 0, &MicInputType, 1, NULL, 0}, {"MicWavPath", 1, MicWavPath, 0, "", 1023}, @@ -199,7 +201,7 @@ ConfigEntry PlatformConfigFile[] = {"MouseHide", 0, &MouseHide, 0, NULL, 0}, {"MouseHideSeconds", 0, &MouseHideSeconds, 5, NULL, 0}, {"PauseLostFocus", 0, &PauseLostFocus, 0, NULL, 0}, - + {"", -1, NULL, 0, NULL, 0} }; diff --git a/src/frontend/qt_sdl/PlatformConfig.h b/src/frontend/qt_sdl/PlatformConfig.h index 43ac139..202e36a 100644 --- a/src/frontend/qt_sdl/PlatformConfig.h +++ b/src/frontend/qt_sdl/PlatformConfig.h @@ -85,6 +85,7 @@ extern int DirectLAN; extern int SavestateRelocSRAM; +extern int AudioInterp; extern int AudioVolume; extern int MicInputType; extern char MicWavPath[1024]; diff --git a/src/frontend/qt_sdl/ROMInfoDialog.cpp b/src/frontend/qt_sdl/ROMInfoDialog.cpp index 673aaee..cab5f7e 100644 --- a/src/frontend/qt_sdl/ROMInfoDialog.cpp +++ b/src/frontend/qt_sdl/ROMInfoDialog.cpp @@ -34,7 +34,7 @@ QString IntToHex(u64 num) QString QStringBytes(u64 num)
{
- return (QString::number(num) + " Bytes");
+ return (QString::number(num) + " bytes");
}
ROMInfoDialog* ROMInfoDialog::currentDlg = nullptr;
@@ -51,7 +51,7 @@ ROMInfoDialog::ROMInfoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ROMI ui->iconImage->setPixmap(QPixmap::fromImage(iconImage));
if (NDSCart::Banner.Version == 0x103)
- {
+ {
u32 animatedIconData[32 * 32 * 64] = {0};
Frontend::AnimatedROMIcon(NDSCart::Banner.DSiIcon, NDSCart::Banner.DSiPalette, NDSCart::Banner.DSiSequence, animatedIconData, animatedSequence);
@@ -87,7 +87,7 @@ ROMInfoDialog::ROMInfoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ROMI ui->chineseTitle->setText(QString::fromUtf16(NDSCart::Banner.ChineseTitle));
else
ui->chineseTitle->setText("None");
-
+
if (NDSCart::Banner.Version > 2)
ui->koreanTitle->setText(QString::fromUtf16(NDSCart::Banner.KoreanTitle));
else
@@ -107,12 +107,12 @@ ROMInfoDialog::ROMInfoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ROMI ui->arm7EntryAddress->setText(IntToHex(NDSCart::Header.ARM7EntryAddress));
ui->arm7RamAddress->setText(IntToHex(NDSCart::Header.ARM7RAMAddress));
ui->arm7Size->setText(QStringBytes(NDSCart::Header.ARM7Size));
-
+
ui->fntOffset->setText(IntToHex(NDSCart::Header.FNTOffset));
ui->fntSize->setText(QStringBytes(NDSCart::Header.FNTSize));
ui->fatOffset->setText(IntToHex(NDSCart::Header.FATOffset));
ui->fatSize->setText(QStringBytes(NDSCart::Header.FATSize));
-
+
}
ROMInfoDialog::~ROMInfoDialog()
diff --git a/src/frontend/qt_sdl/ROMInfoDialog.ui b/src/frontend/qt_sdl/ROMInfoDialog.ui index 4c5d7d3..0c65cab 100644 --- a/src/frontend/qt_sdl/ROMInfoDialog.ui +++ b/src/frontend/qt_sdl/ROMInfoDialog.ui @@ -17,7 +17,7 @@ </sizepolicy> </property> <property name="windowTitle"> - <string>ROM Info - melonDS</string> + <string>ROM info - melonDS</string> </property> <layout class="QGridLayout" name="gridLayout"> <item row="2" column="0"> @@ -40,7 +40,7 @@ </font> </property> <property name="text"> - <string>Japanese Title:</string> + <string>Japanese title:</string> </property> </widget> </item> @@ -59,7 +59,7 @@ </font> </property> <property name="text"> - <string>English Title:</string> + <string>English title:</string> </property> </widget> </item> @@ -78,7 +78,7 @@ </font> </property> <property name="text"> - <string>French Title:</string> + <string>French title:</string> </property> </widget> </item> @@ -97,7 +97,7 @@ </font> </property> <property name="text"> - <string>German Title:</string> + <string>German title:</string> </property> </widget> </item> @@ -116,7 +116,7 @@ </font> </property> <property name="text"> - <string>Italian Title:</string> + <string>Italian title:</string> </property> </widget> </item> @@ -135,7 +135,7 @@ </font> </property> <property name="text"> - <string>Spanish Title:</string> + <string>Spanish title:</string> </property> </widget> </item> @@ -154,7 +154,7 @@ </font> </property> <property name="text"> - <string>Chinese Title:</string> + <string>Chinese title:</string> </property> </widget> </item> @@ -173,7 +173,7 @@ </font> </property> <property name="text"> - <string>Korean Title:</string> + <string>Korean title:</string> </property> </widget> </item> @@ -201,7 +201,7 @@ </font> </property> <property name="text"> - <string>ARM9 ROM Offset: </string> + <string>ARM9 ROM offset: </string> </property> </widget> </item> @@ -220,7 +220,7 @@ </font> </property> <property name="text"> - <string>ARM9 Entry Address:</string> + <string>ARM9 entry address:</string> </property> </widget> </item> @@ -239,7 +239,7 @@ </font> </property> <property name="text"> - <string>ARM9 RAM Address:</string> + <string>ARM9 RAM address:</string> </property> </widget> </item> @@ -258,7 +258,7 @@ </font> </property> <property name="text"> - <string>ARM9 Size:</string> + <string>ARM9 size:</string> </property> </widget> </item> @@ -277,7 +277,7 @@ </font> </property> <property name="text"> - <string>ARM7 ROM Offset: </string> + <string>ARM7 ROM offset: </string> </property> </widget> </item> @@ -296,7 +296,7 @@ </font> </property> <property name="text"> - <string>ARM7 Entry Address:</string> + <string>ARM7 entry address:</string> </property> </widget> </item> @@ -315,7 +315,7 @@ </font> </property> <property name="text"> - <string>ARM7 RAM Address:</string> + <string>ARM7 RAM address:</string> </property> </widget> </item> @@ -334,7 +334,7 @@ </font> </property> <property name="text"> - <string>ARM7 Size:</string> + <string>ARM7 size:</string> </property> </widget> </item> @@ -368,7 +368,7 @@ </font> </property> <property name="text"> - <string>FNT Offset:</string> + <string>FNT offset:</string> </property> </widget> </item> @@ -387,7 +387,7 @@ </font> </property> <property name="text"> - <string>FNT Size:</string> + <string>FNT size:</string> </property> </widget> </item> @@ -406,7 +406,7 @@ </font> </property> <property name="text"> - <string>FAT Offset:</string> + <string>FAT offset:</string> </property> </widget> </item> @@ -425,7 +425,7 @@ </font> </property> <property name="text"> - <string>FAT Size:</string> + <string>FAT size:</string> </property> </widget> </item> @@ -448,7 +448,7 @@ </sizepolicy> </property> <property name="title"> - <string>General Info</string> + <string>General info</string> </property> <layout class="QFormLayout" name="formLayout_3"> <item row="0" column="0"> @@ -459,7 +459,7 @@ </font> </property> <property name="text"> - <string>Game Title:</string> + <string>Game title:</string> </property> </widget> </item> @@ -478,7 +478,7 @@ </font> </property> <property name="text"> - <string>Game Code:</string> + <string>Game code:</string> </property> </widget> </item> @@ -497,7 +497,7 @@ </font> </property> <property name="text"> - <string>Maker Code:</string> + <string>Maker code:</string> </property> </widget> </item> @@ -516,7 +516,7 @@ </font> </property> <property name="text"> - <string>Card Size:</string> + <string>Card size:</string> </property> </widget> </item> @@ -784,7 +784,7 @@ <item row="1" column="1"> <widget class="QPushButton" name="saveIconButton"> <property name="text"> - <string>Save Icon</string> + <string>Save icon</string> </property> </widget> </item> diff --git a/src/frontend/qt_sdl/WifiSettingsDialog.cpp b/src/frontend/qt_sdl/WifiSettingsDialog.cpp index 538a35b..061d914 100644 --- a/src/frontend/qt_sdl/WifiSettingsDialog.cpp +++ b/src/frontend/qt_sdl/WifiSettingsDialog.cpp @@ -144,12 +144,12 @@ void WifiSettingsDialog::on_cbxDirectAdapter_currentIndexChanged(int sel) LAN_PCap::AdapterData* adapter = &LAN_PCap::Adapters[sel]; char tmp[64]; - sprintf(tmp, "MAC: %02X:%02X:%02X:%02X:%02X:%02X", + sprintf(tmp, "%02X:%02X:%02X:%02X:%02X:%02X", adapter->MAC[0], adapter->MAC[1], adapter->MAC[2], adapter->MAC[3], adapter->MAC[4], adapter->MAC[5]); ui->lblAdapterMAC->setText(QString(tmp)); - sprintf(tmp, "IP: %d.%d.%d.%d", + sprintf(tmp, "%d.%d.%d.%d", adapter->IP_v4[0], adapter->IP_v4[1], adapter->IP_v4[2], adapter->IP_v4[3]); ui->lblAdapterIP->setText(QString(tmp)); diff --git a/src/frontend/qt_sdl/WifiSettingsDialog.ui b/src/frontend/qt_sdl/WifiSettingsDialog.ui index 174a3dc..44a4232 100644 --- a/src/frontend/qt_sdl/WifiSettingsDialog.ui +++ b/src/frontend/qt_sdl/WifiSettingsDialog.ui @@ -61,7 +61,7 @@ <item row="3" column="0" rowspan="3" colspan="2"> <widget class="QGroupBox" name="groupBox_3"> <property name="title"> - <string>Direct Mode Settings</string> + <string>Direct mode settings</string> </property> <layout class="QGridLayout" name="gridLayout_3"> <item row="0" column="0"> @@ -127,7 +127,7 @@ <string><html><head/><body><p>Indirect mode uses libslirp. It requires no extra setup and is easy to use.</p></body></html></string> </property> <property name="text"> - <string>Indirect Mode (uses libslirp, recommended)</string> + <string>Indirect mode (uses libslirp, recommended)</string> </property> </widget> </item> diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 01e5e75..ce0ff84 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -399,6 +399,8 @@ void EmuThread::run() GPU::InitRenderer(videoRenderer); GPU::SetRenderSettings(videoRenderer, videoSettings); + SPU::SetInterpolation(Config::AudioInterp); + Input::Init(); u32 nframes = 0; @@ -2424,13 +2426,21 @@ void MainWindow::onOpenVideoSettings() void MainWindow::onOpenAudioSettings() { AudioSettingsDialog* dlg = AudioSettingsDialog::openDlg(this); + connect(dlg, &AudioSettingsDialog::updateAudioSettings, this, &MainWindow::onUpdateAudioSettings); connect(dlg, &AudioSettingsDialog::finished, this, &MainWindow::onAudioSettingsFinished); } +void MainWindow::onUpdateAudioSettings() +{ + SPU::SetInterpolation(Config::AudioInterp); +} + void MainWindow::onAudioSettingsFinished(int res) { micClose(); + SPU::SetInterpolation(Config::AudioInterp); + if (Config::MicInputType == 3) { micLoadWav(Config::MicWavPath); @@ -2750,6 +2760,7 @@ int main(int argc, char** argv) ); SANITIZE(Config::ScreenVSyncInterval, 1, 20); SANITIZE(Config::GL_ScaleFactor, 1, 16); + SANITIZE(Config::AudioInterp, 0, 3); SANITIZE(Config::AudioVolume, 0, 256); SANITIZE(Config::MicInputType, 0, 3); SANITIZE(Config::ScreenRotation, 0, 3); diff --git a/src/frontend/qt_sdl/main.h b/src/frontend/qt_sdl/main.h index acaad55..4d570a3 100644 --- a/src/frontend/qt_sdl/main.h +++ b/src/frontend/qt_sdl/main.h @@ -243,6 +243,7 @@ private slots: void onInputConfigFinished(int res); void onOpenVideoSettings(); void onOpenAudioSettings(); + void onUpdateAudioSettings(); void onAudioSettingsFinished(int res); void onOpenWifiSettings(); void onWifiSettingsFinished(int res); |