@ -1,8 +1,6 @@
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Modified by JuanCStar on 2024/03/06
# include <cinttypes>
# include <clocale>
# include <cmath>
@ -225,7 +223,7 @@ void GMainWindow::ShowTelemetryCallout() {
const int GMainWindow : : max_recent_files_item ;
static void RemoveCachedContents ( ) {
const auto cache_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : CacheDir ) ;
const auto cache_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : CacheDir ) ;
const auto offline_fonts = cache_dir / " fonts " ;
const auto offline_manual = cache_dir / " offline_web_applet_manual " ;
const auto offline_legal_information = cache_dir / " offline_web_applet_legal_information " ;
@ -372,13 +370,13 @@ GMainWindow::GMainWindow(std::unique_ptr<QtConfig> config_, bool has_broken_vulk
const auto description = std : : string ( Common : : g_scm_desc ) ;
const auto build_id = std : : string ( Common : : g_build_id ) ;
const auto yuzu_build = fmt : : format ( " S uyu Development Build | {}-{}" , branch_name , description ) ;
const auto suyu_build = fmt : : format ( " s uyu Development Build | {}-{}" , branch_name , description ) ;
const auto override_build =
fmt : : format ( fmt : : runtime ( std : : string ( Common : : g_title_bar_format_idle ) ) , build_id ) ;
const auto yuz u_build_version = override_build . empty ( ) ? yuz u_build : override_build ;
const auto suy u_build_version = override_build . empty ( ) ? suy u_build : override_build ;
const auto processor_count = std : : thread : : hardware_concurrency ( ) ;
LOG_INFO ( Frontend , " Suyu Version: {}" , yuz u_build_version) ;
LOG_INFO ( Frontend , " suyu Version: {}" , suy u_build_version) ;
LogRuntimes ( ) ;
# ifdef ARCHITECTURE_x86_64
const auto & caps = Common : : GetCPUCaps ( ) ;
@ -1338,7 +1336,7 @@ void GMainWindow::InitializeHotkeys() {
LinkActionShortcut ( ui - > action_Load_File , QStringLiteral ( " Load File " ) ) ;
LinkActionShortcut ( ui - > action_Load_Amiibo , QStringLiteral ( " Load/Remove Amiibo " ) ) ;
LinkActionShortcut ( ui - > action_Exit , QStringLiteral ( " Exit yuz u" ) ) ;
LinkActionShortcut ( ui - > action_Exit , QStringLiteral ( " Exit suy u" ) ) ;
LinkActionShortcut ( ui - > action_Restart , QStringLiteral ( " Restart Emulation " ) ) ;
LinkActionShortcut ( ui - > action_Pause , QStringLiteral ( " Continue/Pause Emulation " ) ) ;
LinkActionShortcut ( ui - > action_Stop , QStringLiteral ( " Stop Emulation " ) ) ;
@ -2289,7 +2287,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
switch ( target ) {
case GameListOpenTarget : : SaveData : {
open_target = tr ( " Save Data " ) ;
const auto nand_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : NANDDir ) ;
const auto nand_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : NANDDir ) ;
auto vfs_nand_dir =
vfs - > OpenDirectory ( Common : : FS : : PathToUTF8String ( nand_dir ) , FileSys : : OpenMode : : Read ) ;
@ -2345,7 +2343,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
}
case GameListOpenTarget : : ModData : {
open_target = tr ( " Mod Data " ) ;
path = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : LoadDir ) /
path = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : LoadDir ) /
fmt : : format ( " {:016X} " , program_id ) ;
break ;
}
@ -2367,7 +2365,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
}
void GMainWindow : : OnTransferableShaderCacheOpenFile ( u64 program_id ) {
const auto shader_cache_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : ShaderDir ) ;
const auto shader_cache_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : ShaderDir ) ;
const auto shader_cache_folder_path { shader_cache_dir / fmt : : format ( " {:016x} " , program_id ) } ;
if ( ! Common : : FS : : CreateDirs ( shader_cache_folder_path ) ) {
QMessageBox : : warning ( this , tr ( " Error Opening Transferable Shader Cache " ) ,
@ -2486,7 +2484,7 @@ void GMainWindow::OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryT
RemoveAddOnContent ( program_id , type ) ;
break ;
}
Common : : FS : : RemoveDirRecursively ( Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : CacheDir ) /
Common : : FS : : RemoveDirRecursively ( Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : CacheDir ) /
" game_list " ) ;
game_list - > PopulateAsync ( UISettings : : values . game_dirs ) ;
}
@ -2592,7 +2590,7 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id, GameListRemoveTa
return " " ;
}
} ( ) ;
const auto shader_cache_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : ShaderDir ) ;
const auto shader_cache_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : ShaderDir ) ;
const auto shader_cache_folder_path = shader_cache_dir / fmt : : format ( " {:016x} " , program_id ) ;
const auto target_file = shader_cache_folder_path / target_file_name ;
@ -2613,7 +2611,7 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id, GameListRemoveTa
void GMainWindow : : RemoveVulkanDriverPipelineCache ( u64 program_id ) {
static constexpr std : : string_view target_file_name = " vulkan_pipelines.bin " ;
const auto shader_cache_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : ShaderDir ) ;
const auto shader_cache_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : ShaderDir ) ;
const auto shader_cache_folder_path = shader_cache_dir / fmt : : format ( " {:016x} " , program_id ) ;
const auto target_file = shader_cache_folder_path / target_file_name ;
@ -2627,7 +2625,7 @@ void GMainWindow::RemoveVulkanDriverPipelineCache(u64 program_id) {
}
void GMainWindow : : RemoveAllTransferableShaderCaches ( u64 program_id ) {
const auto shader_cache_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : ShaderDir ) ;
const auto shader_cache_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : ShaderDir ) ;
const auto program_shader_cache_dir = shader_cache_dir / fmt : : format ( " {:016x} " , program_id ) ;
if ( ! Common : : FS : : Exists ( program_shader_cache_dir ) ) {
@ -2650,7 +2648,7 @@ void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& g
program_id = = 0 ? Common : : FS : : PathToUTF8String ( file_path . filename ( ) ) . append ( " .ini " )
: fmt : : format ( " {:016X}.ini " , program_id ) ;
const auto custom_config_file_path =
Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : ConfigDir ) / " custom " / config_file_name ;
Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : ConfigDir ) / " custom " / config_file_name ;
if ( ! Common : : FS : : Exists ( custom_config_file_path ) ) {
QMessageBox : : warning ( this , tr ( " Error Removing Custom Configuration " ) ,
@ -2668,7 +2666,7 @@ void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& g
}
void GMainWindow : : RemoveCacheStorage ( u64 program_id ) {
const auto nand_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : NANDDir ) ;
const auto nand_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : NANDDir ) ;
auto vfs_nand_dir =
vfs - > OpenDirectory ( Common : : FS : : PathToUTF8String ( nand_dir ) , FileSys : : OpenMode : : Read ) ;
@ -2726,8 +2724,8 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa
const auto base_romfs = base_nca - > GetRomFS ( ) ;
const auto dump_dir =
target = = DumpRomFSTarget : : Normal
? Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : DumpDir )
: Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : SDMCDir ) / " atmosphere " / " contents " ;
? Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : DumpDir )
: Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : SDMCDir ) / " atmosphere " / " contents " ;
const auto romfs_dir = fmt : : format ( " {:016X}/romfs " , title_id ) ;
const auto path = Common : : FS : : PathToUTF8String ( dump_dir / romfs_dir ) ;
@ -2985,7 +2983,7 @@ bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_vi
// Get path to Yuzu icons directory & icon extension
std : : string ico_extension = " png " ;
# if defined(_WIN32)
out_icon_path = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : IconsDir ) ;
out_icon_path = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : IconsDir ) ;
ico_extension = " ico " ;
# elif defined(__linux__) || defined(__FreeBSD__)
out_icon_path = Common : : FS : : GetDataDirectory ( " XDG_DATA_HOME " ) / " icons/hicolor/256x256 " ;
@ -3108,13 +3106,13 @@ void GMainWindow::OnGameListOpenDirectory(const QString& directory) {
std : : filesystem : : path fs_path ;
if ( directory = = QStringLiteral ( " SDMC " ) ) {
fs_path =
Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : SDMCDir ) / " Nintendo/Contents/registered " ;
Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : SDMCDir ) / " Nintendo/Contents/registered " ;
} else if ( directory = = QStringLiteral ( " UserNAND " ) ) {
fs_path =
Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : NANDDir ) / " user/Contents/registered " ;
Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : NANDDir ) / " user/Contents/registered " ;
} else if ( directory = = QStringLiteral ( " SysNAND " ) ) {
fs_path =
Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : NANDDir ) / " system/Contents/registered " ;
Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : NANDDir ) / " system/Contents/registered " ;
} else {
fs_path = directory . toStdString ( ) ;
}
@ -3340,7 +3338,7 @@ void GMainWindow::OnMenuInstallToNAND() {
: tr ( " %n file(s) failed to install \n " , " " , failed_files . size ( ) ) ) ;
QMessageBox : : information ( this , tr ( " Install Results " ) , install_results ) ;
Common : : FS : : RemoveDirRecursively ( Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : CacheDir ) /
Common : : FS : : RemoveDirRecursively ( Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : CacheDir ) /
" game_list " ) ;
game_list - > PopulateAsync ( UISettings : : values . game_dirs ) ;
ui - > action_Install_File_NAND - > setEnabled ( true ) ;
@ -3761,11 +3759,11 @@ void GMainWindow::OnConfigure() {
LOG_WARNING ( Frontend , " Failed to remove configuration file " ) ;
}
if ( ! Common : : FS : : RemoveDirContentsRecursively (
Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : ConfigDir ) / " custom " ) ) {
Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : ConfigDir ) / " custom " ) ) {
LOG_WARNING ( Frontend , " Failed to remove custom configuration files " ) ;
}
if ( ! Common : : FS : : RemoveDirRecursively (
Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : CacheDir ) / " game_list " ) ) {
Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : CacheDir ) / " game_list " ) ) {
LOG_WARNING ( Frontend , " Failed to remove game metadata cache files " ) ;
}
@ -4123,7 +4121,7 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
void GMainWindow : : OnOpenYuzuFolder ( ) {
QDesktopServices : : openUrl ( QUrl : : fromLocalFile (
QString : : fromStdString ( Common : : FS : : Get YuzuPathString( Common : : FS : : YuzuPath : : Yuz uDir) ) ) ) ;
QString : : fromStdString ( Common : : FS : : Get SuyuPathString( Common : : FS : : SuyuPath : : Suy uDir) ) ) ) ;
}
void GMainWindow : : OnVerifyInstalledContents ( ) {
@ -4338,7 +4336,7 @@ void GMainWindow::OnInstallDecryptionKeys() {
return ;
}
const auto yuzu_keys_dir = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : KeysDir ) ;
const auto yuzu_keys_dir = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : KeysDir ) ;
for ( auto key_file : source_key_files ) {
std : : filesystem : : path destination_key_file = yuzu_keys_dir / key_file . filename ( ) ;
if ( ! std : : filesystem : : copy_file ( key_file , destination_key_file ,
@ -4491,7 +4489,7 @@ void GMainWindow::OnCaptureScreenshot() {
const u64 title_id = system - > GetApplicationProcessProgramID ( ) ;
const auto screenshot_path =
QString : : fromStdString ( Common : : FS : : Get YuzuPathString( Common : : FS : : Yuz uPath: : ScreenshotsDir ) ) ;
QString : : fromStdString ( Common : : FS : : Get SuyuPathString( Common : : FS : : Suy uPath: : ScreenshotsDir ) ) ;
const auto date =
QDateTime : : currentDateTime ( ) . toString ( QStringLiteral ( " yyyy-MM-dd_hh-mm-ss-zzz " ) ) ;
QString filename = QStringLiteral ( " %1/%2_%3.png " )
@ -4519,7 +4517,7 @@ void GMainWindow::OnCaptureScreenshot() {
// TODO: Written 2020-10-01: Remove per-game config migration code when it is irrelevant
void GMainWindow : : MigrateConfigFiles ( ) {
const auto config_dir_fs_path = Common : : FS : : Get YuzuPath( Common : : FS : : Yuz uPath: : ConfigDir ) ;
const auto config_dir_fs_path = Common : : FS : : Get SuyuPath( Common : : FS : : Suy uPath: : ConfigDir ) ;
const QDir config_dir =
QDir ( QString : : fromStdString ( Common : : FS : : PathToUTF8String ( config_dir_fs_path ) ) ) ;
const QStringList config_dir_list = config_dir . entryList ( QStringList ( QStringLiteral ( " *.ini " ) ) ) ;