diff options
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/am/am.cpp | 11 | ||||
-rw-r--r-- | src/core/hle/service/nfp/nfp.cpp | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index d13ce4dca..7a5e9d216 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -38,6 +38,7 @@ namespace Service::AM { constexpr ResultCode ERR_NO_DATA_IN_CHANNEL{ErrorModule::AM, 0x2}; +constexpr ResultCode ERR_NO_MESSAGES{ErrorModule::AM, 0x3}; constexpr ResultCode ERR_SIZE_OUT_OF_BOUNDS{ErrorModule::AM, 0x1F7}; enum class AppletId : u32 { @@ -460,9 +461,17 @@ void ICommonStateGetter::GetEventHandle(Kernel::HLERequestContext& ctx) { void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_AM, "called"); + const auto message = msg_queue->PopMessage(); IPC::ResponseBuilder rb{ctx, 3}; + + if (message == AppletMessageQueue::AppletMessage::NoMessage) { + LOG_ERROR(Service_AM, "Message queue is empty"); + rb.Push(ERR_NO_MESSAGES); + rb.PushEnum<AppletMessageQueue::AppletMessage>(message); + return; + } rb.Push(RESULT_SUCCESS); - rb.PushEnum<AppletMessageQueue::AppletMessage>(msg_queue->PopMessage()); + rb.PushEnum<AppletMessageQueue::AppletMessage>(message); } void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) { diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp index 2254fb46b..1c4482e47 100644 --- a/src/core/hle/service/nfp/nfp.cpp +++ b/src/core/hle/service/nfp/nfp.cpp @@ -20,7 +20,8 @@ namespace Service::NFP { namespace ErrCodes { constexpr ResultCode ERR_TAG_FAILED(ErrorModule::NFP, -1); // TODO(ogniK): Find the actual error code -} +constexpr ResultCode ERR_NO_APPLICATION_AREA(ErrorModule::NFP, 152); +} // namespace ErrCodes Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) : ServiceFramework(name), module(std::move(module)) { @@ -292,10 +293,9 @@ private: } void OpenApplicationArea(Kernel::HLERequestContext& ctx) { - LOG_DEBUG(Service_NFP, "called"); - // We don't need to worry about this since we can just open the file + LOG_WARNING(Service_NFP, "(STUBBED) called"); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(ErrCodes::ERR_NO_APPLICATION_AREA); } void GetApplicationAreaSize(Kernel::HLERequestContext& ctx) { |