summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nim/nim.cpp
blob: b10d5852ba8e185e9232faa1e0f657e89b72209c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#include "common/common_types.h"
#include "common/logging/log.h"
#include "core/hle/ipc.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/event.h"
#include "core/hle/service/nim/nim.h"
#include "core/hle/service/nim/nim_aoc.h"
#include "core/hle/service/nim/nim_s.h"
#include "core/hle/service/nim/nim_u.h"
#include "core/hle/service/service.h"

namespace Service {
namespace NIM {

static Kernel::SharedPtr<Kernel::Event> nim_system_update_event;

void CheckForSysUpdateEvent(Service::Interface* self) {
    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x5, 0, 0); // 0x50000
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
    rb.Push(RESULT_SUCCESS);
    rb.PushCopyHandles(Kernel::g_handle_table.Create(nim_system_update_event).Unwrap());
    LOG_TRACE(Service_NIM, "called");
}

void CheckSysUpdateAvailable(Service::Interface* self) {
    u32* cmd_buff = Kernel::GetCommandBuffer();

    cmd_buff[1] = RESULT_SUCCESS.raw;
    cmd_buff[2] = 0; // No update available

    LOG_WARNING(Service_NIM, "(STUBBED) called");
}

void Init() {
    using namespace Kernel;

    AddService(new NIM_AOC_Interface);
    AddService(new NIM_S_Interface);
    AddService(new NIM_U_Interface);

    nim_system_update_event = Kernel::Event::Create(ResetType::OneShot, "NIM System Update Event");
}

void Shutdown() {
    nim_system_update_event = nullptr;
}

} // namespace NIM

} // namespace Service