mirror of
https://github.com/AxioDL/nod.git
synced 2025-12-14 15:46:30 +00:00
Support for Wii U VC NFS images
This commit is contained in:
@@ -12,6 +12,7 @@ logvisor::Module LogModule("nod");
|
||||
|
||||
std::unique_ptr<IDiscIO> NewDiscIOISO(SystemStringView path);
|
||||
std::unique_ptr<IDiscIO> NewDiscIOWBFS(SystemStringView path);
|
||||
std::unique_ptr<IDiscIO> NewDiscIONFS(SystemStringView path);
|
||||
|
||||
std::unique_ptr<DiscBase> OpenDiscFromImage(SystemStringView path, bool& isWii) {
|
||||
/* Temporary file handle to determine image type */
|
||||
@@ -32,9 +33,17 @@ std::unique_ptr<DiscBase> OpenDiscFromImage(SystemStringView path, bool& isWii)
|
||||
return {};
|
||||
}
|
||||
|
||||
using SignedSize = std::make_signed<SystemString::size_type>::type;
|
||||
const auto dotPos = SignedSize(path.rfind('.'));
|
||||
const auto slashPos = SignedSize(path.rfind("/\\"));
|
||||
if (magic == nod::SBig((uint32_t)'WBFS')) {
|
||||
discIO = NewDiscIOWBFS(path);
|
||||
isWii = true;
|
||||
} else if (path.size() > 4 && dotPos != -1 && dotPos > slashPos &&
|
||||
!path.compare(slashPos + 1, 4, "hif_") &&
|
||||
!path.compare(dotPos, path.size() - dotPos, ".nfs")) {
|
||||
discIO = NewDiscIONFS(path);
|
||||
isWii = true;
|
||||
} else {
|
||||
rs->seek(0x18, SEEK_SET);
|
||||
rs->read(&magic, 4);
|
||||
|
||||
Reference in New Issue
Block a user