diff options
| author | 2019-04-23 08:35:12 -0400 | |
|---|---|---|
| committer | 2019-09-21 16:43:10 -0400 | |
| commit | 2590b5a9ea51f6868cac4322b2e4984d65656541 (patch) | |
| tree | c7d2be3ecac40031e3b34950710b0d234e7e0385 /src | |
| parent | settings: Add options for setting storage sizes (diff) | |
| download | yuzu-2590b5a9ea51f6868cac4322b2e4984d65656541.tar.gz yuzu-2590b5a9ea51f6868cac4322b2e4984d65656541.tar.xz yuzu-2590b5a9ea51f6868cac4322b2e4984d65656541.zip | |
settings: Add options for managing gamecard emulation
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/settings.h | 5 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 36 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 14 |
4 files changed, 67 insertions, 2 deletions
diff --git a/src/core/settings.h b/src/core/settings.h index 51363fc51..47bddfb30 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -407,8 +407,9 @@ struct Values { | |||
| 407 | 407 | ||
| 408 | // Data Storage | 408 | // Data Storage |
| 409 | bool use_virtual_sd; | 409 | bool use_virtual_sd; |
| 410 | std::string nand_dir; | 410 | bool gamecard_inserted; |
| 411 | std::string sdmc_dir; | 411 | bool gamecard_current_game; |
| 412 | std::string gamecard_path; | ||
| 412 | NANDTotalSize nand_total_size; | 413 | NANDTotalSize nand_total_size; |
| 413 | NANDSystemSize nand_system_size; | 414 | NANDSystemSize nand_system_size; |
| 414 | NANDUserSize nand_user_size; | 415 | NANDUserSize nand_user_size; |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index bcd0c0b1b..8113060d0 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -459,6 +459,30 @@ void Config::ReadDataStorageValues() { | |||
| 459 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))) | 459 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))) |
| 460 | .toString() | 460 | .toString() |
| 461 | .toStdString()); | 461 | .toStdString()); |
| 462 | FileUtil::GetUserPath( | ||
| 463 | FileUtil::UserPath::LoadDir, | ||
| 464 | qt_config | ||
| 465 | ->value("load_directory", | ||
| 466 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir))) | ||
| 467 | .toString() | ||
| 468 | .toStdString()); | ||
| 469 | FileUtil::GetUserPath( | ||
| 470 | FileUtil::UserPath::DumpDir, | ||
| 471 | qt_config | ||
| 472 | ->value("dump_directory", | ||
| 473 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::DumpDir))) | ||
| 474 | .toString() | ||
| 475 | .toStdString()); | ||
| 476 | FileUtil::GetUserPath( | ||
| 477 | FileUtil::UserPath::CacheDir, | ||
| 478 | qt_config | ||
| 479 | ->value("cache_directory", | ||
| 480 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::CacheDir))) | ||
| 481 | .toString() | ||
| 482 | .toStdString()); | ||
| 483 | Settings::values.gamecard_inserted = ReadSetting("gamecard_inserted", false).toBool(); | ||
| 484 | Settings::values.gamecard_current_game = ReadSetting("gamecard_current_game", false).toBool(); | ||
| 485 | Settings::values.gamecard_path = ReadSetting("gamecard_path", "").toString().toStdString(); | ||
| 462 | Settings::values.nand_total_size = static_cast<Settings::NANDTotalSize>( | 486 | Settings::values.nand_total_size = static_cast<Settings::NANDTotalSize>( |
| 463 | ReadSetting(QStringLiteral("nand_total_size"), static_cast<u64>(Settings::NANDTotalSize::S29_1GB)) | 487 | ReadSetting(QStringLiteral("nand_total_size"), static_cast<u64>(Settings::NANDTotalSize::S29_1GB)) |
| 464 | .toULongLong()); | 488 | .toULongLong()); |
| @@ -886,6 +910,18 @@ void Config::SaveDataStorageValues() { | |||
| 886 | WriteSetting(QStringLiteral("sdmc_directory"), | 910 | WriteSetting(QStringLiteral("sdmc_directory"), |
| 887 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)), | 911 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)), |
| 888 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))); | 912 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))); |
| 913 | WriteSetting(QStringLiteral("load_directory"), | ||
| 914 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir)), | ||
| 915 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::LoadDir))); | ||
| 916 | WriteSetting(QStringLiteral("dump_directory"), | ||
| 917 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::DumpDir)), | ||
| 918 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::DumpDir))); | ||
| 919 | WriteSetting(QStringLiteral("cache_directory"), | ||
| 920 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::CacheDir)), | ||
| 921 | QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::CacheDir))); | ||
| 922 | WriteSetting(QStringLiteral("gamecard_inserted"), Settings::values.gamecard_inserted, false); | ||
| 923 | WriteSetting(QStringLiteral("gamecard_current_game"), Settings::values.gamecard_current_game, false); | ||
| 924 | WriteSetting(QStringLiteral("gamecard_path"), QString::fromStdString(Settings::values.gamecard_path), ""); | ||
| 889 | WriteSetting(QStringLiteral("nand_total_size"), static_cast<u64>(Settings::values.nand_total_size), | 925 | WriteSetting(QStringLiteral("nand_total_size"), static_cast<u64>(Settings::values.nand_total_size), |
| 890 | static_cast<u64>(Settings::NANDTotalSize::S29_1GB)); | 926 | static_cast<u64>(Settings::NANDTotalSize::S29_1GB)); |
| 891 | WriteSetting(QStringLiteral("nand_user_size"), static_cast<u64>(Settings::values.nand_user_size), | 927 | WriteSetting(QStringLiteral("nand_user_size"), static_cast<u64>(Settings::values.nand_user_size), |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 60e2b2d1b..d82438502 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -316,6 +316,20 @@ void Config::ReadValues() { | |||
| 316 | FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir, | 316 | FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir, |
| 317 | sdl2_config->Get("Data Storage", "sdmc_directory", | 317 | sdl2_config->Get("Data Storage", "sdmc_directory", |
| 318 | FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))); | 318 | FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))); |
| 319 | FileUtil::GetUserPath(FileUtil::UserPath::LoadDir, | ||
| 320 | sdl2_config->Get("Data Storage", "load_directory", | ||
| 321 | FileUtil::GetUserPath(FileUtil::UserPath::LoadDir))); | ||
| 322 | FileUtil::GetUserPath(FileUtil::UserPath::DumpDir, | ||
| 323 | sdl2_config->Get("Data Storage", "dump_directory", | ||
| 324 | FileUtil::GetUserPath(FileUtil::UserPath::DumpDir))); | ||
| 325 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir, | ||
| 326 | sdl2_config->Get("Data Storage", "cache_directory", | ||
| 327 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir))); | ||
| 328 | Settings::values.gamecard_inserted = | ||
| 329 | sdl2_config->GetBoolean("Data Storage", "gamecard_inserted", false); | ||
| 330 | Settings::values.gamecard_current_game = | ||
| 331 | sdl2_config->GetBoolean("Data Storage", "gamecard_current_game", false); | ||
| 332 | Settings::values.gamecard_path = sdl2_config->Get("Data Storage", "gamecard_path", ""); | ||
| 319 | Settings::values.nand_total_size = static_cast<Settings::NANDTotalSize>(sdl2_config->GetInteger( | 333 | Settings::values.nand_total_size = static_cast<Settings::NANDTotalSize>(sdl2_config->GetInteger( |
| 320 | "Data Storage", "nand_total_size", static_cast<long>(Settings::NANDTotalSize::S29_1GB))); | 334 | "Data Storage", "nand_total_size", static_cast<long>(Settings::NANDTotalSize::S29_1GB))); |
| 321 | Settings::values.nand_user_size = static_cast<Settings::NANDUserSize>(sdl2_config->GetInteger( | 335 | Settings::values.nand_user_size = static_cast<Settings::NANDUserSize>(sdl2_config->GetInteger( |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index f9f244522..e66d2f89b 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -173,6 +173,20 @@ volume = | |||
| 173 | # 1 (default): Yes, 0: No | 173 | # 1 (default): Yes, 0: No |
| 174 | use_virtual_sd = | 174 | use_virtual_sd = |
| 175 | 175 | ||
| 176 | # Whether or not to enable gamecard emulation | ||
| 177 | # 1: Yes, 0 (default): No | ||
| 178 | gamecard_inserted = | ||
| 179 | |||
| 180 | # Whether or not the gamecard should be emulated as the current game | ||
| 181 | # If 'gamecard_inserted' is 0 this setting is irrelevant | ||
| 182 | # 1: Yes, 0 (default): No | ||
| 183 | gamecard_current_game = | ||
| 184 | |||
| 185 | # Path to an XCI file to use as the gamecard | ||
| 186 | # If 'gamecard_inserted' is 0 this setting is irrelevant | ||
| 187 | # If 'gamecard_current_game' is 1 this setting is irrelevant | ||
| 188 | gamecard_path = | ||
| 189 | |||
| 176 | [System] | 190 | [System] |
| 177 | # Whether the system is docked | 191 | # Whether the system is docked |
| 178 | # 1: Yes, 0 (default): No | 192 | # 1: Yes, 0 (default): No |