diff options
Diffstat (limited to 'src/core')
44 files changed, 111 insertions, 111 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 4b93d3313..3ae528562 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| @@ -63,7 +63,7 @@ public: | |||
| 63 | * Get the current CPSR register | 63 | * Get the current CPSR register |
| 64 | * @return Returns the value of the CPSR register | 64 | * @return Returns the value of the CPSR register |
| 65 | */ | 65 | */ |
| 66 | virtual u32 GetCPSR() const = 0; | 66 | virtual u32 GetCPSR() const = 0; |
| 67 | 67 | ||
| 68 | /** | 68 | /** |
| 69 | * Set the current CPSR register | 69 | * Set the current CPSR register |
| @@ -98,7 +98,7 @@ public: | |||
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | protected: | 100 | protected: |
| 101 | 101 | ||
| 102 | /** | 102 | /** |
| 103 | * Executes the given number of instructions | 103 | * Executes the given number of instructions |
| 104 | * @param num_instructions Number of instructions to executes | 104 | * @param num_instructions Number of instructions to executes |
diff --git a/src/core/arm/disassembler/load_symbol_map.cpp b/src/core/arm/disassembler/load_symbol_map.cpp index 0f384ad3e..55278474b 100644 --- a/src/core/arm/disassembler/load_symbol_map.cpp +++ b/src/core/arm/disassembler/load_symbol_map.cpp | |||
| @@ -22,8 +22,8 @@ void LoadSymbolMap(std::string filename) { | |||
| 22 | 22 | ||
| 23 | while (std::getline(infile, line)) { | 23 | while (std::getline(infile, line)) { |
| 24 | std::istringstream iss(line); | 24 | std::istringstream iss(line); |
| 25 | if (!(iss >> address_str >> size >> function_name)) { | 25 | if (!(iss >> address_str >> size >> function_name)) { |
| 26 | break; // Error parsing | 26 | break; // Error parsing |
| 27 | } | 27 | } |
| 28 | u32 address = std::stoul(address_str, nullptr, 16); | 28 | u32 address = std::stoul(address_str, nullptr, 16); |
| 29 | 29 | ||
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp index a3ed3e31e..6c8ea211e 100644 --- a/src/core/arm/dyncom/arm_dyncom.cpp +++ b/src/core/arm/dyncom/arm_dyncom.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/arm/skyeye_common/armcpu.h" | 5 | #include "core/arm/skyeye_common/armcpu.h" |
| 6 | #include "core/arm/skyeye_common/armemu.h" | 6 | #include "core/arm/skyeye_common/armemu.h" |
| @@ -113,7 +113,7 @@ void ARM_DynCom::ExecuteInstructions(int num_instructions) { | |||
| 113 | state->NumInstrsToExecute = num_instructions; | 113 | state->NumInstrsToExecute = num_instructions; |
| 114 | 114 | ||
| 115 | // Dyncom only breaks on instruction dispatch. This only happens on every instruction when | 115 | // Dyncom only breaks on instruction dispatch. This only happens on every instruction when |
| 116 | // executing one instruction at a time. Otherwise, if a block is being executed, more | 116 | // executing one instruction at a time. Otherwise, if a block is being executed, more |
| 117 | // instructions may actually be executed than specified. | 117 | // instructions may actually be executed than specified. |
| 118 | ticks += InterpreterMainLoop(state.get()); | 118 | ticks += InterpreterMainLoop(state.get()); |
| 119 | } | 119 | } |
diff --git a/src/core/arm/dyncom/arm_dyncom.h b/src/core/arm/dyncom/arm_dyncom.h index f3c70b7d3..51eea41ed 100644 --- a/src/core/arm/dyncom/arm_dyncom.h +++ b/src/core/arm/dyncom/arm_dyncom.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.h b/src/core/arm/dyncom/arm_dyncom_interpreter.h index c65eb23f7..3a2462f55 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.h +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp index ed4415082..e2aa5ce92 100644 --- a/src/core/arm/interpreter/arm_interpreter.cpp +++ b/src/core/arm/interpreter/arm_interpreter.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/arm/interpreter/arm_interpreter.h" | 5 | #include "core/arm/interpreter/arm_interpreter.h" |
| 6 | 6 | ||
| @@ -24,7 +24,7 @@ ARM_Interpreter::ARM_Interpreter() { | |||
| 24 | state->lateabtSig = LOW; | 24 | state->lateabtSig = LOW; |
| 25 | 25 | ||
| 26 | // Reset the core to initial state | 26 | // Reset the core to initial state |
| 27 | ARMul_CoProInit(state); | 27 | ARMul_CoProInit(state); |
| 28 | ARMul_Reset(state); | 28 | ARMul_Reset(state); |
| 29 | state->NextInstr = RESUME; // NOTE: This will be overwritten by LoadContext | 29 | state->NextInstr = RESUME; // NOTE: This will be overwritten by LoadContext |
| 30 | state->Emulate = 3; | 30 | state->Emulate = 3; |
diff --git a/src/core/arm/interpreter/arm_interpreter.h b/src/core/arm/interpreter/arm_interpreter.h index f1e7198c5..ed53d997c 100644 --- a/src/core/arm/interpreter/arm_interpreter.h +++ b/src/core/arm/interpreter/arm_interpreter.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 0116cb376..d6e9dc849 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -249,7 +249,7 @@ void AddEventToQueue(Event* ne) | |||
| 249 | 249 | ||
| 250 | // This must be run ONLY from within the cpu thread | 250 | // This must be run ONLY from within the cpu thread |
| 251 | // cyclesIntoFuture may be VERY inaccurate if called from anything else | 251 | // cyclesIntoFuture may be VERY inaccurate if called from anything else |
| 252 | // than Advance | 252 | // than Advance |
| 253 | void ScheduleEvent(s64 cyclesIntoFuture, int event_type, u64 userdata) | 253 | void ScheduleEvent(s64 cyclesIntoFuture, int event_type, u64 userdata) |
| 254 | { | 254 | { |
| 255 | Event *ne = GetNewEvent(); | 255 | Event *ne = GetNewEvent(); |
| @@ -469,7 +469,7 @@ void ProcessFifoWaitEvents() | |||
| 469 | { | 469 | { |
| 470 | if (first->time <= globalTimer) | 470 | if (first->time <= globalTimer) |
| 471 | { | 471 | { |
| 472 | // LOG(TIMER, "[Scheduler] %s (%lld, %lld) ", | 472 | // LOG(TIMER, "[Scheduler] %s (%lld, %lld) ", |
| 473 | // first->name ? first->name : "?", (u64)globalTimer, (u64)first->time); | 473 | // first->name ? first->name : "?", (u64)globalTimer, (u64)first->time); |
| 474 | Event* evt = first; | 474 | Event* evt = first; |
| 475 | first = first->next; | 475 | first = first->next; |
diff --git a/src/core/file_sys/archive.h b/src/core/file_sys/archive.h index dc2d2ced9..1135d8804 100644 --- a/src/core/file_sys/archive.h +++ b/src/core/file_sys/archive.h | |||
| @@ -222,7 +222,7 @@ public: | |||
| 222 | * @return Size of the archive in bytes | 222 | * @return Size of the archive in bytes |
| 223 | */ | 223 | */ |
| 224 | virtual size_t GetSize() const = 0; | 224 | virtual size_t GetSize() const = 0; |
| 225 | 225 | ||
| 226 | /** | 226 | /** |
| 227 | * Set the size of the archive in bytes | 227 | * Set the size of the archive in bytes |
| 228 | */ | 228 | */ |
diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.h index b0dd421b7..f05327f51 100644 --- a/src/core/file_sys/archive_romfs.h +++ b/src/core/file_sys/archive_romfs.h | |||
| @@ -74,7 +74,7 @@ public: | |||
| 74 | * @return Size of the archive in bytes | 74 | * @return Size of the archive in bytes |
| 75 | */ | 75 | */ |
| 76 | size_t GetSize() const override; | 76 | size_t GetSize() const override; |
| 77 | 77 | ||
| 78 | /** | 78 | /** |
| 79 | * Set the size of the archive in bytes | 79 | * Set the size of the archive in bytes |
| 80 | */ | 80 | */ |
diff --git a/src/core/hle/config_mem.cpp b/src/core/hle/config_mem.cpp index a45e61427..c7cf5b1d3 100644 --- a/src/core/hle/config_mem.cpp +++ b/src/core/hle/config_mem.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/common_types.h" | 5 | #include "common/common_types.h" |
| 6 | 6 | ||
diff --git a/src/core/hle/coprocessor.cpp b/src/core/hle/coprocessor.cpp index 1eb33eb86..e34229a57 100644 --- a/src/core/hle/coprocessor.cpp +++ b/src/core/hle/coprocessor.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/coprocessor.h" | 5 | #include "core/hle/coprocessor.h" |
| 6 | #include "core/hle/hle.h" | 6 | #include "core/hle/hle.h" |
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index 55eaf0621..3dbe25037 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h | |||
| @@ -50,7 +50,7 @@ template<s32 func(u32*, u32, u32, u32, u32, u32)> void Wrap(){ | |||
| 50 | 50 | ||
| 51 | template<s32 func(s32*, u32*, s32, bool, s64)> void Wrap() { | 51 | template<s32 func(s32*, u32*, s32, bool, s64)> void Wrap() { |
| 52 | s32 param_1 = 0; | 52 | s32 param_1 = 0; |
| 53 | s32 retval = func(¶m_1, (Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), | 53 | s32 retval = func(¶m_1, (Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), |
| 54 | (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0))); | 54 | (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0))); |
| 55 | Core::g_app_core->SetReg(1, (u32)param_1); | 55 | Core::g_app_core->SetReg(1, (u32)param_1); |
| 56 | FuncReturn(retval); | 56 | FuncReturn(retval); |
| @@ -103,7 +103,7 @@ template<s32 func(void*)> void Wrap() { | |||
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | template<s32 func(s64*, u32, void*, s32)> void Wrap(){ | 105 | template<s32 func(s64*, u32, void*, s32)> void Wrap(){ |
| 106 | FuncReturn(func((s64*)Memory::GetPointer(PARAM(0)), PARAM(1), Memory::GetPointer(PARAM(2)), | 106 | FuncReturn(func((s64*)Memory::GetPointer(PARAM(0)), PARAM(1), Memory::GetPointer(PARAM(2)), |
| 107 | (s32)PARAM(3))); | 107 | (s32)PARAM(3))); |
| 108 | } | 108 | } |
| 109 | 109 | ||
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index b03894ad7..b8ac186f6 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <vector> | 5 | #include <vector> |
| 6 | 6 | ||
| @@ -20,7 +20,7 @@ bool g_reschedule = false; ///< If true, immediately reschedules the CPU to a n | |||
| 20 | const FunctionDef* GetSVCInfo(u32 opcode) { | 20 | const FunctionDef* GetSVCInfo(u32 opcode) { |
| 21 | u32 func_num = opcode & 0xFFFFFF; // 8 bits | 21 | u32 func_num = opcode & 0xFFFFFF; // 8 bits |
| 22 | if (func_num > 0xFF) { | 22 | if (func_num > 0xFF) { |
| 23 | ERROR_LOG(HLE,"unknown svc=0x%02X", func_num); | 23 | ERROR_LOG(HLE,"unknown svc=0x%02X", func_num); |
| 24 | return nullptr; | 24 | return nullptr; |
| 25 | } | 25 | } |
| 26 | return &g_module_db[0].func_table[func_num]; | 26 | return &g_module_db[0].func_table[func_num]; |
| @@ -58,7 +58,7 @@ void RegisterAllModules() { | |||
| 58 | 58 | ||
| 59 | void Init() { | 59 | void Init() { |
| 60 | Service::Init(); | 60 | Service::Init(); |
| 61 | 61 | ||
| 62 | RegisterAllModules(); | 62 | RegisterAllModules(); |
| 63 | 63 | ||
| 64 | NOTICE_LOG(HLE, "initialized OK"); | 64 | NOTICE_LOG(HLE, "initialized OK"); |
diff --git a/src/core/hle/hle.h b/src/core/hle/hle.h index bf4d84575..4ab258c69 100644 --- a/src/core/hle/hle.h +++ b/src/core/hle/hle.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h index a483fe466..6886e479d 100644 --- a/src/core/hle/kernel/address_arbiter.h +++ b/src/core/hle/kernel/address_arbiter.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | // Address arbiters are an underlying kernel synchronization object that can be created/used via | 11 | // Address arbiters are an underlying kernel synchronization object that can be created/used via |
| 12 | // supervisor calls (SVCs). They function as sort of a global lock. Typically, games/other CTR | 12 | // supervisor calls (SVCs). They function as sort of a global lock. Typically, games/other CTR |
| 13 | // applications use them as an underlying mechanism to implement thread-safe barriers, events, and | 13 | // applications use them as an underlying mechanism to implement thread-safe barriers, events, and |
| 14 | // semphores. | 14 | // semphores. |
| 15 | 15 | ||
| 16 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 16 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 17 | // Kernel namespace | 17 | // Kernel namespace |
diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp index 8f1c95d0f..d9ee4682a 100644 --- a/src/core/hle/kernel/archive.cpp +++ b/src/core/hle/kernel/archive.cpp | |||
| @@ -52,14 +52,14 @@ public: | |||
| 52 | FileSys::Archive* backend; ///< Archive backend interface | 52 | FileSys::Archive* backend; ///< Archive backend interface |
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * Synchronize kernel object | 55 | * Synchronize kernel object |
| 56 | * @param wait Boolean wait set if current thread should wait as a result of sync operation | 56 | * @param wait Boolean wait set if current thread should wait as a result of sync operation |
| 57 | * @return Result of operation, 0 on success, otherwise error code | 57 | * @return Result of operation, 0 on success, otherwise error code |
| 58 | */ | 58 | */ |
| 59 | Result SyncRequest(bool* wait) override { | 59 | Result SyncRequest(bool* wait) override { |
| 60 | u32* cmd_buff = Service::GetCommandBuffer(); | 60 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 61 | FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); | 61 | FileCommand cmd = static_cast<FileCommand>(cmd_buff[0]); |
| 62 | 62 | ||
| 63 | switch (cmd) { | 63 | switch (cmd) { |
| 64 | // Read from archive... | 64 | // Read from archive... |
| 65 | case FileCommand::Read: | 65 | case FileCommand::Read: |
| @@ -343,7 +343,7 @@ Archive* CreateArchive(Handle& handle, FileSys::Archive* backend, const std::str | |||
| 343 | archive->backend = backend; | 343 | archive->backend = backend; |
| 344 | 344 | ||
| 345 | MountArchive(archive); | 345 | MountArchive(archive); |
| 346 | 346 | ||
| 347 | return archive; | 347 | return archive; |
| 348 | } | 348 | } |
| 349 | 349 | ||
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 45ed79be8..e0117c0bc 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <map> | 5 | #include <map> |
| 6 | #include <algorithm> | 6 | #include <algorithm> |
| @@ -95,7 +95,7 @@ Result SignalEvent(const Handle handle) { | |||
| 95 | for (size_t i = 0; i < evt->waiting_threads.size(); ++i) { | 95 | for (size_t i = 0; i < evt->waiting_threads.size(); ++i) { |
| 96 | ResumeThreadFromWait( evt->waiting_threads[i]); | 96 | ResumeThreadFromWait( evt->waiting_threads[i]); |
| 97 | 97 | ||
| 98 | // If any thread is signalled awake by this event, assume the event was "caught" and reset | 98 | // If any thread is signalled awake by this event, assume the event was "caught" and reset |
| 99 | // the event. This will result in the next thread waiting on the event to block. Otherwise, | 99 | // the event. This will result in the next thread waiting on the event to block. Otherwise, |
| 100 | // the event will not be reset, and the next thread to call WaitSynchronization on it will | 100 | // the event will not be reset, and the next thread to call WaitSynchronization on it will |
| 101 | // not block. Not sure if this is correct behavior, but it seems to work. | 101 | // not block. Not sure if this is correct behavior, but it seems to work. |
diff --git a/src/core/hle/kernel/event.h b/src/core/hle/kernel/event.h index c39b33180..6add72897 100644 --- a/src/core/hle/kernel/event.h +++ b/src/core/hle/kernel/event.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 88cbc1af5..018000abd 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project | 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/common.h" | 5 | #include "common/common.h" |
| 6 | 6 | ||
| @@ -68,7 +68,7 @@ void ObjectPool::List() { | |||
| 68 | for (int i = 0; i < MAX_COUNT; i++) { | 68 | for (int i = 0; i < MAX_COUNT; i++) { |
| 69 | if (occupied[i]) { | 69 | if (occupied[i]) { |
| 70 | if (pool[i]) { | 70 | if (pool[i]) { |
| 71 | INFO_LOG(KERNEL, "KO %i: %s \"%s\"", i + HANDLE_OFFSET, pool[i]->GetTypeName().c_str(), | 71 | INFO_LOG(KERNEL, "KO %i: %s \"%s\"", i + HANDLE_OFFSET, pool[i]->GetTypeName().c_str(), |
| 72 | pool[i]->GetName().c_str()); | 72 | pool[i]->GetName().c_str()); |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| @@ -110,7 +110,7 @@ void Shutdown() { | |||
| 110 | */ | 110 | */ |
| 111 | bool LoadExec(u32 entry_point) { | 111 | bool LoadExec(u32 entry_point) { |
| 112 | Init(); | 112 | Init(); |
| 113 | 113 | ||
| 114 | Core::g_app_core->SetPC(entry_point); | 114 | Core::g_app_core->SetPC(entry_point); |
| 115 | 115 | ||
| 116 | // 0x30 is the typical main thread priority I've seen used so far | 116 | // 0x30 is the typical main thread priority I've seen used so far |
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index dd7c91d4f..e0c94f186 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project | 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| @@ -34,7 +34,7 @@ enum class HandleType : u32 { | |||
| 34 | Archive = 12, | 34 | Archive = 12, |
| 35 | Directory = 13, | 35 | Directory = 13, |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | enum { | 38 | enum { |
| 39 | DEFAULT_STACK_SIZE = 0x4000, | 39 | DEFAULT_STACK_SIZE = 0x4000, |
| 40 | }; | 40 | }; |
| @@ -52,7 +52,7 @@ public: | |||
| 52 | virtual Kernel::HandleType GetHandleType() const = 0; | 52 | virtual Kernel::HandleType GetHandleType() const = 0; |
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * Synchronize kernel object | 55 | * Synchronize kernel object |
| 56 | * @param wait Boolean wait set if current thread should wait as a result of sync operation | 56 | * @param wait Boolean wait set if current thread should wait as a result of sync operation |
| 57 | * @return Result of operation, 0 on success, otherwise error code | 57 | * @return Result of operation, 0 on success, otherwise error code |
| 58 | */ | 58 | */ |
| @@ -139,7 +139,7 @@ public: | |||
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | bool GetIDType(Handle handle, HandleType* type) const { | 141 | bool GetIDType(Handle handle, HandleType* type) const { |
| 142 | if ((handle < HANDLE_OFFSET) || (handle >= HANDLE_OFFSET + MAX_COUNT) || | 142 | if ((handle < HANDLE_OFFSET) || (handle >= HANDLE_OFFSET + MAX_COUNT) || |
| 143 | !occupied[handle - HANDLE_OFFSET]) { | 143 | !occupied[handle - HANDLE_OFFSET]) { |
| 144 | ERROR_LOG(KERNEL, "Kernel: Bad object handle %i (%08x)", handle, handle); | 144 | ERROR_LOG(KERNEL, "Kernel: Bad object handle %i (%08x)", handle, handle); |
| 145 | return false; | 145 | return false; |
| @@ -155,7 +155,7 @@ public: | |||
| 155 | int GetCount(); | 155 | int GetCount(); |
| 156 | 156 | ||
| 157 | private: | 157 | private: |
| 158 | 158 | ||
| 159 | enum { | 159 | enum { |
| 160 | MAX_COUNT = 0x1000, | 160 | MAX_COUNT = 0x1000, |
| 161 | HANDLE_OFFSET = 0x100, | 161 | HANDLE_OFFSET = 0x100, |
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index fcfd061ac..31129fd86 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <map> | 5 | #include <map> |
| 6 | #include <vector> | 6 | #include <vector> |
| @@ -28,7 +28,7 @@ public: | |||
| 28 | std::string name; ///< Name of mutex (optional) | 28 | std::string name; ///< Name of mutex (optional) |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * Synchronize kernel object | 31 | * Synchronize kernel object |
| 32 | * @param wait Boolean wait set if current thread should wait as a result of sync operation | 32 | * @param wait Boolean wait set if current thread should wait as a result of sync operation |
| 33 | * @return Result of operation, 0 on success, otherwise error code | 33 | * @return Result of operation, 0 on success, otherwise error code |
| 34 | */ | 34 | */ |
diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h index 7d7b5137e..313ba6fee 100644 --- a/src/core/hle/kernel/mutex.h +++ b/src/core/hle/kernel/mutex.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index f538c6550..7ef3e54cc 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/common.h" | 5 | #include "common/common.h" |
| 6 | 6 | ||
| @@ -67,7 +67,7 @@ Handle CreateSharedMemory(const std::string& name) { | |||
| 67 | * @param other_permissions Memory block map other permissions (specified by SVC field) | 67 | * @param other_permissions Memory block map other permissions (specified by SVC field) |
| 68 | * @return Result of operation, 0 on success, otherwise error code | 68 | * @return Result of operation, 0 on success, otherwise error code |
| 69 | */ | 69 | */ |
| 70 | Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions, | 70 | Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions, |
| 71 | MemoryPermission other_permissions) { | 71 | MemoryPermission other_permissions) { |
| 72 | 72 | ||
| 73 | if (address < Memory::SHARED_MEMORY_VADDR || address >= Memory::SHARED_MEMORY_VADDR_END) { | 73 | if (address < Memory::SHARED_MEMORY_VADDR || address >= Memory::SHARED_MEMORY_VADDR_END) { |
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index 5312b8854..0aec03538 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| @@ -34,7 +34,7 @@ Handle CreateSharedMemory(const std::string& name="Unknown"); | |||
| 34 | * @param other_permissions Memory block map other permissions (specified by SVC field) | 34 | * @param other_permissions Memory block map other permissions (specified by SVC field) |
| 35 | * @return Result of operation, 0 on success, otherwise error code | 35 | * @return Result of operation, 0 on success, otherwise error code |
| 36 | */ | 36 | */ |
| 37 | Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions, | 37 | Result MapSharedMemory(u32 handle, u32 address, MemoryPermission permissions, |
| 38 | MemoryPermission other_permissions); | 38 | MemoryPermission other_permissions); |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index e15590c49..9e2e15c8e 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project | 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <list> | 6 | #include <list> |
| @@ -113,7 +113,7 @@ void ResetThread(Thread* t, u32 arg, s32 lowest_priority) { | |||
| 113 | t->context.pc = t->context.reg_15 = t->entry_point; | 113 | t->context.pc = t->context.reg_15 = t->entry_point; |
| 114 | t->context.sp = t->stack_top; | 114 | t->context.sp = t->stack_top; |
| 115 | t->context.cpsr = 0x1F; // Usermode | 115 | t->context.cpsr = 0x1F; // Usermode |
| 116 | 116 | ||
| 117 | // TODO(bunnei): This instructs the CPU core to start the execution as if it is "resuming" a | 117 | // TODO(bunnei): This instructs the CPU core to start the execution as if it is "resuming" a |
| 118 | // thread. This is somewhat Sky-Eye specific, and should be re-architected in the future to be | 118 | // thread. This is somewhat Sky-Eye specific, and should be re-architected in the future to be |
| 119 | // agnostic of the CPU core. | 119 | // agnostic of the CPU core. |
| @@ -148,7 +148,7 @@ inline bool VerifyWait(const Handle& handle, WaitType type, Handle wait_handle) | |||
| 148 | Thread* thread = g_object_pool.GetFast<Thread>(handle); | 148 | Thread* thread = g_object_pool.GetFast<Thread>(handle); |
| 149 | _assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!"); | 149 | _assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!"); |
| 150 | 150 | ||
| 151 | if (type != thread->wait_type || wait_handle != thread->wait_handle) | 151 | if (type != thread->wait_type || wait_handle != thread->wait_handle) |
| 152 | return false; | 152 | return false; |
| 153 | 153 | ||
| 154 | return true; | 154 | return true; |
| @@ -158,7 +158,7 @@ inline bool VerifyWait(const Handle& handle, WaitType type, Handle wait_handle) | |||
| 158 | void StopThread(Handle handle, const char* reason) { | 158 | void StopThread(Handle handle, const char* reason) { |
| 159 | Thread* thread = g_object_pool.GetFast<Thread>(handle); | 159 | Thread* thread = g_object_pool.GetFast<Thread>(handle); |
| 160 | _assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!"); | 160 | _assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!"); |
| 161 | 161 | ||
| 162 | ChangeReadyState(thread, false); | 162 | ChangeReadyState(thread, false); |
| 163 | thread->status = THREADSTATUS_DORMANT; | 163 | thread->status = THREADSTATUS_DORMANT; |
| 164 | for (size_t i = 0; i < thread->waiting_threads.size(); ++i) { | 164 | for (size_t i = 0; i < thread->waiting_threads.size(); ++i) { |
| @@ -181,7 +181,7 @@ void ChangeThreadState(Thread* t, ThreadStatus new_status) { | |||
| 181 | } | 181 | } |
| 182 | ChangeReadyState(t, (new_status & THREADSTATUS_READY) != 0); | 182 | ChangeReadyState(t, (new_status & THREADSTATUS_READY) != 0); |
| 183 | t->status = new_status; | 183 | t->status = new_status; |
| 184 | 184 | ||
| 185 | if (new_status == THREADSTATUS_WAIT) { | 185 | if (new_status == THREADSTATUS_WAIT) { |
| 186 | if (t->wait_type == WAITTYPE_NONE) { | 186 | if (t->wait_type == WAITTYPE_NONE) { |
| 187 | ERROR_LOG(KERNEL, "Waittype none not allowed"); | 187 | ERROR_LOG(KERNEL, "Waittype none not allowed"); |
| @@ -216,7 +216,7 @@ Handle ArbitrateHighestPriorityThread(u32 arbiter, u32 address) { | |||
| 216 | 216 | ||
| 217 | /// Arbitrate all threads currently waiting | 217 | /// Arbitrate all threads currently waiting |
| 218 | void ArbitrateAllThreads(u32 arbiter, u32 address) { | 218 | void ArbitrateAllThreads(u32 arbiter, u32 address) { |
| 219 | 219 | ||
| 220 | // Iterate through threads, find highest priority thread that is waiting to be arbitrated... | 220 | // Iterate through threads, find highest priority thread that is waiting to be arbitrated... |
| 221 | for (const auto& handle : g_thread_queue) { | 221 | for (const auto& handle : g_thread_queue) { |
| 222 | 222 | ||
| @@ -238,11 +238,11 @@ void CallThread(Thread* t) { | |||
| 238 | /// Switches CPU context to that of the specified thread | 238 | /// Switches CPU context to that of the specified thread |
| 239 | void SwitchContext(Thread* t) { | 239 | void SwitchContext(Thread* t) { |
| 240 | Thread* cur = GetCurrentThread(); | 240 | Thread* cur = GetCurrentThread(); |
| 241 | 241 | ||
| 242 | // Save context for current thread | 242 | // Save context for current thread |
| 243 | if (cur) { | 243 | if (cur) { |
| 244 | SaveContext(cur->context); | 244 | SaveContext(cur->context); |
| 245 | 245 | ||
| 246 | if (cur->IsRunning()) { | 246 | if (cur->IsRunning()) { |
| 247 | ChangeReadyState(cur, true); | 247 | ChangeReadyState(cur, true); |
| 248 | } | 248 | } |
| @@ -263,7 +263,7 @@ void SwitchContext(Thread* t) { | |||
| 263 | Thread* NextThread() { | 263 | Thread* NextThread() { |
| 264 | Handle next; | 264 | Handle next; |
| 265 | Thread* cur = GetCurrentThread(); | 265 | Thread* cur = GetCurrentThread(); |
| 266 | 266 | ||
| 267 | if (cur && cur->IsRunning()) { | 267 | if (cur && cur->IsRunning()) { |
| 268 | next = g_thread_ready_queue.pop_first_better(cur->current_priority); | 268 | next = g_thread_ready_queue.pop_first_better(cur->current_priority); |
| 269 | } else { | 269 | } else { |
| @@ -319,7 +319,7 @@ void DebugThreadQueue() { | |||
| 319 | Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 priority, | 319 | Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 priority, |
| 320 | s32 processor_id, u32 stack_top, int stack_size) { | 320 | s32 processor_id, u32 stack_top, int stack_size) { |
| 321 | 321 | ||
| 322 | _assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST), | 322 | _assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST), |
| 323 | "CreateThread priority=%d, outside of allowable range!", priority) | 323 | "CreateThread priority=%d, outside of allowable range!", priority) |
| 324 | 324 | ||
| 325 | Thread* thread = new Thread; | 325 | Thread* thread = new Thread; |
| @@ -351,7 +351,7 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3 | |||
| 351 | return -1; | 351 | return -1; |
| 352 | } | 352 | } |
| 353 | if ((u32)stack_size < 0x200) { | 353 | if ((u32)stack_size < 0x200) { |
| 354 | ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid stack_size=0x%08X", name, | 354 | ERROR_LOG(KERNEL, "CreateThread(name=%s): invalid stack_size=0x%08X", name, |
| 355 | stack_size); | 355 | stack_size); |
| 356 | return -1; | 356 | return -1; |
| 357 | } | 357 | } |
| @@ -368,7 +368,7 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3 | |||
| 368 | return -1; | 368 | return -1; |
| 369 | } | 369 | } |
| 370 | Handle handle; | 370 | Handle handle; |
| 371 | Thread* thread = CreateThread(handle, name, entry_point, priority, processor_id, stack_top, | 371 | Thread* thread = CreateThread(handle, name, entry_point, priority, processor_id, stack_top, |
| 372 | stack_size); | 372 | stack_size); |
| 373 | 373 | ||
| 374 | ResetThread(thread, arg, 0); | 374 | ResetThread(thread, arg, 0); |
| @@ -423,19 +423,19 @@ Result SetThreadPriority(Handle handle, s32 priority) { | |||
| 423 | /// Sets up the primary application thread | 423 | /// Sets up the primary application thread |
| 424 | Handle SetupMainThread(s32 priority, int stack_size) { | 424 | Handle SetupMainThread(s32 priority, int stack_size) { |
| 425 | Handle handle; | 425 | Handle handle; |
| 426 | 426 | ||
| 427 | // Initialize new "main" thread | 427 | // Initialize new "main" thread |
| 428 | Thread* thread = CreateThread(handle, "main", Core::g_app_core->GetPC(), priority, | 428 | Thread* thread = CreateThread(handle, "main", Core::g_app_core->GetPC(), priority, |
| 429 | THREADPROCESSORID_0, Memory::SCRATCHPAD_VADDR_END, stack_size); | 429 | THREADPROCESSORID_0, Memory::SCRATCHPAD_VADDR_END, stack_size); |
| 430 | 430 | ||
| 431 | ResetThread(thread, 0, 0); | 431 | ResetThread(thread, 0, 0); |
| 432 | 432 | ||
| 433 | // If running another thread already, set it to "ready" state | 433 | // If running another thread already, set it to "ready" state |
| 434 | Thread* cur = GetCurrentThread(); | 434 | Thread* cur = GetCurrentThread(); |
| 435 | if (cur && cur->IsRunning()) { | 435 | if (cur && cur->IsRunning()) { |
| 436 | ChangeReadyState(cur, true); | 436 | ChangeReadyState(cur, true); |
| 437 | } | 437 | } |
| 438 | 438 | ||
| 439 | // Run new "main" thread | 439 | // Run new "main" thread |
| 440 | SetCurrentThread(thread); | 440 | SetCurrentThread(thread); |
| 441 | thread->status = THREADSTATUS_RUNNING; | 441 | thread->status = THREADSTATUS_RUNNING; |
| @@ -452,12 +452,12 @@ void Reschedule() { | |||
| 452 | HLE::g_reschedule = false; | 452 | HLE::g_reschedule = false; |
| 453 | if (next > 0) { | 453 | if (next > 0) { |
| 454 | INFO_LOG(KERNEL, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle()); | 454 | INFO_LOG(KERNEL, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle()); |
| 455 | 455 | ||
| 456 | SwitchContext(next); | 456 | SwitchContext(next); |
| 457 | 457 | ||
| 458 | // Hack - There is no mechanism yet to waken the primary thread if it has been put to sleep | 458 | // Hack - There is no mechanism yet to waken the primary thread if it has been put to sleep |
| 459 | // by a simulated VBLANK thread switch. So, we'll just immediately set it to "ready" again. | 459 | // by a simulated VBLANK thread switch. So, we'll just immediately set it to "ready" again. |
| 460 | // This results in the current thread yielding on a VBLANK once, and then it will be | 460 | // This results in the current thread yielding on a VBLANK once, and then it will be |
| 461 | // immediately placed back in the queue for execution. | 461 | // immediately placed back in the queue for execution. |
| 462 | if (prev->wait_type == WAITTYPE_VBLANK) { | 462 | if (prev->wait_type == WAITTYPE_VBLANK) { |
| 463 | ResumeThreadFromWait(prev->GetHandle()); | 463 | ResumeThreadFromWait(prev->GetHandle()); |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 39fa38b75..2a43797ee 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project | 1 | // Copyright 2014 Citra Emulator Project / PPSSPP Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/hle/service/ac_u.h b/src/core/hle/service/ac_u.h index 3c5958d27..8509a793e 100644 --- a/src/core/hle/service/ac_u.h +++ b/src/core/hle/service/ac_u.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 9 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 10 | // Namespace AC_U | 10 | // Namespace AC_U |
| 11 | 11 | ||
| 12 | // socket service "ac:u" | 12 | // socket service "ac:u" |
| 13 | 13 | ||
| 14 | namespace AC_U { | 14 | namespace AC_U { |
| 15 | 15 | ||
diff --git a/src/core/hle/service/apt_u.cpp b/src/core/hle/service/apt_u.cpp index 4f41ec5f4..4bb05ce40 100644 --- a/src/core/hle/service/apt_u.cpp +++ b/src/core/hle/service/apt_u.cpp | |||
| @@ -27,7 +27,7 @@ enum class SignalType : u32 { | |||
| 27 | 27 | ||
| 28 | void Initialize(Service::Interface* self) { | 28 | void Initialize(Service::Interface* self) { |
| 29 | u32* cmd_buff = Service::GetCommandBuffer(); | 29 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 30 | 30 | ||
| 31 | cmd_buff[3] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Menu"); // APT menu event handle | 31 | cmd_buff[3] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Menu"); // APT menu event handle |
| 32 | cmd_buff[4] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Pause"); // APT pause event handle | 32 | cmd_buff[4] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "APT_U:Pause"); // APT pause event handle |
| 33 | 33 | ||
| @@ -168,7 +168,7 @@ void AppletUtility(Service::Interface* self) { | |||
| 168 | cmd_buff[1] = 0; // No error | 168 | cmd_buff[1] = 0; // No error |
| 169 | 169 | ||
| 170 | WARN_LOG(KERNEL, "(STUBBED) called unk=0x%08X, buffer1_size=0x%08x, buffer2_size=0x%08x, " | 170 | WARN_LOG(KERNEL, "(STUBBED) called unk=0x%08X, buffer1_size=0x%08x, buffer2_size=0x%08x, " |
| 171 | "buffer1_addr=0x%08x, buffer2_addr=0x%08x", unk, buffer1_size, buffer2_size, | 171 | "buffer1_addr=0x%08x, buffer2_addr=0x%08x", unk, buffer1_size, buffer2_size, |
| 172 | buffer1_addr, buffer2_addr); | 172 | buffer1_addr, buffer2_addr); |
| 173 | } | 173 | } |
| 174 | 174 | ||
diff --git a/src/core/hle/service/apt_u.h b/src/core/hle/service/apt_u.h index 5af39e085..306730400 100644 --- a/src/core/hle/service/apt_u.h +++ b/src/core/hle/service/apt_u.h | |||
| @@ -13,8 +13,8 @@ namespace APT_U { | |||
| 13 | 13 | ||
| 14 | // Application and title launching service. These services handle signaling for home/power button as | 14 | // Application and title launching service. These services handle signaling for home/power button as |
| 15 | // well. Only one session for either APT service can be open at a time, normally processes close the | 15 | // well. Only one session for either APT service can be open at a time, normally processes close the |
| 16 | // service handle immediately once finished using the service. The commands for APT:U and APT:S are | 16 | // service handle immediately once finished using the service. The commands for APT:U and APT:S are |
| 17 | // exactly the same, however certain commands are only accessible with APT:S(NS module will call | 17 | // exactly the same, however certain commands are only accessible with APT:S(NS module will call |
| 18 | // svcBreak when the command isn't accessible). See http://3dbrew.org/wiki/NS#APT_Services. | 18 | // svcBreak when the command isn't accessible). See http://3dbrew.org/wiki/NS#APT_Services. |
| 19 | 19 | ||
| 20 | /// Interface to "APT:U" service | 20 | /// Interface to "APT:U" service |
diff --git a/src/core/hle/service/boss_u.cpp b/src/core/hle/service/boss_u.cpp index d398edc68..b2ff4a756 100644 --- a/src/core/hle/service/boss_u.cpp +++ b/src/core/hle/service/boss_u.cpp | |||
| @@ -21,8 +21,8 @@ namespace BOSS_U { | |||
| 21 | Interface::Interface() { | 21 | Interface::Interface() { |
| 22 | Register(FunctionTable, ARRAY_SIZE(FunctionTable)); | 22 | Register(FunctionTable, ARRAY_SIZE(FunctionTable)); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | Interface::~Interface() { | 25 | Interface::~Interface() { |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | } // namespace | 28 | } // namespace |
diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index 917b2f8ca..785c351e9 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp | |||
| @@ -20,8 +20,8 @@ namespace ERR_F { | |||
| 20 | Interface::Interface() { | 20 | Interface::Interface() { |
| 21 | Register(FunctionTable, ARRAY_SIZE(FunctionTable)); | 21 | Register(FunctionTable, ARRAY_SIZE(FunctionTable)); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | Interface::~Interface() { | 24 | Interface::~Interface() { |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | } // namespace | 27 | } // namespace |
diff --git a/src/core/hle/service/err_f.h b/src/core/hle/service/err_f.h index 5da663267..8b636b96c 100644 --- a/src/core/hle/service/err_f.h +++ b/src/core/hle/service/err_f.h | |||
| @@ -23,5 +23,5 @@ namespace ERR_F { | |||
| 23 | return "err:f"; | 23 | return "err:f"; |
| 24 | } | 24 | } |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | } // namespace | 27 | } // namespace |
diff --git a/src/core/hle/service/fs_user.cpp b/src/core/hle/service/fs_user.cpp index 06d3f5656..dadc89ef8 100644 --- a/src/core/hle/service/fs_user.cpp +++ b/src/core/hle/service/fs_user.cpp | |||
| @@ -269,7 +269,7 @@ static void IsSdmcDetected(Service::Interface* self) { | |||
| 269 | 269 | ||
| 270 | cmd_buff[1] = 0; | 270 | cmd_buff[1] = 0; |
| 271 | cmd_buff[2] = Settings::values.use_virtual_sd ? 1 : 0; | 271 | cmd_buff[2] = Settings::values.use_virtual_sd ? 1 : 0; |
| 272 | 272 | ||
| 273 | DEBUG_LOG(KERNEL, "called"); | 273 | DEBUG_LOG(KERNEL, "called"); |
| 274 | } | 274 | } |
| 275 | 275 | ||
diff --git a/src/core/hle/service/hid_user.h b/src/core/hle/service/hid_user.h index 9f6c4d5ed..5ed97085d 100644 --- a/src/core/hle/service/hid_user.h +++ b/src/core/hle/service/hid_user.h | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | namespace HID_User { | 16 | namespace HID_User { |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * Structure of a Pad controller state. | 19 | * Structure of a Pad controller state. |
| 20 | */ | 20 | */ |
| 21 | struct PadState { | 21 | struct PadState { |
diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp index 58051f133..d6f30e9ae 100644 --- a/src/core/hle/service/mic_u.cpp +++ b/src/core/hle/service/mic_u.cpp | |||
| @@ -27,7 +27,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 27 | {0x000D0040, nullptr, "SetClamp"}, | 27 | {0x000D0040, nullptr, "SetClamp"}, |
| 28 | {0x000E0000, nullptr, "GetClamp"}, | 28 | {0x000E0000, nullptr, "GetClamp"}, |
| 29 | {0x000F0040, nullptr, "unknown_input1"}, | 29 | {0x000F0040, nullptr, "unknown_input1"}, |
| 30 | {0x00100040, nullptr, "unknown_input2"}, | 30 | {0x00100040, nullptr, "unknown_input2"}, |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 33 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index ba7299170..5906e2060 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -75,7 +75,7 @@ Interface* Manager::FetchFromPortName(const std::string& port_name) { | |||
| 75 | /// Initialize ServiceManager | 75 | /// Initialize ServiceManager |
| 76 | void Init() { | 76 | void Init() { |
| 77 | g_manager = new Manager; | 77 | g_manager = new Manager; |
| 78 | 78 | ||
| 79 | g_manager->AddService(new SRV::Interface); | 79 | g_manager->AddService(new SRV::Interface); |
| 80 | g_manager->AddService(new AC_U::Interface); | 80 | g_manager->AddService(new AC_U::Interface); |
| 81 | g_manager->AddService(new APT_U::Interface); | 81 | g_manager->AddService(new APT_U::Interface); |
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 2f5a866c9..55aa84e83 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h | |||
| @@ -38,7 +38,7 @@ class Manager; | |||
| 38 | class Interface : public Kernel::Object { | 38 | class Interface : public Kernel::Object { |
| 39 | friend class Manager; | 39 | friend class Manager; |
| 40 | public: | 40 | public: |
| 41 | 41 | ||
| 42 | std::string GetName() const override { return GetPortName(); } | 42 | std::string GetName() const override { return GetPortName(); } |
| 43 | std::string GetTypeName() const override { return GetPortName(); } | 43 | std::string GetTypeName() const override { return GetPortName(); } |
| 44 | 44 | ||
| @@ -76,7 +76,7 @@ public: | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /** | 78 | /** |
| 79 | * Synchronize kernel object | 79 | * Synchronize kernel object |
| 80 | * @param wait Boolean wait set if current thread should wait as a result of sync operation | 80 | * @param wait Boolean wait set if current thread should wait as a result of sync operation |
| 81 | * @return Result of operation, 0 on success, otherwise error code | 81 | * @return Result of operation, 0 on success, otherwise error code |
| 82 | */ | 82 | */ |
| @@ -85,23 +85,23 @@ public: | |||
| 85 | auto itr = m_functions.find(cmd_buff[0]); | 85 | auto itr = m_functions.find(cmd_buff[0]); |
| 86 | 86 | ||
| 87 | if (itr == m_functions.end()) { | 87 | if (itr == m_functions.end()) { |
| 88 | ERROR_LOG(OSHLE, "unknown/unimplemented function: port=%s, command=0x%08X", | 88 | ERROR_LOG(OSHLE, "unknown/unimplemented function: port=%s, command=0x%08X", |
| 89 | GetPortName().c_str(), cmd_buff[0]); | 89 | GetPortName().c_str(), cmd_buff[0]); |
| 90 | 90 | ||
| 91 | // TODO(bunnei): Hack - ignore error | 91 | // TODO(bunnei): Hack - ignore error |
| 92 | u32* cmd_buff = Service::GetCommandBuffer(); | 92 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 93 | cmd_buff[1] = 0; | 93 | cmd_buff[1] = 0; |
| 94 | return 0; | 94 | return 0; |
| 95 | } | 95 | } |
| 96 | if (itr->second.func == nullptr) { | 96 | if (itr->second.func == nullptr) { |
| 97 | ERROR_LOG(OSHLE, "unimplemented function: port=%s, name=%s", | 97 | ERROR_LOG(OSHLE, "unimplemented function: port=%s, name=%s", |
| 98 | GetPortName().c_str(), itr->second.name.c_str()); | 98 | GetPortName().c_str(), itr->second.name.c_str()); |
| 99 | 99 | ||
| 100 | // TODO(bunnei): Hack - ignore error | 100 | // TODO(bunnei): Hack - ignore error |
| 101 | u32* cmd_buff = Service::GetCommandBuffer(); | 101 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 102 | cmd_buff[1] = 0; | 102 | cmd_buff[1] = 0; |
| 103 | return 0; | 103 | return 0; |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | itr->second.func(this); | 106 | itr->second.func(this); |
| 107 | 107 | ||
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 16a1d99b7..3a06d6765 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <map> | 5 | #include <map> |
| 6 | 6 | ||
| @@ -30,7 +30,7 @@ enum ControlMemoryOperation { | |||
| 30 | 30 | ||
| 31 | /// Map application or GSP heap memory | 31 | /// Map application or GSP heap memory |
| 32 | static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { | 32 | static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { |
| 33 | DEBUG_LOG(SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X", | 33 | DEBUG_LOG(SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X", |
| 34 | operation, addr0, addr1, size, permissions); | 34 | operation, addr0, addr1, size, permissions); |
| 35 | 35 | ||
| 36 | switch (operation) { | 36 | switch (operation) { |
| @@ -54,7 +54,7 @@ static Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, | |||
| 54 | 54 | ||
| 55 | /// Maps a memory block to specified address | 55 | /// Maps a memory block to specified address |
| 56 | static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { | 56 | static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { |
| 57 | DEBUG_LOG(SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d", | 57 | DEBUG_LOG(SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d", |
| 58 | handle, addr, permissions, other_permissions); | 58 | handle, addr, permissions, other_permissions); |
| 59 | 59 | ||
| 60 | Kernel::MemoryPermission permissions_type = static_cast<Kernel::MemoryPermission>(permissions); | 60 | Kernel::MemoryPermission permissions_type = static_cast<Kernel::MemoryPermission>(permissions); |
| @@ -63,7 +63,7 @@ static Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other | |||
| 63 | case Kernel::MemoryPermission::Write: | 63 | case Kernel::MemoryPermission::Write: |
| 64 | case Kernel::MemoryPermission::ReadWrite: | 64 | case Kernel::MemoryPermission::ReadWrite: |
| 65 | case Kernel::MemoryPermission::DontCare: | 65 | case Kernel::MemoryPermission::DontCare: |
| 66 | Kernel::MapSharedMemory(handle, addr, permissions_type, | 66 | Kernel::MapSharedMemory(handle, addr, permissions_type, |
| 67 | static_cast<Kernel::MemoryPermission>(other_permissions)); | 67 | static_cast<Kernel::MemoryPermission>(other_permissions)); |
| 68 | break; | 68 | break; |
| 69 | default: | 69 | default: |
| @@ -115,7 +115,7 @@ static Result WaitSynchronization1(Handle handle, s64 nano_seconds) { | |||
| 115 | 115 | ||
| 116 | Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle); | 116 | Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handle); |
| 117 | 117 | ||
| 118 | DEBUG_LOG(SVC, "called handle=0x%08X(%s:%s), nanoseconds=%lld", handle, object->GetTypeName().c_str(), | 118 | DEBUG_LOG(SVC, "called handle=0x%08X(%s:%s), nanoseconds=%lld", handle, object->GetTypeName().c_str(), |
| 119 | object->GetName().c_str(), nano_seconds); | 119 | object->GetName().c_str(), nano_seconds); |
| 120 | 120 | ||
| 121 | _assert_msg_(KERNEL, (object != nullptr), "called, but kernel object is nullptr!"); | 121 | _assert_msg_(KERNEL, (object != nullptr), "called, but kernel object is nullptr!"); |
| @@ -138,7 +138,7 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, | |||
| 138 | bool unlock_all = true; | 138 | bool unlock_all = true; |
| 139 | bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated | 139 | bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated |
| 140 | 140 | ||
| 141 | DEBUG_LOG(SVC, "called handle_count=%d, wait_all=%s, nanoseconds=%lld", | 141 | DEBUG_LOG(SVC, "called handle_count=%d, wait_all=%s, nanoseconds=%lld", |
| 142 | handle_count, (wait_all ? "true" : "false"), nano_seconds); | 142 | handle_count, (wait_all ? "true" : "false"), nano_seconds); |
| 143 | 143 | ||
| 144 | // Iterate through each handle, synchronize kernel object | 144 | // Iterate through each handle, synchronize kernel object |
| @@ -149,7 +149,7 @@ static Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, | |||
| 149 | _assert_msg_(KERNEL, (object != nullptr), "called handle=0x%08X, but kernel object " | 149 | _assert_msg_(KERNEL, (object != nullptr), "called handle=0x%08X, but kernel object " |
| 150 | "is nullptr!", handles[i]); | 150 | "is nullptr!", handles[i]); |
| 151 | 151 | ||
| 152 | DEBUG_LOG(SVC, "\thandle[%d] = 0x%08X(%s:%s)", i, handles[i], object->GetTypeName().c_str(), | 152 | DEBUG_LOG(SVC, "\thandle[%d] = 0x%08X(%s:%s)", i, handles[i], object->GetTypeName().c_str(), |
| 153 | object->GetName().c_str()); | 153 | object->GetName().c_str()); |
| 154 | 154 | ||
| 155 | Result res = object->WaitSynchronization(&wait); | 155 | Result res = object->WaitSynchronization(&wait); |
| @@ -183,7 +183,7 @@ static Result CreateAddressArbiter(u32* arbiter) { | |||
| 183 | 183 | ||
| 184 | /// Arbitrate address | 184 | /// Arbitrate address |
| 185 | static Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value, s64 nanoseconds) { | 185 | static Result ArbitrateAddress(Handle arbiter, u32 address, u32 type, u32 value, s64 nanoseconds) { |
| 186 | return Kernel::ArbitrateAddress(arbiter, static_cast<Kernel::ArbitrationType>(type), address, | 186 | return Kernel::ArbitrateAddress(arbiter, static_cast<Kernel::ArbitrationType>(type), address, |
| 187 | value); | 187 | value); |
| 188 | } | 188 | } |
| 189 | 189 | ||
| @@ -195,7 +195,7 @@ static void OutputDebugString(const char* string) { | |||
| 195 | /// Get resource limit | 195 | /// Get resource limit |
| 196 | static Result GetResourceLimit(Handle* resource_limit, Handle process) { | 196 | static Result GetResourceLimit(Handle* resource_limit, Handle process) { |
| 197 | // With regards to proceess values: | 197 | // With regards to proceess values: |
| 198 | // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for | 198 | // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for |
| 199 | // the current KThread. | 199 | // the current KThread. |
| 200 | *resource_limit = 0xDEADBEEF; | 200 | *resource_limit = 0xDEADBEEF; |
| 201 | ERROR_LOG(SVC, "(UNIMPLEMENTED) called process=0x%08X", process); | 201 | ERROR_LOG(SVC, "(UNIMPLEMENTED) called process=0x%08X", process); |
| @@ -227,9 +227,9 @@ static Result CreateThread(u32 priority, u32 entry_point, u32 arg, u32 stack_top | |||
| 227 | Core::g_app_core->SetReg(1, thread); | 227 | Core::g_app_core->SetReg(1, thread); |
| 228 | 228 | ||
| 229 | DEBUG_LOG(SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " | 229 | DEBUG_LOG(SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, " |
| 230 | "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", entry_point, | 230 | "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X", entry_point, |
| 231 | name.c_str(), arg, stack_top, priority, processor_id, thread); | 231 | name.c_str(), arg, stack_top, priority, processor_id, thread); |
| 232 | 232 | ||
| 233 | return 0; | 233 | return 0; |
| 234 | } | 234 | } |
| 235 | 235 | ||
| @@ -258,7 +258,7 @@ static Result SetThreadPriority(Handle handle, s32 priority) { | |||
| 258 | /// Create a mutex | 258 | /// Create a mutex |
| 259 | static Result CreateMutex(Handle* mutex, u32 initial_locked) { | 259 | static Result CreateMutex(Handle* mutex, u32 initial_locked) { |
| 260 | *mutex = Kernel::CreateMutex((initial_locked != 0)); | 260 | *mutex = Kernel::CreateMutex((initial_locked != 0)); |
| 261 | DEBUG_LOG(SVC, "called initial_locked=%s : created handle=0x%08X", | 261 | DEBUG_LOG(SVC, "called initial_locked=%s : created handle=0x%08X", |
| 262 | initial_locked ? "true" : "false", *mutex); | 262 | initial_locked ? "true" : "false", *mutex); |
| 263 | return 0; | 263 | return 0; |
| 264 | } | 264 | } |
| @@ -286,7 +286,7 @@ static Result QueryMemory(void* info, void* out, u32 addr) { | |||
| 286 | /// Create an event | 286 | /// Create an event |
| 287 | static Result CreateEvent(Handle* evt, u32 reset_type) { | 287 | static Result CreateEvent(Handle* evt, u32 reset_type) { |
| 288 | *evt = Kernel::CreateEvent((ResetType)reset_type); | 288 | *evt = Kernel::CreateEvent((ResetType)reset_type); |
| 289 | DEBUG_LOG(SVC, "called reset_type=0x%08X : created handle=0x%08X", | 289 | DEBUG_LOG(SVC, "called reset_type=0x%08X : created handle=0x%08X", |
| 290 | reset_type, *evt); | 290 | reset_type, *evt); |
| 291 | return 0; | 291 | return 0; |
| 292 | } | 292 | } |
| @@ -301,7 +301,7 @@ static Result DuplicateHandle(Handle* out, Handle handle) { | |||
| 301 | } | 301 | } |
| 302 | _assert_msg_(KERNEL, (handle != Kernel::CurrentProcess), | 302 | _assert_msg_(KERNEL, (handle != Kernel::CurrentProcess), |
| 303 | "(UNIMPLEMENTED) process handle duplication!"); | 303 | "(UNIMPLEMENTED) process handle duplication!"); |
| 304 | 304 | ||
| 305 | // TODO(bunnei): FixMe - This is a hack to return the handle that we were asked to duplicate. | 305 | // TODO(bunnei): FixMe - This is a hack to return the handle that we were asked to duplicate. |
| 306 | *out = handle; | 306 | *out = handle; |
| 307 | 307 | ||
diff --git a/src/core/hle/svc.h b/src/core/hle/svc.h index 1d125faf6..6be393d0b 100644 --- a/src/core/hle/svc.h +++ b/src/core/hle/svc.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | 1 | // Copyright 2014 Citra Emulator Project |
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index 33f75c50a..4d0719263 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp | |||
| @@ -39,7 +39,7 @@ enum { | |||
| 39 | template <typename T> | 39 | template <typename T> |
| 40 | inline void Read(T &var, const u32 addr) { | 40 | inline void Read(T &var, const u32 addr) { |
| 41 | switch (addr & 0xFFFFF000) { | 41 | switch (addr & 0xFFFFF000) { |
| 42 | 42 | ||
| 43 | // TODO(bunnei): What is the virtual address of NDMA? | 43 | // TODO(bunnei): What is the virtual address of NDMA? |
| 44 | // case VADDR_NDMA: | 44 | // case VADDR_NDMA: |
| 45 | // NDMA::Read(var, addr); | 45 | // NDMA::Read(var, addr); |
| @@ -57,9 +57,9 @@ inline void Read(T &var, const u32 addr) { | |||
| 57 | template <typename T> | 57 | template <typename T> |
| 58 | inline void Write(u32 addr, const T data) { | 58 | inline void Write(u32 addr, const T data) { |
| 59 | switch (addr & 0xFFFFF000) { | 59 | switch (addr & 0xFFFFF000) { |
| 60 | 60 | ||
| 61 | // TODO(bunnei): What is the virtual address of NDMA? | 61 | // TODO(bunnei): What is the virtual address of NDMA? |
| 62 | // case VADDR_NDMA | 62 | // case VADDR_NDMA |
| 63 | // NDMA::Write(addr, data); | 63 | // NDMA::Write(addr, data); |
| 64 | // break; | 64 | // break; |
| 65 | 65 | ||
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 389d5a8c9..63d2496ed 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp | |||
| @@ -273,13 +273,13 @@ bool ElfReader::LoadInto(u32 vaddr) { | |||
| 273 | 273 | ||
| 274 | for (int i = 0; i < header->e_phnum; i++) { | 274 | for (int i = 0; i < header->e_phnum; i++) { |
| 275 | Elf32_Phdr *p = segments + i; | 275 | Elf32_Phdr *p = segments + i; |
| 276 | INFO_LOG(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr, | 276 | INFO_LOG(MASTER_LOG, "Type: %i Vaddr: %08x Filesz: %i Memsz: %i ", p->p_type, p->p_vaddr, |
| 277 | p->p_filesz, p->p_memsz); | 277 | p->p_filesz, p->p_memsz); |
| 278 | 278 | ||
| 279 | if (p->p_type == PT_LOAD) { | 279 | if (p->p_type == PT_LOAD) { |
| 280 | segment_addr[i] = base_addr + p->p_vaddr; | 280 | segment_addr[i] = base_addr + p->p_vaddr; |
| 281 | memcpy(Memory::GetPointer(segment_addr[i]), GetSegmentPtr(i), p->p_filesz); | 281 | memcpy(Memory::GetPointer(segment_addr[i]), GetSegmentPtr(i), p->p_filesz); |
| 282 | INFO_LOG(MASTER_LOG, "Loadable Segment Copied to %08x, size %08x", segment_addr[i], | 282 | INFO_LOG(MASTER_LOG, "Loadable Segment Copied to %08x, size %08x", segment_addr[i], |
| 283 | p->p_memsz); | 283 | p->p_memsz); |
| 284 | } | 284 | } |
| 285 | } | 285 | } |
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 5b6f88604..343bb7523 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp | |||
| @@ -118,7 +118,7 @@ AppLoader_NCCH::~AppLoader_NCCH() { | |||
| 118 | * @return ResultStatus result of function | 118 | * @return ResultStatus result of function |
| 119 | */ | 119 | */ |
| 120 | ResultStatus AppLoader_NCCH::LoadExec() const { | 120 | ResultStatus AppLoader_NCCH::LoadExec() const { |
| 121 | if (!is_loaded) | 121 | if (!is_loaded) |
| 122 | return ResultStatus::ErrorNotLoaded; | 122 | return ResultStatus::ErrorNotLoaded; |
| 123 | 123 | ||
| 124 | std::vector<u8> code; | 124 | std::vector<u8> code; |
| @@ -185,7 +185,7 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>& | |||
| 185 | return ResultStatus::Error; | 185 | return ResultStatus::Error; |
| 186 | } | 186 | } |
| 187 | return ResultStatus::ErrorNotUsed; | 187 | return ResultStatus::ErrorNotUsed; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | /** | 190 | /** |
| 191 | * Loads an NCCH file (e.g. from a CCI, or the first NCCH in a CXI) | 191 | * Loads an NCCH file (e.g. from a CCI, or the first NCCH in a CXI) |
| @@ -210,7 +210,7 @@ ResultStatus AppLoader_NCCH::Load() { | |||
| 210 | file.Seek(ncch_offset, 0); | 210 | file.Seek(ncch_offset, 0); |
| 211 | file.ReadBytes(&ncch_header, sizeof(NCCH_Header)); | 211 | file.ReadBytes(&ncch_header, sizeof(NCCH_Header)); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | // Verify we are loading the correct file type... | 214 | // Verify we are loading the correct file type... |
| 215 | if (0 != memcmp(&ncch_header.magic, "NCCH", 4)) | 215 | if (0 != memcmp(&ncch_header.magic, "NCCH", 4)) |
| 216 | return ResultStatus::ErrorInvalidFormat; | 216 | return ResultStatus::ErrorInvalidFormat; |
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index f40a258b7..03116add8 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h | |||
| @@ -215,7 +215,7 @@ private: | |||
| 215 | u32 entry_point; | 215 | u32 entry_point; |
| 216 | u32 ncch_offset; // Offset to NCCH header, can be 0 or after NCSD header | 216 | u32 ncch_offset; // Offset to NCCH header, can be 0 or after NCSD header |
| 217 | u32 exefs_offset; | 217 | u32 exefs_offset; |
| 218 | 218 | ||
| 219 | NCCH_Header ncch_header; | 219 | NCCH_Header ncch_header; |
| 220 | ExeFs_Header exefs_header; | 220 | ExeFs_Header exefs_header; |
| 221 | ExHeader_Header exheader_header; | 221 | ExHeader_Header exheader_header; |