aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2021-11-18 01:17:51 +0100
committerArisotura <thetotalworm@gmail.com>2021-11-18 01:17:51 +0100
commit19ddaee13b5400b14ef3d3a6299474e7f715a948 (patch)
tree3a8b0804e91454109936db361a0ad7a9d5e1d5d5 /src
parent65c2a844ac0c1d323a67044973860cdc0dcac953 (diff)
finally decouple Config from the core. baahhahahahah
Diffstat (limited to 'src')
-rw-r--r--src/ARM.cpp1
-rw-r--r--src/ARMJIT_A64/ARMJIT_Compiler.cpp1
-rw-r--r--src/ARMJIT_x64/ARMJIT_Compiler.cpp13
-rw-r--r--src/ARMJIT_x64/ARMJIT_LoadStore.cpp2
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Config.cpp143
-rw-r--r--src/Config.h49
-rw-r--r--src/DSi_SD.cpp1
-rw-r--r--src/GPU3D.cpp5
-rw-r--r--src/GPU3D_OpenGL.cpp1
-rw-r--r--src/GPU3D_Soft.cpp1
-rw-r--r--src/GPU_OpenGL.cpp1
-rw-r--r--src/NDS.cpp8
-rw-r--r--src/Platform.h2
-rw-r--r--src/SPU.cpp2
-rw-r--r--src/frontend/Util_ROM.cpp1
-rw-r--r--src/frontend/qt_sdl/AudioSettingsDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/CMakeLists.txt3
-rw-r--r--src/frontend/qt_sdl/CheatsDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/Config.cpp (renamed from src/frontend/qt_sdl/PlatformConfig.cpp)88
-rw-r--r--src/frontend/qt_sdl/Config.h (renamed from src/frontend/qt_sdl/PlatformConfig.h)18
-rw-r--r--src/frontend/qt_sdl/EmuSettingsDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/FirmwareSettingsDialog.cpp2
-rw-r--r--src/frontend/qt_sdl/Input.cpp2
-rw-r--r--src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/InterfaceSettingsDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/LAN_PCap.cpp2
-rw-r--r--src/frontend/qt_sdl/LAN_Socket.cpp1
-rw-r--r--src/frontend/qt_sdl/OSD.cpp2
-rw-r--r--src/frontend/qt_sdl/Platform.cpp4
-rw-r--r--src/frontend/qt_sdl/ROMInfoDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/TitleManagerDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/VideoSettingsDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/WifiSettingsDialog.cpp1
-rw-r--r--src/frontend/qt_sdl/main.cpp1
35 files changed, 128 insertions, 236 deletions
diff --git a/src/ARM.cpp b/src/ARM.cpp
index 811dd7c..55f60bf 100644
--- a/src/ARM.cpp
+++ b/src/ARM.cpp
@@ -24,7 +24,6 @@
#include "ARMInterpreter.h"
#include "AREngine.h"
#include "ARMJIT.h"
-#include "Config.h"
#ifdef JIT_ENABLED
#include "ARMJIT.h"
diff --git a/src/ARMJIT_A64/ARMJIT_Compiler.cpp b/src/ARMJIT_A64/ARMJIT_Compiler.cpp
index 5941656..1ad24b1 100644
--- a/src/ARMJIT_A64/ARMJIT_Compiler.cpp
+++ b/src/ARMJIT_A64/ARMJIT_Compiler.cpp
@@ -20,7 +20,6 @@
#include "../ARMJIT_Internal.h"
#include "../ARMInterpreter.h"
-#include "../Config.h"
#ifdef __SWITCH__
#include <switch.h>
diff --git a/src/ARMJIT_x64/ARMJIT_Compiler.cpp b/src/ARMJIT_x64/ARMJIT_Compiler.cpp
index 8178684..6fffcec 100644
--- a/src/ARMJIT_x64/ARMJIT_Compiler.cpp
+++ b/src/ARMJIT_x64/ARMJIT_Compiler.cpp
@@ -19,7 +19,6 @@
#include "ARMJIT_Compiler.h"
#include "../ARMInterpreter.h"
-#include "../Config.h"
#include <assert.h>
#include <stdarg.h>
@@ -638,11 +637,11 @@ const Compiler::CompileFunc T_Comp[ARMInstrInfo::tk_Count] = {
// LDR/STR sp rel
F(T_Comp_MemSPRel), F(T_Comp_MemSPRel),
// PUSH/POP
- F(T_Comp_PUSH_POP), F(T_Comp_PUSH_POP),
+ F(T_Comp_PUSH_POP), F(T_Comp_PUSH_POP),
// LDMIA, STMIA
- F(T_Comp_LDMIA_STMIA), F(T_Comp_LDMIA_STMIA),
+ F(T_Comp_LDMIA_STMIA), F(T_Comp_LDMIA_STMIA),
// Branch
- F(T_Comp_BCOND), F(T_Comp_BranchXchangeReg), F(T_Comp_BranchXchangeReg), F(T_Comp_B), F(T_Comp_BL_LONG_1), F(T_Comp_BL_LONG_2),
+ F(T_Comp_BCOND), F(T_Comp_BranchXchangeReg), F(T_Comp_BranchXchangeReg), F(T_Comp_B), F(T_Comp_BL_LONG_1), F(T_Comp_BL_LONG_2),
// Unk, SVC
NULL, NULL,
F(T_Comp_BL_Merged)
@@ -832,7 +831,7 @@ JitBlockEntry Compiler::CompileBlock(ARM* cpu, bool thumb, FetchedInstr instrs[]
SetJumpTarget(skipExecute);
}
}
-
+
}
}
@@ -888,7 +887,7 @@ void Compiler::Comp_AddCycles_CI(Gen::X64Reg i, int add)
s32 cycles = Num ?
NDS::ARM7MemTimings[CurInstr.CodeCycles][Thumb ? 0 : 2]
: ((R15 & 0x2) ? 0 : CurInstr.CodeCycles);
-
+
if (!Thumb && CurInstr.Cond() < 0xE)
{
LEA(32, RSCRATCH, MDisp(i, add + cycles));
@@ -933,7 +932,7 @@ void Compiler::Comp_AddCycles_CDI()
{
cycles = numC + numD + 1;
}
-
+
if (!Thumb && CurInstr.Cond() < 0xE)
ADD(32, MDisp(RCPU, offsetof(ARM, Cycles)), Imm8(cycles));
else
diff --git a/src/ARMJIT_x64/ARMJIT_LoadStore.cpp b/src/ARMJIT_x64/ARMJIT_LoadStore.cpp
index c1a09fa..07cade4 100644
--- a/src/ARMJIT_x64/ARMJIT_LoadStore.cpp
+++ b/src/ARMJIT_x64/ARMJIT_LoadStore.cpp
@@ -18,8 +18,6 @@
#include "ARMJIT_Compiler.h"
-#include "../Config.h"
-
using namespace Gen;
namespace ARMJIT
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d8250ae..16c68e1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,7 +11,6 @@ add_library(core STATIC
ARMInterpreter_ALU.cpp
ARMInterpreter_Branch.cpp
ARMInterpreter_LoadStore.cpp
- Config.cpp
CP15.cpp
CRC32.cpp
DMA.cpp
diff --git a/src/Config.cpp b/src/Config.cpp
deleted file mode 100644
index 0565a32..0000000
--- a/src/Config.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- Copyright 2016-2021 Arisotura
-
- This file is part of melonDS.
-
- melonDS is free software: you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with melonDS. If not, see http://www.gnu.org/licenses/.
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "Config.h"
-#include "Platform.h"
-
-
-namespace Config
-{
-
-const char* kConfigFile = "melonDS.ini";
-
-
-int AudioBitrate;
-
-ConfigEntry ConfigFile[] =
-{
-
- {"AudioBitrate", 0, &AudioBitrate, 0, NULL, 0},
-
- {"", -1, NULL, 0, NULL, 0}
-};
-
-extern ConfigEntry PlatformConfigFile[];
-
-
-void Load()
-{
- ConfigEntry* entry = &ConfigFile[0];
- int c = 0;
- for (;;)
- {
- if (!entry->Value)
- {
- if (c > 0) break;
- entry = &PlatformConfigFile[0];
- if (!entry->Value) break;
- c++;
- }
-
- if (entry->Type == 0)
- *(int*)entry->Value = entry->DefaultInt;
- else
- {
- strncpy((char*)entry->Value, entry->DefaultStr, entry->StrLength);
- ((char*)entry->Value)[entry->StrLength] = '\0';
- }
-
- entry++;
- }
-
- FILE* f = Platform::OpenLocalFile(kConfigFile, "r");
- if (!f) return;
-
- char linebuf[1024];
- char entryname[32];
- char entryval[1024];
- while (!feof(f))
- {
- if (fgets(linebuf, 1024, f) == nullptr)
- break;
-
- int ret = sscanf(linebuf, "%31[A-Za-z_0-9]=%[^\t\r\n]", entryname, entryval);
- entryname[31] = '\0';
- if (ret < 2) continue;
-
- ConfigEntry* entry = &ConfigFile[0];
- c = 0;
- for (;;)
- {
- if (!entry->Value)
- {
- if (c > 0) break;
- entry = &PlatformConfigFile[0];
- if (!entry->Value) break;
- c++;
- }
-
- if (!strncmp(entry->Name, entryname, 32))
- {
- if (entry->Type == 0)
- *(int*)entry->Value = strtol(entryval, NULL, 10);
- else
- strncpy((char*)entry->Value, entryval, entry->StrLength);
-
- break;
- }
-
- entry++;
- }
- }
-
- fclose(f);
-}
-
-void Save()
-{
- FILE* f = Platform::OpenLocalFile(kConfigFile, "w");
- if (!f) return;
-
- ConfigEntry* entry = &ConfigFile[0];
- int c = 0;
- for (;;)
- {
- if (!entry->Value)
- {
- if (c > 0) break;
- entry = &PlatformConfigFile[0];
- if (!entry->Value) break;
- c++;
- }
-
- if (entry->Type == 0)
- fprintf(f, "%s=%d\r\n", entry->Name, *(int*)entry->Value);
- else
- fprintf(f, "%s=%s\r\n", entry->Name, (char*)entry->Value);
-
- entry++;
- }
-
- fclose(f);
-}
-
-
-}
diff --git a/src/Config.h b/src/Config.h
deleted file mode 100644
index 778fd0e..0000000
--- a/src/Config.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright 2016-2021 Arisotura
-
- This file is part of melonDS.
-
- melonDS is free software: you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free
- Software Foundation, either version 3 of the License, or (at your option)
- any later version.
-
- melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with melonDS. If not, see http://www.gnu.org/licenses/.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <stdio.h>
-
-#include "types.h"
-
-namespace Config
-{
-
-struct ConfigEntry
-{
- char Name[32];
- int Type;
- void* Value;
- int DefaultInt;
- const char* DefaultStr;
- int StrLength; // should be set to actual array length minus one
-};
-
-FILE* GetConfigFile(const char* fileName, const char* permissions);
-bool HasConfigFile(const char* fileName);
-void Load();
-void Save();
-
-
-extern int AudioBitrate;
-
-}
-
-#endif // CONFIG_H
diff --git a/src/DSi_SD.cpp b/src/DSi_SD.cpp
index 20c735d..4c2b085 100644
--- a/src/DSi_SD.cpp
+++ b/src/DSi_SD.cpp
@@ -22,7 +22,6 @@
#include "DSi_SD.h"
#include "DSi_NWifi.h"
#include "Platform.h"
-#include "Config.h"
// observed IRQ behavior during transfers
diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp
index 9c02b2f..7fa04b3 100644
--- a/src/GPU3D.cpp
+++ b/src/GPU3D.cpp
@@ -22,7 +22,6 @@
#include "NDS.h"
#include "GPU.h"
#include "FIFO.h"
-#include "Config.h"
// 3D engine notes
@@ -2164,7 +2163,7 @@ void ExecuteCommand()
VertexSlotCounter = 0;
VertexSlotsFree = 1;
break;
-
+
case 0x60: // viewport x1,y1,x2,y2
VertexPipelineCmdDelayed8();
// note: viewport Y coordinates are upside-down
@@ -2413,7 +2412,7 @@ void ExecuteCommand()
CurVertex[2] = ExecParams[1] & 0xFFFF;
PosTest();
break;
-
+
case 0x70: // box test
NumTestCommands -= 3;
BoxTest(ExecParams);
diff --git a/src/GPU3D_OpenGL.cpp b/src/GPU3D_OpenGL.cpp
index ccac08a..df7fc0b 100644
--- a/src/GPU3D_OpenGL.cpp
+++ b/src/GPU3D_OpenGL.cpp
@@ -22,7 +22,6 @@
#include <string.h>
#include "NDS.h"
#include "GPU.h"
-#include "Config.h"
#include "GPU3D_OpenGL_shaders.h"
namespace GPU3D
diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp
index 2f0f825..fa22afa 100644
--- a/src/GPU3D_Soft.cpp
+++ b/src/GPU3D_Soft.cpp
@@ -23,7 +23,6 @@
#include <string.h>
#include "NDS.h"
#include "GPU.h"
-#include "Config.h"
namespace GPU3D
diff --git a/src/GPU_OpenGL.cpp b/src/GPU_OpenGL.cpp
index 350012f..0dd25f0 100644
--- a/src/GPU_OpenGL.cpp
+++ b/src/GPU_OpenGL.cpp
@@ -23,7 +23,6 @@
#include "NDS.h"
#include "GPU.h"
-#include "Config.h"
#include "OpenGLSupport.h"
#include "GPU_OpenGL_shaders.h"
diff --git a/src/NDS.cpp b/src/NDS.cpp
index 287f120..b3e4d2c 100644
--- a/src/NDS.cpp
+++ b/src/NDS.cpp
@@ -19,7 +19,6 @@
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
-#include "Config.h"
#include "NDS.h"
#include "ARM.h"
#include "NDSCart.h"
@@ -634,6 +633,8 @@ void Reset()
RTC::Reset();
Wifi::Reset();
+ // TODO: move the SOUNDBIAS/degrade logic to SPU?
+
// The SOUNDBIAS register does nothing on DSi
SPU::SetApplyBias(ConsoleType == 0);
@@ -646,9 +647,10 @@ void Reset()
degradeAudio = false;
}
- if (Config::AudioBitrate == 1) // Always 10-bit
+ int bitrate = Platform::GetConfigInt(Platform::AudioBitrate);
+ if (bitrate == 1) // Always 10-bit
degradeAudio = true;
- else if (Config::AudioBitrate == 2) // Always 16-bit
+ else if (bitrate == 2) // Always 16-bit
degradeAudio = false;
SPU::SetDegrade10Bit(degradeAudio);
diff --git a/src/Platform.h b/src/Platform.h
index 0323637..5d127e6 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -77,6 +77,8 @@ enum ConfigEntry
Firm_BirthdayDay,
Firm_Color,
Firm_Message,
+
+ AudioBitrate,
};
int GetConfigInt(ConfigEntry entry);
diff --git a/src/SPU.cpp b/src/SPU.cpp
index e2f3277..3cd3a66 100644
--- a/src/SPU.cpp
+++ b/src/SPU.cpp
@@ -99,6 +99,8 @@ bool Init()
AudioLock = Platform::Mutex_Create();
InterpType = 0;
+ ApplyBias = true;
+ Degrade10Bit = false;
// generate interpolation tables
// values are 1:1:14 fixed-point
diff --git a/src/frontend/Util_ROM.cpp b/src/frontend/Util_ROM.cpp
index 8f100c7..99c7054 100644
--- a/src/frontend/Util_ROM.cpp
+++ b/src/frontend/Util_ROM.cpp
@@ -25,7 +25,6 @@
#include "ArchiveUtil.h"
#endif
#include "FrontendUtil.h"
-#include "Config.h"
#include "SharedConfig.h"
#include "Platform.h"
diff --git a/src/frontend/qt_sdl/AudioSettingsDialog.cpp b/src/frontend/qt_sdl/AudioSettingsDialog.cpp
index bf88eab..d4ce678 100644
--- a/src/frontend/qt_sdl/AudioSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/AudioSettingsDialog.cpp
@@ -22,7 +22,6 @@
#include "types.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "AudioSettingsDialog.h"
#include "ui_AudioSettingsDialog.h"
diff --git a/src/frontend/qt_sdl/CMakeLists.txt b/src/frontend/qt_sdl/CMakeLists.txt
index 1d987a4..ad38e37 100644
--- a/src/frontend/qt_sdl/CMakeLists.txt
+++ b/src/frontend/qt_sdl/CMakeLists.txt
@@ -4,6 +4,7 @@ SET(SOURCES_QT_SDL
main.cpp
main_shaders.h
CheatsDialog.cpp
+ Config.cpp
EmuSettingsDialog.cpp
InputConfig/InputConfigDialog.cpp
InputConfig/MapButton.h
@@ -22,7 +23,6 @@ SET(SOURCES_QT_SDL
OSD_shaders.h
font.h
Platform.cpp
- PlatformConfig.cpp
QPathInput.h
ArchiveUtil.h
@@ -33,6 +33,7 @@ SET(SOURCES_QT_SDL
../Util_Audio.cpp
../FrontendUtil.h
../mic_blow.h
+ ../SharedConfig.h
${CMAKE_SOURCE_DIR}/res/melon.qrc
)
diff --git a/src/frontend/qt_sdl/CheatsDialog.cpp b/src/frontend/qt_sdl/CheatsDialog.cpp
index 4a4c4b6..afa0805 100644
--- a/src/frontend/qt_sdl/CheatsDialog.cpp
+++ b/src/frontend/qt_sdl/CheatsDialog.cpp
@@ -24,7 +24,6 @@
#include "types.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "CheatsDialog.h"
#include "ui_CheatsDialog.h"
diff --git a/src/frontend/qt_sdl/PlatformConfig.cpp b/src/frontend/qt_sdl/Config.cpp
index abecb2d..8c3690b 100644
--- a/src/frontend/qt_sdl/PlatformConfig.cpp
+++ b/src/frontend/qt_sdl/Config.cpp
@@ -19,7 +19,9 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include "PlatformConfig.h"
+#include "Platform.h"
+#include "Config.h"
+
namespace Config
{
@@ -112,6 +114,7 @@ int DirectLAN;
int SavestateRelocSRAM;
int AudioInterp;
+int AudioBitrate;
int AudioVolume;
int MicInputType;
char MicWavPath[1024];
@@ -127,7 +130,10 @@ int MouseHideSeconds;
int PauseLostFocus;
-ConfigEntry PlatformConfigFile[] =
+
+const char* kConfigFile = "melonDS.ini";
+
+ConfigEntry ConfigFile[] =
{
{"Key_A", 0, &KeyMapping[0], -1, NULL, 0},
{"Key_B", 0, &KeyMapping[1], -1, NULL, 0},
@@ -265,6 +271,7 @@ ConfigEntry PlatformConfigFile[] =
{"SavStaRelocSRAM", 0, &SavestateRelocSRAM, 0, NULL, 0},
{"AudioInterp", 0, &AudioInterp, 0, NULL, 0},
+ {"AudioBitrate", 0, &AudioBitrate, 0, NULL, 0},
{"AudioVolume", 0, &AudioVolume, 256, NULL, 0},
{"MicInputType", 0, &MicInputType, 1, NULL, 0},
{"MicWavPath", 1, MicWavPath, 0, "", 1023},
@@ -291,4 +298,81 @@ ConfigEntry PlatformConfigFile[] =
{"", -1, NULL, 0, NULL, 0}
};
+
+void Load()
+{
+ ConfigEntry* entry = &ConfigFile[0];
+ for (;;)
+ {
+ if (!entry->Value) break;
+
+ if (entry->Type == 0)
+ *(int*)entry->Value = entry->DefaultInt;
+ else
+ {
+ strncpy((char*)entry->Value, entry->DefaultStr, entry->StrLength);
+ ((char*)entry->Value)[entry->StrLength] = '\0';
+ }
+
+ entry++;
+ }
+
+ FILE* f = Platform::OpenLocalFile(kConfigFile, "r");
+ if (!f) return;
+
+ char linebuf[1024];
+ char entryname[32];
+ char entryval[1024];
+ while (!feof(f))
+ {
+ if (fgets(linebuf, 1024, f) == nullptr)
+ break;
+
+ int ret = sscanf(linebuf, "%31[A-Za-z_0-9]=%[^\t\r\n]", entryname, entryval);
+ entryname[31] = '\0';
+ if (ret < 2) continue;
+
+ ConfigEntry* entry = &ConfigFile[0];
+ for (;;)
+ {
+ if (!entry->Value) break;
+
+ if (!strncmp(entry->Name, entryname, 32))
+ {
+ if (entry->Type == 0)
+ *(int*)entry->Value = strtol(entryval, NULL, 10);
+ else
+ strncpy((char*)entry->Value, entryval, entry->StrLength);
+
+ break;
+ }
+
+ entry++;
+ }
+ }
+
+ fclose(f);
+}
+
+void Save()
+{
+ FILE* f = Platform::OpenLocalFile(kConfigFile, "w");
+ if (!f) return;
+
+ ConfigEntry* entry = &ConfigFile[0];
+ for (;;)
+ {
+ if (!entry->Value) break;
+
+ if (entry->Type == 0)
+ fprintf(f, "%s=%d\r\n", entry->Name, *(int*)entry->Value);
+ else
+ fprintf(f, "%s=%s\r\n", entry->Name, (char*)entry->Value);
+
+ entry++;
+ }
+
+ fclose(f);
+}
+
}
diff --git a/src/frontend/qt_sdl/PlatformConfig.h b/src/frontend/qt_sdl/Config.h
index 9fe7bbb..5914978 100644
--- a/src/frontend/qt_sdl/PlatformConfig.h
+++ b/src/frontend/qt_sdl/Config.h
@@ -19,8 +19,6 @@
#ifndef PLATFORMCONFIG_H
#define PLATFORMCONFIG_H
-#include "Config.h"
-
enum
{
HK_Lid = 0,
@@ -40,6 +38,17 @@ enum
namespace Config
{
+struct ConfigEntry
+{
+ char Name[32];
+ int Type;
+ void* Value;
+ int DefaultInt;
+ const char* DefaultStr;
+ int StrLength; // should be set to actual array length minus one
+};
+
+
extern int KeyMapping[12];
extern int JoyMapping[12];
@@ -128,6 +137,7 @@ extern int DirectLAN;
extern int SavestateRelocSRAM;
extern int AudioInterp;
+extern int AudioBitrate;
extern int AudioVolume;
extern int MicInputType;
extern char MicWavPath[1024];
@@ -142,6 +152,10 @@ extern int MouseHide;
extern int MouseHideSeconds;
extern int PauseLostFocus;
+
+void Load();
+void Save();
+
}
#endif // PLATFORMCONFIG_H
diff --git a/src/frontend/qt_sdl/EmuSettingsDialog.cpp b/src/frontend/qt_sdl/EmuSettingsDialog.cpp
index 99c6630..379300f 100644
--- a/src/frontend/qt_sdl/EmuSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/EmuSettingsDialog.cpp
@@ -25,7 +25,6 @@
#include "types.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "EmuSettingsDialog.h"
#include "ui_EmuSettingsDialog.h"
diff --git a/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp b/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp
index 834624f..94e5f5a 100644
--- a/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp
@@ -16,7 +16,7 @@
with melonDS. If not, see http://www.gnu.org/licenses/.
*/
-#include "PlatformConfig.h"
+#include "Config.h"
#include "FirmwareSettingsDialog.h"
#include "ui_FirmwareSettingsDialog.h"
diff --git a/src/frontend/qt_sdl/Input.cpp b/src/frontend/qt_sdl/Input.cpp
index 07e5252..cca11e7 100644
--- a/src/frontend/qt_sdl/Input.cpp
+++ b/src/frontend/qt_sdl/Input.cpp
@@ -20,7 +20,7 @@
#include <SDL2/SDL.h>
#include "Input.h"
-#include "PlatformConfig.h"
+#include "Config.h"
namespace Input
diff --git a/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp b/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp
index 4040079..2a50539 100644
--- a/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp
+++ b/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp
@@ -25,7 +25,6 @@
#include "types.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "MapButton.h"
#include "Input.h"
diff --git a/src/frontend/qt_sdl/InterfaceSettingsDialog.cpp b/src/frontend/qt_sdl/InterfaceSettingsDialog.cpp
index 3fad0ff..788e596 100644
--- a/src/frontend/qt_sdl/InterfaceSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/InterfaceSettingsDialog.cpp
@@ -22,7 +22,6 @@
#include "types.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
InterfaceSettingsDialog* InterfaceSettingsDialog::currentDlg = nullptr;
diff --git a/src/frontend/qt_sdl/LAN_PCap.cpp b/src/frontend/qt_sdl/LAN_PCap.cpp
index df647fc..ed3eee9 100644
--- a/src/frontend/qt_sdl/LAN_PCap.cpp
+++ b/src/frontend/qt_sdl/LAN_PCap.cpp
@@ -25,7 +25,7 @@
#include <pcap/pcap.h>
#include "../Wifi.h"
#include "LAN_PCap.h"
-#include "PlatformConfig.h"
+#include "Config.h"
#ifdef __WIN32__
#include <iphlpapi.h>
diff --git a/src/frontend/qt_sdl/LAN_Socket.cpp b/src/frontend/qt_sdl/LAN_Socket.cpp
index b385c6a..83ddd99 100644
--- a/src/frontend/qt_sdl/LAN_Socket.cpp
+++ b/src/frontend/qt_sdl/LAN_Socket.cpp
@@ -23,7 +23,6 @@
#include <string.h>
#include "Wifi.h"
#include "LAN_Socket.h"
-#include "Config.h"
#include "FIFO.h"
#include <slirp/libslirp.h>
diff --git a/src/frontend/qt_sdl/OSD.cpp b/src/frontend/qt_sdl/OSD.cpp
index bc3cd91..d9f75fd 100644
--- a/src/frontend/qt_sdl/OSD.cpp
+++ b/src/frontend/qt_sdl/OSD.cpp
@@ -29,7 +29,7 @@
#include "OSD_shaders.h"
#include "font.h"
-#include "PlatformConfig.h"
+#include "Config.h"
extern MainWindow* mainWindow;
diff --git a/src/frontend/qt_sdl/Platform.cpp b/src/frontend/qt_sdl/Platform.cpp
index c787092..9dfad06 100644
--- a/src/frontend/qt_sdl/Platform.cpp
+++ b/src/frontend/qt_sdl/Platform.cpp
@@ -51,7 +51,7 @@
#include <QOpenGLContext>
#include "Platform.h"
-#include "PlatformConfig.h"
+#include "Config.h"
#include "LAN_Socket.h"
#include "LAN_PCap.h"
#include <string>
@@ -140,6 +140,8 @@ int GetConfigInt(ConfigEntry entry)
case Firm_BirthdayMonth: return Config::FirmwareBirthdayMonth;
case Firm_BirthdayDay: return Config::FirmwareBirthdayDay;
case Firm_Color: return Config::FirmwareFavouriteColour;
+
+ case AudioBitrate: return Config::AudioBitrate;
}
return 0;
diff --git a/src/frontend/qt_sdl/ROMInfoDialog.cpp b/src/frontend/qt_sdl/ROMInfoDialog.cpp
index a0e24e4..9166efe 100644
--- a/src/frontend/qt_sdl/ROMInfoDialog.cpp
+++ b/src/frontend/qt_sdl/ROMInfoDialog.cpp
@@ -25,7 +25,6 @@
#include "NDSCart.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
QString IntToHex(u64 num)
{
diff --git a/src/frontend/qt_sdl/TitleManagerDialog.cpp b/src/frontend/qt_sdl/TitleManagerDialog.cpp
index cf2b735..0a5e65d 100644
--- a/src/frontend/qt_sdl/TitleManagerDialog.cpp
+++ b/src/frontend/qt_sdl/TitleManagerDialog.cpp
@@ -23,7 +23,6 @@
#include "types.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "FrontendUtil.h"
#include "DSi_NAND.h"
diff --git a/src/frontend/qt_sdl/VideoSettingsDialog.cpp b/src/frontend/qt_sdl/VideoSettingsDialog.cpp
index 875b0e4..0c3f13e 100644
--- a/src/frontend/qt_sdl/VideoSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/VideoSettingsDialog.cpp
@@ -23,7 +23,6 @@
#include "types.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "VideoSettingsDialog.h"
#include "ui_VideoSettingsDialog.h"
diff --git a/src/frontend/qt_sdl/WifiSettingsDialog.cpp b/src/frontend/qt_sdl/WifiSettingsDialog.cpp
index 061d914..9c428ba 100644
--- a/src/frontend/qt_sdl/WifiSettingsDialog.cpp
+++ b/src/frontend/qt_sdl/WifiSettingsDialog.cpp
@@ -22,7 +22,6 @@
#include "types.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "LAN_Socket.h"
#include "LAN_PCap.h"
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index fb1caea..99c32e0 100644
--- a/src/frontend/qt_sdl/main.cpp
+++ b/src/frontend/qt_sdl/main.cpp
@@ -75,7 +75,6 @@
#include "Wifi.h"
#include "Platform.h"
#include "Config.h"
-#include "PlatformConfig.h"
#include "Savestate.h"