mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-05 20:04:13 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c96d59e4b | |||
| 018210b756 | |||
| 4fc754a5b7 | |||
| 0b9770764f | |||
| 3f6e73290f | |||
| a4184b440f | |||
| 367884e453 | |||
| f7a09f04dd | |||
| 5581da1fb6 | |||
| b58a265336 | |||
| d8832cef70 | |||
| f86995a3b4 |
@@ -28,13 +28,13 @@ object NativeConfig {
|
||||
* Reads values in the global config file and saves them.
|
||||
*/
|
||||
@Synchronized
|
||||
external fun reloadGlobalConfig(): Boolean
|
||||
external fun reloadGlobalConfig()
|
||||
|
||||
/**
|
||||
* Saves global settings values in memory to disk.
|
||||
*/
|
||||
@Synchronized
|
||||
external fun saveGlobalConfig(): Boolean
|
||||
external fun saveGlobalConfig()
|
||||
|
||||
/**
|
||||
* Creates per-game config for the specified parameters. Must be unloaded once per-game config
|
||||
@@ -54,7 +54,7 @@ object NativeConfig {
|
||||
* Saves per-game settings values in memory to disk.
|
||||
*/
|
||||
@Synchronized
|
||||
external fun savePerGameConfig(): Boolean
|
||||
external fun savePerGameConfig()
|
||||
|
||||
/**
|
||||
* Destroys the stored per-game config object. This does not save the config.
|
||||
|
||||
@@ -45,16 +45,12 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_unloadGlobalConfig(JNIEnv* env,
|
||||
global_config.reset();
|
||||
}
|
||||
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_reloadGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
if (global_config)
|
||||
global_config->AndroidConfig::ReloadAllValues();
|
||||
return global_config != nullptr;
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_reloadGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
global_config->AndroidConfig::ReloadAllValues();
|
||||
}
|
||||
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_saveGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
if (global_config)
|
||||
global_config->AndroidConfig::SaveAllValues();
|
||||
return global_config != nullptr;
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_saveGlobalConfig(JNIEnv* env, jobject obj) {
|
||||
global_config->AndroidConfig::SaveAllValues();
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_initializePerGameConfig(JNIEnv* env, jobject obj,
|
||||
@@ -67,14 +63,13 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_initializePerGameConfig(JNIEnv*
|
||||
std::make_unique<AndroidConfig>(config_file_name, Config::ConfigType::PerGameConfig);
|
||||
}
|
||||
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_isPerGameConfigLoaded(JNIEnv* env, jobject obj) {
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_isPerGameConfigLoaded(JNIEnv* env,
|
||||
jobject obj) {
|
||||
return per_game_config != nullptr;
|
||||
}
|
||||
|
||||
jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_savePerGameConfig(JNIEnv* env, jobject obj) {
|
||||
if (per_game_config)
|
||||
per_game_config->AndroidConfig::SaveAllValues();
|
||||
return per_game_config != nullptr;
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_savePerGameConfig(JNIEnv* env, jobject obj) {
|
||||
per_game_config->AndroidConfig::SaveAllValues();
|
||||
}
|
||||
|
||||
void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_unloadPerGameConfig(JNIEnv* env, jobject obj) {
|
||||
|
||||
@@ -120,7 +120,7 @@ std::array<u8, 32> IPSwitchCompiler::GetBuildID() const {
|
||||
|
||||
static IPSwitchRecord EscapeStringSequences(std::string_view sv) {
|
||||
IPSwitchRecord r{};
|
||||
for (auto it = sv.cbegin(); it != sv.cend(); ) {
|
||||
for (auto it = sv.cbegin(); it < sv.cend(); ) {
|
||||
if (*it == '\\' && it + 1 < sv.cend()) {
|
||||
switch (it[1]) {
|
||||
case 'a': r.data[r.count] = '\a'; break;
|
||||
@@ -198,6 +198,8 @@ void IPSwitchCompiler::Parse(std::span<u8 const> bytes) {
|
||||
LOG_WARNING(Loader, "Unknown flag {}", line);
|
||||
break;
|
||||
}
|
||||
} else if (patches.empty()) {
|
||||
LOG_WARNING(Loader, "Invalid line not in a patch {}", line);
|
||||
} else {
|
||||
size_t offset = size_t(std::strtoul(line.data(), nullptr, 16));
|
||||
offset += size_t(offset_shift);
|
||||
@@ -253,25 +255,30 @@ void IPSwitchCompiler::Parse(std::span<u8 const> bytes) {
|
||||
// now make a nominal preprocessed line: remove comments
|
||||
char quote = '\0';
|
||||
auto const sline_start = p;
|
||||
auto last_char = p;
|
||||
for (; p < sline.cend(); ) {
|
||||
// we dont check for "//", IPS checks for '/' only...
|
||||
if ((!quote && p[0] == '/')
|
||||
if (std::isspace(*p)) {
|
||||
++p;
|
||||
} else if ((!quote && p[0] == '/')
|
||||
|| (!quote && p[0] == '#')) {
|
||||
break;
|
||||
} else if (p[0] == '\"' || p[0] == '\'') {
|
||||
quote = (p[0] == quote) ? '\0' : p[0];
|
||||
++p;
|
||||
last_char = p;
|
||||
} else if (p + 1 < sline.cend() && p[0] == '\\') {
|
||||
p += 2;
|
||||
last_char = p;
|
||||
} else {
|
||||
++p;
|
||||
last_char = p;
|
||||
}
|
||||
}
|
||||
// now we have the preprocessed string ;)
|
||||
std::string_view pp_str(sline_start, p);
|
||||
if (pp_str.size() > 0 && !parse_line(pp_str)) {
|
||||
std::string_view const pp_str(sline_start, last_char);
|
||||
if (pp_str.size() > 0 && !parse_line(pp_str))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user