Compare commits

..

7 Commits

Author SHA1 Message Date
Lioncash
9b22f856c2 loader/nso: Check if read succeeded in IdentifyFile() before checking magic value
We should always assume the filesystem is volatile and check each IO
operation. While we're at it reorganize checks so that early-out errors
are near one another.
2018-07-19 12:43:21 -04:00
bunnei
758c357868 Merge pull request #699 from lioncash/vfs
vfs: Deduplicate accumulation code in VfsDirectory's GetSize()
2018-07-19 07:38:45 -07:00
bunnei
87053fb3b8 Merge pull request #697 from bunnei/disable-depth-cull
gl_state: Temporarily disable culling and depth test.
2018-07-19 07:38:00 -07:00
bunnei
cd4fca8447 Merge pull request #700 from bunnei/update-dynarmic
externals: Update dynarmic to 5a91c94.
2018-07-18 22:01:39 -07:00
bunnei
cf30c4be22 gl_state: Temporarily disable culling and depth test. 2018-07-18 23:21:43 -04:00
bunnei
522bd5b736 externals: Update dynarmic to 5a91c94. 2018-07-18 23:14:44 -04:00
Lioncash
5e626c774f vfs: Deduplicate accumulation code in VfsDirectory's GetSize()
We can just use a generic lambda to avoid writing the same thing twice.
2018-07-18 23:03:27 -04:00
6 changed files with 19 additions and 15 deletions

View File

@@ -592,7 +592,7 @@ std::string GetBundleDirectory() {
#endif
#ifdef _WIN32
const std::string& GetExeDirectory() {
std::string& GetExeDirectory() {
static std::string exe_path;
if (exe_path.empty()) {
wchar_t wchar_exe_path[2048];

View File

@@ -133,7 +133,7 @@ std::string GetBundleDirectory();
#endif
#ifdef _WIN32
const std::string& GetExeDirectory();
std::string& GetExeDirectory();
std::string AppDataRoamingDirectory();
#endif

View File

@@ -116,14 +116,14 @@ bool VfsDirectory::IsRoot() const {
size_t VfsDirectory::GetSize() const {
const auto& files = GetFiles();
const auto file_total =
std::accumulate(files.begin(), files.end(), 0ull,
[](const auto& f1, const auto& f2) { return f1 + f2->GetSize(); });
const auto sum_sizes = [](const auto& range) {
return std::accumulate(range.begin(), range.end(), 0ULL,
[](const auto& f1, const auto& f2) { return f1 + f2->GetSize(); });
};
const auto file_total = sum_sizes(files);
const auto& sub_dir = GetSubdirectories();
const auto subdir_total =
std::accumulate(sub_dir.begin(), sub_dir.end(), 0ull,
[](const auto& f1, const auto& f2) { return f1 + f2->GetSize(); });
const auto subdir_total = sum_sizes(sub_dir);
return file_total + subdir_total;
}

View File

@@ -55,13 +55,15 @@ AppLoader_NSO::AppLoader_NSO(FileSys::VirtualFile file) : AppLoader(std::move(fi
FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) {
u32 magic = 0;
file->ReadObject(&magic);
if (Common::MakeMagic('N', 'S', 'O', '0') == magic) {
return FileType::NSO;
if (file->ReadObject(&magic) != sizeof(magic)) {
return FileType::Error;
}
return FileType::Error;
if (Common::MakeMagic('N', 'S', 'O', '0') != magic) {
return FileType::Error;
}
return FileType::NSO;
}
static std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data,

View File

@@ -795,7 +795,9 @@ void RasterizerOpenGL::SyncClipCoef() {
void RasterizerOpenGL::SyncCullMode() {
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
state.cull.enabled = regs.cull.enabled != 0;
// TODO(bunnei): Enable the below once more things work - until then, this may hide regressions
// state.cull.enabled = regs.cull.enabled != 0;
state.cull.enabled = false;
if (state.cull.enabled) {
state.cull.front_face = MaxwellToGL::FrontFace(regs.cull.front_face);