diff --git a/include/fs/archive_ncch.hpp b/include/fs/archive_ncch.hpp index de19cbe5..275bcd20 100644 --- a/include/fs/archive_ncch.hpp +++ b/include/fs/archive_ncch.hpp @@ -18,8 +18,7 @@ public: // Returns whether the cart has a RomFS bool hasRomFS() { auto cxi = mem.getCXI(); - auto hb3dsx = mem.get3DSX(); - return (cxi != nullptr && cxi->hasRomFS()) || (hb3dsx != nullptr && hb3dsx->hasRomFs()); + return (cxi != nullptr && cxi->hasRomFS()); } // Returns whether the cart has an ExeFS (All executable carts should have an ExeFS. This is just here to be safe) diff --git a/src/core/fs/archive_ncch.cpp b/src/core/fs/archive_ncch.cpp index 5a808ade..d7dd1f57 100644 --- a/src/core/fs/archive_ncch.cpp +++ b/src/core/fs/archive_ncch.cpp @@ -131,16 +131,12 @@ std::optional NCCHArchive::readFile(FileSession* file, u64 offset, u32 size } auto cxi = mem.getCXI(); - auto hb3dsx = mem.get3DSX(); - - // If isCXI is true then we've loaded a CXI/3DS file, else it's 3DSX - bool isCXI = cxi != nullptr; // Seek to file offset depending on if we're reading from RomFS, ExeFS, etc switch (type) { case PathType::RomFS: { - const u64 romFSSize = isCXI ? cxi->romFS.size : hb3dsx->romFSSize; - const u64 romFSOffset = isCXI ? cxi->romFS.offset : hb3dsx->romFSOffset; + const u64 romFSSize = cxi->romFS.size; + const u64 romFSOffset = cxi->romFS.offset; if ((offset >> 32) || (offset >= romFSSize) || (offset + size >= romFSSize)) { Helpers::panic("Tried to read from NCCH with too big of an offset"); } @@ -154,8 +150,7 @@ std::optional NCCHArchive::readFile(FileSession* file, u64 offset, u32 size } std::unique_ptr data(new u8[size]); - auto [success, bytesRead] = - isCXI ? cxi->readFromFile(mem.CXIFile, cxi->romFS, &data[0], offset, size) : hb3dsx->readRomFSBytes(&data[0], offset, size); + auto [success, bytesRead] = cxi->readFromFile(mem.CXIFile, cxi->romFS, &data[0], offset, size); if (!success) { Helpers::panic("Failed to read from NCCH archive");