allow emmc writes (to write warmboot to emusd), allow unaligned emmc writes

This commit is contained in:
Christoph Baumann
2025-05-20 23:52:02 +02:00
parent b301bba5e7
commit 77a01f0a9b
7 changed files with 12 additions and 14 deletions

View File

@@ -241,7 +241,7 @@ namespace ams::fs {
private:
void EnsureFile(int id);
public:
MultiFileStorage(const char *base_path);
MultiFileStorage(const char *base_path, OpenMode mode);
virtual Result Read(s64 offset, void *buffer, size_t size) override;
virtual Result Flush() override;
virtual Result GetSize(s64 *out) override;

View File

@@ -34,7 +34,7 @@ namespace ams::fs {
}
}
MultiFileStorage::MultiFileStorage(const char *base_path) {
MultiFileStorage::MultiFileStorage(const char *base_path, fs::OpenMode mode) {
util::Strlcpy(m_base_path, base_path, sizeof(m_base_path) - 2);
m_file_path_ofs = strlen(m_base_path);
@@ -44,7 +44,7 @@ namespace ams::fs {
std::memcpy(m_base_path + m_file_path_ofs, "00", 3);
Result r;
if (R_FAILED(r = fs::OpenFile(std::addressof(m_handles[0]), m_base_path, fs::OpenMode_Read))) {
if (R_FAILED(r = fs::OpenFile(std::addressof(m_handles[0]), m_base_path, mode))) {
nxboot::ShowFatalError("Failed to open part %02d (%s): 0x%08" PRIx32 "!\n", 0, m_base_path, r.GetValue());
}