mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-04 06:06:00 +00:00
0f27e0edf2
- Added a trophy viewer (right click on game ==> trophy viewer) - Enabled Run button. - Switched gui settings to toml. - Added recent files (6 max) - Applied @raphaelthegreat suggestions and corrections (Thanks a lot). - Fixed several bugs and crashes. - Full screen should disabled by default. - Added region in list mode. - Added a simple temp elf list widget. - Added messages when extracting pkg (ex: installing a patch before the game...etc)
29 lines
659 B
C++
29 lines
659 B
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "common/io_file.h"
|
|
#include "common/types.h"
|
|
#include "loader.h"
|
|
|
|
namespace Loader {
|
|
|
|
FileTypes DetectFileType(const std::filesystem::path& filepath) {
|
|
// No file loaded
|
|
if (filepath.empty()) {
|
|
return FileTypes::Unknown;
|
|
}
|
|
Common::FS::IOFile file;
|
|
file.Open(filepath, Common::FS::FileAccessMode::Read);
|
|
file.Seek(0);
|
|
u32 magic;
|
|
file.Read(magic);
|
|
file.Close();
|
|
switch (magic) {
|
|
case PkgMagic:
|
|
return FileTypes::Pkg;
|
|
}
|
|
return FileTypes::Unknown;
|
|
}
|
|
|
|
} // namespace Loader
|