summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/function_wrappers.h4
-rw-r--r--src/core/hle/svc.cpp14
2 files changed, 17 insertions, 1 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 0e5ae29ae..23c86a72d 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -166,6 +166,10 @@ template<void func(const char*)> void Wrap() {
166 func((char*)Memory::GetPointer(PARAM(0))); 166 func((char*)Memory::GetPointer(PARAM(0)));
167} 167}
168 168
169template<void func(u8)> void Wrap() {
170 func((u8)PARAM(0));
171}
172
169#undef PARAM 173#undef PARAM
170#undef FuncReturn 174#undef FuncReturn
171 175
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 654ee2bf6..22adf9595 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -296,6 +296,18 @@ static ResultCode ArbitrateAddress(Handle handle, u32 address, u32 type, u32 val
296 return res; 296 return res;
297} 297}
298 298
299static void Break(u8 break_reason) {
300 LOG_CRITICAL(Debug_Emulated, "Emulated program broke execution!");
301 std::string reason_str;
302 switch (break_reason) {
303 case 0: reason_str = "PANIC"; break;
304 case 1: reason_str = "ASSERT"; break;
305 case 2: reason_str = "USER"; break;
306 default: reason_str = "UNKNOWN"; break;
307 }
308 LOG_CRITICAL(Debug_Emulated, "Break reason: %s", reason_str.c_str());
309}
310
299/// Used to output a message on a debug hardware unit - does nothing on a retail unit 311/// Used to output a message on a debug hardware unit - does nothing on a retail unit
300static void OutputDebugString(const char* string) { 312static void OutputDebugString(const char* string) {
301 LOG_DEBUG(Debug_Emulated, "%s", string); 313 LOG_DEBUG(Debug_Emulated, "%s", string);
@@ -737,7 +749,7 @@ static const FunctionDef SVC_Table[] = {
737 {0x39, HLE::Wrap<GetResourceLimitLimitValues>, "GetResourceLimitLimitValues"}, 749 {0x39, HLE::Wrap<GetResourceLimitLimitValues>, "GetResourceLimitLimitValues"},
738 {0x3A, HLE::Wrap<GetResourceLimitCurrentValues>, "GetResourceLimitCurrentValues"}, 750 {0x3A, HLE::Wrap<GetResourceLimitCurrentValues>, "GetResourceLimitCurrentValues"},
739 {0x3B, nullptr, "GetThreadContext"}, 751 {0x3B, nullptr, "GetThreadContext"},
740 {0x3C, nullptr, "Break"}, 752 {0x3C, HLE::Wrap<Break>, "Break"},
741 {0x3D, HLE::Wrap<OutputDebugString>, "OutputDebugString"}, 753 {0x3D, HLE::Wrap<OutputDebugString>, "OutputDebugString"},
742 {0x3E, nullptr, "ControlPerformanceCounter"}, 754 {0x3E, nullptr, "ControlPerformanceCounter"},
743 {0x3F, nullptr, "Unknown"}, 755 {0x3F, nullptr, "Unknown"},