deconstructed_rom_directory.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <string>
  6. #include "common/common_types.h"
  7. #include "core/hle/kernel/kernel.h"
  8. #include "core/loader/loader.h"
  9. namespace Loader {
  10. /**
  11. * This class loads a "deconstructed ROM directory", which are the typical format we see for Switch
  12. * game dumps. The path should be a "main" NSO, which must be in a directory that contains the other
  13. * standard ExeFS NSOs (e.g. rtld, sdk, etc.). It will automatically find and load these.
  14. * Furthermore, it will look for the first .istorage file (optionally) and use this for the RomFS.
  15. */
  16. class AppLoader_DeconstructedRomDirectory final : public AppLoader {
  17. public:
  18. AppLoader_DeconstructedRomDirectory(FileUtil::IOFile&& file, std::string filepath);
  19. /**
  20. * Returns the type of the file
  21. * @param file FileUtil::IOFile open file
  22. * @param filepath Path of the file that we are opening.
  23. * @return FileType found, or FileType::Error if this loader doesn't know it
  24. */
  25. static FileType IdentifyType(FileUtil::IOFile& file, const std::string& filepath);
  26. FileType GetFileType() override {
  27. return IdentifyType(file, filepath);
  28. }
  29. ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
  30. private:
  31. std::string filepath;
  32. };
  33. } // namespace Loader