yuzu-emu
/
yuzu
Archived
1
0
Fork 0

Loader: Remove the useless THREEDSXReader class.

This commit is contained in:
Emmanuel Gil Peyrot 2015-01-06 19:56:26 +00:00
parent 85030c6e6b
commit 9d3bb8b7c0
1 changed files with 4 additions and 10 deletions

View File

@ -86,11 +86,6 @@ struct THREEloadinfo
u32 seg_sizes[3]; 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) static u32 TranslateAddr(u32 addr, THREEloadinfo *loadinfo, u32* offsets)
{ {
if (addr < offsets[0]) 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]; 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; return ERROR_FILE;
}
THREEDSX_Header hdr; THREEDSX_Header hdr;
if (file.ReadBytes(&hdr, sizeof(hdr)) != sizeof(hdr)) if (file.ReadBytes(&hdr, sizeof(hdr)) != sizeof(hdr))
return ERROR_READ; return ERROR_READ;
@ -222,7 +216,7 @@ ResultStatus AppLoader_THREEDSX::Load() {
FileUtil::IOFile file(filename, "rb"); FileUtil::IOFile file(filename, "rb");
if (file.IsOpen()) { if (file.IsOpen()) {
THREEDSXReader::Load3DSXFile(filename, 0x00100000); Load3DSXFile(file, 0x00100000);
Kernel::LoadExec(0x00100000); Kernel::LoadExec(0x00100000);
} else { } else {
return ResultStatus::Error; return ResultStatus::Error;