summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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) {
return true;
}
-bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directory,
+bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory,
DirectoryEntryCallable callback) {
LOG_TRACE(Common_Filesystem, "directory {}", directory);
// How many files + directories we found
- unsigned found_entries = 0;
+ u64 found_entries = 0;
// Save the status of callback function
bool callback_error = false;
@@ -431,7 +431,7 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directo
if (virtual_name == "." || virtual_name == "..")
continue;
- unsigned ret_entries = 0;
+ u64 ret_entries = 0;
if (!callback(&ret_entries, directory, virtual_name)) {
callback_error = true;
break;
@@ -455,9 +455,9 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directo
return true;
}
-unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
- unsigned int recursion) {
- const auto callback = [recursion, &parent_entry](unsigned* num_entries_out,
+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 {
FSTEntry entry;
@@ -469,7 +469,7 @@ unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
// is a directory, lets go inside if we didn't recurse to often
if (recursion > 0) {
entry.size = ScanDirectoryTree(entry.physicalName, entry, recursion - 1);
- *num_entries_out += (int)entry.size;
+ *num_entries_out += entry.size;
} else {
entry.size = 0;
}
@@ -480,16 +480,16 @@ unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
(*num_entries_out)++;
// Push into the tree
- parent_entry.children.push_back(entry);
+ parent_entry.children.push_back(std::move(entry));
return true;
};
- unsigned num_entries;
+ u64 num_entries;
return ForeachDirectoryEntry(&num_entries, directory, callback) ? num_entries : 0;
}
bool DeleteDirRecursively(const std::string& directory, unsigned int recursion) {
- const auto callback = [recursion](unsigned* num_entries_out, const std::string& directory,
+ const auto callback = [recursion](u64* num_entries_out, const std::string& directory,
const std::string& virtual_name) -> bool {
std::string new_path = directory + DIR_SEP_CHR + virtual_name;
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);
* @return whether handling the entry succeeded
*/
using DirectoryEntryCallable = std::function<bool(
- unsigned* num_entries_out, const std::string& directory, const std::string& virtual_name)>;
+ u64* num_entries_out, const std::string& directory, const std::string& virtual_name)>;
/**
* Scans a directory, calling the callback for each file/directory contained within.
@@ -95,7 +95,7 @@ using DirectoryEntryCallable = std::function<bool(
* @param callback The callback which will be called for each entry
* @return whether scanning the directory succeeded
*/
-bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directory,
+bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory,
DirectoryEntryCallable callback);
/**
@@ -105,8 +105,8 @@ bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directo
* @param recursion Number of children directories to read before giving up.
* @return the total number of files/directories found
*/
-unsigned ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
- unsigned int recursion = 0);
+u64 ScanDirectoryTree(const std::string& directory, FSTEntry& parent_entry,
+ unsigned int recursion = 0);
// deletes the given directory and anything under it. Returns true on success.
bool 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_)
perms(perms_) {
if (!FileUtil::Exists(path) && (perms == Mode::Write || perms == Mode::Append))
FileUtil::CreateDir(path);
- unsigned size;
+
if (perms == Mode::Append)
return;
FileUtil::ForeachDirectoryEntry(
- &size, path,
- [this](unsigned* entries_out, const std::string& directory, const std::string& filename) {
+ nullptr, path,
+ [this](u64* entries_out, const std::string& directory, const std::string& filename) {
std::string full_path = directory + DIR_SEP + filename;
if (FileUtil::IsDirectory(full_path))
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 {
static std::string FindRomFS(const std::string& directory) {
std::string filepath_romfs;
- const auto callback = [&filepath_romfs](unsigned*, const std::string& directory,
+ const auto callback = [&filepath_romfs](u64*, const std::string& directory,
const std::string& virtual_name) -> bool {
const std::string physical_name = directory + virtual_name;
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 {
union {
BitField<39, 3, u64> pred;
+ BitField<42, 1, u64> neg_pred;
+ } sel;
+
+ union {
+ BitField<39, 3, u64> pred;
BitField<42, 1, u64> negate_pred;
BitField<43, 2, IMinMaxExchange> exchange;
BitField<48, 1, u64> is_signed;
@@ -513,6 +518,9 @@ public:
ISCADD_C, // Scale and Add
ISCADD_R,
ISCADD_IMM,
+ SEL_C,
+ SEL_R,
+ SEL_IMM,
MUFU, // Multi-Function Operator
RRO_C, // Range Reduction Operator
RRO_R,
@@ -713,6 +721,9 @@ private:
INST("0100110000011---", Id::ISCADD_C, Type::ArithmeticInteger, "ISCADD_C"),
INST("0101110000011---", Id::ISCADD_R, Type::ArithmeticInteger, "ISCADD_R"),
INST("0011100-00011---", Id::ISCADD_IMM, Type::ArithmeticInteger, "ISCADD_IMM"),
+ INST("0100110010100---", Id::SEL_C, Type::ArithmeticInteger, "SEL_C"),
+ INST("0101110010100---", Id::SEL_R, Type::ArithmeticInteger, "SEL_R"),
+ INST("0011100010100---", Id::SEL_IMM, Type::ArithmeticInteger, "SEL_IMM"),
INST("0101000010000---", Id::MUFU, Type::Arithmetic, "MUFU"),
INST("0100110010010---", Id::RRO_C, Type::Arithmetic, "RRO_C"),
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:
"((" + op_a + " << " + shift + ") + " + op_b + ')', 1, 1);
break;
}
+ case OpCode::Id::SEL_C:
+ case OpCode::Id::SEL_R:
+ case OpCode::Id::SEL_IMM: {
+ std::string condition =
+ GetPredicateCondition(instr.sel.pred, instr.sel.neg_pred != 0);
+ regs.SetRegisterToInteger(instr.gpr0, true, 0,
+ '(' + condition + ") ? " + op_a + " : " + op_b, 1, 1);
+ break;
+ }
case OpCode::Id::LOP_C:
case OpCode::Id::LOP_R:
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() {
}
void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) {
- const auto callback = [this, recursion](unsigned* num_entries_out, const std::string& directory,
+ const auto callback = [this, recursion](u64* num_entries_out, const std::string& directory,
const std::string& virtual_name) -> bool {
std::string physical_name = directory + DIR_SEP + virtual_name;