mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 13:20:57 -06:00
Audio interpolation (#1176)
add audio interpolation (emulation improvement)
This commit is contained in:
83
src/SPU.cpp
83
src/SPU.cpp
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <cmath>
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "NDS.h"
|
#include "NDS.h"
|
||||||
#include "DSi.h"
|
#include "DSi.h"
|
||||||
@ -27,7 +28,6 @@
|
|||||||
// SPU TODO
|
// SPU TODO
|
||||||
// * capture addition modes, overflow bugs
|
// * capture addition modes, overflow bugs
|
||||||
// * channel hold
|
// * channel hold
|
||||||
// * 'length less than 4' glitch
|
|
||||||
|
|
||||||
namespace SPU
|
namespace SPU
|
||||||
{
|
{
|
||||||
@ -62,6 +62,12 @@ const s16 PSGTable[8][8] =
|
|||||||
{-0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF}
|
{-0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF, -0x7FFF}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// audio interpolation is an improvement upon the original hardware
|
||||||
|
// (which performs no interpolation)
|
||||||
|
int InterpType;
|
||||||
|
s16 InterpCos[0x100];
|
||||||
|
s16 InterpCubic[0x100][4];
|
||||||
|
|
||||||
const u32 OutputBufferSize = 2*2048;
|
const u32 OutputBufferSize = 2*2048;
|
||||||
s16 OutputBackbuffer[2 * OutputBufferSize];
|
s16 OutputBackbuffer[2 * OutputBufferSize];
|
||||||
u32 OutputBackbufferWritePosition;
|
u32 OutputBackbufferWritePosition;
|
||||||
@ -90,6 +96,32 @@ bool Init()
|
|||||||
|
|
||||||
AudioLock = Platform::Mutex_Create();
|
AudioLock = Platform::Mutex_Create();
|
||||||
|
|
||||||
|
InterpType = 0;
|
||||||
|
|
||||||
|
// generate interpolation tables
|
||||||
|
// values are 1:1:14 fixed-point
|
||||||
|
|
||||||
|
float m_pi = std::acos(-1.0f);
|
||||||
|
for (int i = 0; i < 0x100; i++)
|
||||||
|
{
|
||||||
|
float ratio = (i * m_pi) / 255.0f;
|
||||||
|
ratio = 1.0f - std::cos(ratio);
|
||||||
|
|
||||||
|
InterpCos[i] = (s16)(ratio * 0x2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 0x100; i++)
|
||||||
|
{
|
||||||
|
s32 i1 = i << 6;
|
||||||
|
s32 i2 = (i * i) >> 2;
|
||||||
|
s32 i3 = (i * i * i) >> 10;
|
||||||
|
|
||||||
|
InterpCubic[i][0] = -i3 + 2*i2 - i1;
|
||||||
|
InterpCubic[i][1] = i3 - 2*i2 + 0x4000;
|
||||||
|
InterpCubic[i][2] = -i3 + i2 + i1;
|
||||||
|
InterpCubic[i][3] = i3 - i2;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,6 +180,11 @@ void DoSavestate(Savestate* file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetInterpolation(int type)
|
||||||
|
{
|
||||||
|
InterpType = type;
|
||||||
|
}
|
||||||
|
|
||||||
void SetBias(u16 bias)
|
void SetBias(u16 bias)
|
||||||
{
|
{
|
||||||
Bias = bias;
|
Bias = bias;
|
||||||
@ -202,6 +239,7 @@ void Channel::DoSavestate(Savestate* file)
|
|||||||
file->Var8((u8*)&KeyOn);
|
file->Var8((u8*)&KeyOn);
|
||||||
file->Var32(&Timer);
|
file->Var32(&Timer);
|
||||||
file->Var32((u32*)&Pos);
|
file->Var32((u32*)&Pos);
|
||||||
|
file->VarArray(PrevSample, sizeof(PrevSample));
|
||||||
file->Var16((u16*)&CurSample);
|
file->Var16((u16*)&CurSample);
|
||||||
file->Var16(&NoiseVal);
|
file->Var16(&NoiseVal);
|
||||||
|
|
||||||
@ -215,7 +253,7 @@ void Channel::DoSavestate(Savestate* file)
|
|||||||
file->Var32(&FIFOWritePos);
|
file->Var32(&FIFOWritePos);
|
||||||
file->Var32(&FIFOReadOffset);
|
file->Var32(&FIFOReadOffset);
|
||||||
file->Var32(&FIFOLevel);
|
file->Var32(&FIFOLevel);
|
||||||
file->VarArray(FIFO, 8*4);
|
file->VarArray(FIFO, sizeof(FIFO));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Channel::FIFO_BufferData()
|
void Channel::FIFO_BufferData()
|
||||||
@ -269,6 +307,9 @@ void Channel::Start()
|
|||||||
Pos = -3;
|
Pos = -3;
|
||||||
|
|
||||||
NoiseVal = 0x7FFF;
|
NoiseVal = 0x7FFF;
|
||||||
|
PrevSample[0] = 0;
|
||||||
|
PrevSample[1] = 0;
|
||||||
|
PrevSample[2] = 0;
|
||||||
CurSample = 0;
|
CurSample = 0;
|
||||||
|
|
||||||
FIFOReadPos = 0;
|
FIFOReadPos = 0;
|
||||||
@ -444,6 +485,16 @@ s32 Channel::Run()
|
|||||||
{
|
{
|
||||||
Timer = TimerReload + (Timer - 0x10000);
|
Timer = TimerReload + (Timer - 0x10000);
|
||||||
|
|
||||||
|
// for optional interpolation: save previous samples
|
||||||
|
// the interpolated audio will be delayed by a couple samples,
|
||||||
|
// but it's easier to deal with this way
|
||||||
|
if ((type < 3) && (InterpType != 0))
|
||||||
|
{
|
||||||
|
PrevSample[2] = PrevSample[1];
|
||||||
|
PrevSample[1] = PrevSample[0];
|
||||||
|
PrevSample[0] = CurSample;
|
||||||
|
}
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 0: NextSample_PCM8(); break;
|
case 0: NextSample_PCM8(); break;
|
||||||
@ -455,6 +506,34 @@ s32 Channel::Run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
s32 val = (s32)CurSample;
|
s32 val = (s32)CurSample;
|
||||||
|
|
||||||
|
// interpolation (emulation improvement, not a hardware feature)
|
||||||
|
if ((type < 3) && (InterpType != 0))
|
||||||
|
{
|
||||||
|
s32 samplepos = ((Timer - TimerReload) * 0x100) / (0x10000 - TimerReload);
|
||||||
|
if (samplepos > 0xFF) samplepos = 0xFF;
|
||||||
|
|
||||||
|
switch (InterpType)
|
||||||
|
{
|
||||||
|
case 1: // linear
|
||||||
|
val = ((val * samplepos) +
|
||||||
|
(PrevSample[0] * (0xFF-samplepos))) >> 8;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: // cosine
|
||||||
|
val = ((val * InterpCos[samplepos]) +
|
||||||
|
(PrevSample[0] * InterpCos[0xFF-samplepos])) >> 14;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3: // cubic
|
||||||
|
val = ((PrevSample[2] * InterpCubic[samplepos][0]) +
|
||||||
|
(PrevSample[1] * InterpCubic[samplepos][1]) +
|
||||||
|
(PrevSample[0] * InterpCubic[samplepos][2]) +
|
||||||
|
(val * InterpCubic[samplepos][3])) >> 14;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val <<= VolumeShift;
|
val <<= VolumeShift;
|
||||||
val *= Volume;
|
val *= Volume;
|
||||||
return val;
|
return val;
|
||||||
|
@ -31,6 +31,9 @@ void Stop();
|
|||||||
|
|
||||||
void DoSavestate(Savestate* file);
|
void DoSavestate(Savestate* file);
|
||||||
|
|
||||||
|
// 0=none 1=linear 2=cosine 3=cubic
|
||||||
|
void SetInterpolation(int type);
|
||||||
|
|
||||||
void SetBias(u16 bias);
|
void SetBias(u16 bias);
|
||||||
|
|
||||||
void Mix(u32 dummy);
|
void Mix(u32 dummy);
|
||||||
@ -73,6 +76,7 @@ public:
|
|||||||
bool KeyOn;
|
bool KeyOn;
|
||||||
u32 Timer;
|
u32 Timer;
|
||||||
s32 Pos;
|
s32 Pos;
|
||||||
|
s16 PrevSample[3];
|
||||||
s16 CurSample;
|
s16 CurSample;
|
||||||
u16 NoiseVal;
|
u16 NoiseVal;
|
||||||
|
|
||||||
|
@ -38,8 +38,15 @@ AudioSettingsDialog::AudioSettingsDialog(QWidget* parent) : QDialog(parent), ui(
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
|
oldInterp = Config::AudioInterp;
|
||||||
oldVolume = Config::AudioVolume;
|
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);
|
ui->slVolume->setValue(Config::AudioVolume);
|
||||||
|
|
||||||
grpMicMode = new QButtonGroup(this);
|
grpMicMode = new QButtonGroup(this);
|
||||||
@ -73,11 +80,22 @@ void AudioSettingsDialog::on_AudioSettingsDialog_accepted()
|
|||||||
|
|
||||||
void AudioSettingsDialog::on_AudioSettingsDialog_rejected()
|
void AudioSettingsDialog::on_AudioSettingsDialog_rejected()
|
||||||
{
|
{
|
||||||
|
Config::AudioInterp = oldInterp;
|
||||||
Config::AudioVolume = oldVolume;
|
Config::AudioVolume = oldVolume;
|
||||||
|
|
||||||
closeDlg();
|
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)
|
void AudioSettingsDialog::on_slVolume_valueChanged(int val)
|
||||||
{
|
{
|
||||||
Config::AudioVolume = val;
|
Config::AudioVolume = val;
|
||||||
|
@ -51,10 +51,14 @@ public:
|
|||||||
currentDlg = nullptr;
|
currentDlg = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void updateAudioSettings();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_AudioSettingsDialog_accepted();
|
void on_AudioSettingsDialog_accepted();
|
||||||
void on_AudioSettingsDialog_rejected();
|
void on_AudioSettingsDialog_rejected();
|
||||||
|
|
||||||
|
void on_cbInterpolation_currentIndexChanged(int idx);
|
||||||
void on_slVolume_valueChanged(int val);
|
void on_slVolume_valueChanged(int val);
|
||||||
void onChangeMicMode(int mode);
|
void onChangeMicMode(int mode);
|
||||||
void on_btnMicWavBrowse_clicked();
|
void on_btnMicWavBrowse_clicked();
|
||||||
@ -62,6 +66,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Ui::AudioSettingsDialog* ui;
|
Ui::AudioSettingsDialog* ui;
|
||||||
|
|
||||||
|
int oldInterp;
|
||||||
int oldVolume;
|
int oldVolume;
|
||||||
QButtonGroup* grpMicMode;
|
QButtonGroup* grpMicMode;
|
||||||
};
|
};
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>482</width>
|
<width>482</width>
|
||||||
<height>230</height>
|
<height>256</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -29,14 +29,14 @@
|
|||||||
<string>Audio output</string>
|
<string>Audio output</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Volume:</string>
|
<string>Volume:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSlider" name="slVolume">
|
<widget class="QSlider" name="slVolume">
|
||||||
<property name="whatsThis">
|
<property name="whatsThis">
|
||||||
<string><html><head/><body><p>Controls the volume of the audio output.</p></body></html></string>
|
<string><html><head/><body><p>Controls the volume of the audio output.</p></body></html></string>
|
||||||
@ -52,6 +52,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -354,21 +354,21 @@
|
|||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="chkJITBranchOptimisations">
|
<widget class="QCheckBox" name="chkJITBranchOptimisations">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Branch Optimisations</string>
|
<string>Branch optimisations</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QCheckBox" name="chkJITLiteralOptimisations">
|
<widget class="QCheckBox" name="chkJITLiteralOptimisations">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Literal Optimisations</string>
|
<string>Literal optimisations</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="chkJITFastMemory">
|
<widget class="QCheckBox" name="chkJITFastMemory">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fast Memory</string>
|
<string>Fast memory</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -69,6 +69,7 @@ int DirectLAN;
|
|||||||
|
|
||||||
int SavestateRelocSRAM;
|
int SavestateRelocSRAM;
|
||||||
|
|
||||||
|
int AudioInterp;
|
||||||
int AudioVolume;
|
int AudioVolume;
|
||||||
int MicInputType;
|
int MicInputType;
|
||||||
char MicWavPath[1024];
|
char MicWavPath[1024];
|
||||||
@ -177,6 +178,7 @@ ConfigEntry PlatformConfigFile[] =
|
|||||||
|
|
||||||
{"SavStaRelocSRAM", 0, &SavestateRelocSRAM, 0, NULL, 0},
|
{"SavStaRelocSRAM", 0, &SavestateRelocSRAM, 0, NULL, 0},
|
||||||
|
|
||||||
|
{"AudioInterp", 0, &AudioInterp, 0, NULL, 0},
|
||||||
{"AudioVolume", 0, &AudioVolume, 256, NULL, 0},
|
{"AudioVolume", 0, &AudioVolume, 256, NULL, 0},
|
||||||
{"MicInputType", 0, &MicInputType, 1, NULL, 0},
|
{"MicInputType", 0, &MicInputType, 1, NULL, 0},
|
||||||
{"MicWavPath", 1, MicWavPath, 0, "", 1023},
|
{"MicWavPath", 1, MicWavPath, 0, "", 1023},
|
||||||
@ -199,7 +201,7 @@ ConfigEntry PlatformConfigFile[] =
|
|||||||
{"MouseHide", 0, &MouseHide, 0, NULL, 0},
|
{"MouseHide", 0, &MouseHide, 0, NULL, 0},
|
||||||
{"MouseHideSeconds", 0, &MouseHideSeconds, 5, NULL, 0},
|
{"MouseHideSeconds", 0, &MouseHideSeconds, 5, NULL, 0},
|
||||||
{"PauseLostFocus", 0, &PauseLostFocus, 0, NULL, 0},
|
{"PauseLostFocus", 0, &PauseLostFocus, 0, NULL, 0},
|
||||||
|
|
||||||
{"", -1, NULL, 0, NULL, 0}
|
{"", -1, NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ extern int DirectLAN;
|
|||||||
|
|
||||||
extern int SavestateRelocSRAM;
|
extern int SavestateRelocSRAM;
|
||||||
|
|
||||||
|
extern int AudioInterp;
|
||||||
extern int AudioVolume;
|
extern int AudioVolume;
|
||||||
extern int MicInputType;
|
extern int MicInputType;
|
||||||
extern char MicWavPath[1024];
|
extern char MicWavPath[1024];
|
||||||
|
@ -34,7 +34,7 @@ QString IntToHex(u64 num)
|
|||||||
|
|
||||||
QString QStringBytes(u64 num)
|
QString QStringBytes(u64 num)
|
||||||
{
|
{
|
||||||
return (QString::number(num) + " Bytes");
|
return (QString::number(num) + " bytes");
|
||||||
}
|
}
|
||||||
|
|
||||||
ROMInfoDialog* ROMInfoDialog::currentDlg = nullptr;
|
ROMInfoDialog* ROMInfoDialog::currentDlg = nullptr;
|
||||||
@ -51,7 +51,7 @@ ROMInfoDialog::ROMInfoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ROMI
|
|||||||
ui->iconImage->setPixmap(QPixmap::fromImage(iconImage));
|
ui->iconImage->setPixmap(QPixmap::fromImage(iconImage));
|
||||||
|
|
||||||
if (NDSCart::Banner.Version == 0x103)
|
if (NDSCart::Banner.Version == 0x103)
|
||||||
{
|
{
|
||||||
u32 animatedIconData[32 * 32 * 64] = {0};
|
u32 animatedIconData[32 * 32 * 64] = {0};
|
||||||
Frontend::AnimatedROMIcon(NDSCart::Banner.DSiIcon, NDSCart::Banner.DSiPalette, NDSCart::Banner.DSiSequence, animatedIconData, animatedSequence);
|
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));
|
ui->chineseTitle->setText(QString::fromUtf16(NDSCart::Banner.ChineseTitle));
|
||||||
else
|
else
|
||||||
ui->chineseTitle->setText("None");
|
ui->chineseTitle->setText("None");
|
||||||
|
|
||||||
if (NDSCart::Banner.Version > 2)
|
if (NDSCart::Banner.Version > 2)
|
||||||
ui->koreanTitle->setText(QString::fromUtf16(NDSCart::Banner.KoreanTitle));
|
ui->koreanTitle->setText(QString::fromUtf16(NDSCart::Banner.KoreanTitle));
|
||||||
else
|
else
|
||||||
@ -107,12 +107,12 @@ ROMInfoDialog::ROMInfoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ROMI
|
|||||||
ui->arm7EntryAddress->setText(IntToHex(NDSCart::Header.ARM7EntryAddress));
|
ui->arm7EntryAddress->setText(IntToHex(NDSCart::Header.ARM7EntryAddress));
|
||||||
ui->arm7RamAddress->setText(IntToHex(NDSCart::Header.ARM7RAMAddress));
|
ui->arm7RamAddress->setText(IntToHex(NDSCart::Header.ARM7RAMAddress));
|
||||||
ui->arm7Size->setText(QStringBytes(NDSCart::Header.ARM7Size));
|
ui->arm7Size->setText(QStringBytes(NDSCart::Header.ARM7Size));
|
||||||
|
|
||||||
ui->fntOffset->setText(IntToHex(NDSCart::Header.FNTOffset));
|
ui->fntOffset->setText(IntToHex(NDSCart::Header.FNTOffset));
|
||||||
ui->fntSize->setText(QStringBytes(NDSCart::Header.FNTSize));
|
ui->fntSize->setText(QStringBytes(NDSCart::Header.FNTSize));
|
||||||
ui->fatOffset->setText(IntToHex(NDSCart::Header.FATOffset));
|
ui->fatOffset->setText(IntToHex(NDSCart::Header.FATOffset));
|
||||||
ui->fatSize->setText(QStringBytes(NDSCart::Header.FATSize));
|
ui->fatSize->setText(QStringBytes(NDSCart::Header.FATSize));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ROMInfoDialog::~ROMInfoDialog()
|
ROMInfoDialog::~ROMInfoDialog()
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>ROM Info - melonDS</string>
|
<string>ROM info - melonDS</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
@ -40,7 +40,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Japanese Title:</string>
|
<string>Japanese title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>English Title:</string>
|
<string>English title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -78,7 +78,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>French Title:</string>
|
<string>French title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -97,7 +97,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>German Title:</string>
|
<string>German title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -116,7 +116,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Italian Title:</string>
|
<string>Italian title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -135,7 +135,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Spanish Title:</string>
|
<string>Spanish title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -154,7 +154,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Chinese Title:</string>
|
<string>Chinese title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -173,7 +173,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Korean Title:</string>
|
<string>Korean title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -201,7 +201,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM9 ROM Offset: </string>
|
<string>ARM9 ROM offset: </string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -220,7 +220,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM9 Entry Address:</string>
|
<string>ARM9 entry address:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -239,7 +239,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM9 RAM Address:</string>
|
<string>ARM9 RAM address:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -258,7 +258,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM9 Size:</string>
|
<string>ARM9 size:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -277,7 +277,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM7 ROM Offset: </string>
|
<string>ARM7 ROM offset: </string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -296,7 +296,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM7 Entry Address:</string>
|
<string>ARM7 entry address:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -315,7 +315,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM7 RAM Address:</string>
|
<string>ARM7 RAM address:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -334,7 +334,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>ARM7 Size:</string>
|
<string>ARM7 size:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -368,7 +368,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FNT Offset:</string>
|
<string>FNT offset:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -387,7 +387,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FNT Size:</string>
|
<string>FNT size:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -406,7 +406,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FAT Offset:</string>
|
<string>FAT offset:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -425,7 +425,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>FAT Size:</string>
|
<string>FAT size:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -448,7 +448,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>General Info</string>
|
<string>General info</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout_3">
|
<layout class="QFormLayout" name="formLayout_3">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
@ -459,7 +459,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Game Title:</string>
|
<string>Game title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -478,7 +478,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Game Code:</string>
|
<string>Game code:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -497,7 +497,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Maker Code:</string>
|
<string>Maker code:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -516,7 +516,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Card Size:</string>
|
<string>Card size:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -784,7 +784,7 @@
|
|||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QPushButton" name="saveIconButton">
|
<widget class="QPushButton" name="saveIconButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save Icon</string>
|
<string>Save icon</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -144,12 +144,12 @@ void WifiSettingsDialog::on_cbxDirectAdapter_currentIndexChanged(int sel)
|
|||||||
LAN_PCap::AdapterData* adapter = &LAN_PCap::Adapters[sel];
|
LAN_PCap::AdapterData* adapter = &LAN_PCap::Adapters[sel];
|
||||||
char tmp[64];
|
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[0], adapter->MAC[1], adapter->MAC[2],
|
||||||
adapter->MAC[3], adapter->MAC[4], adapter->MAC[5]);
|
adapter->MAC[3], adapter->MAC[4], adapter->MAC[5]);
|
||||||
ui->lblAdapterMAC->setText(QString(tmp));
|
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[0], adapter->IP_v4[1],
|
||||||
adapter->IP_v4[2], adapter->IP_v4[3]);
|
adapter->IP_v4[2], adapter->IP_v4[3]);
|
||||||
ui->lblAdapterIP->setText(QString(tmp));
|
ui->lblAdapterIP->setText(QString(tmp));
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<item row="3" column="0" rowspan="3" colspan="2">
|
<item row="3" column="0" rowspan="3" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Direct Mode Settings</string>
|
<string>Direct mode settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="0" column="0">
|
<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>
|
<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>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Indirect Mode (uses libslirp, recommended)</string>
|
<string>Indirect mode (uses libslirp, recommended)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -399,6 +399,8 @@ void EmuThread::run()
|
|||||||
GPU::InitRenderer(videoRenderer);
|
GPU::InitRenderer(videoRenderer);
|
||||||
GPU::SetRenderSettings(videoRenderer, videoSettings);
|
GPU::SetRenderSettings(videoRenderer, videoSettings);
|
||||||
|
|
||||||
|
SPU::SetInterpolation(Config::AudioInterp);
|
||||||
|
|
||||||
Input::Init();
|
Input::Init();
|
||||||
|
|
||||||
u32 nframes = 0;
|
u32 nframes = 0;
|
||||||
@ -2424,13 +2426,21 @@ void MainWindow::onOpenVideoSettings()
|
|||||||
void MainWindow::onOpenAudioSettings()
|
void MainWindow::onOpenAudioSettings()
|
||||||
{
|
{
|
||||||
AudioSettingsDialog* dlg = AudioSettingsDialog::openDlg(this);
|
AudioSettingsDialog* dlg = AudioSettingsDialog::openDlg(this);
|
||||||
|
connect(dlg, &AudioSettingsDialog::updateAudioSettings, this, &MainWindow::onUpdateAudioSettings);
|
||||||
connect(dlg, &AudioSettingsDialog::finished, this, &MainWindow::onAudioSettingsFinished);
|
connect(dlg, &AudioSettingsDialog::finished, this, &MainWindow::onAudioSettingsFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onUpdateAudioSettings()
|
||||||
|
{
|
||||||
|
SPU::SetInterpolation(Config::AudioInterp);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onAudioSettingsFinished(int res)
|
void MainWindow::onAudioSettingsFinished(int res)
|
||||||
{
|
{
|
||||||
micClose();
|
micClose();
|
||||||
|
|
||||||
|
SPU::SetInterpolation(Config::AudioInterp);
|
||||||
|
|
||||||
if (Config::MicInputType == 3)
|
if (Config::MicInputType == 3)
|
||||||
{
|
{
|
||||||
micLoadWav(Config::MicWavPath);
|
micLoadWav(Config::MicWavPath);
|
||||||
@ -2750,6 +2760,7 @@ int main(int argc, char** argv)
|
|||||||
);
|
);
|
||||||
SANITIZE(Config::ScreenVSyncInterval, 1, 20);
|
SANITIZE(Config::ScreenVSyncInterval, 1, 20);
|
||||||
SANITIZE(Config::GL_ScaleFactor, 1, 16);
|
SANITIZE(Config::GL_ScaleFactor, 1, 16);
|
||||||
|
SANITIZE(Config::AudioInterp, 0, 3);
|
||||||
SANITIZE(Config::AudioVolume, 0, 256);
|
SANITIZE(Config::AudioVolume, 0, 256);
|
||||||
SANITIZE(Config::MicInputType, 0, 3);
|
SANITIZE(Config::MicInputType, 0, 3);
|
||||||
SANITIZE(Config::ScreenRotation, 0, 3);
|
SANITIZE(Config::ScreenRotation, 0, 3);
|
||||||
|
@ -243,6 +243,7 @@ private slots:
|
|||||||
void onInputConfigFinished(int res);
|
void onInputConfigFinished(int res);
|
||||||
void onOpenVideoSettings();
|
void onOpenVideoSettings();
|
||||||
void onOpenAudioSettings();
|
void onOpenAudioSettings();
|
||||||
|
void onUpdateAudioSettings();
|
||||||
void onAudioSettingsFinished(int res);
|
void onAudioSettingsFinished(int res);
|
||||||
void onOpenWifiSettings();
|
void onOpenWifiSettings();
|
||||||
void onWifiSettingsFinished(int res);
|
void onWifiSettingsFinished(int res);
|
||||||
|
Reference in New Issue
Block a user