From 33ea9ed3aac947667074b39541679d328a0c4946 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 21 Nov 2020 04:00:52 -0800 Subject: [PATCH] fs: fix RomFs GetEntryType (fixes mariko daybreak) --- .../fssystem_dbm_hierarchical_rom_file_table.hpp | 16 ++++++++-------- .../fs/fs_dbm_hierarchical_rom_file_table.cpp | 16 ++++++++-------- libstratosphere/source/updater/updater_api.cpp | 2 ++ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/libstratosphere/include/stratosphere/fssystem/fssystem_dbm_hierarchical_rom_file_table.hpp b/libstratosphere/include/stratosphere/fssystem/fssystem_dbm_hierarchical_rom_file_table.hpp index 8ee5f4da..390aad10 100644 --- a/libstratosphere/include/stratosphere/fssystem/fssystem_dbm_hierarchical_rom_file_table.hpp +++ b/libstratosphere/include/stratosphere/fssystem/fssystem_dbm_hierarchical_rom_file_table.hpp @@ -584,8 +584,8 @@ namespace ams::fssystem { AMS_ASSERT(out_entry != nullptr); const Result dir_res = this->dir_table.Get(out_pos, out_entry, key); - R_UNLESS(R_FAILED(dir_res), dir_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); + R_UNLESS(R_FAILED(dir_res), dir_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); Position pos = 0; RomFileEntry entry = {}; @@ -601,8 +601,8 @@ namespace ams::fssystem { RomEntryKey key = {}; const Result dir_res = this->dir_table.GetByPosition(std::addressof(key), out_entry, nullptr, nullptr, pos); - R_UNLESS(R_FAILED(dir_res), dir_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); + R_UNLESS(R_FAILED(dir_res), dir_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); RomFileEntry entry = {}; const Result file_res = this->file_table.GetByPosition(std::addressof(key), std::addressof(entry), nullptr, nullptr, pos); @@ -616,8 +616,8 @@ namespace ams::fssystem { AMS_ASSERT(out_entry != nullptr); const Result file_res = this->file_table.Get(out_pos, out_entry, key); - R_UNLESS(R_FAILED(file_res), file_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(file_res), file_res); + R_UNLESS(R_FAILED(file_res), file_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(file_res), file_res); Position pos = 0; RomDirectoryEntry entry = {}; @@ -633,8 +633,8 @@ namespace ams::fssystem { RomEntryKey key = {}; const Result file_res = this->file_table.GetByPosition(std::addressof(key), out_entry, nullptr, nullptr, pos); - R_UNLESS(R_FAILED(file_res), file_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(file_res), file_res); + R_UNLESS(R_FAILED(file_res), file_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(file_res), file_res); RomDirectoryEntry entry = {}; const Result dir_res = this->dir_table.GetByPosition(std::addressof(key), std::addressof(entry), nullptr, nullptr, pos); diff --git a/libstratosphere/source/fs/fs_dbm_hierarchical_rom_file_table.cpp b/libstratosphere/source/fs/fs_dbm_hierarchical_rom_file_table.cpp index b0067efc..56d279b2 100644 --- a/libstratosphere/source/fs/fs_dbm_hierarchical_rom_file_table.cpp +++ b/libstratosphere/source/fs/fs_dbm_hierarchical_rom_file_table.cpp @@ -479,8 +479,8 @@ namespace ams::fs { AMS_ASSERT(out_entry != nullptr); const Result dir_res = this->dir_table.Get(out_pos, out_entry, key); - R_UNLESS(R_FAILED(dir_res), dir_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); + R_UNLESS(R_FAILED(dir_res), dir_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); Position pos = 0; RomFileEntry entry = {}; @@ -496,8 +496,8 @@ namespace ams::fs { RomEntryKey key = {}; const Result dir_res = this->dir_table.GetByPosition(std::addressof(key), out_entry, pos); - R_UNLESS(R_FAILED(dir_res), dir_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); + R_UNLESS(R_FAILED(dir_res), dir_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(dir_res), dir_res); RomFileEntry entry = {}; const Result file_res = this->file_table.GetByPosition(std::addressof(key), std::addressof(entry), pos); @@ -511,8 +511,8 @@ namespace ams::fs { AMS_ASSERT(out_entry != nullptr); const Result file_res = this->file_table.Get(out_pos, out_entry, key); - R_UNLESS(R_FAILED(file_res), file_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(file_res), file_res); + R_UNLESS(R_FAILED(file_res), file_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(file_res), file_res); Position pos = 0; RomDirectoryEntry entry = {}; @@ -528,8 +528,8 @@ namespace ams::fs { RomEntryKey key = {}; const Result file_res = this->file_table.GetByPosition(std::addressof(key), out_entry, pos); - R_UNLESS(R_FAILED(file_res), file_res); - R_UNLESS(!fs::ResultDbmKeyNotFound::Includes(file_res), file_res); + R_UNLESS(R_FAILED(file_res), file_res); + R_UNLESS(fs::ResultDbmKeyNotFound::Includes(file_res), file_res); RomDirectoryEntry entry = {}; const Result dir_res = this->dir_table.GetByPosition(std::addressof(key), std::addressof(entry), pos); diff --git a/libstratosphere/source/updater/updater_api.cpp b/libstratosphere/source/updater/updater_api.cpp index 879a0eee..124cee5d 100644 --- a/libstratosphere/source/updater/updater_api.cpp +++ b/libstratosphere/source/updater/updater_api.cpp @@ -463,6 +463,8 @@ namespace ams::updater { return BootImageUpdateType::Erista; case spl::HardwareType::Hoag: case spl::HardwareType::Iowa: + case spl::HardwareType::Calcio: + case spl::HardwareType::_Five_: return BootImageUpdateType::Mariko; AMS_UNREACHABLE_DEFAULT_CASE(); }