diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 8 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_run.h | 41 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_thumb.cpp | 2 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom_thumb.h | 4 | ||||
| -rw-r--r-- | src/core/arm/skyeye_common/skyeye_defs.h | 25 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir.cpp | 48 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir.h | 30 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir_rst.cpp | 24 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir_rst.h (renamed from src/core/hle/service/ir_rst.h) | 13 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir_u.cpp (renamed from src/core/hle/service/ir_u.cpp) | 17 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir_u.h (renamed from src/core/hle/service/ir_u.h) | 13 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir_user.cpp | 34 | ||||
| -rw-r--r-- | src/core/hle/service/ir/ir_user.h | 22 | ||||
| -rw-r--r-- | src/core/hle/service/ir_rst.cpp | 27 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 7 |
16 files changed, 218 insertions, 109 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index bdf4b6212..0528175ba 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -61,8 +61,10 @@ set(SRCS | |||
| 61 | hle/service/hid/hid_spvr.cpp | 61 | hle/service/hid/hid_spvr.cpp |
| 62 | hle/service/gsp_lcd.cpp | 62 | hle/service/gsp_lcd.cpp |
| 63 | hle/service/http_c.cpp | 63 | hle/service/http_c.cpp |
| 64 | hle/service/ir_rst.cpp | 64 | hle/service/ir/ir.cpp |
| 65 | hle/service/ir_u.cpp | 65 | hle/service/ir/ir_rst.cpp |
| 66 | hle/service/ir/ir_u.cpp | ||
| 67 | hle/service/ir/ir_user.cpp | ||
| 66 | hle/service/ldr_ro.cpp | 68 | hle/service/ldr_ro.cpp |
| 67 | hle/service/mic_u.cpp | 69 | hle/service/mic_u.cpp |
| 68 | hle/service/ndm_u.cpp | 70 | hle/service/ndm_u.cpp |
| @@ -170,8 +172,10 @@ set(HEADERS | |||
| 170 | hle/service/hid/hid_user.h | 172 | hle/service/hid/hid_user.h |
| 171 | hle/service/gsp_lcd.h | 173 | hle/service/gsp_lcd.h |
| 172 | hle/service/http_c.h | 174 | hle/service/http_c.h |
| 173 | hle/service/ir_rst.h | 175 | hle/service/ir/ir.h |
| 174 | hle/service/ir_u.h | 176 | hle/service/ir/ir_rst.h |
| 177 | hle/service/ir/ir_u.h | ||
| 178 | hle/service/ir/ir_user.h | ||
| 175 | hle/service/ldr_ro.h | 179 | hle/service/ldr_ro.h |
| 176 | hle/service/mic_u.h | 180 | hle/service/mic_u.h |
| 177 | hle/service/ndm_u.h | 181 | hle/service/ndm_u.h |
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 65fe8a055..fde11e4ff 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp | |||
| @@ -3557,7 +3557,7 @@ enum { | |||
| 3557 | FETCH_FAILURE | 3557 | FETCH_FAILURE |
| 3558 | }; | 3558 | }; |
| 3559 | 3559 | ||
| 3560 | static tdstate decode_thumb_instr(ARMul_State* cpu, uint32_t inst, addr_t addr, uint32_t* arm_inst, uint32_t* inst_size, ARM_INST_PTR* ptr_inst_base){ | 3560 | static tdstate decode_thumb_instr(ARMul_State* cpu, u32 inst, u32 addr, u32* arm_inst, u32* inst_size, ARM_INST_PTR* ptr_inst_base) { |
| 3561 | // Check if in Thumb mode | 3561 | // Check if in Thumb mode |
| 3562 | tdstate ret = thumb_translate (addr, inst, arm_inst, inst_size); | 3562 | tdstate ret = thumb_translate (addr, inst, arm_inst, inst_size); |
| 3563 | if(ret == t_branch){ | 3563 | if(ret == t_branch){ |
| @@ -3620,7 +3620,7 @@ typedef struct instruction_set_encoding_item ISEITEM; | |||
| 3620 | 3620 | ||
| 3621 | extern const ISEITEM arm_instruction[]; | 3621 | extern const ISEITEM arm_instruction[]; |
| 3622 | 3622 | ||
| 3623 | static int InterpreterTranslate(ARMul_State* cpu, int& bb_start, addr_t addr) { | 3623 | static int InterpreterTranslate(ARMul_State* cpu, int& bb_start, u32 addr) { |
| 3624 | Common::Profiling::ScopeTimer timer_decode(profile_decode); | 3624 | Common::Profiling::ScopeTimer timer_decode(profile_decode); |
| 3625 | 3625 | ||
| 3626 | // Decode instruction, get index | 3626 | // Decode instruction, get index |
| @@ -3638,8 +3638,8 @@ static int InterpreterTranslate(ARMul_State* cpu, int& bb_start, addr_t addr) { | |||
| 3638 | if (cpu->TFlag) | 3638 | if (cpu->TFlag) |
| 3639 | thumb = THUMB; | 3639 | thumb = THUMB; |
| 3640 | 3640 | ||
| 3641 | addr_t phys_addr = addr; | 3641 | u32 phys_addr = addr; |
| 3642 | addr_t pc_start = cpu->Reg[15]; | 3642 | u32 pc_start = cpu->Reg[15]; |
| 3643 | 3643 | ||
| 3644 | while(ret == NON_BRANCH) { | 3644 | while(ret == NON_BRANCH) { |
| 3645 | inst = Memory::Read32(phys_addr & 0xFFFFFFFC); | 3645 | inst = Memory::Read32(phys_addr & 0xFFFFFFFC); |
diff --git a/src/core/arm/dyncom/arm_dyncom_run.h b/src/core/arm/dyncom/arm_dyncom_run.h index e17420497..85774c565 100644 --- a/src/core/arm/dyncom/arm_dyncom_run.h +++ b/src/core/arm/dyncom/arm_dyncom_run.h | |||
| @@ -22,31 +22,36 @@ | |||
| 22 | 22 | ||
| 23 | void switch_mode(ARMul_State* core, uint32_t mode); | 23 | void switch_mode(ARMul_State* core, uint32_t mode); |
| 24 | 24 | ||
| 25 | /* FIXME, we temporarily think thumb instruction is always 16 bit */ | 25 | // Note that for the 3DS, a Thumb instruction will only ever be |
| 26 | // two bytes in size. Thus we don't need to worry about ThumbEE | ||
| 27 | // or Thumb-2 where instructions can be 4 bytes in length. | ||
| 26 | static inline u32 GET_INST_SIZE(ARMul_State* core) { | 28 | static inline u32 GET_INST_SIZE(ARMul_State* core) { |
| 27 | return core->TFlag? 2 : 4; | 29 | return core->TFlag? 2 : 4; |
| 28 | } | 30 | } |
| 29 | 31 | ||
| 30 | /** | 32 | /** |
| 31 | * @brief Read R15 and forced R15 to wold align, used address calculation | 33 | * Checks if the PC is being read, and if so, word-aligns it. |
| 32 | * | 34 | * Used with address calculations. |
| 33 | * @param core | 35 | * |
| 34 | * @param Rn | 36 | * @param core The ARM CPU state instance. |
| 35 | * | 37 | * @param Rn The register being read. |
| 36 | * @return | 38 | * |
| 37 | */ | 39 | * @return If the PC is being read, then the word-aligned PC value is returned. |
| 38 | static inline addr_t CHECK_READ_REG15_WA(ARMul_State* core, int Rn) { | 40 | * If the PC is not being read, then the value stored in the register is returned. |
| 39 | return (Rn == 15)? ((core->Reg[15] & ~0x3) + GET_INST_SIZE(core) * 2) : core->Reg[Rn]; | 41 | */ |
| 42 | static inline u32 CHECK_READ_REG15_WA(ARMul_State* core, int Rn) { | ||
| 43 | return (Rn == 15) ? ((core->Reg[15] & ~0x3) + GET_INST_SIZE(core) * 2) : core->Reg[Rn]; | ||
| 40 | } | 44 | } |
| 41 | 45 | ||
| 42 | /** | 46 | /** |
| 43 | * @brief Read R15, used to data processing with pc | 47 | * Reads the PC. Used for data processing operations that use the PC. |
| 44 | * | 48 | * |
| 45 | * @param core | 49 | * @param core The ARM CPU state instance. |
| 46 | * @param Rn | 50 | * @param Rn The register being read. |
| 47 | * | 51 | * |
| 48 | * @return | 52 | * @return If the PC is being read, then the incremented PC value is returned. |
| 49 | */ | 53 | * If the PC is not being read, then the values stored in the register is returned. |
| 54 | */ | ||
| 50 | static inline u32 CHECK_READ_REG15(ARMul_State* core, int Rn) { | 55 | static inline u32 CHECK_READ_REG15(ARMul_State* core, int Rn) { |
| 51 | return (Rn == 15)? ((core->Reg[15] & ~0x1) + GET_INST_SIZE(core) * 2) : core->Reg[Rn]; | 56 | return (Rn == 15) ? ((core->Reg[15] & ~0x1) + GET_INST_SIZE(core) * 2) : core->Reg[Rn]; |
| 52 | } | 57 | } |
diff --git a/src/core/arm/dyncom/arm_dyncom_thumb.cpp b/src/core/arm/dyncom/arm_dyncom_thumb.cpp index e30d515fb..bfb45f104 100644 --- a/src/core/arm/dyncom/arm_dyncom_thumb.cpp +++ b/src/core/arm/dyncom/arm_dyncom_thumb.cpp | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | // with the following Thumb instruction held in the high 16-bits. Passing in two Thumb instructions | 13 | // with the following Thumb instruction held in the high 16-bits. Passing in two Thumb instructions |
| 14 | // allows easier simulation of the special dual BL instruction. | 14 | // allows easier simulation of the special dual BL instruction. |
| 15 | 15 | ||
| 16 | tdstate thumb_translate(addr_t addr, uint32_t instr, uint32_t* ainstr, uint32_t* inst_size) { | 16 | tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) { |
| 17 | tdstate valid = t_uninitialized; | 17 | tdstate valid = t_uninitialized; |
| 18 | ARMword tinstr = instr; | 18 | ARMword tinstr = instr; |
| 19 | 19 | ||
diff --git a/src/core/arm/dyncom/arm_dyncom_thumb.h b/src/core/arm/dyncom/arm_dyncom_thumb.h index a1785abb8..8394ff156 100644 --- a/src/core/arm/dyncom/arm_dyncom_thumb.h +++ b/src/core/arm/dyncom/arm_dyncom_thumb.h | |||
| @@ -35,9 +35,9 @@ enum tdstate { | |||
| 35 | t_uninitialized, | 35 | t_uninitialized, |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | tdstate thumb_translate(addr_t addr, u32 instr, u32* ainstr, u32* inst_size); | 38 | tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size); |
| 39 | 39 | ||
| 40 | static inline u32 get_thumb_instr(u32 instr, addr_t pc) { | 40 | static inline u32 get_thumb_instr(u32 instr, u32 pc) { |
| 41 | u32 tinstr; | 41 | u32 tinstr; |
| 42 | if ((pc & 0x3) != 0) | 42 | if ((pc & 0x3) != 0) |
| 43 | tinstr = instr >> 16; | 43 | tinstr = instr >> 16; |
diff --git a/src/core/arm/skyeye_common/skyeye_defs.h b/src/core/arm/skyeye_common/skyeye_defs.h index edf6097e0..94b02459d 100644 --- a/src/core/arm/skyeye_common/skyeye_defs.h +++ b/src/core/arm/skyeye_common/skyeye_defs.h | |||
| @@ -11,28 +11,3 @@ struct cpu_config_t | |||
| 11 | u32 cpu_mask; // cpu_val's mask. | 11 | u32 cpu_mask; // cpu_val's mask. |
| 12 | u32 cachetype; // CPU cache type | 12 | u32 cachetype; // CPU cache type |
| 13 | }; | 13 | }; |
| 14 | |||
| 15 | enum { | ||
| 16 | // No exception | ||
| 17 | No_exp = 0, | ||
| 18 | // Memory allocation exception | ||
| 19 | Malloc_exp, | ||
| 20 | // File open exception | ||
| 21 | File_open_exp, | ||
| 22 | // DLL open exception | ||
| 23 | Dll_open_exp, | ||
| 24 | // Invalid argument exception | ||
| 25 | Invarg_exp, | ||
| 26 | // Invalid module exception | ||
| 27 | Invmod_exp, | ||
| 28 | // wrong format exception for config file parsing | ||
| 29 | Conf_format_exp, | ||
| 30 | // some reference excess the predefiend range. Such as the index out of array range | ||
| 31 | Excess_range_exp, | ||
| 32 | // Can not find the desirable result | ||
| 33 | Not_found_exp, | ||
| 34 | // Unknown exception | ||
| 35 | Unknown_exp | ||
| 36 | }; | ||
| 37 | |||
| 38 | typedef u32 addr_t; | ||
diff --git a/src/core/hle/service/ir/ir.cpp b/src/core/hle/service/ir/ir.cpp new file mode 100644 index 000000000..58dfd8e1a --- /dev/null +++ b/src/core/hle/service/ir/ir.cpp | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/service.h" | ||
| 6 | #include "core/hle/service/ir/ir.h" | ||
| 7 | #include "core/hle/service/ir/ir_rst.h" | ||
| 8 | #include "core/hle/service/ir/ir_u.h" | ||
| 9 | #include "core/hle/service/ir/ir_user.h" | ||
| 10 | |||
| 11 | #include "core/hle/hle.h" | ||
| 12 | #include "core/hle/kernel/event.h" | ||
| 13 | #include "core/hle/kernel/shared_memory.h" | ||
| 14 | |||
| 15 | namespace Service { | ||
| 16 | namespace IR { | ||
| 17 | |||
| 18 | static Kernel::SharedPtr<Kernel::Event> handle_event = nullptr; | ||
| 19 | static Kernel::SharedPtr<Kernel::SharedMemory> shared_memory = nullptr; | ||
| 20 | |||
| 21 | void GetHandles(Service::Interface* self) { | ||
| 22 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 23 | |||
| 24 | cmd_buff[1] = RESULT_SUCCESS.raw; | ||
| 25 | cmd_buff[2] = 0x4000000; | ||
| 26 | cmd_buff[3] = Kernel::g_handle_table.Create(Service::IR::shared_memory).MoveFrom(); | ||
| 27 | cmd_buff[4] = Kernel::g_handle_table.Create(Service::IR::handle_event).MoveFrom(); | ||
| 28 | } | ||
| 29 | |||
| 30 | void Init() { | ||
| 31 | using namespace Kernel; | ||
| 32 | |||
| 33 | AddService(new IR_RST_Interface); | ||
| 34 | AddService(new IR_U_Interface); | ||
| 35 | AddService(new IR_User_Interface); | ||
| 36 | |||
| 37 | shared_memory = SharedMemory::Create("IR:SharedMemory"); | ||
| 38 | |||
| 39 | // Create event handle(s) | ||
| 40 | handle_event = Event::Create(RESETTYPE_ONESHOT, "IR:HandleEvent"); | ||
| 41 | } | ||
| 42 | |||
| 43 | void Shutdown() { | ||
| 44 | } | ||
| 45 | |||
| 46 | } // namespace IR | ||
| 47 | |||
| 48 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir/ir.h b/src/core/hle/service/ir/ir.h new file mode 100644 index 000000000..c16d963e7 --- /dev/null +++ b/src/core/hle/service/ir/ir.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/kernel/kernel.h" | ||
| 8 | #include "core/hle/service/service.h" | ||
| 9 | |||
| 10 | namespace Service { | ||
| 11 | namespace IR { | ||
| 12 | |||
| 13 | /** | ||
| 14 | * IR::GetHandles service function | ||
| 15 | * Outputs: | ||
| 16 | * 1 : Result of function, 0 on success, otherwise error code | ||
| 17 | * 2 : Translate header, used by the ARM11-kernel | ||
| 18 | * 3 : Shared memory handle | ||
| 19 | * 4 : Event handle | ||
| 20 | */ | ||
| 21 | void GetHandles(Interface* self); | ||
| 22 | |||
| 23 | /// Initialize IR service | ||
| 24 | void Init(); | ||
| 25 | |||
| 26 | /// Shutdown IR service | ||
| 27 | void Shutdown(); | ||
| 28 | |||
| 29 | } // namespace IR | ||
| 30 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp new file mode 100644 index 000000000..96ae63420 --- /dev/null +++ b/src/core/hle/service/ir/ir_rst.cpp | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/hle.h" | ||
| 6 | #include "core/hle/service/ir/ir.h" | ||
| 7 | #include "core/hle/service/ir/ir_rst.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace IR { | ||
| 11 | |||
| 12 | const Interface::FunctionInfo FunctionTable[] = { | ||
| 13 | {0x00010000, GetHandles, "GetHandles"}, | ||
| 14 | {0x00020080, nullptr, "Initialize"}, | ||
| 15 | {0x00030000, nullptr, "Shutdown"}, | ||
| 16 | {0x00090000, nullptr, "WriteToTwoFields"}, | ||
| 17 | }; | ||
| 18 | |||
| 19 | IR_RST_Interface::IR_RST_Interface() { | ||
| 20 | Register(FunctionTable); | ||
| 21 | } | ||
| 22 | |||
| 23 | } // namespace IR | ||
| 24 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir_rst.h b/src/core/hle/service/ir/ir_rst.h index deef701c5..a492e15c9 100644 --- a/src/core/hle/service/ir_rst.h +++ b/src/core/hle/service/ir/ir_rst.h | |||
| @@ -6,18 +6,17 @@ | |||
| 6 | 6 | ||
| 7 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 8 | 8 | ||
| 9 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 9 | namespace Service { |
| 10 | // Namespace IR_RST | 10 | namespace IR { |
| 11 | 11 | ||
| 12 | namespace IR_RST { | 12 | class IR_RST_Interface : public Service::Interface { |
| 13 | |||
| 14 | class Interface : public Service::Interface { | ||
| 15 | public: | 13 | public: |
| 16 | Interface(); | 14 | IR_RST_Interface(); |
| 17 | 15 | ||
| 18 | std::string GetPortName() const override { | 16 | std::string GetPortName() const override { |
| 19 | return "ir:rst"; | 17 | return "ir:rst"; |
| 20 | } | 18 | } |
| 21 | }; | 19 | }; |
| 22 | 20 | ||
| 23 | } // namespace | 21 | } // namespace IR |
| 22 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir_u.cpp b/src/core/hle/service/ir/ir_u.cpp index 608ed3c06..1b1e3078b 100644 --- a/src/core/hle/service/ir_u.cpp +++ b/src/core/hle/service/ir/ir_u.cpp | |||
| @@ -3,12 +3,11 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/hle.h" | 5 | #include "core/hle/hle.h" |
| 6 | #include "core/hle/service/ir_u.h" | 6 | #include "core/hle/service/ir/ir.h" |
| 7 | #include "core/hle/service/ir/ir_u.h" | ||
| 7 | 8 | ||
| 8 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 9 | namespace Service { |
| 9 | // Namespace IR_U | 10 | namespace IR { |
| 10 | |||
| 11 | namespace IR_U { | ||
| 12 | 11 | ||
| 13 | const Interface::FunctionInfo FunctionTable[] = { | 12 | const Interface::FunctionInfo FunctionTable[] = { |
| 14 | {0x00010000, nullptr, "Initialize"}, | 13 | {0x00010000, nullptr, "Initialize"}, |
| @@ -31,11 +30,9 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 31 | {0x00120040, nullptr, "SetSleepModeState"}, | 30 | {0x00120040, nullptr, "SetSleepModeState"}, |
| 32 | }; | 31 | }; |
| 33 | 32 | ||
| 34 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 33 | IR_U_Interface::IR_U_Interface() { |
| 35 | // Interface class | ||
| 36 | |||
| 37 | Interface::Interface() { | ||
| 38 | Register(FunctionTable); | 34 | Register(FunctionTable); |
| 39 | } | 35 | } |
| 40 | 36 | ||
| 41 | } // namespace | 37 | } // namespace IR |
| 38 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir_u.h b/src/core/hle/service/ir/ir_u.h index ec47a1524..056d2ce1a 100644 --- a/src/core/hle/service/ir_u.h +++ b/src/core/hle/service/ir/ir_u.h | |||
| @@ -6,18 +6,17 @@ | |||
| 6 | 6 | ||
| 7 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 8 | 8 | ||
| 9 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 9 | namespace Service { |
| 10 | // Namespace IR_U | 10 | namespace IR { |
| 11 | 11 | ||
| 12 | namespace IR_U { | 12 | class IR_U_Interface : public Service::Interface { |
| 13 | |||
| 14 | class Interface : public Service::Interface { | ||
| 15 | public: | 13 | public: |
| 16 | Interface(); | 14 | IR_U_Interface(); |
| 17 | 15 | ||
| 18 | std::string GetPortName() const override { | 16 | std::string GetPortName() const override { |
| 19 | return "ir:u"; | 17 | return "ir:u"; |
| 20 | } | 18 | } |
| 21 | }; | 19 | }; |
| 22 | 20 | ||
| 23 | } // namespace | 21 | } // namespace IR |
| 22 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp new file mode 100644 index 000000000..8e3ff140f --- /dev/null +++ b/src/core/hle/service/ir/ir_user.cpp | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/hle.h" | ||
| 6 | #include "core/hle/service/ir/ir.h" | ||
| 7 | #include "core/hle/service/ir/ir_user.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace IR { | ||
| 11 | |||
| 12 | const Interface::FunctionInfo FunctionTable[] = { | ||
| 13 | {0x00010182, nullptr, "InitializeIrNop"}, | ||
| 14 | {0x00020000, nullptr, "FinalizeIrNop"}, | ||
| 15 | {0x00030000, nullptr, "ClearReceiveBuffer"}, | ||
| 16 | {0x00040000, nullptr, "ClearSendBuffer"}, | ||
| 17 | {0x00060040, nullptr, "RequireConnection"}, | ||
| 18 | {0x00090000, nullptr, "Disconnect"}, | ||
| 19 | {0x000A0000, nullptr, "GetReceiveEvent"}, | ||
| 20 | {0x000B0000, nullptr, "GetSendEvent"}, | ||
| 21 | {0x000C0000, nullptr, "GetConnectionStatusEvent"}, | ||
| 22 | {0x000D0042, nullptr, "SendIrNop"}, | ||
| 23 | {0x000E0042, nullptr, "SendIrNopLarge"}, | ||
| 24 | {0x00180182, nullptr, "InitializeIrNopShared"}, | ||
| 25 | {0x00190040, nullptr, "ReleaseReceivedData"}, | ||
| 26 | {0x001A0040, nullptr, "SetOwnMachineId"}, | ||
| 27 | }; | ||
| 28 | |||
| 29 | IR_User_Interface::IR_User_Interface() { | ||
| 30 | Register(FunctionTable); | ||
| 31 | } | ||
| 32 | |||
| 33 | } // namespace IR | ||
| 34 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir/ir_user.h b/src/core/hle/service/ir/ir_user.h new file mode 100644 index 000000000..71c932ffa --- /dev/null +++ b/src/core/hle/service/ir/ir_user.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2015 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace IR { | ||
| 11 | |||
| 12 | class IR_User_Interface : public Service::Interface { | ||
| 13 | public: | ||
| 14 | IR_User_Interface(); | ||
| 15 | |||
| 16 | std::string GetPortName() const override { | ||
| 17 | return "ir:USER"; | ||
| 18 | } | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace IR | ||
| 22 | } // namespace Service | ||
diff --git a/src/core/hle/service/ir_rst.cpp b/src/core/hle/service/ir_rst.cpp deleted file mode 100644 index 4c26c2f03..000000000 --- a/src/core/hle/service/ir_rst.cpp +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/hle.h" | ||
| 6 | #include "core/hle/service/ir_rst.h" | ||
| 7 | |||
| 8 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 9 | // Namespace IR_RST | ||
| 10 | |||
| 11 | namespace IR_RST { | ||
| 12 | |||
| 13 | const Interface::FunctionInfo FunctionTable[] = { | ||
| 14 | {0x00010000, nullptr, "GetHandles"}, | ||
| 15 | {0x00020080, nullptr, "Initialize"}, | ||
| 16 | {0x00030000, nullptr, "Shutdown"}, | ||
| 17 | {0x00090000, nullptr, "WriteToTwoFields"}, | ||
| 18 | }; | ||
| 19 | |||
| 20 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 21 | // Interface class | ||
| 22 | |||
| 23 | Interface::Interface() { | ||
| 24 | Register(FunctionTable); | ||
| 25 | } | ||
| 26 | |||
| 27 | } // namespace | ||
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index eeb404659..134ff1740 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -24,8 +24,6 @@ | |||
| 24 | #include "core/hle/service/gsp_gpu.h" | 24 | #include "core/hle/service/gsp_gpu.h" |
| 25 | #include "core/hle/service/gsp_lcd.h" | 25 | #include "core/hle/service/gsp_lcd.h" |
| 26 | #include "core/hle/service/http_c.h" | 26 | #include "core/hle/service/http_c.h" |
| 27 | #include "core/hle/service/ir_rst.h" | ||
| 28 | #include "core/hle/service/ir_u.h" | ||
| 29 | #include "core/hle/service/ldr_ro.h" | 27 | #include "core/hle/service/ldr_ro.h" |
| 30 | #include "core/hle/service/mic_u.h" | 28 | #include "core/hle/service/mic_u.h" |
| 31 | #include "core/hle/service/ndm_u.h" | 29 | #include "core/hle/service/ndm_u.h" |
| @@ -45,6 +43,7 @@ | |||
| 45 | #include "core/hle/service/fs/archive.h" | 43 | #include "core/hle/service/fs/archive.h" |
| 46 | #include "core/hle/service/cfg/cfg.h" | 44 | #include "core/hle/service/cfg/cfg.h" |
| 47 | #include "core/hle/service/hid/hid.h" | 45 | #include "core/hle/service/hid/hid.h" |
| 46 | #include "core/hle/service/ir/ir.h" | ||
| 48 | #include "core/hle/service/ptm/ptm.h" | 47 | #include "core/hle/service/ptm/ptm.h" |
| 49 | 48 | ||
| 50 | namespace Service { | 49 | namespace Service { |
| @@ -73,6 +72,7 @@ void Init() { | |||
| 73 | Service::APT::Init(); | 72 | Service::APT::Init(); |
| 74 | Service::PTM::Init(); | 73 | Service::PTM::Init(); |
| 75 | Service::HID::Init(); | 74 | Service::HID::Init(); |
| 75 | Service::IR::Init(); | ||
| 76 | 76 | ||
| 77 | AddService(new AC_U::Interface); | 77 | AddService(new AC_U::Interface); |
| 78 | AddService(new ACT_U::Interface); | 78 | AddService(new ACT_U::Interface); |
| @@ -91,8 +91,6 @@ void Init() { | |||
| 91 | AddService(new GSP_GPU::Interface); | 91 | AddService(new GSP_GPU::Interface); |
| 92 | AddService(new GSP_LCD::Interface); | 92 | AddService(new GSP_LCD::Interface); |
| 93 | AddService(new HTTP_C::Interface); | 93 | AddService(new HTTP_C::Interface); |
| 94 | AddService(new IR_RST::Interface); | ||
| 95 | AddService(new IR_U::Interface); | ||
| 96 | AddService(new LDR_RO::Interface); | 94 | AddService(new LDR_RO::Interface); |
| 97 | AddService(new MIC_U::Interface); | 95 | AddService(new MIC_U::Interface); |
| 98 | AddService(new NDM_U::Interface); | 96 | AddService(new NDM_U::Interface); |
| @@ -112,6 +110,7 @@ void Init() { | |||
| 112 | 110 | ||
| 113 | /// Shutdown ServiceManager | 111 | /// Shutdown ServiceManager |
| 114 | void Shutdown() { | 112 | void Shutdown() { |
| 113 | Service::IR::Shutdown(); | ||
| 115 | Service::HID::Shutdown(); | 114 | Service::HID::Shutdown(); |
| 116 | Service::PTM::Shutdown(); | 115 | Service::PTM::Shutdown(); |
| 117 | Service::APT::Shutdown(); | 116 | Service::APT::Shutdown(); |