summaryrefslogtreecommitdiffstats
path: root/src/core/loader/3dsx.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-07 00:10:13 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-15 22:23:08 +0100
commit82ec17db7df53ed1c376d1cdaa9a6587719a546d (patch)
tree3c2236849146037fbba2fb75ea8a50f53b847a17 /src/core/loader/3dsx.cpp
parentLoader: Don’t assume the file hasn’t been read before. (diff)
downloadyuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar.gz
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar.bz2
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar.lz
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar.xz
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.tar.zst
yuzu-82ec17db7df53ed1c376d1cdaa9a6587719a546d.zip
Diffstat (limited to 'src/core/loader/3dsx.cpp')
-rw-r--r--src/core/loader/3dsx.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp
index e239808f3..f3e09ecd6 100644
--- a/src/core/loader/3dsx.cpp
+++ b/src/core/loader/3dsx.cpp
@@ -44,7 +44,6 @@ enum THREEDSX_Error {
static const u32 RELOCBUFSIZE = 512;
// File header
-static const u32 THREEDSX_MAGIC = 0x58534433; // '3DSX'
#pragma pack(1)
struct THREEDSX_Header
{
@@ -202,6 +201,18 @@ static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr)
return ERROR_NONE;
}
+FileType AppLoader_THREEDSX::IdentifyType(FileUtil::IOFile& file) {
+ u32 magic;
+ file.Seek(0, SEEK_SET);
+ if (1 != file.ReadArray<u32>(&magic, 1))
+ return FileType::Error;
+
+ if (MakeMagic('3', 'D', 'S', 'X') == magic)
+ return FileType::THREEDSX;
+
+ return FileType::Error;
+}
+
ResultStatus AppLoader_THREEDSX::Load() {
if (is_loaded)
return ResultStatus::ErrorAlreadyLoaded;