Add LLE modules for online features option + AM Refactor w/ various improvements/fixes

- Added option to enable required LLE modules for online features.
- (Android) Fixed bug that would cause FS RenameFile to fail sometimes on Android.
- (Android) Moved New 3DS mode and LLE applets to system settings tab on Android.
- (Android) Fixed cfg save data related issues (mostly Console ID).
- Made AM title scanning asynchronous, which makes game boot way faster on Android on most cases.
- Made more AM functions asynchronous, to prevent stutter.
- Fixed bug in SOC that could cause the emulator to crash when disconnecting.
- Fixed keys not being initialized when processing console unique files.
This commit is contained in:
PabloMK7
2025-03-13 20:47:21 +00:00
committed by OpenSauce04
parent 518b3d7432
commit d5745cae8f
31 changed files with 646 additions and 254 deletions

View File

@@ -516,11 +516,16 @@ bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory,
return true;
}
u64 ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
unsigned int recursion) {
const auto callback = [recursion, &parent_entry](u64* num_entries_out,
const std::string& directory,
const std::string& virtual_name) -> bool {
u64 ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry, unsigned int recursion,
std::atomic<bool>* stop_flag) {
const auto callback = [recursion, &parent_entry,
stop_flag](u64* num_entries_out, const std::string& directory,
const std::string& virtual_name) -> bool {
// Break early and return error if stop is requested
if (stop_flag && *stop_flag) {
return false;
}
FSTEntry entry;
entry.virtualName = virtual_name;
entry.physicalName = directory + DIR_SEP + virtual_name;

View File

@@ -8,6 +8,7 @@
#pragma once
#include <array>
#include <atomic>
#include <cstdio>
#include <functional>
#include <ios>
@@ -170,10 +171,11 @@ bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory,
* @param directory the parent directory to start scanning from
* @param parent_entry FSTEntry where the filesystem tree results will be stored.
* @param recursion Number of children directories to read before giving up.
* @param stop_flag Optional stop flag, the scan will stop if it becomes true
* @return the total number of files/directories found
*/
u64 ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
unsigned int recursion = 0);
unsigned int recursion = 0, std::atomic<bool>* stop_flag = nullptr);
/**
* Recursively searches through a FSTEntry for files, and stores them.

View File

@@ -1,4 +1,4 @@
// Copyright 2024 Azahar Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -40,7 +40,7 @@ HackManager hack_manager = {
.affected_title_ids =
{
// The Legend of Zelda: Ocarina of Time 3D
0x0004000000033400, // JAP
0x0004000000033400, // JPN
0x0004000000033500, // USA
0x0004000000033600, // EUR
0x000400000008F800, // KOR
@@ -49,12 +49,12 @@ HackManager hack_manager = {
// Mario & Luigi: Superstar Saga + Bowsers Minions
0x00040000001B8F00, // USA
0x00040000001B9000, // EUR
0x0004000000194B00, // JAP
0x0004000000194B00, // JPN
// Mario & Luigi: Bowsers Inside Story + Bowser Jrs Journey
0x00040000001D1400, // USA
0x00040000001D1500, // EUR
0x00040000001CA900, // JAP
0x00040000001CA900, // JPN
},
}},
@@ -70,5 +70,43 @@ HackManager hack_manager = {
},
}},
{HackType::ONLINE_LLE_REQUIRED,
HackEntry{
.mode = HackAllowMode::FORCE,
.affected_title_ids =
{
// eShop
0x0004001000020900, // JPN
0x0004001000021900, // USA
0x0004001000022900, // EUR
0x0004001000027900, // KOR
0x0004001000028900, // TWN
// System Settings
0x0004001000020000, // JPN
0x0004001000021000, // USA
0x0004001000022000, // EUR
0x0004001000026000, // CHN
0x0004001000027000, // KOR
0x0004001000028000, // TWN
// Nintendo Network ID Settings
0x000400100002BF00, // JPN
0x000400100002C000, // USA
0x000400100002C100, // EUR
// System Settings
0x0004003000008202, // JPN
0x0004003000008F02, // USA
0x0004003000009802, // EUR
0x000400300000A102, // CHN
0x000400300000A902, // KOR
0x000400300000B102, // TWN
// Pretendo Network's Nimbus
0x000400000D40D200,
},
}},
}};
}

View File

@@ -1,4 +1,4 @@
// Copyright 2024 Azahar Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -12,6 +12,7 @@ enum class HackType : int {
RIGHT_EYE_DISABLE,
ACCURATE_MULTIPLICATION,
DECRYPTION_AUTHORIZED,
ONLINE_LLE_REQUIRED,
};
class UserHackData {};

View File

@@ -1,4 +1,4 @@
// Copyright 2024 Azahar Emulator Project
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -32,6 +32,28 @@ struct HackManager {
return (hack != nullptr) ? hack->mode : default_mode;
}
/**
* Overrides the provided boolean setting depending on the hack type for the title ID
* If there is no hack, or the hack is set to allow, the setting value is returned
* If the hack disallows, false is returned.
* If the hack forces, true is returned.
*/
bool OverrideBooleanSetting(const HackType& type, u64 title_id, bool setting_value) {
const HackEntry* hack = GetHack(type, title_id);
if (hack == nullptr)
return setting_value;
switch (hack->mode) {
case HackAllowMode::DISALLOW:
return false;
case HackAllowMode::FORCE:
return true;
case HackAllowMode::ALLOW:
default:
break;
}
return setting_value;
}
std::multimap<HackType, HackEntry> entries;
};

View File

@@ -450,8 +450,10 @@ struct Values {
Setting<bool> use_cpu_jit{true, "use_cpu_jit"};
SwitchableSetting<s32, true> cpu_clock_percentage{100, 5, 400, "cpu_clock_percentage"};
SwitchableSetting<bool> is_new_3ds{true, "is_new_3ds"};
SwitchableSetting<bool> lle_applets{false, "lle_applets"};
SwitchableSetting<bool> lle_applets{true, "lle_applets"};
SwitchableSetting<bool> deterministic_async_operations{false, "deterministic_async_operations"};
SwitchableSetting<bool> enable_required_online_lle_modules{
false, "enable_required_online_lle_modules"};
// Data Storage
Setting<bool> use_virtual_sd{true, "use_virtual_sd"};