ew global variable
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <cassert>
|
||||
#include <core/JIT.hpp>
|
||||
#include <unarr.h>
|
||||
#include <Options.hpp>
|
||||
|
||||
namespace n64 {
|
||||
Mem::Mem(Registers ®s, ParallelRDP ¶llel, JIT *jit) : mmio(*this, regs, parallel), flash(saveData), jit(jit) {
|
||||
@@ -28,6 +29,7 @@ void Mem::Reset() {
|
||||
void Mem::LoadSRAM(SaveType save_type, fs::path path) {
|
||||
if (save_type == SAVE_SRAM_256k) {
|
||||
std::error_code error;
|
||||
std::string savePath = Options::GetInstance().GetValue<std::string>("general", "savePath");
|
||||
if (!savePath.empty()) {
|
||||
path = savePath / path.filename();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <Mem.hpp>
|
||||
#include <cassert>
|
||||
#include <Options.hpp>
|
||||
|
||||
namespace n64 {
|
||||
constexpr auto FLASH_SIZE = 1_mb;
|
||||
@@ -18,6 +19,7 @@ void Flash::Reset() {
|
||||
void Flash::Load(SaveType saveType, const std::string &path) {
|
||||
if (saveType == SAVE_FLASH_1m) {
|
||||
fs::path flashPath_ = path;
|
||||
std::string savePath = Options::GetInstance().GetValue<std::string>("general", "savePath");
|
||||
if (!savePath.empty()) {
|
||||
flashPath_ = savePath / flashPath_.filename();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <core/mmio/PIF.hpp>
|
||||
#include <core/registers/Registers.hpp>
|
||||
#include <log.hpp>
|
||||
#include <Options.hpp>
|
||||
|
||||
#define MEMPAK_SIZE 32768
|
||||
|
||||
@@ -37,6 +38,7 @@ void PIF::Reset() {
|
||||
void PIF::MaybeLoadMempak() {
|
||||
if (!mempakOpen) {
|
||||
fs::path mempakPath_ = mempakPath;
|
||||
std::string savePath = Options::GetInstance().GetValue<std::string>("general", "savePath");
|
||||
if (!savePath.empty()) {
|
||||
mempakPath_ = savePath / mempakPath_.filename();
|
||||
}
|
||||
@@ -88,6 +90,7 @@ FORCE_INLINE size_t GetSaveSize(SaveType saveType) {
|
||||
void PIF::LoadEeprom(const SaveType saveType, const std::string &path) {
|
||||
if (saveType == SAVE_EEPROM_16k || saveType == SAVE_EEPROM_4k) {
|
||||
fs::path eepromPath_ = path;
|
||||
std::string savePath = Options::GetInstance().GetValue<std::string>("general", "savePath");
|
||||
if (!savePath.empty()) {
|
||||
eepromPath_ = savePath / eepromPath_.filename();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ using m128i = __m128i;
|
||||
|
||||
constexpr u32 N64_CPU_FREQ = 93750000;
|
||||
constexpr u16 KAIZEN_VERSION = 0x010;
|
||||
extern std::string savePath;
|
||||
|
||||
static FORCE_INLINE constexpr u32 GetCyclesPerFrame(bool pal) {
|
||||
if (pal) {
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include <Options.hpp>
|
||||
#include <imgui.h>
|
||||
|
||||
std::string savePath;
|
||||
SettingsWindow::SettingsWindow(gui::NativeWindow& window) : window(window) {
|
||||
savesPath = Options::GetInstance().GetValue<std::string>("general", "savePath");
|
||||
}
|
||||
|
||||
bool SettingsWindow::render() {
|
||||
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||
|
||||
Reference in New Issue
Block a user