finally decouple Config from the core. baahhahahahah
This commit is contained in:
parent
65c2a844ac
commit
19ddaee13b
|
@ -24,7 +24,6 @@
|
||||||
#include "ARMInterpreter.h"
|
#include "ARMInterpreter.h"
|
||||||
#include "AREngine.h"
|
#include "AREngine.h"
|
||||||
#include "ARMJIT.h"
|
#include "ARMJIT.h"
|
||||||
#include "Config.h"
|
|
||||||
|
|
||||||
#ifdef JIT_ENABLED
|
#ifdef JIT_ENABLED
|
||||||
#include "ARMJIT.h"
|
#include "ARMJIT.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
#include "../ARMJIT_Internal.h"
|
#include "../ARMJIT_Internal.h"
|
||||||
#include "../ARMInterpreter.h"
|
#include "../ARMInterpreter.h"
|
||||||
#include "../Config.h"
|
|
||||||
|
|
||||||
#ifdef __SWITCH__
|
#ifdef __SWITCH__
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "ARMJIT_Compiler.h"
|
#include "ARMJIT_Compiler.h"
|
||||||
|
|
||||||
#include "../ARMInterpreter.h"
|
#include "../ARMInterpreter.h"
|
||||||
#include "../Config.h"
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#include "ARMJIT_Compiler.h"
|
#include "ARMJIT_Compiler.h"
|
||||||
|
|
||||||
#include "../Config.h"
|
|
||||||
|
|
||||||
using namespace Gen;
|
using namespace Gen;
|
||||||
|
|
||||||
namespace ARMJIT
|
namespace ARMJIT
|
||||||
|
|
|
@ -11,7 +11,6 @@ add_library(core STATIC
|
||||||
ARMInterpreter_ALU.cpp
|
ARMInterpreter_ALU.cpp
|
||||||
ARMInterpreter_Branch.cpp
|
ARMInterpreter_Branch.cpp
|
||||||
ARMInterpreter_LoadStore.cpp
|
ARMInterpreter_LoadStore.cpp
|
||||||
Config.cpp
|
|
||||||
CP15.cpp
|
CP15.cpp
|
||||||
CRC32.cpp
|
CRC32.cpp
|
||||||
DMA.cpp
|
DMA.cpp
|
||||||
|
|
143
src/Config.cpp
143
src/Config.cpp
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
49
src/Config.h
49
src/Config.h
|
@ -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
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "DSi_SD.h"
|
#include "DSi_SD.h"
|
||||||
#include "DSi_NWifi.h"
|
#include "DSi_NWifi.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
|
||||||
|
|
||||||
|
|
||||||
// observed IRQ behavior during transfers
|
// observed IRQ behavior during transfers
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "NDS.h"
|
#include "NDS.h"
|
||||||
#include "GPU.h"
|
#include "GPU.h"
|
||||||
#include "FIFO.h"
|
#include "FIFO.h"
|
||||||
#include "Config.h"
|
|
||||||
|
|
||||||
|
|
||||||
// 3D engine notes
|
// 3D engine notes
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "NDS.h"
|
#include "NDS.h"
|
||||||
#include "GPU.h"
|
#include "GPU.h"
|
||||||
#include "Config.h"
|
|
||||||
#include "GPU3D_OpenGL_shaders.h"
|
#include "GPU3D_OpenGL_shaders.h"
|
||||||
|
|
||||||
namespace GPU3D
|
namespace GPU3D
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "NDS.h"
|
#include "NDS.h"
|
||||||
#include "GPU.h"
|
#include "GPU.h"
|
||||||
#include "Config.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace GPU3D
|
namespace GPU3D
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include "NDS.h"
|
#include "NDS.h"
|
||||||
#include "GPU.h"
|
#include "GPU.h"
|
||||||
#include "Config.h"
|
|
||||||
#include "OpenGLSupport.h"
|
#include "OpenGLSupport.h"
|
||||||
#include "GPU_OpenGL_shaders.h"
|
#include "GPU_OpenGL_shaders.h"
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "Config.h"
|
|
||||||
#include "NDS.h"
|
#include "NDS.h"
|
||||||
#include "ARM.h"
|
#include "ARM.h"
|
||||||
#include "NDSCart.h"
|
#include "NDSCart.h"
|
||||||
|
@ -634,6 +633,8 @@ void Reset()
|
||||||
RTC::Reset();
|
RTC::Reset();
|
||||||
Wifi::Reset();
|
Wifi::Reset();
|
||||||
|
|
||||||
|
// TODO: move the SOUNDBIAS/degrade logic to SPU?
|
||||||
|
|
||||||
// The SOUNDBIAS register does nothing on DSi
|
// The SOUNDBIAS register does nothing on DSi
|
||||||
SPU::SetApplyBias(ConsoleType == 0);
|
SPU::SetApplyBias(ConsoleType == 0);
|
||||||
|
|
||||||
|
@ -646,9 +647,10 @@ void Reset()
|
||||||
degradeAudio = false;
|
degradeAudio = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config::AudioBitrate == 1) // Always 10-bit
|
int bitrate = Platform::GetConfigInt(Platform::AudioBitrate);
|
||||||
|
if (bitrate == 1) // Always 10-bit
|
||||||
degradeAudio = true;
|
degradeAudio = true;
|
||||||
else if (Config::AudioBitrate == 2) // Always 16-bit
|
else if (bitrate == 2) // Always 16-bit
|
||||||
degradeAudio = false;
|
degradeAudio = false;
|
||||||
|
|
||||||
SPU::SetDegrade10Bit(degradeAudio);
|
SPU::SetDegrade10Bit(degradeAudio);
|
||||||
|
|
|
@ -77,6 +77,8 @@ enum ConfigEntry
|
||||||
Firm_BirthdayDay,
|
Firm_BirthdayDay,
|
||||||
Firm_Color,
|
Firm_Color,
|
||||||
Firm_Message,
|
Firm_Message,
|
||||||
|
|
||||||
|
AudioBitrate,
|
||||||
};
|
};
|
||||||
|
|
||||||
int GetConfigInt(ConfigEntry entry);
|
int GetConfigInt(ConfigEntry entry);
|
||||||
|
|
|
@ -99,6 +99,8 @@ bool Init()
|
||||||
AudioLock = Platform::Mutex_Create();
|
AudioLock = Platform::Mutex_Create();
|
||||||
|
|
||||||
InterpType = 0;
|
InterpType = 0;
|
||||||
|
ApplyBias = true;
|
||||||
|
Degrade10Bit = false;
|
||||||
|
|
||||||
// generate interpolation tables
|
// generate interpolation tables
|
||||||
// values are 1:1:14 fixed-point
|
// values are 1:1:14 fixed-point
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "ArchiveUtil.h"
|
#include "ArchiveUtil.h"
|
||||||
#endif
|
#endif
|
||||||
#include "FrontendUtil.h"
|
#include "FrontendUtil.h"
|
||||||
#include "Config.h"
|
|
||||||
#include "SharedConfig.h"
|
#include "SharedConfig.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
#include "AudioSettingsDialog.h"
|
#include "AudioSettingsDialog.h"
|
||||||
#include "ui_AudioSettingsDialog.h"
|
#include "ui_AudioSettingsDialog.h"
|
||||||
|
|
|
@ -4,6 +4,7 @@ SET(SOURCES_QT_SDL
|
||||||
main.cpp
|
main.cpp
|
||||||
main_shaders.h
|
main_shaders.h
|
||||||
CheatsDialog.cpp
|
CheatsDialog.cpp
|
||||||
|
Config.cpp
|
||||||
EmuSettingsDialog.cpp
|
EmuSettingsDialog.cpp
|
||||||
InputConfig/InputConfigDialog.cpp
|
InputConfig/InputConfigDialog.cpp
|
||||||
InputConfig/MapButton.h
|
InputConfig/MapButton.h
|
||||||
|
@ -22,7 +23,6 @@ SET(SOURCES_QT_SDL
|
||||||
OSD_shaders.h
|
OSD_shaders.h
|
||||||
font.h
|
font.h
|
||||||
Platform.cpp
|
Platform.cpp
|
||||||
PlatformConfig.cpp
|
|
||||||
QPathInput.h
|
QPathInput.h
|
||||||
|
|
||||||
ArchiveUtil.h
|
ArchiveUtil.h
|
||||||
|
@ -33,6 +33,7 @@ SET(SOURCES_QT_SDL
|
||||||
../Util_Audio.cpp
|
../Util_Audio.cpp
|
||||||
../FrontendUtil.h
|
../FrontendUtil.h
|
||||||
../mic_blow.h
|
../mic_blow.h
|
||||||
|
../SharedConfig.h
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/res/melon.qrc
|
${CMAKE_SOURCE_DIR}/res/melon.qrc
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
#include "CheatsDialog.h"
|
#include "CheatsDialog.h"
|
||||||
#include "ui_CheatsDialog.h"
|
#include "ui_CheatsDialog.h"
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "PlatformConfig.h"
|
#include "Platform.h"
|
||||||
|
#include "Config.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Config
|
namespace Config
|
||||||
{
|
{
|
||||||
|
@ -112,6 +114,7 @@ int DirectLAN;
|
||||||
int SavestateRelocSRAM;
|
int SavestateRelocSRAM;
|
||||||
|
|
||||||
int AudioInterp;
|
int AudioInterp;
|
||||||
|
int AudioBitrate;
|
||||||
int AudioVolume;
|
int AudioVolume;
|
||||||
int MicInputType;
|
int MicInputType;
|
||||||
char MicWavPath[1024];
|
char MicWavPath[1024];
|
||||||
|
@ -127,7 +130,10 @@ int MouseHideSeconds;
|
||||||
|
|
||||||
int PauseLostFocus;
|
int PauseLostFocus;
|
||||||
|
|
||||||
ConfigEntry PlatformConfigFile[] =
|
|
||||||
|
const char* kConfigFile = "melonDS.ini";
|
||||||
|
|
||||||
|
ConfigEntry ConfigFile[] =
|
||||||
{
|
{
|
||||||
{"Key_A", 0, &KeyMapping[0], -1, NULL, 0},
|
{"Key_A", 0, &KeyMapping[0], -1, NULL, 0},
|
||||||
{"Key_B", 0, &KeyMapping[1], -1, NULL, 0},
|
{"Key_B", 0, &KeyMapping[1], -1, NULL, 0},
|
||||||
|
@ -265,6 +271,7 @@ ConfigEntry PlatformConfigFile[] =
|
||||||
{"SavStaRelocSRAM", 0, &SavestateRelocSRAM, 0, NULL, 0},
|
{"SavStaRelocSRAM", 0, &SavestateRelocSRAM, 0, NULL, 0},
|
||||||
|
|
||||||
{"AudioInterp", 0, &AudioInterp, 0, NULL, 0},
|
{"AudioInterp", 0, &AudioInterp, 0, NULL, 0},
|
||||||
|
{"AudioBitrate", 0, &AudioBitrate, 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},
|
||||||
|
@ -291,4 +298,81 @@ ConfigEntry PlatformConfigFile[] =
|
||||||
{"", -1, NULL, 0, NULL, 0}
|
{"", -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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -19,8 +19,6 @@
|
||||||
#ifndef PLATFORMCONFIG_H
|
#ifndef PLATFORMCONFIG_H
|
||||||
#define PLATFORMCONFIG_H
|
#define PLATFORMCONFIG_H
|
||||||
|
|
||||||
#include "Config.h"
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
HK_Lid = 0,
|
HK_Lid = 0,
|
||||||
|
@ -40,6 +38,17 @@ enum
|
||||||
namespace Config
|
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 KeyMapping[12];
|
||||||
extern int JoyMapping[12];
|
extern int JoyMapping[12];
|
||||||
|
|
||||||
|
@ -128,6 +137,7 @@ extern int DirectLAN;
|
||||||
extern int SavestateRelocSRAM;
|
extern int SavestateRelocSRAM;
|
||||||
|
|
||||||
extern int AudioInterp;
|
extern int AudioInterp;
|
||||||
|
extern int AudioBitrate;
|
||||||
extern int AudioVolume;
|
extern int AudioVolume;
|
||||||
extern int MicInputType;
|
extern int MicInputType;
|
||||||
extern char MicWavPath[1024];
|
extern char MicWavPath[1024];
|
||||||
|
@ -142,6 +152,10 @@ extern int MouseHide;
|
||||||
extern int MouseHideSeconds;
|
extern int MouseHideSeconds;
|
||||||
extern int PauseLostFocus;
|
extern int PauseLostFocus;
|
||||||
|
|
||||||
|
|
||||||
|
void Load();
|
||||||
|
void Save();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // PLATFORMCONFIG_H
|
#endif // PLATFORMCONFIG_H
|
|
@ -25,7 +25,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
#include "EmuSettingsDialog.h"
|
#include "EmuSettingsDialog.h"
|
||||||
#include "ui_EmuSettingsDialog.h"
|
#include "ui_EmuSettingsDialog.h"
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
with melonDS. If not, see http://www.gnu.org/licenses/.
|
with melonDS. If not, see http://www.gnu.org/licenses/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "PlatformConfig.h"
|
#include "Config.h"
|
||||||
#include "FirmwareSettingsDialog.h"
|
#include "FirmwareSettingsDialog.h"
|
||||||
#include "ui_FirmwareSettingsDialog.h"
|
#include "ui_FirmwareSettingsDialog.h"
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
#include "Input.h"
|
#include "Input.h"
|
||||||
#include "PlatformConfig.h"
|
#include "Config.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Input
|
namespace Input
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
#include "MapButton.h"
|
#include "MapButton.h"
|
||||||
#include "Input.h"
|
#include "Input.h"
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
InterfaceSettingsDialog* InterfaceSettingsDialog::currentDlg = nullptr;
|
InterfaceSettingsDialog* InterfaceSettingsDialog::currentDlg = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include <pcap/pcap.h>
|
#include <pcap/pcap.h>
|
||||||
#include "../Wifi.h"
|
#include "../Wifi.h"
|
||||||
#include "LAN_PCap.h"
|
#include "LAN_PCap.h"
|
||||||
#include "PlatformConfig.h"
|
#include "Config.h"
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "Wifi.h"
|
#include "Wifi.h"
|
||||||
#include "LAN_Socket.h"
|
#include "LAN_Socket.h"
|
||||||
#include "Config.h"
|
|
||||||
#include "FIFO.h"
|
#include "FIFO.h"
|
||||||
|
|
||||||
#include <slirp/libslirp.h>
|
#include <slirp/libslirp.h>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "OSD_shaders.h"
|
#include "OSD_shaders.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
|
|
||||||
#include "PlatformConfig.h"
|
#include "Config.h"
|
||||||
|
|
||||||
extern MainWindow* mainWindow;
|
extern MainWindow* mainWindow;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
#include <QOpenGLContext>
|
#include <QOpenGLContext>
|
||||||
|
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "PlatformConfig.h"
|
#include "Config.h"
|
||||||
#include "LAN_Socket.h"
|
#include "LAN_Socket.h"
|
||||||
#include "LAN_PCap.h"
|
#include "LAN_PCap.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -140,6 +140,8 @@ int GetConfigInt(ConfigEntry entry)
|
||||||
case Firm_BirthdayMonth: return Config::FirmwareBirthdayMonth;
|
case Firm_BirthdayMonth: return Config::FirmwareBirthdayMonth;
|
||||||
case Firm_BirthdayDay: return Config::FirmwareBirthdayDay;
|
case Firm_BirthdayDay: return Config::FirmwareBirthdayDay;
|
||||||
case Firm_Color: return Config::FirmwareFavouriteColour;
|
case Firm_Color: return Config::FirmwareFavouriteColour;
|
||||||
|
|
||||||
|
case AudioBitrate: return Config::AudioBitrate;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "NDSCart.h"
|
#include "NDSCart.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
QString IntToHex(u64 num)
|
QString IntToHex(u64 num)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
#include "FrontendUtil.h"
|
#include "FrontendUtil.h"
|
||||||
#include "DSi_NAND.h"
|
#include "DSi_NAND.h"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
#include "VideoSettingsDialog.h"
|
#include "VideoSettingsDialog.h"
|
||||||
#include "ui_VideoSettingsDialog.h"
|
#include "ui_VideoSettingsDialog.h"
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
#include "LAN_Socket.h"
|
#include "LAN_Socket.h"
|
||||||
#include "LAN_PCap.h"
|
#include "LAN_PCap.h"
|
||||||
|
|
|
@ -75,7 +75,6 @@
|
||||||
#include "Wifi.h"
|
#include "Wifi.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlatformConfig.h"
|
|
||||||
|
|
||||||
#include "Savestate.h"
|
#include "Savestate.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue