citra-emu
/
citra
Archived
1
0
Fork 0

Loader: Never forget to change is_loaded.

This commit is contained in:
Emmanuel Gil Peyrot 2015-01-06 19:49:25 +00:00
parent 43e699d849
commit 85030c6e6b
6 changed files with 15 additions and 7 deletions

View File

@ -215,13 +215,20 @@ AppLoader_THREEDSX::~AppLoader_THREEDSX() {
ResultStatus AppLoader_THREEDSX::Load() {
LOG_INFO(Loader, "Loading 3DSX file %s...", filename.c_str());
if (is_loaded)
return ResultStatus::ErrorAlreadyLoaded;
FileUtil::IOFile file(filename, "rb");
if (file.IsOpen()) {
THREEDSXReader::Load3DSXFile(filename, 0x00100000);
Kernel::LoadExec(0x00100000);
} else {
return ResultStatus::Error;
}
is_loaded = true;
return ResultStatus::Success;
}

View File

@ -26,7 +26,7 @@ public:
private:
std::string filename;
bool is_loaded;
bool is_loaded = false;
};
} // namespace Loader

View File

@ -331,7 +331,7 @@ bool ElfReader::LoadSymbols() {
namespace Loader {
/// AppLoader_ELF constructor
AppLoader_ELF::AppLoader_ELF(const std::string& filename) : is_loaded(false) {
AppLoader_ELF::AppLoader_ELF(const std::string& filename) {
this->filename = filename;
}
@ -358,6 +358,8 @@ ResultStatus AppLoader_ELF::Load() {
} else {
return ResultStatus::Error;
}
is_loaded = true;
return ResultStatus::Success;
}

View File

@ -26,7 +26,7 @@ public:
private:
std::string filename;
bool is_loaded;
bool is_loaded = false;
};
} // namespace Loader

View File

@ -102,7 +102,6 @@ static bool LZSS_Decompress(u8* compressed, u32 compressed_size, u8* decompresse
/// AppLoader_NCCH constructor
AppLoader_NCCH::AppLoader_NCCH(const std::string& filename) {
this->filename = filename;
is_loaded = false;
is_compressed = false;
entry_point = 0;
ncch_offset = 0;
@ -221,10 +220,10 @@ ResultStatus AppLoader_NCCH::Load() {
file.Seek(exefs_offset + ncch_offset, 0);
file.ReadBytes(&exefs_header, sizeof(ExeFs_Header));
is_loaded = true; // Set state to loaded
LoadExec(); // Load the executable into memory for booting
is_loaded = true; // Set state to loaded
return ResultStatus::Success;
} else {
LOG_ERROR(Loader, "Unable to read file %s!", filename.c_str());

View File

@ -215,7 +215,7 @@ private:
std::string filename;
bool is_loaded;
bool is_loaded = false;
bool is_compressed;
u32 entry_point;