mirror of
https://github.com/mikage-emu/mikage-dev.git
synced 2025-01-06 21:40:59 +01:00
Gamecard/3DSX: Fix file size reporting with RomFS
This commit is contained in:
parent
79a9221eaf
commit
2c80b243a9
1 changed files with 5 additions and 0 deletions
|
@ -518,6 +518,11 @@ public:
|
|||
}
|
||||
|
||||
HLE::OS::OS::ResultAnd<uint64_t> GetSize(HLE::PXI::FS::FileContext& context) override {
|
||||
if (ncch.romfs_size.ToBytes()) {
|
||||
// RomFS may extend past original 3DSX size, since its start offset is aligned in NCCH but not in 3DSX
|
||||
return std::make_tuple(HLE::OS::RESULT_OK, uint64_t { ncch.romfs_offset.ToBytes() + ncch.romfs_size.ToBytes() });
|
||||
}
|
||||
|
||||
// Return original file size as upper bound; this is merely needed to prevent the bounds check in FileViews from failing
|
||||
return file->GetSize(context);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue