diff options
author | bunnei <ericbunnie@gmail.com> | 2014-05-23 04:57:45 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-05-23 04:57:45 +0200 |
commit | 32c314c99290a52f1f870ecf8c677e3792ed09c4 (patch) | |
tree | 1cea62bc320d51ebb217e7c361ae10b65b71dd45 /src/core/loader.cpp | |
parent | Merge branch 'master' of https://github.com/citra-emu/citra (diff) | |
parent | core: added Kernel::Reschedule() call to check for thread changes, shortened delay time to 100 instructions (diff) | |
download | yuzu-32c314c99290a52f1f870ecf8c677e3792ed09c4.tar yuzu-32c314c99290a52f1f870ecf8c677e3792ed09c4.tar.gz yuzu-32c314c99290a52f1f870ecf8c677e3792ed09c4.tar.bz2 yuzu-32c314c99290a52f1f870ecf8c677e3792ed09c4.tar.lz yuzu-32c314c99290a52f1f870ecf8c677e3792ed09c4.tar.xz yuzu-32c314c99290a52f1f870ecf8c677e3792ed09c4.tar.zst yuzu-32c314c99290a52f1f870ecf8c677e3792ed09c4.zip |
Diffstat (limited to 'src/core/loader.cpp')
-rw-r--r-- | src/core/loader.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/loader.cpp b/src/core/loader.cpp index 8756588ae..ff1c873bb 100644 --- a/src/core/loader.cpp +++ b/src/core/loader.cpp @@ -10,7 +10,7 @@ #include "core/core.h" #include "core/file_sys/directory_file_system.h" #include "core/elf/elf_reader.h" - +#include "core/hle/kernel/kernel.h" #include "core/mem_map.h" //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -56,7 +56,7 @@ bool Load_ELF(std::string &filename) { elf_reader = new ElfReader(buffer); elf_reader->LoadInto(0x00100000); - Core::g_app_core->SetPC(elf_reader->GetEntryPoint()); + Kernel::LoadExec(elf_reader->GetEntryPoint()); delete[] buffer; delete elf_reader; @@ -89,11 +89,11 @@ bool Load_DAT(std::string &filename) { * but for the sake of making it easier... we'll temporarily/hackishly * allow it. No sense in making a proper reader for this. */ - u32 entrypoint = 0x00100000; // write to same entrypoint as elf + u32 entry_point = 0x00100000; // write to same entrypoint as elf u32 payload_offset = 0xA150; const u8 *src = &buffer[payload_offset]; - u8 *dst = Memory::GetPointer(entrypoint); + u8 *dst = Memory::GetPointer(entry_point); u32 srcSize = size - payload_offset; //just load everything... u32 *s = (u32*)src; u32 *d = (u32*)dst; @@ -102,7 +102,8 @@ bool Load_DAT(std::string &filename) { *d++ = (*s++); } - Core::g_app_core->SetPC(entrypoint); + Kernel::LoadExec(entry_point); + delete[] buffer; } @@ -131,10 +132,10 @@ bool Load_BIN(std::string &filename) { f.ReadBytes(buffer, size); - u32 entrypoint = 0x00100000; // Hardcoded, read from exheader + u32 entry_point = 0x00100000; // Hardcoded, read from exheader const u8 *src = buffer; - u8 *dst = Memory::GetPointer(entrypoint); + u8 *dst = Memory::GetPointer(entry_point); u32 srcSize = size; u32 *s = (u32*)src; u32 *d = (u32*)dst; @@ -143,7 +144,7 @@ bool Load_BIN(std::string &filename) { *d++ = (*s++); } - Core::g_app_core->SetPC(entrypoint); + Kernel::LoadExec(entry_point); delete[] buffer; } @@ -186,6 +187,9 @@ FileType IdentifyFile(std::string &filename) { else if (!strcasecmp(extension.c_str(), ".elf")) { return FILETYPE_CTR_ELF; // TODO(bunnei): Do some filetype checking :p } + else if (!strcasecmp(extension.c_str(), ".axf")) { + return FILETYPE_CTR_ELF; // TODO(bunnei): Do some filetype checking :p + } else if (!strcasecmp(extension.c_str(), ".bin")) { return FILETYPE_CTR_BIN; } |