summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-06 20:56:26 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-01-15 22:21:26 +0100
commit9d3bb8b7c00b953cfd87479570c25a5e607f3e61 (patch)
treec8ad6a88567f2bd8e6fc455add689c1f087e3440
parentLoader: Never forget to change is_loaded. (diff)
downloadyuzu-9d3bb8b7c00b953cfd87479570c25a5e607f3e61.tar
yuzu-9d3bb8b7c00b953cfd87479570c25a5e607f3e61.tar.gz
yuzu-9d3bb8b7c00b953cfd87479570c25a5e607f3e61.tar.bz2
yuzu-9d3bb8b7c00b953cfd87479570c25a5e607f3e61.tar.lz
yuzu-9d3bb8b7c00b953cfd87479570c25a5e607f3e61.tar.xz
yuzu-9d3bb8b7c00b953cfd87479570c25a5e607f3e61.tar.zst
yuzu-9d3bb8b7c00b953cfd87479570c25a5e607f3e61.zip
-rw-r--r--src/core/loader/3dsx.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp
index 15032e0ae..54ee992fc 100644
--- a/src/core/loader/3dsx.cpp
+++ b/src/core/loader/3dsx.cpp
@@ -86,11 +86,6 @@ struct THREEloadinfo
u32 seg_sizes[3];
};
-class THREEDSXReader {
-public:
- static int Load3DSXFile(const std::string& filename, u32 base_addr);
-};
-
static u32 TranslateAddr(u32 addr, THREEloadinfo *loadinfo, u32* offsets)
{
if (addr < offsets[0])
@@ -100,12 +95,11 @@ static u32 TranslateAddr(u32 addr, THREEloadinfo *loadinfo, u32* offsets)
return loadinfo->seg_addrs[2] + addr - offsets[1];
}
-int THREEDSXReader::Load3DSXFile(const std::string& filename, u32 base_addr)
+static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr)
{
- FileUtil::IOFile file(filename, "rb");
- if (!file.IsOpen()) {
+ if (!file.IsOpen())
return ERROR_FILE;
- }
+
THREEDSX_Header hdr;
if (file.ReadBytes(&hdr, sizeof(hdr)) != sizeof(hdr))
return ERROR_READ;
@@ -222,7 +216,7 @@ ResultStatus AppLoader_THREEDSX::Load() {
FileUtil::IOFile file(filename, "rb");
if (file.IsOpen()) {
- THREEDSXReader::Load3DSXFile(filename, 0x00100000);
+ Load3DSXFile(file, 0x00100000);
Kernel::LoadExec(0x00100000);
} else {
return ResultStatus::Error;