mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-08-28 05:06:02 +00:00
Add setting for toggling fastmem
This commit is contained in:
parent
c0794dd3d5
commit
8d67685b93
5 changed files with 13 additions and 3 deletions
|
@ -2,10 +2,10 @@
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "screen_layout.hpp"
|
|
||||||
#include "audio/dsp_core.hpp"
|
#include "audio/dsp_core.hpp"
|
||||||
#include "frontend_settings.hpp"
|
#include "frontend_settings.hpp"
|
||||||
#include "renderer.hpp"
|
#include "renderer.hpp"
|
||||||
|
#include "screen_layout.hpp"
|
||||||
#include "services/region_codes.hpp"
|
#include "services/region_codes.hpp"
|
||||||
|
|
||||||
struct AudioDeviceConfig {
|
struct AudioDeviceConfig {
|
||||||
|
@ -58,11 +58,13 @@ struct EmulatorConfig {
|
||||||
static constexpr RendererType rendererDefault = RendererType::OpenGL;
|
static constexpr RendererType rendererDefault = RendererType::OpenGL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static constexpr bool enableFastmemDefault = true;
|
||||||
static constexpr bool hashTexturesDefault = false;
|
static constexpr bool hashTexturesDefault = false;
|
||||||
|
|
||||||
bool shaderJitEnabled = shaderJitDefault;
|
bool shaderJitEnabled = shaderJitDefault;
|
||||||
bool useUbershaders = ubershaderDefault;
|
bool useUbershaders = ubershaderDefault;
|
||||||
bool accelerateShaders = accelerateShadersDefault;
|
bool accelerateShaders = accelerateShadersDefault;
|
||||||
|
bool fastmemEnabled = enableFastmemDefault;
|
||||||
bool hashTextures = hashTexturesDefault;
|
bool hashTextures = hashTexturesDefault;
|
||||||
|
|
||||||
ScreenLayout::Layout screenLayout = ScreenLayout::Layout::Default;
|
ScreenLayout::Layout screenLayout = ScreenLayout::Layout::Default;
|
||||||
|
|
|
@ -39,6 +39,7 @@ enum class ROMType {
|
||||||
};
|
};
|
||||||
|
|
||||||
class Emulator {
|
class Emulator {
|
||||||
|
// Config should be initialized before anything else
|
||||||
EmulatorConfig config;
|
EmulatorConfig config;
|
||||||
|
|
||||||
Memory memory;
|
Memory memory;
|
||||||
|
|
|
@ -48,6 +48,7 @@ void EmulatorConfig::load() {
|
||||||
|
|
||||||
printAppVersion = toml::find_or<toml::boolean>(general, "PrintAppVersion", true);
|
printAppVersion = toml::find_or<toml::boolean>(general, "PrintAppVersion", true);
|
||||||
circlePadProEnabled = toml::find_or<toml::boolean>(general, "EnableCirclePadPro", true);
|
circlePadProEnabled = toml::find_or<toml::boolean>(general, "EnableCirclePadPro", true);
|
||||||
|
fastmemEnabled = toml::find_or<toml::boolean>(general, "EnableFastmem", enableFastmemDefault);
|
||||||
systemLanguage = languageCodeFromString(toml::find_or<std::string>(general, "SystemLanguage", "en"));
|
systemLanguage = languageCodeFromString(toml::find_or<std::string>(general, "SystemLanguage", "en"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,6 +181,7 @@ void EmulatorConfig::save() {
|
||||||
data["General"]["PrintAppVersion"] = printAppVersion;
|
data["General"]["PrintAppVersion"] = printAppVersion;
|
||||||
data["General"]["SystemLanguage"] = languageCodeToString(systemLanguage);
|
data["General"]["SystemLanguage"] = languageCodeToString(systemLanguage);
|
||||||
data["General"]["EnableCirclePadPro"] = circlePadProEnabled;
|
data["General"]["EnableCirclePadPro"] = circlePadProEnabled;
|
||||||
|
data["General"]["EnableFastmem"] = fastmemEnabled;
|
||||||
|
|
||||||
data["Window"]["AppVersionOnWindow"] = windowSettings.showAppVersion;
|
data["Window"]["AppVersionOnWindow"] = windowSettings.showAppVersion;
|
||||||
data["Window"]["RememberWindowPosition"] = windowSettings.rememberPosition;
|
data["Window"]["RememberWindowPosition"] = windowSettings.rememberPosition;
|
||||||
|
|
|
@ -16,7 +16,8 @@ CMRC_DECLARE(ConsoleFonts);
|
||||||
using namespace KernelMemoryTypes;
|
using namespace KernelMemoryTypes;
|
||||||
|
|
||||||
Memory::Memory(KFcram& fcramManager, const EmulatorConfig& config) : fcramManager(fcramManager), config(config) {
|
Memory::Memory(KFcram& fcramManager, const EmulatorConfig& config) : fcramManager(fcramManager), config(config) {
|
||||||
arena = new Common::HostMemory(FASTMEM_BACKING_SIZE, FASTMEM_VIRTUAL_SIZE, false);
|
const bool fastmemEnabled = config.fastmemEnabled;
|
||||||
|
arena = new Common::HostMemory(FASTMEM_BACKING_SIZE, FASTMEM_VIRTUAL_SIZE, fastmemEnabled);
|
||||||
|
|
||||||
readTable.resize(totalPageCount, 0);
|
readTable.resize(totalPageCount, 0);
|
||||||
writeTable.resize(totalPageCount, 0);
|
writeTable.resize(totalPageCount, 0);
|
||||||
|
@ -24,7 +25,7 @@ Memory::Memory(KFcram& fcramManager, const EmulatorConfig& config) : fcramManage
|
||||||
|
|
||||||
fcram = arena->BackingBasePointer() + FASTMEM_FCRAM_OFFSET;
|
fcram = arena->BackingBasePointer() + FASTMEM_FCRAM_OFFSET;
|
||||||
// arenaDSPRam = arena->BackingBasePointer() + FASTMEM_DSP_RAM_OFFSET;
|
// arenaDSPRam = arena->BackingBasePointer() + FASTMEM_DSP_RAM_OFFSET;
|
||||||
useFastmem = arena->VirtualBasePointer() != nullptr;
|
useFastmem = fastmemEnabled && arena->VirtualBasePointer() != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Memory::reset() {
|
void Memory::reset() {
|
||||||
|
|
|
@ -172,6 +172,10 @@ ConfigWindow::ConfigWindow(ConfigCallback configCallback, MainWindowCallback win
|
||||||
connectCheckbox(circlePadProEnabled, config.circlePadProEnabled);
|
connectCheckbox(circlePadProEnabled, config.circlePadProEnabled);
|
||||||
genLayout->addRow(circlePadProEnabled);
|
genLayout->addRow(circlePadProEnabled);
|
||||||
|
|
||||||
|
QCheckBox* fastmemEnabled = new QCheckBox(tr("Enable fastmem"));
|
||||||
|
connectCheckbox(fastmemEnabled, config.fastmemEnabled);
|
||||||
|
genLayout->addRow(fastmemEnabled);
|
||||||
|
|
||||||
QCheckBox* discordRpcEnabled = new QCheckBox(tr("Enable Discord RPC"));
|
QCheckBox* discordRpcEnabled = new QCheckBox(tr("Enable Discord RPC"));
|
||||||
connectCheckbox(discordRpcEnabled, config.discordRpcEnabled);
|
connectCheckbox(discordRpcEnabled, config.discordRpcEnabled);
|
||||||
genLayout->addRow(discordRpcEnabled);
|
genLayout->addRow(discordRpcEnabled);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue