1 // Copyright (c) 2012- PPSSPP Project.
2 
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, version 2.0 or later versions.
6 
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 // GNU General Public License 2.0 for more details.
11 
12 // A copy of the GPL 2.0 should have been included with the program.
13 // If not, see http://www.gnu.org/licenses/
14 
15 // Official git repository and contact information can be found at
16 // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17 
18 #include "Core/HLE/HLE.h"
19 #include "Core/HLE/FunctionWrappers.h"
20 #include "Core/HLE/sceHprm.h"
21 #include "Core/MemMap.h"
22 #include "Core/MIPS/MIPS.h"
23 
24 static u32 sceHprmPeekCurrentKey(u32 keyAddress) {
25 	DEBUG_LOG(HLE,"0=sceHprmPeekCurrentKey(ptr)");
26 	Memory::Write_U32(0, keyAddress);
27 	return 0;
28 }
29 
30 // TODO: Might make sense to reflect the headphone status of the host here,
31 // if the games adjust their sound.
32 static u32 sceHprmIsHeadphoneExist() {
33 	DEBUG_LOG(HLE, "sceHprmIsHeadphoneExist()");
34 	return 0;
35 }
36 
37 static u32 sceHprmIsMicrophoneExist() {
38 	DEBUG_LOG(HLE, "sceHprmIsMicrophoneExist()");
39 	return 0;
40 }
41 
42 static u32 sceHprmIsRemoteExist() {
43 	DEBUG_LOG(HLE, "sceHprmIsRemoteExist()");
44 	return 0;
45 }
46 
47 static u32 sceHprmPeekLatch(u32 latchAddr) {
48 	DEBUG_LOG(HLE,"sceHprmPeekLatch latchAddr %08x",latchAddr);
49 	return 0;
50 }
51 
52 static u32 sceHprmReadLatch(u32 latchAddr) {
53 	DEBUG_LOG(HLE,"sceHprmReadLatch latchAddr %08x",latchAddr);
54 	return 0;
55 }
56 
57 const HLEFunction sceHprm[] =
58 {
59 	{0X089FDFA4, nullptr,                            "sceHprm_089fdfa4",          '?', "" },
60 	{0X1910B327, &WrapU_U<sceHprmPeekCurrentKey>,    "sceHprmPeekCurrentKey",     'x', "x"},
61 	{0X208DB1BD, &WrapU_V<sceHprmIsRemoteExist>,     "sceHprmIsRemoteExist",      'x', "" },
62 	{0X7E69EDA4, &WrapU_V<sceHprmIsHeadphoneExist>,  "sceHprmIsHeadphoneExist",   'x', "" },
63 	{0X219C58F1, &WrapU_V<sceHprmIsMicrophoneExist>, "sceHprmIsMicrophoneExist",  'x', "" },
64 	{0XC7154136, nullptr,                            "sceHprmRegisterCallback",   '?', "" },
65 	{0X444ED0B7, nullptr,                            "sceHprmUnregitserCallback", '?', "" }, // Typo.
66 	{0X2BCEC83E, &WrapU_U<sceHprmPeekLatch>,         "sceHprmPeekLatch",          'x', "x"},
67 	{0X40D2F9F0, &WrapU_U<sceHprmReadLatch>,         "sceHprmReadLatch",          'x', "x"},
68 };
69 
70 void Register_sceHprm()
71 {
72 	RegisterModule("sceHprm", ARRAY_SIZE(sceHprm), sceHprm);
73 }
74