Loader: Fix indentation, whitespace, and a few other such cosmetic stuff.

This commit is contained in:
Emmanuel Gil Peyrot 2015-01-05 20:09:35 +00:00
parent 3ff5a80d46
commit bc2212106f
2 changed files with 24 additions and 26 deletions

View file

@ -13,11 +13,9 @@
#include "3dsx.h" #include "3dsx.h"
namespace Loader { namespace Loader {
/**
/**
* File layout: * File layout:
* - File header * - File header
* - Code, rodata and data relocation table headers * - Code, rodata and data relocation table headers
@ -64,9 +62,9 @@ struct THREEDSX_Header
struct THREEDSX_RelocHdr struct THREEDSX_RelocHdr
{ {
// # of absolute relocations (that is, fix address to post-relocation memory layout) // # of absolute relocations (that is, fix address to post-relocation memory layout)
u32 cross_segment_absolute; u32 cross_segment_absolute;
// # of cross-segment relative relocations (that is, 32bit signed offsets that need to be patched) // # of cross-segment relative relocations (that is, 32bit signed offsets that need to be patched)
u32 cross_segment_relative; u32 cross_segment_relative;
// more? // more?
// Relocations are written in this order: // Relocations are written in this order:
@ -207,28 +205,28 @@ int THREEDSXReader::Load3DSXFile(const std::string& filename, u32 base_addr)
return ERROR_NONE; return ERROR_NONE;
} }
/// AppLoader_DSX constructor /// AppLoader_DSX constructor
AppLoader_THREEDSX::AppLoader_THREEDSX(const std::string& filename) : filename(filename) { AppLoader_THREEDSX::AppLoader_THREEDSX(const std::string& filename) : filename(filename) {
} }
/// AppLoader_DSX destructor /// AppLoader_DSX destructor
AppLoader_THREEDSX::~AppLoader_THREEDSX() { AppLoader_THREEDSX::~AppLoader_THREEDSX() {
} }
/** /**
* Loads a 3DSX file * Loads a 3DSX file
* @return Success on success, otherwise Error * @return Success on success, otherwise Error
*/ */
ResultStatus AppLoader_THREEDSX::Load() { ResultStatus AppLoader_THREEDSX::Load() {
LOG_INFO(Loader, "Loading 3DSX file %s...", filename.c_str()); LOG_INFO(Loader, "Loading 3DSX file %s...", filename.c_str());
FileUtil::IOFile file(filename, "rb"); FileUtil::IOFile file(filename, "rb");
if (file.IsOpen()) { if (file.IsOpen()) {
THREEDSXReader::Load3DSXFile(filename, 0x00100000); THREEDSXReader::Load3DSXFile(filename, 0x00100000);
Kernel::LoadExec(0x00100000); Kernel::LoadExec(0x00100000);
} else { } else {
return ResultStatus::Error; return ResultStatus::Error;
}
return ResultStatus::Success;
} }
return ResultStatus::Success;
}
} // namespace Loader } // namespace Loader

View file

@ -149,7 +149,7 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
exefs_header.section[i].name); exefs_header.section[i].name);
s64 section_offset = (exefs_header.section[i].offset + exefs_offset + s64 section_offset = (exefs_header.section[i].offset + exefs_offset +
sizeof(ExeFs_Header)+ncch_offset); sizeof(ExeFs_Header)+ncch_offset);
file.Seek(section_offset, 0); file.Seek(section_offset, 0);
// Section is compressed... // Section is compressed...