summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/file_util.cpp20
-rw-r--r--src/common/file_util.h8
-rw-r--r--src/core/file_sys/vfs_real.cpp6
-rw-r--r--src/core/loader/deconstructed_rom_directory.cpp2
-rw-r--r--src/video_core/engines/shader_bytecode.h11
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp9
-rw-r--r--src/yuzu/game_list.cpp2
7 files changed, 39 insertions, 19 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index d8163a4a8..47ac8368e 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -396,12 +396,12 @@ bool CreateEmptyFile(const std::string& filename) {
396 return true; 396 return true;
397} 397}
398 398
399bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directory, 399bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory,
400 DirectoryEntryCallable callback) { 400 DirectoryEntryCallable callback) {
401 LOG_TRACE(Common_Filesystem, "directory {}", directory); 401 LOG_TRACE(Common_Filesystem, "directory {}", directory);
402 402
403 // How many files + directories we found 403 // How many files + directories we found
404 unsigned found_entries = 0; 404 u64 found_entries = 0;
405 405
406 // Save the status of callback function 406 // Save the status of callback function
407 bool callback_error = false; 407 bool callback_error = false;
@@ -431,7 +431,7 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directo
431 if (virtual_name == "." || virtual_name == "..") 431 if (virtual_name == "." || virtual_name == "..")
432 continue; 432 continue;
433 433
434 unsigned ret_entries = 0; 434 u64 ret_entries = 0;
435 if (!callback(&ret_entries, directory, virtual_name)) { 435 if (!callback(&ret_entries, directory, virtual_name)) {
436 callback_error = true; 436 callback_error = true;
437 break; 437 break;
@@ -455,9 +455,9 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directo
455 return true; 455 return true;
456} 456}
457 457
458unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry, 458u64 ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
459 unsigned int recursion) { 459 unsigned int recursion) {
460 const auto callback = [recursion, &parent_entry](unsigned* num_entries_out, 460 const auto callback = [recursion, &parent_entry](u64* num_entries_out,
461 const std::string& directory, 461 const std::string& directory,
462 const std::string& virtual_name) -> bool { 462 const std::string& virtual_name) -> bool {
463 FSTEntry entry; 463 FSTEntry entry;
@@ -469,7 +469,7 @@ unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
469 // is a directory, lets go inside if we didn't recurse to often 469 // is a directory, lets go inside if we didn't recurse to often
470 if (recursion > 0) { 470 if (recursion > 0) {
471 entry.size = ScanDirectoryTree(entry.physicalName, entry, recursion - 1); 471 entry.size = ScanDirectoryTree(entry.physicalName, entry, recursion - 1);
472 *num_entries_out += (int)entry.size; 472 *num_entries_out += entry.size;
473 } else { 473 } else {
474 entry.size = 0; 474 entry.size = 0;
475 } 475 }
@@ -480,16 +480,16 @@ unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
480 (*num_entries_out)++; 480 (*num_entries_out)++;
481 481
482 // Push into the tree 482 // Push into the tree
483 parent_entry.children.push_back(entry); 483 parent_entry.children.push_back(std::move(entry));
484 return true; 484 return true;
485 }; 485 };
486 486
487 unsigned num_entries; 487 u64 num_entries;
488 return ForeachDirectoryEntry(&num_entries, directory, callback) ? num_entries : 0; 488 return ForeachDirectoryEntry(&num_entries, directory, callback) ? num_entries : 0;
489} 489}
490 490
491bool DeleteDirRecursively(const std::string& directory, unsigned int recursion) { 491bool DeleteDirRecursively(const std::string& directory, unsigned int recursion) {
492 const auto callback = [recursion](unsigned* num_entries_out, const std::string& directory, 492 const auto callback = [recursion](u64* num_entries_out, const std::string& directory,
493 const std::string& virtual_name) -> bool { 493 const std::string& virtual_name) -> bool {
494 std::string new_path = directory + DIR_SEP_CHR + virtual_name; 494 std::string new_path = directory + DIR_SEP_CHR + virtual_name;
495 495
diff --git a/src/common/file_util.h b/src/common/file_util.h
index ff01bf0ff..090907c03 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -84,7 +84,7 @@ bool CreateEmptyFile(const std::string& filename);
84 * @return whether handling the entry succeeded 84 * @return whether handling the entry succeeded
85 */ 85 */
86using DirectoryEntryCallable = std::function<bool( 86using DirectoryEntryCallable = std::function<bool(
87 unsigned* num_entries_out, const std::string& directory, const std::string& virtual_name)>; 87 u64* num_entries_out, const std::string& directory, const std::string& virtual_name)>;
88 88
89/** 89/**
90 * Scans a directory, calling the callback for each file/directory contained within. 90 * Scans a directory, calling the callback for each file/directory contained within.
@@ -95,7 +95,7 @@ using DirectoryEntryCallable = std::function<bool(
95 * @param callback The callback which will be called for each entry 95 * @param callback The callback which will be called for each entry
96 * @return whether scanning the directory succeeded 96 * @return whether scanning the directory succeeded
97 */ 97 */
98bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directory, 98bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory,
99 DirectoryEntryCallable callback); 99 DirectoryEntryCallable callback);
100 100
101/** 101/**
@@ -105,8 +105,8 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directo
105 * @param recursion Number of children directories to read before giving up. 105 * @param recursion Number of children directories to read before giving up.
106 * @return the total number of files/directories found 106 * @return the total number of files/directories found
107 */ 107 */
108unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry, 108u64 ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
109 unsigned int recursion = 0); 109 unsigned int recursion = 0);
110 110
111// deletes the given directory and anything under it. Returns true on success. 111// deletes the given directory and anything under it. Returns true on success.
112bool DeleteDirRecursively(const std::string& directory, unsigned int recursion = 256); 112bool DeleteDirRecursively(const std::string& directory, unsigned int recursion = 256);
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index f27fb1f2a..27fd464ae 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -92,13 +92,13 @@ RealVfsDirectory::RealVfsDirectory(const std::string& path_, Mode perms_)
92 perms(perms_) { 92 perms(perms_) {
93 if (!FileUtil::Exists(path) && (perms == Mode::Write || perms == Mode::Append)) 93 if (!FileUtil::Exists(path) && (perms == Mode::Write || perms == Mode::Append))
94 FileUtil::CreateDir(path); 94 FileUtil::CreateDir(path);
95 unsigned size; 95
96 if (perms == Mode::Append) 96 if (perms == Mode::Append)
97 return; 97 return;
98 98
99 FileUtil::ForeachDirectoryEntry( 99 FileUtil::ForeachDirectoryEntry(
100 &size, path, 100 nullptr, path,
101 [this](unsigned* entries_out, const std::string& directory, const std::string& filename) { 101 [this](u64* entries_out, const std::string& directory, const std::string& filename) {
102 std::string full_path = directory + DIR_SEP + filename; 102 std::string full_path = directory + DIR_SEP + filename;
103 if (FileUtil::IsDirectory(full_path)) 103 if (FileUtil::IsDirectory(full_path))
104 subdirectories.emplace_back(std::make_shared<RealVfsDirectory>(full_path, perms)); 104 subdirectories.emplace_back(std::make_shared<RealVfsDirectory>(full_path, perms));
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp
index 394963a69..18bd62a08 100644
--- a/src/core/loader/deconstructed_rom_directory.cpp
+++ b/src/core/loader/deconstructed_rom_directory.cpp
@@ -20,7 +20,7 @@ namespace Loader {
20 20
21static std::string FindRomFS(const std::string& directory) { 21static std::string FindRomFS(const std::string& directory) {
22 std::string filepath_romfs; 22 std::string filepath_romfs;
23 const auto callback = [&filepath_romfs](unsigned*, const std::string& directory, 23 const auto callback = [&filepath_romfs](u64*, const std::string& directory,
24 const std::string& virtual_name) -> bool { 24 const std::string& virtual_name) -> bool {
25 const std::string physical_name = directory + virtual_name; 25 const std::string physical_name = directory + virtual_name;
26 if (FileUtil::IsDirectory(physical_name)) { 26 if (FileUtil::IsDirectory(physical_name)) {
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 939a71022..f495b623b 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -290,6 +290,11 @@ union Instruction {
290 290
291 union { 291 union {
292 BitField<39, 3, u64> pred; 292 BitField<39, 3, u64> pred;
293 BitField<42, 1, u64> neg_pred;
294 } sel;
295
296 union {
297 BitField<39, 3, u64> pred;
293 BitField<42, 1, u64> negate_pred; 298 BitField<42, 1, u64> negate_pred;
294 BitField<43, 2, IMinMaxExchange> exchange; 299 BitField<43, 2, IMinMaxExchange> exchange;
295 BitField<48, 1, u64> is_signed; 300 BitField<48, 1, u64> is_signed;
@@ -513,6 +518,9 @@ public:
513 ISCADD_C, // Scale and Add 518 ISCADD_C, // Scale and Add
514 ISCADD_R, 519 ISCADD_R,
515 ISCADD_IMM, 520 ISCADD_IMM,
521 SEL_C,
522 SEL_R,
523 SEL_IMM,
516 MUFU, // Multi-Function Operator 524 MUFU, // Multi-Function Operator
517 RRO_C, // Range Reduction Operator 525 RRO_C, // Range Reduction Operator
518 RRO_R, 526 RRO_R,
@@ -713,6 +721,9 @@ private:
713 INST("0100110000011---", Id::ISCADD_C, Type::ArithmeticInteger, "ISCADD_C"), 721 INST("0100110000011---", Id::ISCADD_C, Type::ArithmeticInteger, "ISCADD_C"),
714 INST("0101110000011---", Id::ISCADD_R, Type::ArithmeticInteger, "ISCADD_R"), 722 INST("0101110000011---", Id::ISCADD_R, Type::ArithmeticInteger, "ISCADD_R"),
715 INST("0011100-00011---", Id::ISCADD_IMM, Type::ArithmeticInteger, "ISCADD_IMM"), 723 INST("0011100-00011---", Id::ISCADD_IMM, Type::ArithmeticInteger, "ISCADD_IMM"),
724 INST("0100110010100---", Id::SEL_C, Type::ArithmeticInteger, "SEL_C"),
725 INST("0101110010100---", Id::SEL_R, Type::ArithmeticInteger, "SEL_R"),
726 INST("0011100010100---", Id::SEL_IMM, Type::ArithmeticInteger, "SEL_IMM"),
716 INST("0101000010000---", Id::MUFU, Type::Arithmetic, "MUFU"), 727 INST("0101000010000---", Id::MUFU, Type::Arithmetic, "MUFU"),
717 INST("0100110010010---", Id::RRO_C, Type::Arithmetic, "RRO_C"), 728 INST("0100110010010---", Id::RRO_C, Type::Arithmetic, "RRO_C"),
718 INST("0101110010010---", Id::RRO_R, Type::Arithmetic, "RRO_R"), 729 INST("0101110010010---", Id::RRO_R, Type::Arithmetic, "RRO_R"),
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 6485d75a8..f47fd217d 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1076,6 +1076,15 @@ private:
1076 "((" + op_a + " << " + shift + ") + " + op_b + ')', 1, 1); 1076 "((" + op_a + " << " + shift + ") + " + op_b + ')', 1, 1);
1077 break; 1077 break;
1078 } 1078 }
1079 case OpCode::Id::SEL_C:
1080 case OpCode::Id::SEL_R:
1081 case OpCode::Id::SEL_IMM: {
1082 std::string condition =
1083 GetPredicateCondition(instr.sel.pred, instr.sel.neg_pred != 0);
1084 regs.SetRegisterToInteger(instr.gpr0, true, 0,
1085 '(' + condition + ") ? " + op_a + " : " + op_b, 1, 1);
1086 break;
1087 }
1079 case OpCode::Id::LOP_C: 1088 case OpCode::Id::LOP_C:
1080 case OpCode::Id::LOP_R: 1089 case OpCode::Id::LOP_R:
1081 case OpCode::Id::LOP_IMM: { 1090 case OpCode::Id::LOP_IMM: {
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index e1ca0e77b..99e6634a1 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -394,7 +394,7 @@ void GameList::RefreshGameDirectory() {
394} 394}
395 395
396void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) { 396void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) {
397 const auto callback = [this, recursion](unsigned* num_entries_out, const std::string& directory, 397 const auto callback = [this, recursion](u64* num_entries_out, const std::string& directory,
398 const std::string& virtual_name) -> bool { 398 const std::string& virtual_name) -> bool {
399 std::string physical_name = directory + DIR_SEP + virtual_name; 399 std::string physical_name = directory + DIR_SEP + virtual_name;
400 400