Răsfoiți Sursa

hle: Remove a large amount of 3ds-specific service code.

bunnei 8 ani în urmă
părinte
comite
0906de9a14
100 a modificat fișierele cu 0 adăugiri și 10682 ștergeri
  1. 0 15
      src/citra/config.cpp
  2. 0 16
      src/citra/default_ini.h
  3. 0 32
      src/citra_qt/configuration/config.cpp
  4. 0 21
      src/common/logging/backend.cpp
  5. 0 21
      src/common/logging/log.h
  6. 0 190
      src/core/CMakeLists.txt
  7. 0 31
      src/core/frontend/camera/blank_camera.cpp
  8. 0 28
      src/core/frontend/camera/blank_camera.h
  9. 0 32
      src/core/frontend/camera/factory.cpp
  10. 0 41
      src/core/frontend/camera/factory.h
  11. 0 11
      src/core/frontend/camera/interface.cpp
  12. 0 61
      src/core/frontend/camera/interface.h
  13. 0 130
      src/core/hle/applets/applet.cpp
  14. 0 83
      src/core/hle/applets/applet.h
  15. 0 72
      src/core/hle/applets/erreula.cpp
  16. 0 29
      src/core/hle/applets/erreula.h
  17. 0 86
      src/core/hle/applets/mii_selector.cpp
  18. 0 78
      src/core/hle/applets/mii_selector.h
  19. 0 72
      src/core/hle/applets/mint.cpp
  20. 0 29
      src/core/hle/applets/mint.h
  21. 0 118
      src/core/hle/applets/swkbd.cpp
  22. 0 85
      src/core/hle/applets/swkbd.h
  23. 0 186
      src/core/hle/service/ac/ac.cpp
  24. 0 134
      src/core/hle/service/ac/ac.h
  25. 0 39
      src/core/hle/service/ac/ac_i.cpp
  26. 0 22
      src/core/hle/service/ac/ac_i.h
  27. 0 39
      src/core/hle/service/ac/ac_u.cpp
  28. 0 22
      src/core/hle/service/ac/ac_u.h
  29. 0 18
      src/core/hle/service/act/act.cpp
  30. 0 14
      src/core/hle/service/act/act.h
  31. 0 30
      src/core/hle/service/act/act_a.cpp
  32. 0 22
      src/core/hle/service/act/act_a.h
  33. 0 26
      src/core/hle/service/act/act_u.cpp
  34. 0 22
      src/core/hle/service/act/act_u.h
  35. 0 193
      src/core/hle/service/am/am.cpp
  36. 0 164
      src/core/hle/service/am/am.h
  37. 0 32
      src/core/hle/service/am/am_app.cpp
  38. 0 22
      src/core/hle/service/am/am_app.h
  39. 0 129
      src/core/hle/service/am/am_net.cpp
  40. 0 22
      src/core/hle/service/am/am_net.h
  41. 0 77
      src/core/hle/service/am/am_sys.cpp
  42. 0 22
      src/core/hle/service/am/am_sys.h
  43. 0 89
      src/core/hle/service/am/am_u.cpp
  44. 0 22
      src/core/hle/service/am/am_u.h
  45. 0 1124
      src/core/hle/service/apt/apt.cpp
  46. 0 533
      src/core/hle/service/apt/apt.h
  47. 0 110
      src/core/hle/service/apt/apt_a.cpp
  48. 0 22
      src/core/hle/service/apt/apt_a.h
  49. 0 110
      src/core/hle/service/apt/apt_s.cpp
  50. 0 29
      src/core/hle/service/apt/apt_s.h
  51. 0 107
      src/core/hle/service/apt/apt_u.cpp
  52. 0 29
      src/core/hle/service/apt/apt_u.h
  53. 0 110
      src/core/hle/service/apt/bcfnt/bcfnt.cpp
  54. 0 92
      src/core/hle/service/apt/bcfnt/bcfnt.h
  55. 0 994
      src/core/hle/service/boss/boss.cpp
  56. 0 802
      src/core/hle/service/boss/boss.h
  57. 0 86
      src/core/hle/service/boss/boss_p.cpp
  58. 0 22
      src/core/hle/service/boss/boss_p.h
  59. 0 74
      src/core/hle/service/boss/boss_u.cpp
  60. 0 22
      src/core/hle/service/boss/boss_u.h
  61. 0 1106
      src/core/hle/service/cam/cam.cpp
  62. 0 686
      src/core/hle/service/cam/cam.h
  63. 0 18
      src/core/hle/service/cam/cam_c.cpp
  64. 0 22
      src/core/hle/service/cam/cam_c.h
  65. 0 18
      src/core/hle/service/cam/cam_q.cpp
  66. 0 22
      src/core/hle/service/cam/cam_q.h
  67. 0 18
      src/core/hle/service/cam/cam_s.cpp
  68. 0 22
      src/core/hle/service/cam/cam_s.h
  69. 0 81
      src/core/hle/service/cam/cam_u.cpp
  70. 0 22
      src/core/hle/service/cam/cam_u.h
  71. 0 66
      src/core/hle/service/cecd/cecd.cpp
  72. 0 60
      src/core/hle/service/cecd/cecd.h
  73. 0 23
      src/core/hle/service/cecd/cecd_ndm.cpp
  74. 0 22
      src/core/hle/service/cecd/cecd_ndm.h
  75. 0 36
      src/core/hle/service/cecd/cecd_s.cpp
  76. 0 22
      src/core/hle/service/cecd/cecd_s.h
  77. 0 36
      src/core/hle/service/cecd/cecd_u.cpp
  78. 0 22
      src/core/hle/service/cecd/cecd_u.h
  79. 0 143
      src/core/hle/service/csnd_snd.cpp
  80. 0 22
      src/core/hle/service/csnd_snd.h
  81. 0 23
      src/core/hle/service/dlp/dlp.cpp
  82. 0 17
      src/core/hle/service/dlp/dlp.h
  83. 0 38
      src/core/hle/service/dlp/dlp_clnt.cpp
  84. 0 22
      src/core/hle/service/dlp/dlp_clnt.h
  85. 0 35
      src/core/hle/service/dlp/dlp_fkcl.cpp
  86. 0 22
      src/core/hle/service/dlp/dlp_fkcl.h
  87. 0 47
      src/core/hle/service/dlp/dlp_srvr.cpp
  88. 0 22
      src/core/hle/service/dlp/dlp_srvr.h
  89. 0 266
      src/core/hle/service/err_f.cpp
  90. 0 22
      src/core/hle/service/err_f.h
  91. 0 174
      src/core/hle/service/frd/frd.cpp
  92. 0 127
      src/core/hle/service/frd/frd.h
  93. 0 18
      src/core/hle/service/frd/frd_a.cpp
  94. 0 22
      src/core/hle/service/frd/frd_a.h
  95. 0 72
      src/core/hle/service/frd/frd_u.cpp
  96. 0 22
      src/core/hle/service/frd/frd_u.h
  97. 0 72
      src/core/hle/service/http_c.cpp
  98. 0 22
      src/core/hle/service/http_c.h
  99. 0 231
      src/core/hle/service/ir/extra_hid.cpp
  100. 0 48
      src/core/hle/service/ir/extra_hid.h

+ 0 - 15
src/citra/config.cpp

@@ -134,21 +134,6 @@ void Config::ReadValues() {
     Settings::values.region_value =
         sdl2_config->GetInteger("System", "region_value", Settings::REGION_VALUE_AUTO_SELECT);
 
-    // Camera
-    using namespace Service::CAM;
-    Settings::values.camera_name[OuterRightCamera] =
-        sdl2_config->Get("Camera", "camera_outer_right_name", "blank");
-    Settings::values.camera_config[OuterRightCamera] =
-        sdl2_config->Get("Camera", "camera_outer_right_config", "");
-    Settings::values.camera_name[InnerCamera] =
-        sdl2_config->Get("Camera", "camera_inner_name", "blank");
-    Settings::values.camera_config[InnerCamera] =
-        sdl2_config->Get("Camera", "camera_inner_config", "");
-    Settings::values.camera_name[OuterLeftCamera] =
-        sdl2_config->Get("Camera", "camera_outer_left_name", "blank");
-    Settings::values.camera_config[OuterLeftCamera] =
-        sdl2_config->Get("Camera", "camera_outer_left_config", "");
-
     // Miscellaneous
     Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Info");
 

+ 0 - 16
src/citra/default_ini.h

@@ -153,22 +153,6 @@ is_new_3ds =
 # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
 region_value =
 
-[Camera]
-# Which camera engine to use for the right outer camera
-# blank (default): a dummy camera that always returns black image
-camera_outer_right_name =
-
-# A config string for the right outer camera. Its meaning is defined by the camera engine
-camera_outer_right_config =
-
-# ... for the left outer camera
-camera_outer_left_name =
-camera_outer_left_config =
-
-# ... for the inner camera
-camera_inner_name =
-camera_inner_config =
-
 [Miscellaneous]
 # A filter which removes logs below a certain logging level.
 # Examples: *:Debug Kernel.SVC:Trace Service.*:Critical

+ 0 - 32
src/citra_qt/configuration/config.cpp

@@ -105,22 +105,6 @@ void Config::ReadValues() {
         qt_config->value("output_device", "auto").toString().toStdString();
     qt_config->endGroup();
 
-    using namespace Service::CAM;
-    qt_config->beginGroup("Camera");
-    Settings::values.camera_name[OuterRightCamera] =
-        qt_config->value("camera_outer_right_name", "blank").toString().toStdString();
-    Settings::values.camera_config[OuterRightCamera] =
-        qt_config->value("camera_outer_right_config", "").toString().toStdString();
-    Settings::values.camera_name[InnerCamera] =
-        qt_config->value("camera_inner_name", "blank").toString().toStdString();
-    Settings::values.camera_config[InnerCamera] =
-        qt_config->value("camera_inner_config", "").toString().toStdString();
-    Settings::values.camera_name[OuterLeftCamera] =
-        qt_config->value("camera_outer_left_name", "blank").toString().toStdString();
-    Settings::values.camera_config[OuterLeftCamera] =
-        qt_config->value("camera_outer_left_config", "").toString().toStdString();
-    qt_config->endGroup();
-
     qt_config->beginGroup("Data Storage");
     Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool();
     qt_config->endGroup();
@@ -259,22 +243,6 @@ void Config::SaveValues() {
     qt_config->setValue("output_device", QString::fromStdString(Settings::values.audio_device_id));
     qt_config->endGroup();
 
-    using namespace Service::CAM;
-    qt_config->beginGroup("Camera");
-    qt_config->setValue("camera_outer_right_name",
-                        QString::fromStdString(Settings::values.camera_name[OuterRightCamera]));
-    qt_config->setValue("camera_outer_right_config",
-                        QString::fromStdString(Settings::values.camera_config[OuterRightCamera]));
-    qt_config->setValue("camera_inner_name",
-                        QString::fromStdString(Settings::values.camera_name[InnerCamera]));
-    qt_config->setValue("camera_inner_config",
-                        QString::fromStdString(Settings::values.camera_config[InnerCamera]));
-    qt_config->setValue("camera_outer_left_name",
-                        QString::fromStdString(Settings::values.camera_name[OuterLeftCamera]));
-    qt_config->setValue("camera_outer_left_config",
-                        QString::fromStdString(Settings::values.camera_config[OuterLeftCamera]));
-    qt_config->endGroup();
-
     qt_config->beginGroup("Data Storage");
     qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd);
     qt_config->endGroup();

+ 0 - 21
src/common/logging/backend.cpp

@@ -33,32 +33,11 @@ namespace Log {
     SUB(Kernel, SVC)                                                                               \
     CLS(Service)                                                                                   \
     SUB(Service, SRV)                                                                              \
-    SUB(Service, FRD)                                                                              \
     SUB(Service, FS)                                                                               \
-    SUB(Service, ERR)                                                                              \
-    SUB(Service, APT)                                                                              \
-    SUB(Service, BOSS)                                                                             \
     SUB(Service, GSP)                                                                              \
-    SUB(Service, AC)                                                                               \
-    SUB(Service, AM)                                                                               \
-    SUB(Service, PTM)                                                                              \
-    SUB(Service, LDR)                                                                              \
-    SUB(Service, MIC)                                                                              \
-    SUB(Service, NDM)                                                                              \
-    SUB(Service, NFC)                                                                              \
-    SUB(Service, NIM)                                                                              \
-    SUB(Service, NWM)                                                                              \
-    SUB(Service, CAM)                                                                              \
-    SUB(Service, CECD)                                                                             \
     SUB(Service, CFG)                                                                              \
-    SUB(Service, CSND)                                                                             \
     SUB(Service, DSP)                                                                              \
-    SUB(Service, DLP)                                                                              \
     SUB(Service, HID)                                                                              \
-    SUB(Service, HTTP)                                                                             \
-    SUB(Service, SOC)                                                                              \
-    SUB(Service, IR)                                                                               \
-    SUB(Service, Y2R)                                                                              \
     CLS(HW)                                                                                        \
     SUB(HW, Memory)                                                                                \
     SUB(HW, LCD)                                                                                   \

+ 0 - 21
src/common/logging/log.h

@@ -50,32 +50,11 @@ enum class Class : ClassType {
     Service,           ///< HLE implementation of system services. Each major service
                        ///  should have its own subclass.
     Service_SRV,       ///< The SRV (Service Directory) implementation
-    Service_FRD,       ///< The FRD (Friends) service
     Service_FS,        ///< The FS (Filesystem) service implementation
-    Service_ERR,       ///< The ERR (Error) port implementation
-    Service_APT,       ///< The APT (Applets) service
-    Service_BOSS,      ///< The BOSS (SpotPass) service
     Service_GSP,       ///< The GSP (GPU control) service
-    Service_AC,        ///< The AC (WiFi status) service
-    Service_AM,        ///< The AM (Application manager) service
-    Service_PTM,       ///< The PTM (Power status & misc.) service
-    Service_LDR,       ///< The LDR (3ds dll loader) service
-    Service_MIC,       ///< The MIC (Microphone) service
-    Service_NDM,       ///< The NDM (Network daemon manager) service
-    Service_NFC,       ///< The NFC service
-    Service_NIM,       ///< The NIM (Network interface manager) service
-    Service_NWM,       ///< The NWM (Network wlan manager) service
-    Service_CAM,       ///< The CAM (Camera) service
-    Service_CECD,      ///< The CECD (StreetPass) service
     Service_CFG,       ///< The CFG (Configuration) service
-    Service_CSND,      ///< The CSND (CWAV format process) service
     Service_DSP,       ///< The DSP (DSP control) service
-    Service_DLP,       ///< The DLP (Download Play) service
     Service_HID,       ///< The HID (Human interface device) service
-    Service_HTTP,      ///< The HTTP service
-    Service_SOC,       ///< The SOC (Socket) service
-    Service_IR,        ///< The IR service
-    Service_Y2R,       ///< The Y2R (YUV to RGB conversion) service
     HW,                ///< Low-level hardware emulation
     HW_Memory,         ///< Memory-map and address translation
     HW_LCD,            ///< LCD register emulation

+ 0 - 190
src/core/CMakeLists.txt

@@ -32,18 +32,10 @@ set(SRCS
             file_sys/path_parser.cpp
             file_sys/savedata_archive.cpp
             file_sys/title_metadata.cpp
-            frontend/camera/blank_camera.cpp
-            frontend/camera/factory.cpp
-            frontend/camera/interface.cpp
             frontend/emu_window.cpp
             frontend/framebuffer_layout.cpp
             gdbstub/gdbstub.cpp
             hle/config_mem.cpp
-            hle/applets/applet.cpp
-            hle/applets/erreula.cpp
-            hle/applets/mii_selector.cpp
-            hle/applets/mint.cpp
-            hle/applets/swkbd.cpp
             hle/kernel/address_arbiter.cpp
             hle/kernel/client_port.cpp
             hle/kernel/client_session.cpp
@@ -65,49 +57,12 @@ set(SRCS
             hle/kernel/wait_object.cpp
             hle/lock.cpp
             hle/romfs.cpp
-            hle/service/ac/ac.cpp
-            hle/service/ac/ac_i.cpp
-            hle/service/ac/ac_u.cpp
-            hle/service/act/act.cpp
-            hle/service/act/act_a.cpp
-            hle/service/act/act_u.cpp
-            hle/service/am/am.cpp
-            hle/service/am/am_app.cpp
-            hle/service/am/am_net.cpp
-            hle/service/am/am_sys.cpp
-            hle/service/am/am_u.cpp
-            hle/service/apt/apt.cpp
-            hle/service/apt/apt_a.cpp
-            hle/service/apt/apt_s.cpp
-            hle/service/apt/apt_u.cpp
-            hle/service/apt/bcfnt/bcfnt.cpp
-            hle/service/boss/boss.cpp
-            hle/service/boss/boss_p.cpp
-            hle/service/boss/boss_u.cpp
-            hle/service/cam/cam.cpp
-            hle/service/cam/cam_c.cpp
-            hle/service/cam/cam_q.cpp
-            hle/service/cam/cam_s.cpp
-            hle/service/cam/cam_u.cpp
-            hle/service/cecd/cecd.cpp
-            hle/service/cecd/cecd_ndm.cpp
-            hle/service/cecd/cecd_s.cpp
-            hle/service/cecd/cecd_u.cpp
             hle/service/cfg/cfg.cpp
             hle/service/cfg/cfg_i.cpp
             hle/service/cfg/cfg_nor.cpp
             hle/service/cfg/cfg_s.cpp
             hle/service/cfg/cfg_u.cpp
-            hle/service/csnd_snd.cpp
-            hle/service/dlp/dlp.cpp
-            hle/service/dlp/dlp_clnt.cpp
-            hle/service/dlp/dlp_fkcl.cpp
-            hle/service/dlp/dlp_srvr.cpp
             hle/service/dsp_dsp.cpp
-            hle/service/err_f.cpp
-            hle/service/frd/frd.cpp
-            hle/service/frd/frd_a.cpp
-            hle/service/frd/frd_u.cpp
             hle/service/fs/archive.cpp
             hle/service/fs/fs_user.cpp
             hle/service/gsp_gpu.cpp
@@ -115,60 +70,11 @@ set(SRCS
             hle/service/hid/hid.cpp
             hle/service/hid/hid_spvr.cpp
             hle/service/hid/hid_user.cpp
-            hle/service/http_c.cpp
-            hle/service/ir/extra_hid.cpp
-            hle/service/ir/ir.cpp
-            hle/service/ir/ir_rst.cpp
-            hle/service/ir/ir_u.cpp
-            hle/service/ir/ir_user.cpp
-            hle/service/ldr_ro/cro_helper.cpp
-            hle/service/ldr_ro/ldr_ro.cpp
-            hle/service/ldr_ro/memory_synchronizer.cpp
-            hle/service/mic_u.cpp
-            hle/service/mvd/mvd.cpp
-            hle/service/mvd/mvd_std.cpp
-            hle/service/ndm/ndm.cpp
-            hle/service/ndm/ndm_u.cpp
-            hle/service/nfc/nfc.cpp
-            hle/service/nfc/nfc_m.cpp
-            hle/service/nfc/nfc_u.cpp
-            hle/service/news/news.cpp
-            hle/service/news/news_s.cpp
-            hle/service/news/news_u.cpp
-            hle/service/nim/nim.cpp
-            hle/service/nim/nim_aoc.cpp
-            hle/service/nim/nim_s.cpp
-            hle/service/nim/nim_u.cpp
             hle/service/ns/ns.cpp
             hle/service/ns/ns_s.cpp
-            hle/service/nwm/nwm.cpp
-            hle/service/nwm/nwm_cec.cpp
-            hle/service/nwm/nwm_ext.cpp
-            hle/service/nwm/nwm_inf.cpp
-            hle/service/nwm/nwm_sap.cpp
-            hle/service/nwm/nwm_soc.cpp
-            hle/service/nwm/nwm_tst.cpp
-            hle/service/nwm/nwm_uds.cpp
-            hle/service/nwm/uds_beacon.cpp
-            hle/service/nwm/uds_connection.cpp
-            hle/service/nwm/uds_data.cpp
-            hle/service/pm_app.cpp
-            hle/service/ptm/ptm.cpp
-            hle/service/ptm/ptm_gets.cpp
-            hle/service/ptm/ptm_play.cpp
-            hle/service/ptm/ptm_sets.cpp
-            hle/service/ptm/ptm_sysm.cpp
-            hle/service/ptm/ptm_u.cpp
-            hle/service/qtm/qtm.cpp
-            hle/service/qtm/qtm_s.cpp
-            hle/service/qtm/qtm_sp.cpp
-            hle/service/qtm/qtm_u.cpp
             hle/service/service.cpp
             hle/service/sm/sm.cpp
             hle/service/sm/srv.cpp
-            hle/service/soc_u.cpp
-            hle/service/ssl_c.cpp
-            hle/service/y2r_u.cpp
             hle/shared_page.cpp
             hle/svc.cpp
             hw/aes/arithmetic128.cpp
@@ -177,7 +83,6 @@ set(SRCS
             hw/gpu.cpp
             hw/hw.cpp
             hw/lcd.cpp
-            hw/y2r.cpp
             loader/3dsx.cpp
             loader/elf.cpp
             loader/linker.cpp
@@ -231,9 +136,6 @@ set(HEADERS
             file_sys/ivfc_archive.h
             file_sys/path_parser.h
             file_sys/savedata_archive.h
-            frontend/camera/blank_camera.h
-            frontend/camera/factory.h
-            frontend/camera/interface.h
             frontend/emu_window.h
             frontend/framebuffer_layout.h
             frontend/input.h
@@ -242,11 +144,6 @@ set(HEADERS
             hle/function_wrappers.h
             hle/ipc.h
             hle/ipc_helpers.h
-            hle/applets/applet.h
-            hle/applets/erreula.h
-            hle/applets/mii_selector.h
-            hle/applets/mint.h
-            hle/applets/swkbd.h
             hle/kernel/address_arbiter.h
             hle/kernel/client_port.h
             hle/kernel/client_session.h
@@ -271,49 +168,12 @@ set(HEADERS
             hle/lock.h
             hle/result.h
             hle/romfs.h
-            hle/service/ac/ac.h
-            hle/service/ac/ac_i.h
-            hle/service/ac/ac_u.h
-            hle/service/act/act.h
-            hle/service/act/act_a.h
-            hle/service/act/act_u.h
-            hle/service/am/am.h
-            hle/service/am/am_app.h
-            hle/service/am/am_net.h
-            hle/service/am/am_sys.h
-            hle/service/am/am_u.h
-            hle/service/apt/apt.h
-            hle/service/apt/apt_a.h
-            hle/service/apt/apt_s.h
-            hle/service/apt/apt_u.h
-            hle/service/apt/bcfnt/bcfnt.h
-            hle/service/boss/boss.h
-            hle/service/boss/boss_p.h
-            hle/service/boss/boss_u.h
-            hle/service/cam/cam.h
-            hle/service/cam/cam_c.h
-            hle/service/cam/cam_q.h
-            hle/service/cam/cam_s.h
-            hle/service/cam/cam_u.h
-            hle/service/cecd/cecd.h
-            hle/service/cecd/cecd_ndm.h
-            hle/service/cecd/cecd_s.h
-            hle/service/cecd/cecd_u.h
             hle/service/cfg/cfg.h
             hle/service/cfg/cfg_i.h
             hle/service/cfg/cfg_nor.h
             hle/service/cfg/cfg_s.h
             hle/service/cfg/cfg_u.h
-            hle/service/csnd_snd.h
-            hle/service/dlp/dlp.h
-            hle/service/dlp/dlp_clnt.h
-            hle/service/dlp/dlp_fkcl.h
-            hle/service/dlp/dlp_srvr.h
             hle/service/dsp_dsp.h
-            hle/service/err_f.h
-            hle/service/frd/frd.h
-            hle/service/frd/frd_a.h
-            hle/service/frd/frd_u.h
             hle/service/fs/archive.h
             hle/service/fs/fs_user.h
             hle/service/gsp_gpu.h
@@ -321,60 +181,11 @@ set(HEADERS
             hle/service/hid/hid.h
             hle/service/hid/hid_spvr.h
             hle/service/hid/hid_user.h
-            hle/service/http_c.h
-            hle/service/ir/extra_hid.h
-            hle/service/ir/ir.h
-            hle/service/ir/ir_rst.h
-            hle/service/ir/ir_u.h
-            hle/service/ir/ir_user.h
-            hle/service/ldr_ro/cro_helper.h
-            hle/service/ldr_ro/ldr_ro.h
-            hle/service/ldr_ro/memory_synchronizer.h
-            hle/service/mic_u.h
-            hle/service/mvd/mvd.h
-            hle/service/mvd/mvd_std.h
-            hle/service/ndm/ndm.h
-            hle/service/ndm/ndm_u.h
-            hle/service/nfc/nfc.h
-            hle/service/nfc/nfc_m.h
-            hle/service/nfc/nfc_u.h
-            hle/service/news/news.h
-            hle/service/news/news_s.h
-            hle/service/news/news_u.h
-            hle/service/nim/nim.h
-            hle/service/nim/nim_aoc.h
-            hle/service/nim/nim_s.h
-            hle/service/nim/nim_u.h
             hle/service/ns/ns.h
             hle/service/ns/ns_s.h
-            hle/service/nwm/nwm.h
-            hle/service/nwm/nwm_cec.h
-            hle/service/nwm/nwm_ext.h
-            hle/service/nwm/nwm_inf.h
-            hle/service/nwm/nwm_sap.h
-            hle/service/nwm/nwm_soc.h
-            hle/service/nwm/nwm_tst.h
-            hle/service/nwm/nwm_uds.h
-            hle/service/nwm/uds_beacon.h
-            hle/service/nwm/uds_connection.h
-            hle/service/nwm/uds_data.h
-            hle/service/pm_app.h
-            hle/service/ptm/ptm.h
-            hle/service/ptm/ptm_gets.h
-            hle/service/ptm/ptm_play.h
-            hle/service/ptm/ptm_sets.h
-            hle/service/ptm/ptm_sysm.h
-            hle/service/ptm/ptm_u.h
-            hle/service/qtm/qtm.h
-            hle/service/qtm/qtm_s.h
-            hle/service/qtm/qtm_sp.h
-            hle/service/qtm/qtm_u.h
             hle/service/service.h
             hle/service/sm/sm.h
             hle/service/sm/srv.h
-            hle/service/soc_u.h
-            hle/service/ssl_c.h
-            hle/service/y2r_u.h
             hle/shared_page.h
             hle/svc.h
             hw/aes/arithmetic128.h
@@ -383,7 +194,6 @@ set(HEADERS
             hw/gpu.h
             hw/hw.h
             hw/lcd.h
-            hw/y2r.h
             loader/3dsx.h
             loader/elf.h
             loader/linker.h

+ 0 - 31
src/core/frontend/camera/blank_camera.cpp

@@ -1,31 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/frontend/camera/blank_camera.h"
-
-namespace Camera {
-
-void BlankCamera::StartCapture() {}
-
-void BlankCamera::StopCapture() {}
-
-void BlankCamera::SetFormat(Service::CAM::OutputFormat output_format) {
-    output_rgb = output_format == Service::CAM::OutputFormat::RGB565;
-}
-
-void BlankCamera::SetResolution(const Service::CAM::Resolution& resolution) {
-    width = resolution.width;
-    height = resolution.height;
-};
-
-void BlankCamera::SetFlip(Service::CAM::Flip) {}
-
-void BlankCamera::SetEffect(Service::CAM::Effect) {}
-
-std::vector<u16> BlankCamera::ReceiveFrame() const {
-    // Note: 0x80008000 stands for two black pixels in YUV422
-    return std::vector<u16>(width * height, output_rgb ? 0 : 0x8000);
-}
-
-} // namespace Camera

+ 0 - 28
src/core/frontend/camera/blank_camera.h

@@ -1,28 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/frontend/camera/factory.h"
-#include "core/frontend/camera/interface.h"
-
-namespace Camera {
-
-class BlankCamera final : public CameraInterface {
-public:
-    void StartCapture() override;
-    void StopCapture() override;
-    void SetResolution(const Service::CAM::Resolution&) override;
-    void SetFlip(Service::CAM::Flip) override;
-    void SetEffect(Service::CAM::Effect) override;
-    void SetFormat(Service::CAM::OutputFormat) override;
-    std::vector<u16> ReceiveFrame() const override;
-
-private:
-    int width = 0;
-    int height = 0;
-    bool output_rgb = false;
-};
-
-} // namespace Camera

+ 0 - 32
src/core/frontend/camera/factory.cpp

@@ -1,32 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <unordered_map>
-#include "common/logging/log.h"
-#include "core/frontend/camera/blank_camera.h"
-#include "core/frontend/camera/factory.h"
-
-namespace Camera {
-
-static std::unordered_map<std::string, std::unique_ptr<CameraFactory>> factories;
-
-CameraFactory::~CameraFactory() = default;
-
-void RegisterFactory(const std::string& name, std::unique_ptr<CameraFactory> factory) {
-    factories[name] = std::move(factory);
-}
-
-std::unique_ptr<CameraInterface> CreateCamera(const std::string& name, const std::string& config) {
-    auto pair = factories.find(name);
-    if (pair != factories.end()) {
-        return pair->second->Create(config);
-    }
-
-    if (name != "blank") {
-        LOG_ERROR(Service_CAM, "Unknown camera \"%s\"", name.c_str());
-    }
-    return std::make_unique<BlankCamera>();
-}
-
-} // namespace Camera

+ 0 - 41
src/core/frontend/camera/factory.h

@@ -1,41 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include <memory>
-#include <string>
-#include "core/frontend/camera/interface.h"
-
-namespace Camera {
-
-class CameraFactory {
-public:
-    virtual ~CameraFactory();
-
-    /**
-     * Creates a camera object based on the configuration string.
-     * @param config Configuration string to create the camera. The implementation can decide the
-     *               meaning of this string.
-     * @returns a unique_ptr to the created camera object.
-     */
-    virtual std::unique_ptr<CameraInterface> Create(const std::string& config) const = 0;
-};
-
-/**
- * Registers an external camera factory.
- * @param name Identifier of the camera factory.
- * @param factory Camera factory to register.
- */
-void RegisterFactory(const std::string& name, std::unique_ptr<CameraFactory> factory);
-
-/**
- * Creates a camera from the factory.
- * @param name Identifier of the camera factory.
- * @param config Configuration string to create the camera. The meaning of this string is
- *     defined by the factory.
- */
-std::unique_ptr<CameraInterface> CreateCamera(const std::string& name, const std::string& config);
-
-} // namespace Camera

+ 0 - 11
src/core/frontend/camera/interface.cpp

@@ -1,11 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/frontend/camera/interface.h"
-
-namespace Camera {
-
-CameraInterface::~CameraInterface() = default;
-
-} // namespace Camera

+ 0 - 61
src/core/frontend/camera/interface.h

@@ -1,61 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include <vector>
-#include "common/common_types.h"
-#include "core/hle/service/cam/cam.h"
-
-namespace Camera {
-
-/// An abstract class standing for a camera. All camera implementations should inherit from this.
-class CameraInterface {
-public:
-    virtual ~CameraInterface();
-
-    /// Starts the camera for video capturing.
-    virtual void StartCapture() = 0;
-
-    /// Stops the camera for video capturing.
-    virtual void StopCapture() = 0;
-
-    /**
-     * Sets the video resolution from raw CAM service parameters.
-     * For the meaning of the parameters, please refer to Service::CAM::Resolution. Note that the
-     * actual camera implementation doesn't need to respect all the parameters. However, the width
-     * and the height parameters must be respected and be used to determine the size of output
-     * frames.
-     * @param resolution The resolution parameters to set
-     */
-    virtual void SetResolution(const Service::CAM::Resolution& resolution) = 0;
-
-    /**
-     * Configures how received frames should be flipped by the camera.
-     * @param flip Flip applying to the frame
-     */
-    virtual void SetFlip(Service::CAM::Flip flip) = 0;
-
-    /**
-     * Configures what effect should be applied to received frames by the camera.
-     * @param effect Effect applying to the frame
-     */
-    virtual void SetEffect(Service::CAM::Effect effect) = 0;
-
-    /**
-     * Sets the output format of the all frames received after this function is called.
-     * @param format Output format of the frame
-     */
-    virtual void SetFormat(Service::CAM::OutputFormat format) = 0;
-
-    /**
-     * Receives a frame from the camera.
-     * This function should be only called between a StartCapture call and a StopCapture call.
-     * @returns A std::vector<u16> containing pixels. The total size of the vector is width * height
-     *     where width and height are set by a call to SetResolution.
-     */
-    virtual std::vector<u16> ReceiveFrame() const = 0;
-};
-
-} // namespace Camera

+ 0 - 130
src/core/hle/applets/applet.cpp

@@ -1,130 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <cstddef>
-#include <memory>
-#include <type_traits>
-#include <unordered_map>
-#include "common/assert.h"
-#include "common/common_types.h"
-#include "core/core_timing.h"
-#include "core/hle/applets/applet.h"
-#include "core/hle/applets/erreula.h"
-#include "core/hle/applets/mii_selector.h"
-#include "core/hle/applets/mint.h"
-#include "core/hle/applets/swkbd.h"
-#include "core/hle/result.h"
-#include "core/hle/service/apt/apt.h"
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-// Specializes std::hash for AppletId, so that we can use it in std::unordered_map.
-// Workaround for libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970
-namespace std {
-template <>
-struct hash<Service::APT::AppletId> {
-    typedef Service::APT::AppletId argument_type;
-    typedef std::size_t result_type;
-
-    result_type operator()(const argument_type& id_code) const {
-        typedef std::underlying_type<argument_type>::type Type;
-        return std::hash<Type>()(static_cast<Type>(id_code));
-    }
-};
-}
-
-namespace HLE {
-namespace Applets {
-
-static std::unordered_map<Service::APT::AppletId, std::shared_ptr<Applet>> applets;
-static u32 applet_update_event =
-    -1; ///< The CoreTiming event identifier for the Applet update callback.
-/// The interval at which the Applet update callback will be called, 16.6ms
-static const u64 applet_update_interval_us = 16666;
-
-ResultCode Applet::Create(Service::APT::AppletId id) {
-    switch (id) {
-    case Service::APT::AppletId::SoftwareKeyboard1:
-    case Service::APT::AppletId::SoftwareKeyboard2:
-        applets[id] = std::make_shared<SoftwareKeyboard>(id);
-        break;
-    case Service::APT::AppletId::Ed1:
-    case Service::APT::AppletId::Ed2:
-        applets[id] = std::make_shared<MiiSelector>(id);
-        break;
-    case Service::APT::AppletId::Error:
-    case Service::APT::AppletId::Error2:
-        applets[id] = std::make_shared<ErrEula>(id);
-        break;
-    case Service::APT::AppletId::Mint:
-    case Service::APT::AppletId::Mint2:
-        applets[id] = std::make_shared<Mint>(id);
-        break;
-    default:
-        LOG_ERROR(Service_APT, "Could not create applet %u", id);
-        // TODO(Subv): Find the right error code
-        return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
-                          ErrorSummary::NotSupported, ErrorLevel::Permanent);
-    }
-
-    return RESULT_SUCCESS;
-}
-
-std::shared_ptr<Applet> Applet::Get(Service::APT::AppletId id) {
-    auto itr = applets.find(id);
-    if (itr != applets.end())
-        return itr->second;
-    return nullptr;
-}
-
-/// Handles updating the current Applet every time it's called.
-static void AppletUpdateEvent(u64 applet_id, int cycles_late) {
-    Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id);
-    std::shared_ptr<Applet> applet = Applet::Get(id);
-    ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", id);
-
-    applet->Update();
-
-    // If the applet is still running after the last update, reschedule the event
-    if (applet->IsRunning()) {
-        CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us) - cycles_late,
-                                  applet_update_event, applet_id);
-    } else {
-        // Otherwise the applet has terminated, in which case we should clean it up
-        applets[id] = nullptr;
-    }
-}
-
-ResultCode Applet::Start(const Service::APT::AppletStartupParameter& parameter) {
-    ResultCode result = StartImpl(parameter);
-    if (result.IsError())
-        return result;
-    // Schedule the update event
-    CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us), applet_update_event,
-                              static_cast<u64>(id));
-    return result;
-}
-
-bool Applet::IsRunning() const {
-    return is_running;
-}
-
-bool IsLibraryAppletRunning() {
-    // Check the applets map for instances of any applet
-    for (auto itr = applets.begin(); itr != applets.end(); ++itr)
-        if (itr->second != nullptr)
-            return true;
-    return false;
-}
-
-void Init() {
-    // Register the applet update callback
-    applet_update_event = CoreTiming::RegisterEvent("HLE Applet Update Event", AppletUpdateEvent);
-}
-
-void Shutdown() {
-    CoreTiming::RemoveEvent(applet_update_event);
-}
-}
-} // namespace

+ 0 - 83
src/core/hle/applets/applet.h

@@ -1,83 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include <memory>
-#include "core/hle/result.h"
-#include "core/hle/service/apt/apt.h"
-
-namespace HLE {
-namespace Applets {
-
-class Applet {
-public:
-    virtual ~Applet() = default;
-
-    /**
-     * Creates an instance of the Applet subclass identified by the parameter.
-     * and stores it in a global map.
-     * @param id Id of the applet to create.
-     * @returns ResultCode Whether the operation was successful or not.
-     */
-    static ResultCode Create(Service::APT::AppletId id);
-
-    /**
-     * Retrieves the Applet instance identified by the specified id.
-     * @param id Id of the Applet to retrieve.
-     * @returns Requested Applet or nullptr if not found.
-     */
-    static std::shared_ptr<Applet> Get(Service::APT::AppletId id);
-
-    /**
-     * Handles a parameter from the application.
-     * @param parameter Parameter data to handle.
-     * @returns ResultCode Whether the operation was successful or not.
-     */
-    virtual ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) = 0;
-
-    /**
-     * Handles the Applet start event, triggered from the application.
-     * @param parameter Parameter data to handle.
-     * @returns ResultCode Whether the operation was successful or not.
-     */
-    ResultCode Start(const Service::APT::AppletStartupParameter& parameter);
-
-    /**
-     * Whether the applet is currently executing instead of the host application or not.
-     */
-    bool IsRunning() const;
-
-    /**
-     * Handles an update tick for the Applet, lets it update the screen, send commands, etc.
-     */
-    virtual void Update() = 0;
-
-protected:
-    explicit Applet(Service::APT::AppletId id) : id(id) {}
-
-    /**
-     * Handles the Applet start event, triggered from the application.
-     * @param parameter Parameter data to handle.
-     * @returns ResultCode Whether the operation was successful or not.
-     */
-    virtual ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) = 0;
-
-    Service::APT::AppletId id;                    ///< Id of this Applet
-    std::shared_ptr<std::vector<u8>> heap_memory; ///< Heap memory for this Applet
-
-    /// Whether this applet is currently running instead of the host application or not.
-    bool is_running = false;
-};
-
-/// Returns whether a library applet is currently running
-bool IsLibraryAppletRunning();
-
-/// Initializes the HLE applets
-void Init();
-
-/// Shuts down the HLE applets
-void Shutdown();
-}
-} // namespace

+ 0 - 72
src/core/hle/applets/erreula.cpp

@@ -1,72 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "common/string_util.h"
-#include "core/hle/applets/erreula.h"
-#include "core/hle/service/apt/apt.h"
-
-namespace HLE {
-namespace Applets {
-
-ResultCode ErrEula::ReceiveParameter(const Service::APT::MessageParameter& parameter) {
-    if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) {
-        LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal);
-        UNIMPLEMENTED();
-        // TODO(Subv): Find the right error code
-        return ResultCode(-1);
-    }
-
-    // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared
-    // memory.
-    // Create the SharedMemory that will hold the framebuffer data
-    Service::APT::CaptureBufferInfo capture_info;
-    ASSERT(sizeof(capture_info) == parameter.buffer.size());
-
-    memcpy(&capture_info, parameter.buffer.data(), sizeof(capture_info));
-
-    // TODO: allocated memory never released
-    using Kernel::MemoryPermission;
-    // Allocate a heap block of the required size for this applet.
-    heap_memory = std::make_shared<std::vector<u8>>(capture_info.size);
-    // Create a SharedMemory that directly points to this heap block.
-    framebuffer_memory = Kernel::SharedMemory::CreateForApplet(
-        heap_memory, 0, capture_info.size, MemoryPermission::ReadWrite, MemoryPermission::ReadWrite,
-        "ErrEula Memory");
-
-    // Send the response message with the newly created SharedMemory
-    Service::APT::MessageParameter result;
-    result.signal = static_cast<u32>(Service::APT::SignalType::Response);
-    result.buffer.clear();
-    result.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    result.sender_id = static_cast<u32>(id);
-    result.object = framebuffer_memory;
-
-    Service::APT::SendParameter(result);
-    return RESULT_SUCCESS;
-}
-
-ResultCode ErrEula::StartImpl(const Service::APT::AppletStartupParameter& parameter) {
-    is_running = true;
-
-    // TODO(Subv): Set the expected fields in the response buffer before resending it to the
-    // application.
-    // TODO(Subv): Reverse the parameter format for the ErrEula applet
-
-    // Let the application know that we're closing
-    Service::APT::MessageParameter message;
-    message.buffer.resize(parameter.buffer.size());
-    std::fill(message.buffer.begin(), message.buffer.end(), 0);
-    message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit);
-    message.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    message.sender_id = static_cast<u32>(id);
-    Service::APT::SendParameter(message);
-
-    is_running = false;
-    return RESULT_SUCCESS;
-}
-
-void ErrEula::Update() {}
-
-} // namespace Applets
-} // namespace HLE

+ 0 - 29
src/core/hle/applets/erreula.h

@@ -1,29 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/applets/applet.h"
-#include "core/hle/kernel/shared_memory.h"
-
-namespace HLE {
-namespace Applets {
-
-class ErrEula final : public Applet {
-public:
-    explicit ErrEula(Service::APT::AppletId id) : Applet(id) {}
-
-    ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override;
-    ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override;
-    void Update() override;
-
-private:
-    /// This SharedMemory will be created when we receive the LibAppJustStarted message.
-    /// It holds the framebuffer info retrieved by the application with
-    /// GSPGPU::ImportDisplayCaptureInfo
-    Kernel::SharedPtr<Kernel::SharedMemory> framebuffer_memory;
-};
-
-} // namespace Applets
-} // namespace HLE

+ 0 - 86
src/core/hle/applets/mii_selector.cpp

@@ -1,86 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <cstring>
-#include <string>
-#include "common/assert.h"
-#include "common/logging/log.h"
-#include "common/string_util.h"
-#include "core/hle/applets/mii_selector.h"
-#include "core/hle/kernel/kernel.h"
-#include "core/hle/kernel/shared_memory.h"
-#include "core/hle/result.h"
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-namespace HLE {
-namespace Applets {
-
-ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& parameter) {
-    if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) {
-        LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal);
-        UNIMPLEMENTED();
-        // TODO(Subv): Find the right error code
-        return ResultCode(-1);
-    }
-
-    // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared
-    // memory.
-    // Create the SharedMemory that will hold the framebuffer data
-    Service::APT::CaptureBufferInfo capture_info;
-    ASSERT(sizeof(capture_info) == parameter.buffer.size());
-
-    memcpy(&capture_info, parameter.buffer.data(), sizeof(capture_info));
-
-    using Kernel::MemoryPermission;
-    // Allocate a heap block of the required size for this applet.
-    heap_memory = std::make_shared<std::vector<u8>>(capture_info.size);
-    // Create a SharedMemory that directly points to this heap block.
-    framebuffer_memory = Kernel::SharedMemory::CreateForApplet(
-        heap_memory, 0, capture_info.size, MemoryPermission::ReadWrite, MemoryPermission::ReadWrite,
-        "MiiSelector Memory");
-
-    // Send the response message with the newly created SharedMemory
-    Service::APT::MessageParameter result;
-    result.signal = static_cast<u32>(Service::APT::SignalType::Response);
-    result.buffer.clear();
-    result.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    result.sender_id = static_cast<u32>(id);
-    result.object = framebuffer_memory;
-
-    Service::APT::SendParameter(result);
-    return RESULT_SUCCESS;
-}
-
-ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& parameter) {
-    is_running = true;
-
-    // TODO(Subv): Set the expected fields in the response buffer before resending it to the
-    // application.
-    // TODO(Subv): Reverse the parameter format for the Mii Selector
-
-    memcpy(&config, parameter.buffer.data(), parameter.buffer.size());
-
-    // TODO(Subv): Find more about this structure, result code 0 is enough to let most games
-    // continue.
-    MiiResult result;
-    memset(&result, 0, sizeof(result));
-    result.return_code = 0;
-
-    // Let the application know that we're closing
-    Service::APT::MessageParameter message;
-    message.buffer.resize(sizeof(MiiResult));
-    std::memcpy(message.buffer.data(), &result, message.buffer.size());
-    message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit);
-    message.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    message.sender_id = static_cast<u32>(id);
-    Service::APT::SendParameter(message);
-
-    is_running = false;
-    return RESULT_SUCCESS;
-}
-
-void MiiSelector::Update() {}
-} // namespace Applets
-} // namespace HLE

+ 0 - 78
src/core/hle/applets/mii_selector.h

@@ -1,78 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "common/common_funcs.h"
-#include "common/common_types.h"
-#include "core/hle/applets/applet.h"
-#include "core/hle/kernel/kernel.h"
-#include "core/hle/kernel/shared_memory.h"
-#include "core/hle/result.h"
-#include "core/hle/service/apt/apt.h"
-
-namespace HLE {
-namespace Applets {
-
-struct MiiConfig {
-    u8 enable_cancel_button;
-    u8 enable_guest_mii;
-    u8 show_on_top_screen;
-    INSERT_PADDING_BYTES(5);
-    u16 title[0x40];
-    INSERT_PADDING_BYTES(4);
-    u8 show_guest_miis;
-    INSERT_PADDING_BYTES(3);
-    u32 initially_selected_mii_index;
-    u8 guest_mii_whitelist[6];
-    u8 user_mii_whitelist[0x64];
-    INSERT_PADDING_BYTES(2);
-    u32 magic_value;
-};
-static_assert(sizeof(MiiConfig) == 0x104, "MiiConfig structure has incorrect size");
-#define ASSERT_REG_POSITION(field_name, position)                                                  \
-    static_assert(offsetof(MiiConfig, field_name) == position,                                     \
-                  "Field " #field_name " has invalid position")
-ASSERT_REG_POSITION(title, 0x08);
-ASSERT_REG_POSITION(show_guest_miis, 0x8C);
-ASSERT_REG_POSITION(initially_selected_mii_index, 0x90);
-ASSERT_REG_POSITION(guest_mii_whitelist, 0x94);
-#undef ASSERT_REG_POSITION
-
-struct MiiResult {
-    u32 return_code;
-    u32 is_guest_mii_selected;
-    u32 selected_guest_mii_index;
-    // TODO(mailwl): expand to Mii Format structure: https://www.3dbrew.org/wiki/Mii
-    u8 selected_mii_data[0x5C];
-    INSERT_PADDING_BYTES(2);
-    u16 mii_data_checksum;
-    u16 guest_mii_name[0xC];
-};
-static_assert(sizeof(MiiResult) == 0x84, "MiiResult structure has incorrect size");
-#define ASSERT_REG_POSITION(field_name, position)                                                  \
-    static_assert(offsetof(MiiResult, field_name) == position,                                     \
-                  "Field " #field_name " has invalid position")
-ASSERT_REG_POSITION(selected_mii_data, 0x0C);
-ASSERT_REG_POSITION(guest_mii_name, 0x6C);
-#undef ASSERT_REG_POSITION
-
-class MiiSelector final : public Applet {
-public:
-    MiiSelector(Service::APT::AppletId id) : Applet(id) {}
-
-    ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override;
-    ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override;
-    void Update() override;
-
-private:
-    /// This SharedMemory will be created when we receive the LibAppJustStarted message.
-    /// It holds the framebuffer info retrieved by the application with
-    /// GSPGPU::ImportDisplayCaptureInfo
-    Kernel::SharedPtr<Kernel::SharedMemory> framebuffer_memory;
-
-    MiiConfig config;
-};
-} // namespace Applets
-} // namespace HLE

+ 0 - 72
src/core/hle/applets/mint.cpp

@@ -1,72 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "common/string_util.h"
-#include "core/hle/applets/mint.h"
-#include "core/hle/service/apt/apt.h"
-
-namespace HLE {
-namespace Applets {
-
-ResultCode Mint::ReceiveParameter(const Service::APT::MessageParameter& parameter) {
-    if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) {
-        LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal);
-        UNIMPLEMENTED();
-        // TODO(Subv): Find the right error code
-        return ResultCode(-1);
-    }
-
-    // The Request message contains a buffer with the size of the framebuffer shared
-    // memory.
-    // Create the SharedMemory that will hold the framebuffer data
-    Service::APT::CaptureBufferInfo capture_info;
-    ASSERT(sizeof(capture_info) == parameter.buffer.size());
-
-    memcpy(&capture_info, parameter.buffer.data(), sizeof(capture_info));
-
-    // TODO: allocated memory never released
-    using Kernel::MemoryPermission;
-    // Allocate a heap block of the required size for this applet.
-    heap_memory = std::make_shared<std::vector<u8>>(capture_info.size);
-    // Create a SharedMemory that directly points to this heap block.
-    framebuffer_memory = Kernel::SharedMemory::CreateForApplet(
-        heap_memory, 0, capture_info.size, MemoryPermission::ReadWrite, MemoryPermission::ReadWrite,
-        "Mint Memory");
-
-    // Send the response message with the newly created SharedMemory
-    Service::APT::MessageParameter result;
-    result.signal = static_cast<u32>(Service::APT::SignalType::Response);
-    result.buffer.clear();
-    result.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    result.sender_id = static_cast<u32>(id);
-    result.object = framebuffer_memory;
-
-    Service::APT::SendParameter(result);
-    return RESULT_SUCCESS;
-}
-
-ResultCode Mint::StartImpl(const Service::APT::AppletStartupParameter& parameter) {
-    is_running = true;
-
-    // TODO(Subv): Set the expected fields in the response buffer before resending it to the
-    // application.
-    // TODO(Subv): Reverse the parameter format for the Mint applet
-
-    // Let the application know that we're closing
-    Service::APT::MessageParameter message;
-    message.buffer.resize(parameter.buffer.size());
-    std::fill(message.buffer.begin(), message.buffer.end(), 0);
-    message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit);
-    message.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    message.sender_id = static_cast<u32>(id);
-    Service::APT::SendParameter(message);
-
-    is_running = false;
-    return RESULT_SUCCESS;
-}
-
-void Mint::Update() {}
-
-} // namespace Applets
-} // namespace HLE

+ 0 - 29
src/core/hle/applets/mint.h

@@ -1,29 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/applets/applet.h"
-#include "core/hle/kernel/shared_memory.h"
-
-namespace HLE {
-namespace Applets {
-
-class Mint final : public Applet {
-public:
-    explicit Mint(Service::APT::AppletId id) : Applet(id) {}
-
-    ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override;
-    ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override;
-    void Update() override;
-
-private:
-    /// This SharedMemory will be created when we receive the Request message.
-    /// It holds the framebuffer info retrieved by the application with
-    /// GSPGPU::ImportDisplayCaptureInfo
-    Kernel::SharedPtr<Kernel::SharedMemory> framebuffer_memory;
-};
-
-} // namespace Applets
-} // namespace HLE

+ 0 - 118
src/core/hle/applets/swkbd.cpp

@@ -1,118 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <cstring>
-#include <string>
-#include "common/assert.h"
-#include "common/logging/log.h"
-#include "common/string_util.h"
-#include "core/hle/applets/swkbd.h"
-#include "core/hle/kernel/kernel.h"
-#include "core/hle/kernel/shared_memory.h"
-#include "core/hle/result.h"
-#include "core/hle/service/gsp_gpu.h"
-#include "core/hle/service/hid/hid.h"
-#include "core/memory.h"
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-namespace HLE {
-namespace Applets {
-
-ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter const& parameter) {
-    if (parameter.signal != static_cast<u32>(Service::APT::SignalType::Request)) {
-        LOG_ERROR(Service_APT, "unsupported signal %u", parameter.signal);
-        UNIMPLEMENTED();
-        // TODO(Subv): Find the right error code
-        return ResultCode(-1);
-    }
-
-    // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared
-    // memory.
-    // Create the SharedMemory that will hold the framebuffer data
-    Service::APT::CaptureBufferInfo capture_info;
-    ASSERT(sizeof(capture_info) == parameter.buffer.size());
-
-    memcpy(&capture_info, parameter.buffer.data(), sizeof(capture_info));
-
-    using Kernel::MemoryPermission;
-    // Allocate a heap block of the required size for this applet.
-    heap_memory = std::make_shared<std::vector<u8>>(capture_info.size);
-    // Create a SharedMemory that directly points to this heap block.
-    framebuffer_memory = Kernel::SharedMemory::CreateForApplet(
-        heap_memory, 0, capture_info.size, MemoryPermission::ReadWrite, MemoryPermission::ReadWrite,
-        "SoftwareKeyboard Memory");
-
-    // Send the response message with the newly created SharedMemory
-    Service::APT::MessageParameter result;
-    result.signal = static_cast<u32>(Service::APT::SignalType::Response);
-    result.buffer.clear();
-    result.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    result.sender_id = static_cast<u32>(id);
-    result.object = framebuffer_memory;
-
-    Service::APT::SendParameter(result);
-    return RESULT_SUCCESS;
-}
-
-ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) {
-    ASSERT_MSG(parameter.buffer.size() == sizeof(config),
-               "The size of the parameter (SoftwareKeyboardConfig) is wrong");
-
-    memcpy(&config, parameter.buffer.data(), parameter.buffer.size());
-    text_memory =
-        boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object);
-
-    // TODO(Subv): Verify if this is the correct behavior
-    memset(text_memory->GetPointer(), 0, text_memory->size);
-
-    DrawScreenKeyboard();
-
-    is_running = true;
-    return RESULT_SUCCESS;
-}
-
-void SoftwareKeyboard::Update() {
-    // TODO(Subv): Handle input using the touch events from the HID module
-
-    // TODO(Subv): Remove this hardcoded text
-    std::u16string text = Common::UTF8ToUTF16("Citra");
-    memcpy(text_memory->GetPointer(), text.c_str(), text.length() * sizeof(char16_t));
-
-    // TODO(Subv): Ask for input and write it to the shared memory
-    // TODO(Subv): Find out what are the possible values for the return code,
-    // some games seem to check for a hardcoded 2
-    config.return_code = 2;
-    config.text_length = 6;
-    config.text_offset = 0;
-
-    // TODO(Subv): We're finalizing the applet immediately after it's started,
-    // but we should defer this call until after all the input has been collected.
-    Finalize();
-}
-
-void SoftwareKeyboard::DrawScreenKeyboard() {
-    auto bottom_screen = Service::GSP::GetFrameBufferInfo(0, 1);
-    auto info = bottom_screen->framebuffer_info[bottom_screen->index];
-
-    // TODO(Subv): Draw the HLE keyboard, for now just zero-fill the framebuffer
-    Memory::ZeroBlock(info.address_left, info.stride * 320);
-
-    Service::GSP::SetBufferSwap(1, info);
-}
-
-void SoftwareKeyboard::Finalize() {
-    // Let the application know that we're closing
-    Service::APT::MessageParameter message;
-    message.buffer.resize(sizeof(SoftwareKeyboardConfig));
-    std::memcpy(message.buffer.data(), &config, message.buffer.size());
-    message.signal = static_cast<u32>(Service::APT::SignalType::WakeupByExit);
-    message.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
-    message.sender_id = static_cast<u32>(id);
-    Service::APT::SendParameter(message);
-
-    is_running = false;
-}
-}
-} // namespace

+ 0 - 85
src/core/hle/applets/swkbd.h

@@ -1,85 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "common/common_funcs.h"
-#include "common/common_types.h"
-#include "core/hle/applets/applet.h"
-#include "core/hle/kernel/kernel.h"
-#include "core/hle/kernel/shared_memory.h"
-#include "core/hle/result.h"
-#include "core/hle/service/apt/apt.h"
-
-namespace HLE {
-namespace Applets {
-
-struct SoftwareKeyboardConfig {
-    INSERT_PADDING_WORDS(0x8);
-
-    u16 max_text_length; ///< Maximum length of the input text
-
-    INSERT_PADDING_BYTES(0x6E);
-
-    char16_t display_text[65]; ///< Text to display when asking the user for input
-
-    INSERT_PADDING_BYTES(0xE);
-
-    u32 default_text_offset; ///< Offset of the default text in the output SharedMemory
-
-    INSERT_PADDING_WORDS(0x3);
-
-    u32 shared_memory_size; ///< Size of the SharedMemory
-
-    INSERT_PADDING_WORDS(0x1);
-
-    u32 return_code; ///< Return code of the SoftwareKeyboard, usually 2, other values are unknown
-
-    INSERT_PADDING_WORDS(0x2);
-
-    u32 text_offset; ///< Offset in the SharedMemory where the output text starts
-    u16 text_length; ///< Length in characters of the output text
-
-    INSERT_PADDING_BYTES(0x2B6);
-};
-
-/**
- * The size of this structure (0x400) has been verified via reverse engineering of multiple games
- * that use the software keyboard.
- */
-static_assert(sizeof(SoftwareKeyboardConfig) == 0x400, "Software Keyboard Config size is wrong");
-
-class SoftwareKeyboard final : public Applet {
-public:
-    SoftwareKeyboard(Service::APT::AppletId id) : Applet(id) {}
-
-    ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override;
-    ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override;
-    void Update() override;
-
-    /**
-     * Draws a keyboard to the current bottom screen framebuffer.
-     */
-    void DrawScreenKeyboard();
-
-    /**
-     * Sends the LibAppletClosing signal to the application,
-     * along with the relevant data buffers.
-     */
-    void Finalize();
-
-private:
-    /// This SharedMemory will be created when we receive the LibAppJustStarted message.
-    /// It holds the framebuffer info retrieved by the application with
-    /// GSPGPU::ImportDisplayCaptureInfo
-    Kernel::SharedPtr<Kernel::SharedMemory> framebuffer_memory;
-
-    /// SharedMemory where the output text will be stored
-    Kernel::SharedPtr<Kernel::SharedMemory> text_memory;
-
-    /// Configuration of this instance of the SoftwareKeyboard, as received from the application
-    SoftwareKeyboardConfig config;
-};
-}
-} // namespace

+ 0 - 186
src/core/hle/service/ac/ac.cpp

@@ -1,186 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <array>
-
-#include "common/common_types.h"
-#include "common/logging/log.h"
-#include "core/hle/ipc.h"
-#include "core/hle/kernel/event.h"
-#include "core/hle/kernel/handle_table.h"
-#include "core/hle/result.h"
-#include "core/hle/service/ac/ac.h"
-#include "core/hle/service/ac/ac_i.h"
-#include "core/hle/service/ac/ac_u.h"
-#include "core/memory.h"
-
-namespace Service {
-namespace AC {
-
-struct ACConfig {
-    std::array<u8, 0x200> data;
-};
-
-static ACConfig default_config{};
-
-static bool ac_connected = false;
-
-static Kernel::SharedPtr<Kernel::Event> close_event;
-static Kernel::SharedPtr<Kernel::Event> connect_event;
-static Kernel::SharedPtr<Kernel::Event> disconnect_event;
-
-void CreateDefaultConfig(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 ac_config_addr = cmd_buff[65];
-
-    ASSERT_MSG(cmd_buff[64] == (sizeof(ACConfig) << 14 | 2),
-               "Output buffer size not equal ACConfig size");
-
-    Memory::WriteBlock(ac_config_addr, &default_config, sizeof(ACConfig));
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void ConnectAsync(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    connect_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[4]);
-    if (connect_event) {
-        connect_event->name = "AC:connect_event";
-        connect_event->Signal();
-        ac_connected = true;
-    }
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void GetConnectResult(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void CloseAsync(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    if (ac_connected && disconnect_event) {
-        disconnect_event->Signal();
-    }
-
-    close_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[4]);
-    if (close_event) {
-        close_event->name = "AC:close_event";
-        close_event->Signal();
-    }
-
-    ac_connected = false;
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void GetCloseResult(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void GetWifiStatus(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    // TODO(purpasmart96): This function is only a stub,
-    // it returns a valid result without implementing full functionality.
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    cmd_buff[2] = 0;                  // Connection type set to none
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void GetInfraPriority(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    cmd_buff[2] = 0;                  // Infra Priority, default 0
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void SetRequestEulaVersion(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 major = cmd_buff[1] & 0xFF;
-    u32 minor = cmd_buff[2] & 0xFF;
-
-    ASSERT_MSG(cmd_buff[3] == (sizeof(ACConfig) << 14 | 2),
-               "Input buffer size not equal ACConfig size");
-    ASSERT_MSG(cmd_buff[64] == (sizeof(ACConfig) << 14 | 2),
-               "Output buffer size not equal ACConfig size");
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    cmd_buff[2] = 0;                  // Infra Priority
-
-    LOG_WARNING(Service_AC, "(STUBBED) called, major=%u, minor=%u", major, minor);
-}
-
-void RegisterDisconnectEvent(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    disconnect_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[4]);
-    if (disconnect_event) {
-        disconnect_event->name = "AC:disconnect_event";
-    }
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void IsConnected(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    cmd_buff[2] = ac_connected;
-
-    LOG_WARNING(Service_AC, "(STUBBED) called");
-}
-
-void SetClientVersion(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    const u32 version = cmd_buff[1];
-    self->SetVersion(version);
-
-    LOG_WARNING(Service_AC, "(STUBBED) called, version: 0x%08X", version);
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-}
-
-void Init() {
-    AddService(new AC_I);
-    AddService(new AC_U);
-
-    ac_connected = false;
-
-    close_event = nullptr;
-    connect_event = nullptr;
-    disconnect_event = nullptr;
-}
-
-void Shutdown() {
-    ac_connected = false;
-
-    close_event = nullptr;
-    connect_event = nullptr;
-    disconnect_event = nullptr;
-}
-
-} // namespace AC
-} // namespace Service

+ 0 - 134
src/core/hle/service/ac/ac.h

@@ -1,134 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-namespace Service {
-
-class Interface;
-
-namespace AC {
-
-/**
- * AC::CreateDefaultConfig service function
- *  Inputs:
- *      64 : ACConfig size << 14 | 2
- *      65 : pointer to ACConfig struct
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void CreateDefaultConfig(Interface* self);
-
-/**
- * AC::ConnectAsync service function
- *  Inputs:
- *      1 : ProcessId Header
- *      3 : Copy Handle Header
- *      4 : Connection Event handle
- *      5 : ACConfig size << 14 | 2
- *      6 : pointer to ACConfig struct
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void ConnectAsync(Interface* self);
-
-/**
- * AC::GetConnectResult service function
- *  Inputs:
- *      1 : ProcessId Header
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void GetConnectResult(Interface* self);
-
-/**
- * AC::CloseAsync service function
- *  Inputs:
- *      1 : ProcessId Header
- *      3 : Copy Handle Header
- *      4 : Event handle, should be signaled when AC connection is closed
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void CloseAsync(Interface* self);
-
-/**
- * AC::GetCloseResult service function
- *  Inputs:
- *      1 : ProcessId Header
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void GetCloseResult(Interface* self);
-
-/**
- * AC::GetWifiStatus service function
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Output connection type, 0 = none, 1 = Old3DS Internet, 2 = New3DS Internet.
- */
-void GetWifiStatus(Interface* self);
-
-/**
- * AC::GetInfraPriority service function
- *  Inputs:
- *      1 : ACConfig size << 14 | 2
- *      2 : pointer to ACConfig struct
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Infra Priority
- */
-void GetInfraPriority(Interface* self);
-
-/**
- * AC::SetRequestEulaVersion service function
- *  Inputs:
- *      1 : Eula Version major
- *      2 : Eula Version minor
- *      3 : ACConfig size << 14 | 2
- *      4 : Input pointer to ACConfig struct
- *      64 : ACConfig size << 14 | 2
- *      65 : Output pointer to ACConfig struct
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Infra Priority
- */
-void SetRequestEulaVersion(Interface* self);
-
-/**
- * AC::RegisterDisconnectEvent service function
- *  Inputs:
- *      1 : ProcessId Header
- *      3 : Copy Handle Header
- *      4 : Event handle, should be signaled when AC connection is closed
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void RegisterDisconnectEvent(Interface* self);
-
-/**
- * AC::IsConnected service function
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : bool, is connected
- */
-void IsConnected(Interface* self);
-
-/**
- * AC::SetClientVersion service function
- *  Inputs:
- *      1 : Used SDK Version
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetClientVersion(Interface* self);
-
-/// Initialize AC service
-void Init();
-
-/// Shutdown AC service
-void Shutdown();
-
-} // namespace AC
-} // namespace Service

+ 0 - 39
src/core/hle/service/ac/ac_i.cpp

@@ -1,39 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/ac/ac.h"
-#include "core/hle/service/ac/ac_i.h"
-
-namespace Service {
-namespace AC {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010000, CreateDefaultConfig, "CreateDefaultConfig"},
-    {0x00040006, ConnectAsync, "ConnectAsync"},
-    {0x00050002, GetConnectResult, "GetConnectResult"},
-    {0x00070002, nullptr, "CancelConnectAsync"},
-    {0x00080004, CloseAsync, "CloseAsync"},
-    {0x00090002, GetCloseResult, "GetCloseResult"},
-    {0x000A0000, nullptr, "GetLastErrorCode"},
-    {0x000C0000, nullptr, "GetStatus"},
-    {0x000D0000, GetWifiStatus, "GetWifiStatus"},
-    {0x000E0042, nullptr, "GetCurrentAPInfo"},
-    {0x00100042, nullptr, "GetCurrentNZoneInfo"},
-    {0x00110042, nullptr, "GetNZoneApNumService"},
-    {0x001D0042, nullptr, "ScanAPs"},
-    {0x00240042, nullptr, "AddDenyApType"},
-    {0x00270002, GetInfraPriority, "GetInfraPriority"},
-    {0x002D0082, SetRequestEulaVersion, "SetRequestEulaVersion"},
-    {0x00300004, RegisterDisconnectEvent, "RegisterDisconnectEvent"},
-    {0x003C0042, nullptr, "GetAPSSIDList"},
-    {0x003E0042, IsConnected, "IsConnected"},
-    {0x00400042, SetClientVersion, "SetClientVersion"},
-};
-
-AC_I::AC_I() {
-    Register(FunctionTable);
-}
-
-} // namespace AC
-} // namespace Service

+ 0 - 22
src/core/hle/service/ac/ac_i.h

@@ -1,22 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace AC {
-
-class AC_I final : public Interface {
-public:
-    AC_I();
-
-    std::string GetPortName() const override {
-        return "ac:i";
-    }
-};
-
-} // namespace AC
-} // namespace Service

+ 0 - 39
src/core/hle/service/ac/ac_u.cpp

@@ -1,39 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/ac/ac.h"
-#include "core/hle/service/ac/ac_u.h"
-
-namespace Service {
-namespace AC {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010000, CreateDefaultConfig, "CreateDefaultConfig"},
-    {0x00040006, ConnectAsync, "ConnectAsync"},
-    {0x00050002, GetConnectResult, "GetConnectResult"},
-    {0x00070002, nullptr, "CancelConnectAsync"},
-    {0x00080004, CloseAsync, "CloseAsync"},
-    {0x00090002, GetCloseResult, "GetCloseResult"},
-    {0x000A0000, nullptr, "GetLastErrorCode"},
-    {0x000C0000, nullptr, "GetStatus"},
-    {0x000D0000, GetWifiStatus, "GetWifiStatus"},
-    {0x000E0042, nullptr, "GetCurrentAPInfo"},
-    {0x00100042, nullptr, "GetCurrentNZoneInfo"},
-    {0x00110042, nullptr, "GetNZoneApNumService"},
-    {0x001D0042, nullptr, "ScanAPs"},
-    {0x00240042, nullptr, "AddDenyApType"},
-    {0x00270002, GetInfraPriority, "GetInfraPriority"},
-    {0x002D0082, SetRequestEulaVersion, "SetRequestEulaVersion"},
-    {0x00300004, RegisterDisconnectEvent, "RegisterDisconnectEvent"},
-    {0x003C0042, nullptr, "GetAPSSIDList"},
-    {0x003E0042, IsConnected, "IsConnected"},
-    {0x00400042, SetClientVersion, "SetClientVersion"},
-};
-
-AC_U::AC_U() {
-    Register(FunctionTable);
-}
-
-} // namespace AC
-} // namespace Service

+ 0 - 22
src/core/hle/service/ac/ac_u.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace AC {
-
-class AC_U final : public Interface {
-public:
-    AC_U();
-
-    std::string GetPortName() const override {
-        return "ac:u";
-    }
-};
-
-} // namespace AC
-} // namespace Service

+ 0 - 18
src/core/hle/service/act/act.cpp

@@ -1,18 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/act/act.h"
-#include "core/hle/service/act/act_a.h"
-#include "core/hle/service/act/act_u.h"
-
-namespace Service {
-namespace ACT {
-
-void Init() {
-    AddService(new ACT_A);
-    AddService(new ACT_U);
-}
-
-} // namespace ACT
-} // namespace Service

+ 0 - 14
src/core/hle/service/act/act.h

@@ -1,14 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-namespace Service {
-namespace ACT {
-
-/// Initializes all ACT services
-void Init();
-
-} // namespace ACT
-} // namespace Service

+ 0 - 30
src/core/hle/service/act/act_a.cpp

@@ -1,30 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/act/act.h"
-#include "core/hle/service/act/act_a.h"
-
-namespace Service {
-namespace ACT {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    // act:u shared commands
-    {0x00010084, nullptr, "Initialize"},
-    {0x00020040, nullptr, "GetErrorCode"},
-    {0x000600C2, nullptr, "GetAccountDataBlock"},
-    {0x000B0042, nullptr, "AcquireEulaList"},
-    {0x000D0040, nullptr, "GenerateUuid"},
-    // act:a
-    {0x041300C2, nullptr, "UpdateMiiImage"},
-    {0x041B0142, nullptr, "AgreeEula"},
-    {0x04210042, nullptr, "UploadMii"},
-    {0x04230082, nullptr, "ValidateMailAddress"},
-};
-
-ACT_A::ACT_A() {
-    Register(FunctionTable);
-}
-
-} // namespace ACT
-} // namespace Service

+ 0 - 22
src/core/hle/service/act/act_a.h

@@ -1,22 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace ACT {
-
-class ACT_A final : public Service::Interface {
-public:
-    ACT_A();
-
-    std::string GetPortName() const override {
-        return "act:a";
-    }
-};
-
-} // namespace ACT
-} // namespace Service

+ 0 - 26
src/core/hle/service/act/act_u.cpp

@@ -1,26 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/act/act.h"
-#include "core/hle/service/act/act_u.h"
-
-namespace Service {
-namespace ACT {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    // clang-format off
-    {0x00010084, nullptr, "Initialize"},
-    {0x00020040, nullptr, "GetErrorCode"},
-    {0x000600C2, nullptr, "GetAccountDataBlock"},
-    {0x000B0042, nullptr, "AcquireEulaList"},
-    {0x000D0040, nullptr, "GenerateUuid"},
-    // clang-format on
-};
-
-ACT_U::ACT_U() {
-    Register(FunctionTable);
-}
-
-} // namespace ACT
-} // namespace Service

+ 0 - 22
src/core/hle/service/act/act_u.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace ACT {
-
-class ACT_U final : public Interface {
-public:
-    ACT_U();
-
-    std::string GetPortName() const override {
-        return "act:u";
-    }
-};
-
-} // namespace ACT
-} // namespace Service

+ 0 - 193
src/core/hle/service/am/am.cpp

@@ -1,193 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <array>
-#include <cinttypes>
-#include "common/common_types.h"
-#include "common/logging/log.h"
-#include "core/hle/ipc.h"
-#include "core/hle/result.h"
-#include "core/hle/service/am/am.h"
-#include "core/hle/service/am/am_app.h"
-#include "core/hle/service/am/am_net.h"
-#include "core/hle/service/am/am_sys.h"
-#include "core/hle/service/am/am_u.h"
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace AM {
-
-static std::array<u32, 3> am_content_count = {0, 0, 0};
-static std::array<u32, 3> am_titles_count = {0, 0, 0};
-static std::array<u32, 3> am_titles_list_count = {0, 0, 0};
-static u32 am_ticket_count = 0;
-static u32 am_ticket_list_count = 0;
-
-void GetNumPrograms(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 media_type = cmd_buff[1] & 0xFF;
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = am_titles_count[media_type];
-    LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_count=0x%08x", media_type,
-                am_titles_count[media_type]);
-}
-
-void FindContentInfos(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 media_type = cmd_buff[1] & 0xFF;
-    u64 title_id = (static_cast<u64>(cmd_buff[3]) << 32) | cmd_buff[2];
-    u32 content_ids_pointer = cmd_buff[6];
-    u32 content_info_pointer = cmd_buff[8];
-
-    am_content_count[media_type] = cmd_buff[4];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016llx, content_cound=%u, "
-                            "content_ids_pointer=0x%08x, content_info_pointer=0x%08x",
-                media_type, title_id, am_content_count[media_type], content_ids_pointer,
-                content_info_pointer);
-}
-
-void ListContentInfos(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 media_type = cmd_buff[2] & 0xFF;
-    u64 title_id = (static_cast<u64>(cmd_buff[4]) << 32) | cmd_buff[3];
-    u32 start_index = cmd_buff[5];
-    u32 content_info_pointer = cmd_buff[7];
-
-    am_content_count[media_type] = cmd_buff[1];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = am_content_count[media_type];
-    LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, content_count=%u, title_id=0x%016" PRIx64
-                            ", start_index=0x%08x, content_info_pointer=0x%08X",
-                media_type, am_content_count[media_type], title_id, start_index,
-                content_info_pointer);
-}
-
-void DeleteContents(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 media_type = cmd_buff[1] & 0xFF;
-    u64 title_id = (static_cast<u64>(cmd_buff[3]) << 32) | cmd_buff[2];
-    u32 content_ids_pointer = cmd_buff[6];
-
-    am_content_count[media_type] = cmd_buff[4];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016" PRIx64
-                            ", content_count=%u, content_ids_pointer=0x%08x",
-                media_type, title_id, am_content_count[media_type], content_ids_pointer);
-}
-
-void GetProgramList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 media_type = cmd_buff[2] & 0xFF;
-    u32 title_ids_output_pointer = cmd_buff[4];
-
-    am_titles_list_count[media_type] = cmd_buff[1];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = am_titles_list_count[media_type];
-    LOG_WARNING(
-        Service_AM,
-        "(STUBBED) media_type=%u, titles_list_count=0x%08X, title_ids_output_pointer=0x%08X",
-        media_type, am_titles_list_count[media_type], title_ids_output_pointer);
-}
-
-void GetProgramInfos(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 media_type = cmd_buff[1] & 0xFF;
-    u32 title_id_list_pointer = cmd_buff[4];
-    u32 title_list_pointer = cmd_buff[6];
-
-    am_titles_count[media_type] = cmd_buff[2];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, total_titles=0x%08X, "
-                            "title_id_list_pointer=0x%08X, title_list_pointer=0x%08X",
-                media_type, am_titles_count[media_type], title_id_list_pointer, title_list_pointer);
-}
-
-void GetDataTitleInfos(Service::Interface* self) {
-    GetProgramInfos(self);
-
-    LOG_WARNING(Service_AM, "(STUBBED) called");
-}
-
-void ListDataTitleTicketInfos(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u64 title_id = (static_cast<u64>(cmd_buff[3]) << 32) | cmd_buff[2];
-    u32 start_index = cmd_buff[4];
-    u32 ticket_info_pointer = cmd_buff[6];
-
-    am_ticket_count = cmd_buff[1];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = am_ticket_count;
-    LOG_WARNING(Service_AM, "(STUBBED) ticket_count=0x%08X, title_id=0x%016" PRIx64
-                            ", start_index=0x%08X, ticket_info_pointer=0x%08X",
-                am_ticket_count, title_id, start_index, ticket_info_pointer);
-}
-
-void GetNumContentInfos(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 1; // Number of content infos plus one
-    LOG_WARNING(Service_AM, "(STUBBED) called");
-}
-
-void DeleteTicket(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u64 title_id = (static_cast<u64>(cmd_buff[2]) << 32) | cmd_buff[1];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    LOG_WARNING(Service_AM, "(STUBBED) called title_id=0x%016" PRIx64 "", title_id);
-}
-
-void GetNumTickets(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = am_ticket_count;
-    LOG_WARNING(Service_AM, "(STUBBED) called ticket_count=0x%08x", am_ticket_count);
-}
-
-void GetTicketList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 num_of_skip = cmd_buff[2];
-    u32 ticket_list_pointer = cmd_buff[4];
-
-    am_ticket_list_count = cmd_buff[1];
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = am_ticket_list_count;
-    LOG_WARNING(
-        Service_AM,
-        "(STUBBED) ticket_list_count=0x%08x, num_of_skip=0x%08x, ticket_list_pointer=0x%08x",
-        am_ticket_list_count, num_of_skip, ticket_list_pointer);
-}
-
-void Init() {
-    AddService(new AM_APP_Interface);
-    AddService(new AM_NET_Interface);
-    AddService(new AM_SYS_Interface);
-    AddService(new AM_U_Interface);
-}
-
-void Shutdown() {}
-
-} // namespace AM
-
-} // namespace Service

+ 0 - 164
src/core/hle/service/am/am.h

@@ -1,164 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-namespace Service {
-
-class Interface;
-
-namespace AM {
-
-/**
- * AM::GetNumPrograms service function
- * Gets the number of installed titles in the requested media type
- *  Inputs:
- *      0 : Command header (0x00010040)
- *      1 : Media type to load the titles from
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- *      2 : The number of titles in the requested media type
- */
-void GetNumPrograms(Service::Interface* self);
-
-/**
- * AM::FindContentInfos service function
- *  Inputs:
- *      1 : MediaType
- *    2-3 : u64, Title ID
- *      4 : Content count
- *      6 : Content IDs pointer
- *      8 : Content Infos pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- */
-void FindContentInfos(Service::Interface* self);
-
-/**
- * AM::ListContentInfos service function
- *  Inputs:
- *      1 : Content count
- *      2 : MediaType
- *    3-4 : u64, Title ID
- *      5 : Start Index
- *      7 : Content Infos pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- *      2 : Number of content infos returned
- */
-void ListContentInfos(Service::Interface* self);
-
-/**
- * AM::DeleteContents service function
- *  Inputs:
- *      1 : MediaType
- *    2-3 : u64, Title ID
- *      4 : Content count
- *      6 : Content IDs pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- */
-void DeleteContents(Service::Interface* self);
-
-/**
- * AM::GetProgramList service function
- * Loads information about the desired number of titles from the desired media type into an array
- *  Inputs:
- *      1 : Title count
- *      2 : Media type to load the titles from
- *      4 : Title IDs output pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- *      2 : The number of titles loaded from the requested media type
- */
-void GetProgramList(Service::Interface* self);
-
-/**
- * AM::GetProgramInfos service function
- *  Inputs:
- *      1 : u8 Mediatype
- *      2 : Total titles
- *      4 : TitleIDList pointer
- *      6 : TitleList pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- */
-void GetProgramInfos(Service::Interface* self);
-
-/**
- * AM::GetDataTitleInfos service function
- * Wrapper for AM::GetProgramInfos
- *  Inputs:
- *      1 : u8 Mediatype
- *      2 : Total titles
- *      4 : TitleIDList pointer
- *      6 : TitleList pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- */
-void GetDataTitleInfos(Service::Interface* self);
-
-/**
- * AM::ListDataTitleTicketInfos service function
- *  Inputs:
- *      1 : Ticket count
- *    2-3 : u64, Title ID
- *      4 : Start Index?
- *      5 : (TicketCount * 24) << 8 | 0x4
- *      6 : Ticket Infos pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- *      2 : Number of ticket infos returned
- */
-void ListDataTitleTicketInfos(Service::Interface* self);
-
-/**
- * AM::GetNumContentInfos service function
- *  Inputs:
- *      0 : Command header (0x100100C0)
- *      1 : MediaType
- *    2-3 : u64, Title ID
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- *      2 : Number of content infos plus one
- */
-void GetNumContentInfos(Service::Interface* self);
-
-/**
- * AM::DeleteTicket service function
- *  Inputs:
- *    1-2 : u64, Title ID
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- */
-void DeleteTicket(Service::Interface* self);
-
-/**
- * AM::GetNumTickets service function
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- *      2 : Number of tickets
- */
-void GetNumTickets(Service::Interface* self);
-
-/**
- * AM::GetTicketList service function
- *  Inputs:
- *      1 : Number of TicketList
- *      2 : Number to skip
- *      4 : TicketList pointer
- *  Outputs:
- *      1 : Result, 0 on success, otherwise error code
- *      2 : Total TicketList
- */
-void GetTicketList(Service::Interface* self);
-
-/// Initialize AM service
-void Init();
-
-/// Shutdown AM service
-void Shutdown();
-
-} // namespace AM
-} // namespace Service

+ 0 - 32
src/core/hle/service/am/am_app.cpp

@@ -1,32 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/am/am.h"
-#include "core/hle/service/am/am_app.h"
-
-namespace Service {
-namespace AM {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x100100C0, GetNumContentInfos, "GetNumContentInfos"},
-    {0x10020104, FindContentInfos, "FindContentInfos"},
-    {0x10030142, ListContentInfos, "ListContentInfos"},
-    {0x10040102, DeleteContents, "DeleteContents"},
-    {0x10050084, GetDataTitleInfos, "GetDataTitleInfos"},
-    {0x10060080, nullptr, "GetNumDataTitleTickets"},
-    {0x10070102, ListDataTitleTicketInfos, "ListDataTitleTicketInfos"},
-    {0x100801C2, nullptr, "GetItemRights"},
-    {0x100900C0, nullptr, "IsDataTitleInUse"},
-    {0x100A0000, nullptr, "IsExternalTitleDatabaseInitialized"},
-    {0x100B00C0, nullptr, "GetNumExistingContentInfos"},
-    {0x100C0142, nullptr, "ListExistingContentInfos"},
-    {0x100D0084, nullptr, "GetPatchTitleInfos"},
-};
-
-AM_APP_Interface::AM_APP_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace AM
-} // namespace Service

+ 0 - 22
src/core/hle/service/am/am_app.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace AM {
-
-class AM_APP_Interface : public Service::Interface {
-public:
-    AM_APP_Interface();
-
-    std::string GetPortName() const override {
-        return "am:app";
-    }
-};
-
-} // namespace AM
-} // namespace Service

+ 0 - 129
src/core/hle/service/am/am_net.cpp

@@ -1,129 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/am/am.h"
-#include "core/hle/service/am/am_net.h"
-
-namespace Service {
-namespace AM {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010040, GetNumPrograms, "GetNumPrograms"},
-    {0x00020082, GetProgramList, "GetProgramList"},
-    {0x00030084, GetProgramInfos, "GetProgramInfos"},
-    {0x000400C0, nullptr, "DeleteUserProgram"},
-    {0x000500C0, nullptr, "GetProductCode"},
-    {0x000600C0, nullptr, "GetStorageId"},
-    {0x00070080, DeleteTicket, "DeleteTicket"},
-    {0x00080000, GetNumTickets, "GetNumTickets"},
-    {0x00090082, GetTicketList, "GetTicketList"},
-    {0x000A0000, nullptr, "GetDeviceID"},
-    {0x000B0040, nullptr, "GetNumImportTitleContexts"},
-    {0x000C0082, nullptr, "GetImportTitleContextList"},
-    {0x000D0084, nullptr, "GetImportTitleContexts"},
-    {0x000E00C0, nullptr, "DeleteImportTitleContext"},
-    {0x000F00C0, nullptr, "GetNumImportContentContexts"},
-    {0x00100102, nullptr, "GetImportContentContextList"},
-    {0x00110104, nullptr, "GetImportContentContexts"},
-    {0x00120102, nullptr, "DeleteImportContentContexts"},
-    {0x00130040, nullptr, "NeedsCleanup"},
-    {0x00140040, nullptr, "DoCleanup"},
-    {0x00150040, nullptr, "DeleteAllImportContexts"},
-    {0x00160000, nullptr, "DeleteAllTemporaryPrograms"},
-    {0x00170044, nullptr, "ImportTwlBackupLegacy"},
-    {0x00180080, nullptr, "InitializeTitleDatabase"},
-    {0x00190040, nullptr, "QueryAvailableTitleDatabase"},
-    {0x001A00C0, nullptr, "CalcTwlBackupSize"},
-    {0x001B0144, nullptr, "ExportTwlBackup"},
-    {0x001C0084, nullptr, "ImportTwlBackup"},
-    {0x001D0000, nullptr, "DeleteAllTwlUserPrograms"},
-    {0x001E00C8, nullptr, "ReadTwlBackupInfo"},
-    {0x001F0040, nullptr, "DeleteAllExpiredUserPrograms"},
-    {0x00200000, nullptr, "GetTwlArchiveResourceInfo"},
-    {0x00210042, nullptr, "GetPersonalizedTicketInfoList"},
-    {0x00220080, nullptr, "DeleteAllImportContextsFiltered"},
-    {0x00230080, nullptr, "GetNumImportTitleContextsFiltered"},
-    {0x002400C2, nullptr, "GetImportTitleContextListFiltered"},
-    {0x002500C0, nullptr, "CheckContentRights"},
-    {0x00260044, nullptr, "GetTicketLimitInfos"},
-    {0x00270044, nullptr, "GetDemoLaunchInfos"},
-    {0x00280108, nullptr, "ReadTwlBackupInfoEx"},
-    {0x00290082, nullptr, "DeleteUserProgramsAtomically"},
-    {0x002A00C0, nullptr, "GetNumExistingContentInfosSystem"},
-    {0x002B0142, nullptr, "ListExistingContentInfosSystem"},
-    {0x002C0084, nullptr, "GetProgramInfosIgnorePlatform"},
-    {0x002D00C0, nullptr, "CheckContentRightsIgnorePlatform"},
-    {0x04010080, nullptr, "UpdateFirmwareTo"},
-    {0x04020040, nullptr, "BeginImportProgram"},
-    {0x04030000, nullptr, "BeginImportProgramTemporarily"},
-    {0x04040002, nullptr, "CancelImportProgram"},
-    {0x04050002, nullptr, "EndImportProgram"},
-    {0x04060002, nullptr, "EndImportProgramWithoutCommit"},
-    {0x040700C2, nullptr, "CommitImportPrograms"},
-    {0x04080042, nullptr, "GetProgramInfoFromCia"},
-    {0x04090004, nullptr, "GetSystemMenuDataFromCia"},
-    {0x040A0002, nullptr, "GetDependencyListFromCia"},
-    {0x040B0002, nullptr, "GetTransferSizeFromCia"},
-    {0x040C0002, nullptr, "GetCoreVersionFromCia"},
-    {0x040D0042, nullptr, "GetRequiredSizeFromCia"},
-    {0x040E00C2, nullptr, "CommitImportProgramsAndUpdateFirmwareAuto"},
-    {0x040F0000, nullptr, "UpdateFirmwareAuto"},
-    {0x041000C0, nullptr, "DeleteProgram"},
-    {0x04110044, nullptr, "GetTwlProgramListForReboot"},
-    {0x04120000, nullptr, "GetSystemUpdaterMutex"},
-    {0x04130002, nullptr, "GetMetaSizeFromCia"},
-    {0x04140044, nullptr, "GetMetaDataFromCia"},
-    {0x04150080, nullptr, "CheckDemoLaunchRights"},
-    {0x041600C0, nullptr, "GetInternalTitleLocationInfo"},
-    {0x041700C0, nullptr, "PerpetuateAgbSaveData"},
-    {0x04180040, nullptr, "BeginImportProgramForOverWrite"},
-    {0x04190000, nullptr, "BeginImportSystemProgram"},
-    {0x08010000, nullptr, "BeginImportTicket"},
-    {0x08020002, nullptr, "CancelImportTicket"},
-    {0x08030002, nullptr, "EndImportTicket"},
-    {0x08040100, nullptr, "BeginImportTitle"},
-    {0x08050000, nullptr, "StopImportTitle"},
-    {0x080600C0, nullptr, "ResumeImportTitle"},
-    {0x08070000, nullptr, "CancelImportTitle"},
-    {0x08080000, nullptr, "EndImportTitle"},
-    {0x080900C2, nullptr, "CommitImportTitles"},
-    {0x080A0000, nullptr, "BeginImportTmd"},
-    {0x080B0002, nullptr, "CancelImportTmd"},
-    {0x080C0042, nullptr, "EndImportTmd"},
-    {0x080D0042, nullptr, "CreateImportContentContexts"},
-    {0x080E0040, nullptr, "BeginImportContent"},
-    {0x080F0002, nullptr, "StopImportContent"},
-    {0x08100040, nullptr, "ResumeImportContent"},
-    {0x08110002, nullptr, "CancelImportContent"},
-    {0x08120002, nullptr, "EndImportContent"},
-    {0x08130000, nullptr, "GetNumCurrentImportContentContexts"},
-    {0x08140042, nullptr, "GetCurrentImportContentContextList"},
-    {0x08150044, nullptr, "GetCurrentImportContentContexts"},
-    {0x08160146, nullptr, "Sign"},
-    {0x08170146, nullptr, "Verify"},
-    {0x08180042, nullptr, "GetDeviceCert"},
-    {0x08190108, nullptr, "ImportCertificates"},
-    {0x081A0042, nullptr, "ImportCertificate"},
-    {0x081B00C2, nullptr, "CommitImportTitlesAndUpdateFirmwareAuto"},
-    {0x081C0100, nullptr, "DeleteTicketId"},
-    {0x081D0080, nullptr, "GetNumTicketIds"},
-    {0x081E0102, nullptr, "GetTicketIdList"},
-    {0x081F0080, nullptr, "GetNumTicketsOfProgram"},
-    {0x08200102, nullptr, "ListTicketInfos"},
-    {0x08210142, nullptr, "GetRightsOnlyTicketData"},
-    {0x08220000, nullptr, "GetNumCurrentContentInfos"},
-    {0x08230044, nullptr, "FindCurrentContentInfos"},
-    {0x08240082, nullptr, "ListCurrentContentInfos"},
-    {0x08250102, nullptr, "CalculateContextRequiredSize"},
-    {0x08260042, nullptr, "UpdateImportContentContexts"},
-    {0x08270000, nullptr, "DeleteAllDemoLaunchInfos"},
-    {0x082800C0, nullptr, "BeginImportTitleForOverWrite"},
-};
-
-AM_NET_Interface::AM_NET_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace AM
-} // namespace Service

+ 0 - 22
src/core/hle/service/am/am_net.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace AM {
-
-class AM_NET_Interface : public Service::Interface {
-public:
-    AM_NET_Interface();
-
-    std::string GetPortName() const override {
-        return "am:net";
-    }
-};
-
-} // namespace AM
-} // namespace Service

+ 0 - 77
src/core/hle/service/am/am_sys.cpp

@@ -1,77 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/am/am.h"
-#include "core/hle/service/am/am_sys.h"
-
-namespace Service {
-namespace AM {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010040, GetNumPrograms, "GetNumPrograms"},
-    {0x00020082, GetProgramList, "GetProgramList"},
-    {0x00030084, GetProgramInfos, "GetProgramInfos"},
-    {0x000400C0, nullptr, "DeleteUserProgram"},
-    {0x000500C0, nullptr, "GetProductCode"},
-    {0x000600C0, nullptr, "GetStorageId"},
-    {0x00070080, DeleteTicket, "DeleteTicket"},
-    {0x00080000, GetNumTickets, "GetNumTickets"},
-    {0x00090082, GetTicketList, "GetTicketList"},
-    {0x000A0000, nullptr, "GetDeviceID"},
-    {0x000B0040, nullptr, "GetNumImportTitleContexts"},
-    {0x000C0082, nullptr, "GetImportTitleContextList"},
-    {0x000D0084, nullptr, "GetImportTitleContexts"},
-    {0x000E00C0, nullptr, "DeleteImportTitleContext"},
-    {0x000F00C0, nullptr, "GetNumImportContentContexts"},
-    {0x00100102, nullptr, "GetImportContentContextList"},
-    {0x00110104, nullptr, "GetImportContentContexts"},
-    {0x00120102, nullptr, "DeleteImportContentContexts"},
-    {0x00130040, nullptr, "NeedsCleanup"},
-    {0x00140040, nullptr, "DoCleanup"},
-    {0x00150040, nullptr, "DeleteAllImportContexts"},
-    {0x00160000, nullptr, "DeleteAllTemporaryPrograms"},
-    {0x00170044, nullptr, "ImportTwlBackupLegacy"},
-    {0x00180080, nullptr, "InitializeTitleDatabase"},
-    {0x00190040, nullptr, "QueryAvailableTitleDatabase"},
-    {0x001A00C0, nullptr, "CalcTwlBackupSize"},
-    {0x001B0144, nullptr, "ExportTwlBackup"},
-    {0x001C0084, nullptr, "ImportTwlBackup"},
-    {0x001D0000, nullptr, "DeleteAllTwlUserPrograms"},
-    {0x001E00C8, nullptr, "ReadTwlBackupInfo"},
-    {0x001F0040, nullptr, "DeleteAllExpiredUserPrograms"},
-    {0x00200000, nullptr, "GetTwlArchiveResourceInfo"},
-    {0x00210042, nullptr, "GetPersonalizedTicketInfoList"},
-    {0x00220080, nullptr, "DeleteAllImportContextsFiltered"},
-    {0x00230080, nullptr, "GetNumImportTitleContextsFiltered"},
-    {0x002400C2, nullptr, "GetImportTitleContextListFiltered"},
-    {0x002500C0, nullptr, "CheckContentRights"},
-    {0x00260044, nullptr, "GetTicketLimitInfos"},
-    {0x00270044, nullptr, "GetDemoLaunchInfos"},
-    {0x00280108, nullptr, "ReadTwlBackupInfoEx"},
-    {0x00290082, nullptr, "DeleteUserProgramsAtomically"},
-    {0x002A00C0, nullptr, "GetNumExistingContentInfosSystem"},
-    {0x002B0142, nullptr, "ListExistingContentInfosSystem"},
-    {0x002C0084, nullptr, "GetProgramInfosIgnorePlatform"},
-    {0x002D00C0, nullptr, "CheckContentRightsIgnorePlatform"},
-    {0x100100C0, GetNumContentInfos, "GetNumContentInfos"},
-    {0x10020104, FindContentInfos, "FindContentInfos"},
-    {0x10030142, ListContentInfos, "ListContentInfos"},
-    {0x10040102, DeleteContents, "DeleteContents"},
-    {0x10050084, GetDataTitleInfos, "GetDataTitleInfos"},
-    {0x10060080, nullptr, "GetNumDataTitleTickets"},
-    {0x10070102, ListDataTitleTicketInfos, "ListDataTitleTicketInfos"},
-    {0x100801C2, nullptr, "GetItemRights"},
-    {0x100900C0, nullptr, "IsDataTitleInUse"},
-    {0x100A0000, nullptr, "IsExternalTitleDatabaseInitialized"},
-    {0x100B00C0, nullptr, "GetNumExistingContentInfos"},
-    {0x100C0142, nullptr, "ListExistingContentInfos"},
-    {0x100D0084, nullptr, "GetPatchTitleInfos"},
-};
-
-AM_SYS_Interface::AM_SYS_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace AM
-} // namespace Service

+ 0 - 22
src/core/hle/service/am/am_sys.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace AM {
-
-class AM_SYS_Interface : public Service::Interface {
-public:
-    AM_SYS_Interface();
-
-    std::string GetPortName() const override {
-        return "am:sys";
-    }
-};
-
-} // namespace AM
-} // namespace Service

+ 0 - 89
src/core/hle/service/am/am_u.cpp

@@ -1,89 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/am/am.h"
-#include "core/hle/service/am/am_u.h"
-
-namespace Service {
-namespace AM {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010040, GetNumPrograms, "GetNumPrograms"},
-    {0x00020082, GetProgramList, "GetProgramList"},
-    {0x00030084, GetProgramInfos, "GetProgramInfos"},
-    {0x000400C0, nullptr, "DeleteUserProgram"},
-    {0x000500C0, nullptr, "GetProductCode"},
-    {0x000600C0, nullptr, "GetStorageId"},
-    {0x00070080, DeleteTicket, "DeleteTicket"},
-    {0x00080000, GetNumTickets, "GetNumTickets"},
-    {0x00090082, GetTicketList, "GetTicketList"},
-    {0x000A0000, nullptr, "GetDeviceID"},
-    {0x000B0040, nullptr, "GetNumImportTitleContexts"},
-    {0x000C0082, nullptr, "GetImportTitleContextList"},
-    {0x000D0084, nullptr, "GetImportTitleContexts"},
-    {0x000E00C0, nullptr, "DeleteImportTitleContext"},
-    {0x000F00C0, nullptr, "GetNumImportContentContexts"},
-    {0x00100102, nullptr, "GetImportContentContextList"},
-    {0x00110104, nullptr, "GetImportContentContexts"},
-    {0x00120102, nullptr, "DeleteImportContentContexts"},
-    {0x00130040, nullptr, "NeedsCleanup"},
-    {0x00140040, nullptr, "DoCleanup"},
-    {0x00150040, nullptr, "DeleteAllImportContexts"},
-    {0x00160000, nullptr, "DeleteAllTemporaryPrograms"},
-    {0x00170044, nullptr, "ImportTwlBackupLegacy"},
-    {0x00180080, nullptr, "InitializeTitleDatabase"},
-    {0x00190040, nullptr, "QueryAvailableTitleDatabase"},
-    {0x001A00C0, nullptr, "CalcTwlBackupSize"},
-    {0x001B0144, nullptr, "ExportTwlBackup"},
-    {0x001C0084, nullptr, "ImportTwlBackup"},
-    {0x001D0000, nullptr, "DeleteAllTwlUserPrograms"},
-    {0x001E00C8, nullptr, "ReadTwlBackupInfo"},
-    {0x001F0040, nullptr, "DeleteAllExpiredUserPrograms"},
-    {0x00200000, nullptr, "GetTwlArchiveResourceInfo"},
-    {0x00210042, nullptr, "GetPersonalizedTicketInfoList"},
-    {0x00220080, nullptr, "DeleteAllImportContextsFiltered"},
-    {0x00230080, nullptr, "GetNumImportTitleContextsFiltered"},
-    {0x002400C2, nullptr, "GetImportTitleContextListFiltered"},
-    {0x002500C0, nullptr, "CheckContentRights"},
-    {0x00260044, nullptr, "GetTicketLimitInfos"},
-    {0x00270044, nullptr, "GetDemoLaunchInfos"},
-    {0x00280108, nullptr, "ReadTwlBackupInfoEx"},
-    {0x00290082, nullptr, "DeleteUserProgramsAtomically"},
-    {0x002A00C0, nullptr, "GetNumExistingContentInfosSystem"},
-    {0x002B0142, nullptr, "ListExistingContentInfosSystem"},
-    {0x002C0084, nullptr, "GetProgramInfosIgnorePlatform"},
-    {0x002D00C0, nullptr, "CheckContentRightsIgnorePlatform"},
-    {0x04010080, nullptr, "UpdateFirmwareTo"},
-    {0x04020040, nullptr, "BeginImportProgram"},
-    {0x04030000, nullptr, "BeginImportProgramTemporarily"},
-    {0x04040002, nullptr, "CancelImportProgram"},
-    {0x04050002, nullptr, "EndImportProgram"},
-    {0x04060002, nullptr, "EndImportProgramWithoutCommit"},
-    {0x040700C2, nullptr, "CommitImportPrograms"},
-    {0x04080042, nullptr, "GetProgramInfoFromCia"},
-    {0x04090004, nullptr, "GetSystemMenuDataFromCia"},
-    {0x040A0002, nullptr, "GetDependencyListFromCia"},
-    {0x040B0002, nullptr, "GetTransferSizeFromCia"},
-    {0x040C0002, nullptr, "GetCoreVersionFromCia"},
-    {0x040D0042, nullptr, "GetRequiredSizeFromCia"},
-    {0x040E00C2, nullptr, "CommitImportProgramsAndUpdateFirmwareAuto"},
-    {0x040F0000, nullptr, "UpdateFirmwareAuto"},
-    {0x041000C0, nullptr, "DeleteProgram"},
-    {0x04110044, nullptr, "GetTwlProgramListForReboot"},
-    {0x04120000, nullptr, "GetSystemUpdaterMutex"},
-    {0x04130002, nullptr, "GetMetaSizeFromCia"},
-    {0x04140044, nullptr, "GetMetaDataFromCia"},
-    {0x04150080, nullptr, "CheckDemoLaunchRights"},
-    {0x041600C0, nullptr, "GetInternalTitleLocationInfo"},
-    {0x041700C0, nullptr, "PerpetuateAgbSaveData"},
-    {0x04180040, nullptr, "BeginImportProgramForOverWrite"},
-    {0x04190000, nullptr, "BeginImportSystemProgram"},
-};
-
-AM_U_Interface::AM_U_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace AM
-} // namespace Service

+ 0 - 22
src/core/hle/service/am/am_u.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace AM {
-
-class AM_U_Interface : public Service::Interface {
-public:
-    AM_U_Interface();
-
-    std::string GetPortName() const override {
-        return "am:u";
-    }
-};
-
-} // namespace AM
-} // namespace Service

+ 0 - 1124
src/core/hle/service/apt/apt.cpp

@@ -1,1124 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <boost/optional.hpp>
-#include "common/common_paths.h"
-#include "common/file_util.h"
-#include "common/logging/log.h"
-#include "core/core.h"
-#include "core/file_sys/file_backend.h"
-#include "core/hle/applets/applet.h"
-#include "core/hle/kernel/event.h"
-#include "core/hle/kernel/mutex.h"
-#include "core/hle/kernel/process.h"
-#include "core/hle/kernel/shared_memory.h"
-#include "core/hle/romfs.h"
-#include "core/hle/service/apt/apt.h"
-#include "core/hle/service/apt/apt_a.h"
-#include "core/hle/service/apt/apt_s.h"
-#include "core/hle/service/apt/apt_u.h"
-#include "core/hle/service/apt/bcfnt/bcfnt.h"
-#include "core/hle/service/cfg/cfg.h"
-#include "core/hle/service/fs/archive.h"
-#include "core/hle/service/ptm/ptm.h"
-#include "core/hle/service/service.h"
-#include "core/hw/aes/ccm.h"
-#include "core/hw/aes/key.h"
-
-namespace Service {
-namespace APT {
-
-/// Handle to shared memory region designated to for shared system font
-static Kernel::SharedPtr<Kernel::SharedMemory> shared_font_mem;
-static bool shared_font_loaded = false;
-static bool shared_font_relocated = false;
-
-static Kernel::SharedPtr<Kernel::Mutex> lock;
-
-static u32 cpu_percent; ///< CPU time available to the running application
-
-// APT::CheckNew3DSApp will check this unknown_ns_state_field to determine processing mode
-static u8 unknown_ns_state_field;
-
-static ScreencapPostPermission screen_capture_post_permission;
-
-/// Parameter data to be returned in the next call to Glance/ReceiveParameter.
-/// TODO(Subv): Use std::optional once we migrate to C++17.
-static boost::optional<MessageParameter> next_parameter;
-
-enum class AppletPos { Application = 0, Library = 1, System = 2, SysLibrary = 3, Resident = 4 };
-
-static constexpr size_t NumAppletSlot = 4;
-
-enum class AppletSlot : u8 {
-    Application,
-    SystemApplet,
-    HomeMenu,
-    LibraryApplet,
-
-    // An invalid tag
-    Error,
-};
-
-union AppletAttributes {
-    u32 raw;
-
-    BitField<0, 3, u32> applet_pos;
-    BitField<29, 1, u32> is_home_menu;
-
-    AppletAttributes() : raw(0) {}
-    AppletAttributes(u32 attributes) : raw(attributes) {}
-};
-
-struct AppletSlotData {
-    AppletId applet_id;
-    AppletSlot slot;
-    bool registered;
-    AppletAttributes attributes;
-    Kernel::SharedPtr<Kernel::Event> notification_event;
-    Kernel::SharedPtr<Kernel::Event> parameter_event;
-};
-
-// Holds data about the concurrently running applets in the system.
-static std::array<AppletSlotData, NumAppletSlot> applet_slots = {};
-
-// This overload returns nullptr if no applet with the specified id has been started.
-static AppletSlotData* GetAppletSlotData(AppletId id) {
-    auto GetSlot = [](AppletSlot slot) -> AppletSlotData* {
-        return &applet_slots[static_cast<size_t>(slot)];
-    };
-
-    if (id == AppletId::Application) {
-        auto* slot = GetSlot(AppletSlot::Application);
-        if (slot->applet_id != AppletId::None)
-            return slot;
-
-        return nullptr;
-    }
-
-    if (id == AppletId::AnySystemApplet) {
-        auto* system_slot = GetSlot(AppletSlot::SystemApplet);
-        if (system_slot->applet_id != AppletId::None)
-            return system_slot;
-
-        // The Home Menu is also a system applet, but it lives in its own slot to be able to run
-        // concurrently with other system applets.
-        auto* home_slot = GetSlot(AppletSlot::HomeMenu);
-        if (home_slot->applet_id != AppletId::None)
-            return home_slot;
-
-        return nullptr;
-    }
-
-    if (id == AppletId::AnyLibraryApplet || id == AppletId::AnySysLibraryApplet) {
-        auto* slot = GetSlot(AppletSlot::LibraryApplet);
-        if (slot->applet_id == AppletId::None)
-            return nullptr;
-
-        u32 applet_pos = slot->attributes.applet_pos;
-
-        if (id == AppletId::AnyLibraryApplet && applet_pos == static_cast<u32>(AppletPos::Library))
-            return slot;
-
-        if (id == AppletId::AnySysLibraryApplet &&
-            applet_pos == static_cast<u32>(AppletPos::SysLibrary))
-            return slot;
-
-        return nullptr;
-    }
-
-    if (id == AppletId::HomeMenu || id == AppletId::AlternateMenu) {
-        auto* slot = GetSlot(AppletSlot::HomeMenu);
-        if (slot->applet_id != AppletId::None)
-            return slot;
-
-        return nullptr;
-    }
-
-    for (auto& slot : applet_slots) {
-        if (slot.applet_id == id)
-            return &slot;
-    }
-
-    return nullptr;
-}
-
-static AppletSlotData* GetAppletSlotData(AppletAttributes attributes) {
-    // Mapping from AppletPos to AppletSlot
-    static constexpr std::array<AppletSlot, 6> applet_position_slots = {
-        AppletSlot::Application,   AppletSlot::LibraryApplet, AppletSlot::SystemApplet,
-        AppletSlot::LibraryApplet, AppletSlot::Error,         AppletSlot::LibraryApplet};
-
-    u32 applet_pos = attributes.applet_pos;
-    if (applet_pos >= applet_position_slots.size())
-        return nullptr;
-
-    AppletSlot slot = applet_position_slots[applet_pos];
-
-    if (slot == AppletSlot::Error)
-        return nullptr;
-
-    // The Home Menu is a system applet, however, it has its own applet slot so that it can run
-    // concurrently with other system applets.
-    if (slot == AppletSlot::SystemApplet && attributes.is_home_menu)
-        return &applet_slots[static_cast<size_t>(AppletSlot::HomeMenu)];
-
-    return &applet_slots[static_cast<size_t>(slot)];
-}
-
-void SendParameter(const MessageParameter& parameter) {
-    next_parameter = parameter;
-    // Signal the event to let the receiver know that a new parameter is ready to be read
-    auto* const slot_data = GetAppletSlotData(static_cast<AppletId>(parameter.destination_id));
-    if (slot_data == nullptr) {
-        LOG_DEBUG(Service_APT, "No applet was registered with the id %03X",
-                  parameter.destination_id);
-        return;
-    }
-
-    slot_data->parameter_event->Signal();
-}
-
-void Initialize(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x2, 2, 0); // 0x20080
-    u32 app_id = rp.Pop<u32>();
-    u32 attributes = rp.Pop<u32>();
-
-    LOG_DEBUG(Service_APT, "called app_id=0x%08X, attributes=0x%08X", app_id, attributes);
-
-    auto* const slot_data = GetAppletSlotData(attributes);
-
-    // Note: The real NS service does not check if the attributes value is valid before accessing
-    // the data in the array
-    ASSERT_MSG(slot_data, "Invalid application attributes");
-
-    if (slot_data->registered) {
-        IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-        rb.Push(ResultCode(ErrorDescription::AlreadyExists, ErrorModule::Applet,
-                           ErrorSummary::InvalidState, ErrorLevel::Status));
-        return;
-    }
-
-    slot_data->applet_id = static_cast<AppletId>(app_id);
-    slot_data->attributes.raw = attributes;
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 3);
-    rb.Push(RESULT_SUCCESS);
-    rb.PushCopyHandles(Kernel::g_handle_table.Create(slot_data->notification_event).Unwrap(),
-                       Kernel::g_handle_table.Create(slot_data->parameter_event).Unwrap());
-
-    if (slot_data->applet_id == AppletId::Application ||
-        slot_data->applet_id == AppletId::HomeMenu) {
-        // Initialize the APT parameter to wake up the application.
-        next_parameter.emplace();
-        next_parameter->signal = static_cast<u32>(SignalType::Wakeup);
-        next_parameter->sender_id = static_cast<u32>(AppletId::None);
-        next_parameter->destination_id = app_id;
-        // Not signaling the parameter event will cause the application (or Home Menu) to hang
-        // during startup. In the real console, it is usually the Kernel and Home Menu who cause NS
-        // to signal the HomeMenu and Application parameter events, respectively.
-        slot_data->parameter_event->Signal();
-    }
-}
-
-static u32 DecompressLZ11(const u8* in, u8* out) {
-    u32_le decompressed_size;
-    memcpy(&decompressed_size, in, sizeof(u32));
-    in += 4;
-
-    u8 type = decompressed_size & 0xFF;
-    ASSERT(type == 0x11);
-    decompressed_size >>= 8;
-
-    u32 current_out_size = 0;
-    u8 flags = 0, mask = 1;
-    while (current_out_size < decompressed_size) {
-        if (mask == 1) {
-            flags = *(in++);
-            mask = 0x80;
-        } else {
-            mask >>= 1;
-        }
-
-        if (flags & mask) {
-            u8 byte1 = *(in++);
-            u32 length = byte1 >> 4;
-            u32 offset;
-            if (length == 0) {
-                u8 byte2 = *(in++);
-                u8 byte3 = *(in++);
-                length = (((byte1 & 0x0F) << 4) | (byte2 >> 4)) + 0x11;
-                offset = (((byte2 & 0x0F) << 8) | byte3) + 0x1;
-            } else if (length == 1) {
-                u8 byte2 = *(in++);
-                u8 byte3 = *(in++);
-                u8 byte4 = *(in++);
-                length = (((byte1 & 0x0F) << 12) | (byte2 << 4) | (byte3 >> 4)) + 0x111;
-                offset = (((byte3 & 0x0F) << 8) | byte4) + 0x1;
-            } else {
-                u8 byte2 = *(in++);
-                length = (byte1 >> 4) + 0x1;
-                offset = (((byte1 & 0x0F) << 8) | byte2) + 0x1;
-            }
-
-            for (u32 i = 0; i < length; i++) {
-                *out = *(out - offset);
-                ++out;
-            }
-
-            current_out_size += length;
-        } else {
-            *(out++) = *(in++);
-            current_out_size++;
-        }
-    }
-    return decompressed_size;
-}
-
-static bool LoadSharedFont() {
-    u8 font_region_code;
-    switch (CFG::GetRegionValue()) {
-    case 4: // CHN
-        font_region_code = 2;
-        break;
-    case 5: // KOR
-        font_region_code = 3;
-        break;
-    case 6: // TWN
-        font_region_code = 4;
-        break;
-    default: // JPN/EUR/USA
-        font_region_code = 1;
-        break;
-    }
-
-    const u64_le shared_font_archive_id_low = 0x0004009b00014002 | ((font_region_code - 1) << 8);
-    const u64_le shared_font_archive_id_high = 0x00000001ffffff00;
-    std::vector<u8> shared_font_archive_id(16);
-    std::memcpy(&shared_font_archive_id[0], &shared_font_archive_id_low, sizeof(u64));
-    std::memcpy(&shared_font_archive_id[8], &shared_font_archive_id_high, sizeof(u64));
-    FileSys::Path archive_path(shared_font_archive_id);
-    auto archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::NCCH, archive_path);
-    if (archive_result.Failed())
-        return false;
-
-    std::vector<u8> romfs_path(20, 0); // 20-byte all zero path for opening RomFS
-    FileSys::Path file_path(romfs_path);
-    FileSys::Mode open_mode = {};
-    open_mode.read_flag.Assign(1);
-    auto file_result = Service::FS::OpenFileFromArchive(*archive_result, file_path, open_mode);
-    if (file_result.Failed())
-        return false;
-
-    auto romfs = std::move(file_result).Unwrap();
-    std::vector<u8> romfs_buffer(romfs->backend->GetSize());
-    romfs->backend->Read(0, romfs_buffer.size(), romfs_buffer.data());
-    romfs->backend->Close();
-
-    const char16_t* file_name[4] = {u"cbf_std.bcfnt.lz", u"cbf_zh-Hans-CN.bcfnt.lz",
-                                    u"cbf_ko-Hang-KR.bcfnt.lz", u"cbf_zh-Hant-TW.bcfnt.lz"};
-    const u8* font_file =
-        RomFS::GetFilePointer(romfs_buffer.data(), {file_name[font_region_code - 1]});
-    if (font_file == nullptr)
-        return false;
-
-    struct {
-        u32_le status;
-        u32_le region;
-        u32_le decompressed_size;
-        INSERT_PADDING_WORDS(0x1D);
-    } shared_font_header{};
-    static_assert(sizeof(shared_font_header) == 0x80, "shared_font_header has incorrect size");
-
-    shared_font_header.status = 2; // successfully loaded
-    shared_font_header.region = font_region_code;
-    shared_font_header.decompressed_size =
-        DecompressLZ11(font_file, shared_font_mem->GetPointer(0x80));
-    std::memcpy(shared_font_mem->GetPointer(), &shared_font_header, sizeof(shared_font_header));
-    *shared_font_mem->GetPointer(0x83) = 'U'; // Change the magic from "CFNT" to "CFNU"
-
-    return true;
-}
-
-static bool LoadLegacySharedFont() {
-    // This is the legacy method to load shared font.
-    // The expected format is a decrypted, uncompressed BCFNT file with the 0x80 byte header
-    // generated by the APT:U service. The best way to get is by dumping it from RAM. We've provided
-    // a homebrew app to do this: https://github.com/citra-emu/3dsutils. Put the resulting file
-    // "shared_font.bin" in the Citra "sysdata" directory.
-    std::string filepath = FileUtil::GetUserPath(D_SYSDATA_IDX) + SHARED_FONT;
-
-    FileUtil::CreateFullPath(filepath); // Create path if not already created
-    FileUtil::IOFile file(filepath, "rb");
-    if (file.IsOpen()) {
-        file.ReadBytes(shared_font_mem->GetPointer(), file.GetSize());
-        return true;
-    }
-
-    return false;
-}
-
-void GetSharedFont(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x44, 0, 0); // 0x00440000
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
-
-    // Log in telemetry if the game uses the shared font
-    Core::Telemetry().AddField(Telemetry::FieldType::Session, "RequiresSharedFont", true);
-
-    if (!shared_font_loaded) {
-        // On real 3DS, font loading happens on booting. However, we load it on demand to coordinate
-        // with CFG region auto configuration, which happens later than APT initialization.
-        if (LoadSharedFont()) {
-            shared_font_loaded = true;
-        } else if (LoadLegacySharedFont()) {
-            LOG_WARNING(Service_APT, "Loaded shared font by legacy method");
-            shared_font_loaded = true;
-        } else {
-            LOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds");
-            rb.Push<u32>(-1); // TODO: Find the right error code
-            rb.Skip(1 + 2, true);
-            Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorSharedFont);
-            return;
-        }
-    }
-
-    // The shared font has to be relocated to the new address before being passed to the
-    // application.
-    VAddr target_address =
-        Memory::PhysicalToVirtualAddress(shared_font_mem->linear_heap_phys_address).value();
-    if (!shared_font_relocated) {
-        BCFNT::RelocateSharedFont(shared_font_mem, target_address);
-        shared_font_relocated = true;
-    }
-
-    rb.Push(RESULT_SUCCESS); // No error
-    // Since the SharedMemory interface doesn't provide the address at which the memory was
-    // allocated, the real APT service calculates this address by scanning the entire address space
-    // (using svcQueryMemory) and searches for an allocation of the same size as the Shared Font.
-    rb.Push(target_address);
-    rb.PushCopyHandles(Kernel::g_handle_table.Create(shared_font_mem).Unwrap());
-}
-
-void NotifyToWait(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x43, 1, 0); // 0x430040
-    u32 app_id = rp.Pop<u32>();
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-    LOG_WARNING(Service_APT, "(STUBBED) app_id=%u", app_id);
-}
-
-void GetLockHandle(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1, 1, 0); // 0x10040
-
-    // Bits [0:2] are the applet type (System, Library, etc)
-    // Bit 5 tells the application that there's a pending APT parameter,
-    // this will cause the app to wait until parameter_event is signaled.
-    u32 applet_attributes = rp.Pop<u32>();
-    IPC::RequestBuilder rb = rp.MakeBuilder(3, 2);
-    rb.Push(RESULT_SUCCESS); // No error
-
-    // TODO(Subv): The output attributes should have an AppletPos of either Library or System |
-    // Library (depending on the type of the last launched applet) if the input attributes'
-    // AppletPos has the Library bit set.
-
-    rb.Push(applet_attributes); // Applet Attributes, this value is passed to Enable.
-    rb.Push<u32>(0);            // Least significant bit = power button state
-    Kernel::Handle handle_copy = Kernel::g_handle_table.Create(lock).Unwrap();
-    rb.PushCopyHandles(handle_copy);
-
-    LOG_WARNING(Service_APT, "(STUBBED) called handle=0x%08X applet_attributes=0x%08X", handle_copy,
-                applet_attributes);
-}
-
-void Enable(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x3, 1, 0); // 0x30040
-    u32 attributes = rp.Pop<u32>();
-
-    LOG_DEBUG(Service_APT, "called attributes=0x%08X", attributes);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    auto* const slot_data = GetAppletSlotData(attributes);
-
-    if (!slot_data) {
-        rb.Push(ResultCode(ErrCodes::InvalidAppletSlot, ErrorModule::Applet,
-                           ErrorSummary::InvalidState, ErrorLevel::Status));
-        return;
-    }
-
-    slot_data->registered = true;
-
-    rb.Push(RESULT_SUCCESS);
-}
-
-void GetAppletManInfo(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x5, 1, 0); // 0x50040
-    u32 unk = rp.Pop<u32>();
-    IPC::RequestBuilder rb = rp.MakeBuilder(5, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-    rb.Push<u32>(0);
-    rb.Push<u32>(0);
-    rb.Push(static_cast<u32>(AppletId::HomeMenu));    // Home menu AppID
-    rb.Push(static_cast<u32>(AppletId::Application)); // TODO(purpasmart96): Do this correctly
-
-    LOG_WARNING(Service_APT, "(STUBBED) called unk=0x%08X", unk);
-}
-
-void IsRegistered(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x9, 1, 0); // 0x90040
-    AppletId app_id = static_cast<AppletId>(rp.Pop<u32>());
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-
-    auto* const slot_data = GetAppletSlotData(app_id);
-
-    // Check if an LLE applet was registered first, then fallback to HLE applets
-    bool is_registered = slot_data && slot_data->registered;
-
-    if (!is_registered) {
-        if (app_id == AppletId::AnyLibraryApplet) {
-            is_registered = HLE::Applets::IsLibraryAppletRunning();
-        } else if (auto applet = HLE::Applets::Applet::Get(app_id)) {
-            // The applet exists, set it as registered.
-            is_registered = true;
-        }
-    }
-
-    rb.Push(is_registered);
-
-    LOG_DEBUG(Service_APT, "called app_id=0x%08X", static_cast<u32>(app_id));
-}
-
-void InquireNotification(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0xB, 1, 0); // 0xB0040
-    u32 app_id = rp.Pop<u32>();
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    rb.Push(RESULT_SUCCESS);                     // No error
-    rb.Push(static_cast<u32>(SignalType::None)); // Signal type
-    LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id);
-}
-
-void SendParameter(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0xC, 4, 4); // 0xC0104
-    u32 src_app_id = rp.Pop<u32>();
-    u32 dst_app_id = rp.Pop<u32>();
-    u32 signal_type = rp.Pop<u32>();
-    u32 buffer_size = rp.Pop<u32>();
-    Kernel::Handle handle = rp.PopHandle();
-    size_t size;
-    VAddr buffer = rp.PopStaticBuffer(&size);
-
-    LOG_DEBUG(Service_APT,
-              "called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X,"
-              "buffer_size=0x%08X, handle=0x%08X, size=0x%08zX, in_param_buffer_ptr=0x%08X",
-              src_app_id, dst_app_id, signal_type, buffer_size, handle, size, buffer);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    // A new parameter can not be sent if the previous one hasn't been consumed yet
-    if (next_parameter) {
-        rb.Push(ResultCode(ErrCodes::ParameterPresent, ErrorModule::Applet,
-                           ErrorSummary::InvalidState, ErrorLevel::Status));
-        return;
-    }
-
-    MessageParameter param;
-    param.destination_id = dst_app_id;
-    param.sender_id = src_app_id;
-    param.object = Kernel::g_handle_table.GetGeneric(handle);
-    param.signal = signal_type;
-    param.buffer.resize(buffer_size);
-    Memory::ReadBlock(buffer, param.buffer.data(), param.buffer.size());
-
-    SendParameter(param);
-
-    // If the applet is running in HLE mode, use the HLE interface to communicate with it.
-    if (auto dest_applet = HLE::Applets::Applet::Get(static_cast<AppletId>(dst_app_id))) {
-        rb.Push(dest_applet->ReceiveParameter(param));
-    } else {
-        rb.Push(RESULT_SUCCESS);
-    }
-}
-
-void ReceiveParameter(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0xD, 2, 0); // 0xD0080
-    u32 app_id = rp.Pop<u32>();
-    u32 buffer_size = rp.Pop<u32>();
-
-    size_t static_buff_size;
-    VAddr buffer = rp.PeekStaticBuffer(0, &static_buff_size);
-    if (buffer_size > static_buff_size)
-        LOG_WARNING(
-            Service_APT,
-            "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
-            buffer_size, static_buff_size);
-
-    LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08zX", app_id, buffer_size);
-
-    if (!next_parameter) {
-        IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-        rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet,
-                           ErrorSummary::InvalidState, ErrorLevel::Status));
-        return;
-    }
-
-    if (next_parameter->destination_id != app_id) {
-        IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-        rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
-                           ErrorLevel::Status));
-        return;
-    }
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
-
-    rb.Push(RESULT_SUCCESS); // No error
-    rb.Push(next_parameter->sender_id);
-    rb.Push(next_parameter->signal); // Signal type
-    ASSERT_MSG(next_parameter->buffer.size() <= buffer_size, "Input static buffer is too small !");
-    rb.Push(static_cast<u32>(next_parameter->buffer.size())); // Parameter buffer size
-
-    rb.PushMoveHandles((next_parameter->object != nullptr)
-                           ? Kernel::g_handle_table.Create(next_parameter->object).Unwrap()
-                           : 0);
-
-    rb.PushStaticBuffer(buffer, next_parameter->buffer.size(), 0);
-
-    Memory::WriteBlock(buffer, next_parameter->buffer.data(), next_parameter->buffer.size());
-
-    // Clear the parameter
-    next_parameter = boost::none;
-}
-
-void GlanceParameter(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0xE, 2, 0); // 0xE0080
-    u32 app_id = rp.Pop<u32>();
-    u32 buffer_size = rp.Pop<u32>();
-
-    size_t static_buff_size;
-    VAddr buffer = rp.PeekStaticBuffer(0, &static_buff_size);
-    if (buffer_size > static_buff_size)
-        LOG_WARNING(
-            Service_APT,
-            "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
-            buffer_size, static_buff_size);
-
-    LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08zX", app_id, buffer_size);
-
-    if (!next_parameter) {
-        IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-        rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet,
-                           ErrorSummary::InvalidState, ErrorLevel::Status));
-        return;
-    }
-
-    if (next_parameter->destination_id != app_id) {
-        IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-        rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
-                           ErrorLevel::Status));
-        return;
-    }
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
-    rb.Push(RESULT_SUCCESS); // No error
-    rb.Push(next_parameter->sender_id);
-    rb.Push(next_parameter->signal); // Signal type
-    ASSERT_MSG(next_parameter->buffer.size() <= buffer_size, "Input static buffer is too small !");
-    rb.Push(static_cast<u32>(next_parameter->buffer.size())); // Parameter buffer size
-
-    rb.PushMoveHandles((next_parameter->object != nullptr)
-                           ? Kernel::g_handle_table.Create(next_parameter->object).Unwrap()
-                           : 0);
-
-    rb.PushStaticBuffer(buffer, next_parameter->buffer.size(), 0);
-
-    Memory::WriteBlock(buffer, next_parameter->buffer.data(), next_parameter->buffer.size());
-
-    // Note: The NS module always clears the DSPSleep and DSPWakeup signals even in GlanceParameter.
-    if (next_parameter->signal == static_cast<u32>(SignalType::DspSleep) ||
-        next_parameter->signal == static_cast<u32>(SignalType::DspWakeup))
-        next_parameter = boost::none;
-}
-
-void CancelParameter(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0xF, 4, 0); // 0xF0100
-
-    bool check_sender = rp.Pop<bool>();
-    u32 sender_appid = rp.Pop<u32>();
-    bool check_receiver = rp.Pop<bool>();
-    u32 receiver_appid = rp.Pop<u32>();
-
-    bool cancellation_success = true;
-
-    if (!next_parameter) {
-        cancellation_success = false;
-    } else {
-        if (check_sender && next_parameter->sender_id != sender_appid)
-            cancellation_success = false;
-
-        if (check_receiver && next_parameter->destination_id != receiver_appid)
-            cancellation_success = false;
-    }
-
-    if (cancellation_success)
-        next_parameter = boost::none;
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-
-    rb.Push(RESULT_SUCCESS); // No error
-    rb.Push(cancellation_success);
-
-    LOG_DEBUG(Service_APT, "called check_sender=%u, sender_appid=0x%08X, "
-                           "check_receiver=%u, receiver_appid=0x%08X",
-              check_sender, sender_appid, check_receiver, receiver_appid);
-}
-
-void PrepareToStartApplication(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x15, 5, 0); // 0x00150140
-    u32 title_info1 = rp.Pop<u32>();
-    u32 title_info2 = rp.Pop<u32>();
-    u32 title_info3 = rp.Pop<u32>();
-    u32 title_info4 = rp.Pop<u32>();
-    u32 flags = rp.Pop<u32>();
-
-    if (flags & 0x00000100) {
-        unknown_ns_state_field = 1;
-    }
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-
-    LOG_WARNING(Service_APT,
-                "(STUBBED) called title_info1=0x%08X, title_info2=0x%08X, title_info3=0x%08X,"
-                "title_info4=0x%08X, flags=0x%08X",
-                title_info1, title_info2, title_info3, title_info4, flags);
-}
-
-void StartApplication(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1B, 3, 4); // 0x001B00C4
-    u32 buffer1_size = rp.Pop<u32>();
-    u32 buffer2_size = rp.Pop<u32>();
-    u32 flag = rp.Pop<u32>();
-    size_t size1;
-    VAddr buffer1_ptr = rp.PopStaticBuffer(&size1);
-    size_t size2;
-    VAddr buffer2_ptr = rp.PopStaticBuffer(&size2);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-
-    LOG_WARNING(Service_APT,
-                "(STUBBED) called buffer1_size=0x%08X, buffer2_size=0x%08X, flag=0x%08X,"
-                "size1=0x%08zX, buffer1_ptr=0x%08X, size2=0x%08zX, buffer2_ptr=0x%08X",
-                buffer1_size, buffer2_size, flag, size1, buffer1_ptr, size2, buffer2_ptr);
-}
-
-void AppletUtility(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x4B, 3, 2); // 0x004B00C2
-
-    // These are from 3dbrew - I'm not really sure what they're used for.
-    u32 utility_command = rp.Pop<u32>();
-    u32 input_size = rp.Pop<u32>();
-    u32 output_size = rp.Pop<u32>();
-    VAddr input_addr = rp.PopStaticBuffer();
-
-    VAddr output_addr = rp.PeekStaticBuffer(0);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-
-    LOG_WARNING(Service_APT,
-                "(STUBBED) called command=0x%08X, input_size=0x%08X, output_size=0x%08X, "
-                "input_addr=0x%08X, output_addr=0x%08X",
-                utility_command, input_size, output_size, input_addr, output_addr);
-}
-
-void SetAppCpuTimeLimit(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x4F, 2, 0); // 0x4F0080
-    u32 value = rp.Pop<u32>();
-    cpu_percent = rp.Pop<u32>();
-
-    if (value != 1) {
-        LOG_ERROR(Service_APT, "This value should be one, but is actually %u!", value);
-    }
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-
-    LOG_WARNING(Service_APT, "(STUBBED) called cpu_percent=%u, value=%u", cpu_percent, value);
-}
-
-void GetAppCpuTimeLimit(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x50, 1, 0); // 0x500040
-    u32 value = rp.Pop<u32>();
-
-    if (value != 1) {
-        LOG_ERROR(Service_APT, "This value should be one, but is actually %u!", value);
-    }
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-    rb.Push(cpu_percent);
-
-    LOG_WARNING(Service_APT, "(STUBBED) called value=%u", value);
-}
-
-void PrepareToStartLibraryApplet(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x18, 1, 0); // 0x180040
-    AppletId applet_id = static_cast<AppletId>(rp.Pop<u32>());
-
-    LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    // TODO(Subv): Launch the requested applet application.
-
-    auto applet = HLE::Applets::Applet::Get(applet_id);
-    if (applet) {
-        LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        rb.Push(HLE::Applets::Applet::Create(applet_id));
-    }
-}
-
-void PrepareToStartNewestHomeMenu(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1A, 0, 0); // 0x1A0000
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    // TODO(Subv): This command can only be called by a System Applet (return 0xC8A0CC04 otherwise).
-
-    // This command must return an error when called, otherwise the Home Menu will try to reboot the
-    // system.
-    rb.Push(ResultCode(ErrorDescription::AlreadyExists, ErrorModule::Applet,
-                       ErrorSummary::InvalidState, ErrorLevel::Status));
-
-    LOG_DEBUG(Service_APT, "called");
-}
-
-void PreloadLibraryApplet(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x16, 1, 0); // 0x160040
-    AppletId applet_id = static_cast<AppletId>(rp.Pop<u32>());
-
-    LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    // TODO(Subv): Launch the requested applet application.
-
-    auto applet = HLE::Applets::Applet::Get(applet_id);
-    if (applet) {
-        LOG_WARNING(Service_APT, "applet has already been started id=%08X", applet_id);
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        rb.Push(HLE::Applets::Applet::Create(applet_id));
-    }
-}
-
-void StartLibraryApplet(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1E, 2, 4); // 0x1E0084
-    AppletId applet_id = static_cast<AppletId>(rp.Pop<u32>());
-
-    size_t buffer_size = rp.Pop<u32>();
-    Kernel::Handle handle = rp.PopHandle();
-    VAddr buffer_addr = rp.PopStaticBuffer();
-
-    LOG_DEBUG(Service_APT, "called applet_id=%08X", applet_id);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    // Send the Wakeup signal to the applet
-    MessageParameter param;
-    param.destination_id = static_cast<u32>(applet_id);
-    param.sender_id = static_cast<u32>(AppletId::Application);
-    param.object = Kernel::g_handle_table.GetGeneric(handle);
-    param.signal = static_cast<u32>(SignalType::Wakeup);
-    param.buffer.resize(buffer_size);
-    Memory::ReadBlock(buffer_addr, param.buffer.data(), param.buffer.size());
-    SendParameter(param);
-
-    // In case the applet is being HLEd, attempt to communicate with it.
-    if (auto applet = HLE::Applets::Applet::Get(applet_id)) {
-        AppletStartupParameter parameter;
-        parameter.object = Kernel::g_handle_table.GetGeneric(handle);
-        parameter.buffer.resize(buffer_size);
-        Memory::ReadBlock(buffer_addr, parameter.buffer.data(), parameter.buffer.size());
-        rb.Push(applet->Start(parameter));
-    } else {
-        rb.Push(RESULT_SUCCESS);
-    }
-}
-
-void CancelLibraryApplet(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x3B, 1, 0); // 0x003B0040
-    bool exiting = rp.Pop<bool>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push<u32>(1); // TODO: Find the return code meaning
-
-    LOG_WARNING(Service_APT, "(STUBBED) called exiting=%d", exiting);
-}
-
-void SetScreenCapPostPermission(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x55, 1, 0); // 0x00550040
-
-    screen_capture_post_permission = static_cast<ScreencapPostPermission>(rp.Pop<u32>() & 0xF);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-    LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
-                screen_capture_post_permission);
-}
-
-void GetScreenCapPostPermission(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x56, 0, 0); // 0x00560000
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    rb.Push(RESULT_SUCCESS); // No error
-    rb.Push(static_cast<u32>(screen_capture_post_permission));
-    LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u",
-                screen_capture_post_permission);
-}
-
-void GetAppletInfo(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x6, 1, 0); // 0x60040
-    auto app_id = static_cast<AppletId>(rp.Pop<u32>());
-
-    if (auto applet = HLE::Applets::Applet::Get(app_id)) {
-        // TODO(Subv): Get the title id for the current applet and write it in the response[2-3]
-        IPC::RequestBuilder rb = rp.MakeBuilder(7, 0);
-        rb.Push(RESULT_SUCCESS);
-        u64 title_id = 0;
-        rb.Push(title_id);
-        rb.Push(static_cast<u32>(Service::FS::MediaType::NAND));
-        rb.Push(true);   // Registered
-        rb.Push(true);   // Loaded
-        rb.Push<u32>(0); // Applet Attributes
-    } else {
-        IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-        rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
-                           ErrorLevel::Status));
-    }
-    LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id);
-}
-
-void GetStartupArgument(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x51, 2, 0); // 0x00510080
-    u32 parameter_size = rp.Pop<u32>();
-    StartupArgumentType startup_argument_type = static_cast<StartupArgumentType>(rp.Pop<u8>());
-
-    if (parameter_size >= 0x300) {
-        LOG_ERROR(
-            Service_APT,
-            "Parameter size is outside the valid range (capped to 0x300): parameter_size=0x%08x",
-            parameter_size);
-        return;
-    }
-
-    size_t static_buff_size;
-    VAddr addr = rp.PeekStaticBuffer(0, &static_buff_size);
-    if (parameter_size > static_buff_size)
-        LOG_WARNING(
-            Service_APT,
-            "parameter_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
-            parameter_size, static_buff_size);
-
-    if (addr && parameter_size) {
-        Memory::ZeroBlock(addr, parameter_size);
-    }
-
-    LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x",
-                startup_argument_type, parameter_size);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
-    rb.Push(RESULT_SUCCESS);
-    rb.Push<u32>(0);
-    rb.PushStaticBuffer(addr, parameter_size, 0);
-}
-
-void Wrap(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x46, 4, 4);
-    const u32 output_size = rp.Pop<u32>();
-    const u32 input_size = rp.Pop<u32>();
-    const u32 nonce_offset = rp.Pop<u32>();
-    u32 nonce_size = rp.Pop<u32>();
-    size_t desc_size;
-    IPC::MappedBufferPermissions desc_permission;
-    const VAddr input = rp.PopMappedBuffer(&desc_size, &desc_permission);
-    ASSERT(desc_size == input_size && desc_permission == IPC::MappedBufferPermissions::R);
-    const VAddr output = rp.PopMappedBuffer(&desc_size, &desc_permission);
-    ASSERT(desc_size == output_size && desc_permission == IPC::MappedBufferPermissions::W);
-
-    // Note: real 3DS still returns SUCCESS when the sizes don't match. It seems that it doesn't
-    // check the buffer size and writes data with potential overflow.
-    ASSERT_MSG(output_size == input_size + HW::AES::CCM_MAC_SIZE,
-               "input_size (%d) doesn't match to output_size (%d)", input_size, output_size);
-
-    LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u",
-              output_size, input_size, nonce_offset, nonce_size);
-
-    // Note: This weird nonce size modification is verified against real 3DS
-    nonce_size = std::min<u32>(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE);
-
-    // Reads nonce and concatenates the rest of the input as plaintext
-    HW::AES::CCMNonce nonce{};
-    Memory::ReadBlock(input + nonce_offset, nonce.data(), nonce_size);
-    u32 pdata_size = input_size - nonce_size;
-    std::vector<u8> pdata(pdata_size);
-    Memory::ReadBlock(input, pdata.data(), nonce_offset);
-    Memory::ReadBlock(input + nonce_offset + nonce_size, pdata.data() + nonce_offset,
-                      pdata_size - nonce_offset);
-
-    // Encrypts the plaintext using AES-CCM
-    auto cipher = HW::AES::EncryptSignCCM(pdata, nonce, HW::AES::KeySlotID::APTWrap);
-
-    // Puts the nonce to the beginning of the output, with ciphertext followed
-    Memory::WriteBlock(output, nonce.data(), nonce_size);
-    Memory::WriteBlock(output + nonce_size, cipher.data(), cipher.size());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 4);
-    rb.Push(RESULT_SUCCESS);
-
-    // Unmap buffer
-    rb.PushMappedBuffer(input, input_size, IPC::MappedBufferPermissions::R);
-    rb.PushMappedBuffer(output, output_size, IPC::MappedBufferPermissions::W);
-}
-
-void Unwrap(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x47, 4, 4);
-    const u32 output_size = rp.Pop<u32>();
-    const u32 input_size = rp.Pop<u32>();
-    const u32 nonce_offset = rp.Pop<u32>();
-    u32 nonce_size = rp.Pop<u32>();
-    size_t desc_size;
-    IPC::MappedBufferPermissions desc_permission;
-    const VAddr input = rp.PopMappedBuffer(&desc_size, &desc_permission);
-    ASSERT(desc_size == input_size && desc_permission == IPC::MappedBufferPermissions::R);
-    const VAddr output = rp.PopMappedBuffer(&desc_size, &desc_permission);
-    ASSERT(desc_size == output_size && desc_permission == IPC::MappedBufferPermissions::W);
-
-    // Note: real 3DS still returns SUCCESS when the sizes don't match. It seems that it doesn't
-    // check the buffer size and writes data with potential overflow.
-    ASSERT_MSG(output_size == input_size - HW::AES::CCM_MAC_SIZE,
-               "input_size (%d) doesn't match to output_size (%d)", input_size, output_size);
-
-    LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u",
-              output_size, input_size, nonce_offset, nonce_size);
-
-    // Note: This weird nonce size modification is verified against real 3DS
-    nonce_size = std::min<u32>(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE);
-
-    // Reads nonce and cipher text
-    HW::AES::CCMNonce nonce{};
-    Memory::ReadBlock(input, nonce.data(), nonce_size);
-    u32 cipher_size = input_size - nonce_size;
-    std::vector<u8> cipher(cipher_size);
-    Memory::ReadBlock(input + nonce_size, cipher.data(), cipher_size);
-
-    // Decrypts the ciphertext using AES-CCM
-    auto pdata = HW::AES::DecryptVerifyCCM(cipher, nonce, HW::AES::KeySlotID::APTWrap);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 4);
-    if (!pdata.empty()) {
-        // Splits the plaintext and put the nonce in between
-        Memory::WriteBlock(output, pdata.data(), nonce_offset);
-        Memory::WriteBlock(output + nonce_offset, nonce.data(), nonce_size);
-        Memory::WriteBlock(output + nonce_offset + nonce_size, pdata.data() + nonce_offset,
-                           pdata.size() - nonce_offset);
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_APT, "Failed to decrypt data");
-        rb.Push(ResultCode(static_cast<ErrorDescription>(1), ErrorModule::PS,
-                           ErrorSummary::WrongArgument, ErrorLevel::Status));
-    }
-
-    // Unmap buffer
-    rb.PushMappedBuffer(input, input_size, IPC::MappedBufferPermissions::R);
-    rb.PushMappedBuffer(output, output_size, IPC::MappedBufferPermissions::W);
-}
-
-void CheckNew3DSApp(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x101, 0, 0); // 0x01010000
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    if (unknown_ns_state_field) {
-        rb.Push(RESULT_SUCCESS);
-        rb.Push<u32>(0);
-    } else {
-        PTM::CheckNew3DS(rb);
-    }
-
-    LOG_WARNING(Service_APT, "(STUBBED) called");
-}
-
-void CheckNew3DS(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x102, 0, 0); // 0x01020000
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-
-    PTM::CheckNew3DS(rb);
-
-    LOG_WARNING(Service_APT, "(STUBBED) called");
-}
-
-void Init() {
-    AddService(new APT_A_Interface);
-    AddService(new APT_S_Interface);
-    AddService(new APT_U_Interface);
-
-    HLE::Applets::Init();
-
-    using Kernel::MemoryPermission;
-    shared_font_mem =
-        Kernel::SharedMemory::Create(nullptr, 0x332000, // 3272 KB
-                                     MemoryPermission::ReadWrite, MemoryPermission::Read, 0,
-                                     Kernel::MemoryRegion::SYSTEM, "APT:SharedFont");
-
-    if (LoadSharedFont()) {
-        shared_font_loaded = true;
-    } else if (LoadLegacySharedFont()) {
-        LOG_WARNING(Service_APT, "Loaded shared font by legacy method");
-        shared_font_loaded = true;
-    } else {
-        LOG_WARNING(Service_APT, "Unable to load shared font");
-        shared_font_loaded = false;
-    }
-
-    lock = Kernel::Mutex::Create(false, 0, "APT_U:Lock");
-
-    cpu_percent = 0;
-    unknown_ns_state_field = 0;
-    screen_capture_post_permission =
-        ScreencapPostPermission::CleanThePermission; // TODO(JamePeng): verify the initial value
-
-    for (size_t slot = 0; slot < applet_slots.size(); ++slot) {
-        auto& slot_data = applet_slots[slot];
-        slot_data.slot = static_cast<AppletSlot>(slot);
-        slot_data.applet_id = AppletId::None;
-        slot_data.attributes.raw = 0;
-        slot_data.registered = false;
-        slot_data.notification_event =
-            Kernel::Event::Create(Kernel::ResetType::OneShot, "APT:Notification");
-        slot_data.parameter_event =
-            Kernel::Event::Create(Kernel::ResetType::OneShot, "APT:Parameter");
-    }
-}
-
-void Shutdown() {
-    shared_font_mem = nullptr;
-    shared_font_loaded = false;
-    shared_font_relocated = false;
-    lock = nullptr;
-
-    for (auto& slot : applet_slots) {
-        slot.registered = false;
-        slot.notification_event = nullptr;
-        slot.parameter_event = nullptr;
-    }
-
-    next_parameter = boost::none;
-
-    HLE::Applets::Shutdown();
-}
-
-} // namespace APT
-} // namespace Service

+ 0 - 533
src/core/hle/service/apt/apt.h

@@ -1,533 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include <vector>
-#include "common/common_funcs.h"
-#include "common/common_types.h"
-#include "common/swap.h"
-#include "core/hle/kernel/kernel.h"
-
-namespace Service {
-
-class Interface;
-
-namespace APT {
-
-/// Each APT service can only have up to 2 sessions connected at the same time.
-static const u32 MaxAPTSessions = 2;
-
-/// Holds information about the parameters used in Send/Glance/ReceiveParameter
-struct MessageParameter {
-    u32 sender_id = 0;
-    u32 destination_id = 0;
-    u32 signal = 0;
-    Kernel::SharedPtr<Kernel::Object> object = nullptr;
-    std::vector<u8> buffer;
-};
-
-/// Holds information about the parameters used in StartLibraryApplet
-struct AppletStartupParameter {
-    Kernel::SharedPtr<Kernel::Object> object = nullptr;
-    std::vector<u8> buffer;
-};
-
-/// Used by the application to pass information about the current framebuffer to applets.
-struct CaptureBufferInfo {
-    u32_le size;
-    u8 is_3d;
-    INSERT_PADDING_BYTES(0x3); // Padding for alignment
-    u32_le top_screen_left_offset;
-    u32_le top_screen_right_offset;
-    u32_le top_screen_format;
-    u32_le bottom_screen_left_offset;
-    u32_le bottom_screen_right_offset;
-    u32_le bottom_screen_format;
-};
-static_assert(sizeof(CaptureBufferInfo) == 0x20, "CaptureBufferInfo struct has incorrect size");
-
-/// Signals used by APT functions
-enum class SignalType : u32 {
-    None = 0x0,
-    Wakeup = 0x1,
-    Request = 0x2,
-    Response = 0x3,
-    Exit = 0x4,
-    Message = 0x5,
-    HomeButtonSingle = 0x6,
-    HomeButtonDouble = 0x7,
-    DspSleep = 0x8,
-    DspWakeup = 0x9,
-    WakeupByExit = 0xA,
-    WakeupByPause = 0xB,
-    WakeupByCancel = 0xC,
-    WakeupByCancelAll = 0xD,
-    WakeupByPowerButtonClick = 0xE,
-    WakeupToJumpHome = 0xF,
-    RequestForSysApplet = 0x10,
-    WakeupToLaunchApplication = 0x11,
-};
-
-/// App Id's used by APT functions
-enum class AppletId : u32 {
-    None = 0,
-    AnySystemApplet = 0x100,
-    HomeMenu = 0x101,
-    AlternateMenu = 0x103,
-    Camera = 0x110,
-    FriendsList = 0x112,
-    GameNotes = 0x113,
-    InternetBrowser = 0x114,
-    InstructionManual = 0x115,
-    Notifications = 0x116,
-    Miiverse = 0x117,
-    MiiversePost = 0x118,
-    AmiiboSettings = 0x119,
-    AnySysLibraryApplet = 0x200,
-    SoftwareKeyboard1 = 0x201,
-    Ed1 = 0x202,
-    PnoteApp = 0x204,
-    SnoteApp = 0x205,
-    Error = 0x206,
-    Mint = 0x207,
-    Extrapad = 0x208,
-    Memolib = 0x209,
-    Application = 0x300,
-    AnyLibraryApplet = 0x400,
-    SoftwareKeyboard2 = 0x401,
-    Ed2 = 0x402,
-    PnoteApp2 = 0x404,
-    SnoteApp2 = 0x405,
-    Error2 = 0x406,
-    Mint2 = 0x407,
-    Extrapad2 = 0x408,
-    Memolib2 = 0x409,
-};
-
-enum class StartupArgumentType : u32 {
-    OtherApp = 0,
-    Restart = 1,
-    OtherMedia = 2,
-};
-
-enum class ScreencapPostPermission : u32 {
-    CleanThePermission = 0, // TODO(JamePeng): verify what "zero" means
-    NoExplicitSetting = 1,
-    EnableScreenshotPostingToMiiverse = 2,
-    DisableScreenshotPostingToMiiverse = 3
-};
-
-namespace ErrCodes {
-enum {
-    ParameterPresent = 2,
-    InvalidAppletSlot = 4,
-};
-} // namespace ErrCodes
-
-/// Send a parameter to the currently-running application, which will read it via ReceiveParameter
-void SendParameter(const MessageParameter& parameter);
-
-/**
- * APT::Initialize service function
- * Service function that initializes the APT process for the running application
- *  Outputs:
- *      1 : Result of the function, 0 on success, otherwise error code
- *      3 : Handle to the notification event
- *      4 : Handle to the pause event
- */
-void Initialize(Service::Interface* self);
-
-/**
- * APT::GetSharedFont service function
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Virtual address of where shared font will be loaded in memory
- *      4 : Handle to shared font memory
- */
-void GetSharedFont(Service::Interface* self);
-
-/**
- * APT::Wrap service function
- *  Inputs:
- *      1 : Output buffer size
- *      2 : Input buffer size
- *      3 : Nonce offset to the input buffer
- *      4 : Nonce size
- *      5 : Buffer mapping descriptor ((input_buffer_size << 4) | 0xA)
- *      6 : Input buffer address
- *      7 : Buffer mapping descriptor ((input_buffer_size << 4) | 0xC)
- *      8 : Output buffer address
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Buffer unmapping descriptor ((input_buffer_size << 4) | 0xA)
- *      3 : Input buffer address
- *      4 : Buffer unmapping descriptor ((input_buffer_size << 4) | 0xC)
- *      5 : Output buffer address
- */
-void Wrap(Service::Interface* self);
-
-/**
- * APT::Unwrap service function
- *  Inputs:
- *      1 : Output buffer size
- *      2 : Input buffer size
- *      3 : Nonce offset to the output buffer
- *      4 : Nonce size
- *      5 : Buffer mapping descriptor ((input_buffer_size << 4) | 0xA)
- *      6 : Input buffer address
- *      7 : Buffer mapping descriptor ((input_buffer_size << 4) | 0xC)
- *      8 : Output buffer address
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Buffer unmapping descriptor ((input_buffer_size << 4) | 0xA)
- *      3 : Input buffer address
- *      4 : Buffer unmapping descriptor ((input_buffer_size << 4) | 0xC)
- *      5 : Output buffer address
- */
-void Unwrap(Service::Interface* self);
-
-/**
- * APT::NotifyToWait service function
- *  Inputs:
- *      1 : AppID
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void NotifyToWait(Service::Interface* self);
-
-/**
- * APT::GetLockHandle service function
- *  Inputs:
- *      1 : Applet attributes
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Applet attributes
- *      3 : Power button state
- *      4 : IPC handle descriptor
- *      5 : APT mutex handle
- */
-void GetLockHandle(Service::Interface* self);
-
-/**
- * APT::Enable service function
- *  Inputs:
- *      1 : Applet attributes
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void Enable(Service::Interface* self);
-
-/**
- * APT::GetAppletManInfo service function.
- *  Inputs:
- *      1 : Unknown
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Unknown u32 value
- *      3 : Unknown u8 value
- *      4 : Home Menu AppId
- *      5 : AppID of currently active app
- */
-void GetAppletManInfo(Service::Interface* self);
-
-/**
- * APT::GetAppletInfo service function.
- *  Inputs:
- *      1 : AppId
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2-3 : Title ID
- *      4 : Media Type
- *      5 : Registered
- *      6 : Loaded
- *      7 : Attributes
- */
-void GetAppletInfo(Service::Interface* self);
-
-/**
- * APT::IsRegistered service function. This returns whether the specified AppID is registered with
- * NS yet. An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home
- * Menu uses this command to determine when the launched process is running and to determine when to
- * stop using GSP, etc., while displaying the "Nintendo 3DS" loading screen.
- *
- *  Inputs:
- *      1 : AppID
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Output, 0 = not registered, 1 = registered.
- */
-void IsRegistered(Service::Interface* self);
-
-void InquireNotification(Service::Interface* self);
-
-/**
- * APT::SendParameter service function. This sets the parameter data state.
- * Inputs:
- *     1 : Source AppID
- *     2 : Destination AppID
- *     3 : Signal type
- *     4 : Parameter buffer size, max size is 0x1000 (this can be zero)
- *     5 : Value
- *     6 : Handle to the destination process, likely used for shared memory (this can be zero)
- *     7 : (Size<<14) | 2
- *     8 : Input parameter buffer ptr
- * Outputs:
- *     0 : Return Header
- *     1 : Result of function, 0 on success, otherwise error code
-*/
-void SendParameter(Service::Interface* self);
-
-/**
- * APT::ReceiveParameter service function. This returns the current parameter data from NS state,
- * from the source process which set the parameters. Once finished, NS will clear a flag in the NS
- * state so that this command will return an error if this command is used again if parameters were
- * not set again. This is called when the second Initialize event is triggered. It returns a signal
- * type indicating why it was triggered.
- *  Inputs:
- *      1 : AppID
- *      2 : Parameter buffer size, max size is 0x1000
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : AppID of the process which sent these parameters
- *      3 : Signal type
- *      4 : Actual parameter buffer size, this is <= to the the input size
- *      5 : Value
- *      6 : Handle from the source process which set the parameters, likely used for shared memory
- *      7 : Size
- *      8 : Output parameter buffer ptr
- */
-void ReceiveParameter(Service::Interface* self);
-
-/**
- * APT::GlanceParameter service function. This is exactly the same as APT_U::ReceiveParameter
- * (except for the word value prior to the output handle), except this will not clear the flag
- * (except when responseword[3]==8 || responseword[3]==9) in NS state.
- *  Inputs:
- *      1 : AppID
- *      2 : Parameter buffer size, max size is 0x1000
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Unknown, for now assume AppID of the process which sent these parameters
- *      3 : Unknown, for now assume Signal type
- *      4 : Actual parameter buffer size, this is <= to the the input size
- *      5 : Value
- *      6 : Handle from the source process which set the parameters, likely used for shared memory
- *      7 : Size
- *      8 : Output parameter buffer ptr
- */
-void GlanceParameter(Service::Interface* self);
-
-/**
- * APT::CancelParameter service function. When the parameter data is available, and when the above
- * specified fields match the ones in NS state(for the ones where the checks are enabled), this
- * clears the flag which indicates that parameter data is available
- * (same flag cleared by APT:ReceiveParameter).
- *  Inputs:
- *      1 : Flag, when non-zero NS will compare the word after this one with a field in the NS
- *          state.
- *      2 : Unknown, this is the same as the first unknown field returned by APT:ReceiveParameter.
- *      3 : Flag, when non-zero NS will compare the word after this one with a field in the NS
- *          state.
- *      4 : AppID
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Status flag, 0 = failure due to no parameter data being available, or the above enabled
- *          fields don't match the fields in NS state. 1 = success.
- */
-void CancelParameter(Service::Interface* self);
-
-/**
- * APT::PrepareToStartApplication service function. When the input title-info programID is zero,
- * NS will load the actual program ID via AMNet:GetTitleIDList. After doing some checks with the
- * programID, NS will then set a NS state flag to value 1, then set the programID for AppID
- * 0x300(application) to the input program ID(or the one from GetTitleIDList). A media-type field
- * in the NS state is also set to the input media-type value
- * (other state fields are set at this point as well). With 8.0.0-18, NS will set an u8 NS state
- * field to value 1 when input flags bit8 is set
- *  Inputs:
- *    1-4 : 0x10-byte title-info struct
- *      4 : Flags
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void PrepareToStartApplication(Service::Interface* self);
-
-/**
- * APT::StartApplication service function. Buf0 is copied to NS FIRMparams+0x0, then Buf1 is copied
- * to the NS FIRMparams+0x480. Then the application is launched.
- * Inputs:
- *     1 : Buffer 0 size, max size is 0x300
- *     2 : Buffer 1 size, max size is 0x20 (this can be zero)
- *     3 : u8 flag
- *     4 : (Size0<<14) | 2
- *     5 : Buffer 0 pointer
- *     6 : (Size1<<14) | 0x802
- *     7 : Buffer 1 pointer
- * Outputs:
- *     0 : Return Header
- *     1 : Result of function, 0 on success, otherwise error code
-*/
-void StartApplication(Service::Interface* self);
-
-/**
- * APT::AppletUtility service function
- *  Inputs:
- *      1 : Unknown, but clearly used for something
- *      2 : Buffer 1 size (purpose is unknown)
- *      3 : Buffer 2 size (purpose is unknown)
- *      5 : Buffer 1 address (purpose is unknown)
- *      65 : Buffer 2 address (purpose is unknown)
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void AppletUtility(Service::Interface* self);
-
-/**
- * APT::SetAppCpuTimeLimit service function
- *  Inputs:
- *      1 : Value, must be one
- *      2 : Percentage of CPU time from 5 to 80
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetAppCpuTimeLimit(Service::Interface* self);
-
-/**
- * APT::GetAppCpuTimeLimit service function
- *  Inputs:
- *      1 : Value, must be one
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : System core CPU time percentage
- */
-void GetAppCpuTimeLimit(Service::Interface* self);
-
-/**
- * APT::PrepareToStartLibraryApplet service function
- *  Inputs:
- *      0 : Command header [0x00180040]
- *      1 : Id of the applet to start
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void PrepareToStartLibraryApplet(Service::Interface* self);
-
-/**
- * APT::PrepareToStartNewestHomeMenu service function
- *  Inputs:
- *      0 : Command header [0x001A0000]
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function
- */
-void PrepareToStartNewestHomeMenu(Service::Interface* self);
-
-/**
- * APT::PreloadLibraryApplet service function
- *  Inputs:
- *      0 : Command header [0x00160040]
- *      1 : Id of the applet to start
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void PreloadLibraryApplet(Service::Interface* self);
-
-/**
- * APT::StartLibraryApplet service function
- *  Inputs:
- *      0 : Command header [0x001E0084]
- *      1 : Id of the applet to start
- *      2 : Buffer size
- *      3 : Always 0?
- *      4 : Handle passed to the applet
- *      5 : (Size << 14) | 2
- *      6 : Input buffer virtual address
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void StartLibraryApplet(Service::Interface* self);
-
-/**
- * APT::CancelLibraryApplet service function
- *  Inputs:
- *      0 : Command header [0x003B0040]
- *      1 : u8, Application exiting (0 = not exiting, 1 = exiting)
- *  Outputs:
- *      0 : Header code
- *      1 : Result code
- */
-void CancelLibraryApplet(Service::Interface* self);
-
-/**
- * APT::GetStartupArgument service function
- *  Inputs:
- *      1 : Parameter Size (capped to 0x300)
- *      2 : StartupArgumentType
- *      65 : Output buffer for startup argument
- *  Outputs:
- *      0 : Return header
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8, Exists (0 = does not exist, 1 = exists)
- */
-void GetStartupArgument(Service::Interface* self);
-
-/**
- * APT::SetScreenCapPostPermission service function
- *  Inputs:
- *      0 : Header Code[0x00550040]
- *      1 : u8 The screenshot posting permission
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetScreenCapPostPermission(Service::Interface* self);
-
-/**
- * APT::GetScreenCapPostPermission service function
- *  Inputs:
- *      0 : Header Code[0x00560000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 The screenshot posting permission
- */
-void GetScreenCapPostPermission(Service::Interface* self);
-
-/**
- * APT::CheckNew3DSApp service function
- *  Outputs:
- *      1: Result code, 0 on success, otherwise error code
- *      2: u8 output: 0 = Old3DS, 1 = New3DS.
- *  Note:
- *  This uses PTMSYSM:CheckNew3DS.
- *  When a certain NS state field is non-zero, the output value is zero,
- *  Otherwise the output is from PTMSYSM:CheckNew3DS.
- *  Normally this NS state field is zero, however this state field is set to 1
- *  when APT:PrepareToStartApplication is used with flags bit8 is set.
- */
-void CheckNew3DSApp(Service::Interface* self);
-
-/**
- * Wrapper for PTMSYSM:CheckNew3DS
- * APT::CheckNew3DS service function
- *  Outputs:
- *      1: Result code, 0 on success, otherwise error code
- *      2: u8 output: 0 = Old3DS, 1 = New3DS.
- */
-void CheckNew3DS(Service::Interface* self);
-
-/// Initialize the APT service
-void Init();
-
-/// Shutdown the APT service
-void Shutdown();
-
-} // namespace APT
-} // namespace Service

+ 0 - 110
src/core/hle/service/apt/apt_a.cpp

@@ -1,110 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/apt/apt.h"
-#include "core/hle/service/apt/apt_a.h"
-
-namespace Service {
-namespace APT {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010040, GetLockHandle, "GetLockHandle"},
-    {0x00020080, Initialize, "Initialize"},
-    {0x00030040, Enable, "Enable"},
-    {0x00040040, nullptr, "Finalize"},
-    {0x00050040, GetAppletManInfo, "GetAppletManInfo"},
-    {0x00060040, GetAppletInfo, "GetAppletInfo"},
-    {0x00070000, nullptr, "GetLastSignaledAppletId"},
-    {0x00080000, nullptr, "CountRegisteredApplet"},
-    {0x00090040, IsRegistered, "IsRegistered"},
-    {0x000A0040, nullptr, "GetAttribute"},
-    {0x000B0040, InquireNotification, "InquireNotification"},
-    {0x000C0104, SendParameter, "SendParameter"},
-    {0x000D0080, ReceiveParameter, "ReceiveParameter"},
-    {0x000E0080, GlanceParameter, "GlanceParameter"},
-    {0x000F0100, CancelParameter, "CancelParameter"},
-    {0x001000C2, nullptr, "DebugFunc"},
-    {0x001100C0, nullptr, "MapProgramIdForDebug"},
-    {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"},
-    {0x00130000, nullptr, "GetPreparationState"},
-    {0x00140040, nullptr, "SetPreparationState"},
-    {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"},
-    {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"},
-    {0x00170040, nullptr, "FinishPreloadingLibraryApplet"},
-    {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"},
-    {0x00190040, nullptr, "PrepareToStartSystemApplet"},
-    {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"},
-    {0x001B00C4, nullptr, "StartApplication"},
-    {0x001C0000, nullptr, "WakeupApplication"},
-    {0x001D0000, nullptr, "CancelApplication"},
-    {0x001E0084, StartLibraryApplet, "StartLibraryApplet"},
-    {0x001F0084, nullptr, "StartSystemApplet"},
-    {0x00200044, nullptr, "StartNewestHomeMenu"},
-    {0x00210000, nullptr, "OrderToCloseApplication"},
-    {0x00220040, nullptr, "PrepareToCloseApplication"},
-    {0x00230040, nullptr, "PrepareToJumpToApplication"},
-    {0x00240044, nullptr, "JumpToApplication"},
-    {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"},
-    {0x00260000, nullptr, "PrepareToCloseSystemApplet"},
-    {0x00270044, nullptr, "CloseApplication"},
-    {0x00280044, nullptr, "CloseLibraryApplet"},
-    {0x00290044, nullptr, "CloseSystemApplet"},
-    {0x002A0000, nullptr, "OrderToCloseSystemApplet"},
-    {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"},
-    {0x002C0044, nullptr, "JumpToHomeMenu"},
-    {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"},
-    {0x002E0044, nullptr, "LeaveHomeMenu"},
-    {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"},
-    {0x00300044, nullptr, "LeaveResidentApplet"},
-    {0x00310100, nullptr, "PrepareToDoApplicationJump"},
-    {0x00320084, nullptr, "DoApplicationJump"},
-    {0x00330000, nullptr, "GetProgramIdOnApplicationJump"},
-    {0x00340084, nullptr, "SendDeliverArg"},
-    {0x00350080, nullptr, "ReceiveDeliverArg"},
-    {0x00360040, nullptr, "LoadSysMenuArg"},
-    {0x00370042, nullptr, "StoreSysMenuArg"},
-    {0x00380040, nullptr, "PreloadResidentApplet"},
-    {0x00390040, nullptr, "PrepareToStartResidentApplet"},
-    {0x003A0044, nullptr, "StartResidentApplet"},
-    {0x003B0040, CancelLibraryApplet, "CancelLibraryApplet"},
-    {0x003C0042, nullptr, "SendDspSleep"},
-    {0x003D0042, nullptr, "SendDspWakeUp"},
-    {0x003E0080, nullptr, "ReplySleepQuery"},
-    {0x003F0040, nullptr, "ReplySleepNotificationComplete"},
-    {0x00400042, nullptr, "SendCaptureBufferInfo"},
-    {0x00410040, nullptr, "ReceiveCaptureBufferInfo"},
-    {0x00420080, nullptr, "SleepSystem"},
-    {0x00430040, NotifyToWait, "NotifyToWait"},
-    {0x00440000, GetSharedFont, "GetSharedFont"},
-    {0x00450040, nullptr, "GetWirelessRebootInfo"},
-    {0x00460104, Wrap, "Wrap"},
-    {0x00470104, Unwrap, "Unwrap"},
-    {0x00480100, nullptr, "GetProgramInfo"},
-    {0x00490180, nullptr, "Reboot"},
-    {0x004A0040, nullptr, "GetCaptureInfo"},
-    {0x004B00C2, AppletUtility, "AppletUtility"},
-    {0x004C0000, nullptr, "SetFatalErrDispMode"},
-    {0x004D0080, nullptr, "GetAppletProgramInfo"},
-    {0x004E0000, nullptr, "HardwareResetAsync"},
-    {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"},
-    {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"},
-    {0x00510080, GetStartupArgument, "GetStartupArgument"},
-    {0x00520104, nullptr, "Wrap1"},
-    {0x00530104, nullptr, "Unwrap1"},
-    {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"},
-    {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"},
-    {0x00570044, nullptr, "WakeupApplication2"},
-    {0x00580002, nullptr, "GetProgramID"},
-    {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"},
-    {0x01020000, CheckNew3DS, "CheckNew3DS"},
-    {0x01040000, nullptr, "IsStandardMemoryLayout"},
-    {0x01050100, nullptr, "IsTitleAllowed"},
-};
-
-APT_A_Interface::APT_A_Interface() : Interface(MaxAPTSessions) {
-    Register(FunctionTable);
-}
-
-} // namespace APT
-} // namespace Service

+ 0 - 22
src/core/hle/service/apt/apt_a.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace APT {
-
-class APT_A_Interface : public Service::Interface {
-public:
-    APT_A_Interface();
-
-    std::string GetPortName() const override {
-        return "APT:A";
-    }
-};
-
-} // namespace APT
-} // namespace Service

+ 0 - 110
src/core/hle/service/apt/apt_s.cpp

@@ -1,110 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/apt/apt.h"
-#include "core/hle/service/apt/apt_s.h"
-
-namespace Service {
-namespace APT {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010040, GetLockHandle, "GetLockHandle"},
-    {0x00020080, Initialize, "Initialize"},
-    {0x00030040, Enable, "Enable"},
-    {0x00040040, nullptr, "Finalize"},
-    {0x00050040, GetAppletManInfo, "GetAppletManInfo"},
-    {0x00060040, GetAppletInfo, "GetAppletInfo"},
-    {0x00070000, nullptr, "GetLastSignaledAppletId"},
-    {0x00080000, nullptr, "CountRegisteredApplet"},
-    {0x00090040, IsRegistered, "IsRegistered"},
-    {0x000A0040, nullptr, "GetAttribute"},
-    {0x000B0040, InquireNotification, "InquireNotification"},
-    {0x000C0104, SendParameter, "SendParameter"},
-    {0x000D0080, ReceiveParameter, "ReceiveParameter"},
-    {0x000E0080, GlanceParameter, "GlanceParameter"},
-    {0x000F0100, nullptr, "CancelParameter"},
-    {0x001000C2, nullptr, "DebugFunc"},
-    {0x001100C0, nullptr, "MapProgramIdForDebug"},
-    {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"},
-    {0x00130000, nullptr, "GetPreparationState"},
-    {0x00140040, nullptr, "SetPreparationState"},
-    {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"},
-    {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"},
-    {0x00170040, nullptr, "FinishPreloadingLibraryApplet"},
-    {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"},
-    {0x00190040, nullptr, "PrepareToStartSystemApplet"},
-    {0x001A0000, PrepareToStartNewestHomeMenu, "PrepareToStartNewestHomeMenu"},
-    {0x001B00C4, nullptr, "StartApplication"},
-    {0x001C0000, nullptr, "WakeupApplication"},
-    {0x001D0000, nullptr, "CancelApplication"},
-    {0x001E0084, StartLibraryApplet, "StartLibraryApplet"},
-    {0x001F0084, nullptr, "StartSystemApplet"},
-    {0x00200044, nullptr, "StartNewestHomeMenu"},
-    {0x00210000, nullptr, "OrderToCloseApplication"},
-    {0x00220040, nullptr, "PrepareToCloseApplication"},
-    {0x00230040, nullptr, "PrepareToJumpToApplication"},
-    {0x00240044, nullptr, "JumpToApplication"},
-    {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"},
-    {0x00260000, nullptr, "PrepareToCloseSystemApplet"},
-    {0x00270044, nullptr, "CloseApplication"},
-    {0x00280044, nullptr, "CloseLibraryApplet"},
-    {0x00290044, nullptr, "CloseSystemApplet"},
-    {0x002A0000, nullptr, "OrderToCloseSystemApplet"},
-    {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"},
-    {0x002C0044, nullptr, "JumpToHomeMenu"},
-    {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"},
-    {0x002E0044, nullptr, "LeaveHomeMenu"},
-    {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"},
-    {0x00300044, nullptr, "LeaveResidentApplet"},
-    {0x00310100, nullptr, "PrepareToDoApplicationJump"},
-    {0x00320084, nullptr, "DoApplicationJump"},
-    {0x00330000, nullptr, "GetProgramIdOnApplicationJump"},
-    {0x00340084, nullptr, "SendDeliverArg"},
-    {0x00350080, nullptr, "ReceiveDeliverArg"},
-    {0x00360040, nullptr, "LoadSysMenuArg"},
-    {0x00370042, nullptr, "StoreSysMenuArg"},
-    {0x00380040, nullptr, "PreloadResidentApplet"},
-    {0x00390040, nullptr, "PrepareToStartResidentApplet"},
-    {0x003A0044, nullptr, "StartResidentApplet"},
-    {0x003B0040, nullptr, "CancelLibraryApplet"},
-    {0x003C0042, nullptr, "SendDspSleep"},
-    {0x003D0042, nullptr, "SendDspWakeUp"},
-    {0x003E0080, nullptr, "ReplySleepQuery"},
-    {0x003F0040, nullptr, "ReplySleepNotificationComplete"},
-    {0x00400042, nullptr, "SendCaptureBufferInfo"},
-    {0x00410040, nullptr, "ReceiveCaptureBufferInfo"},
-    {0x00420080, nullptr, "SleepSystem"},
-    {0x00430040, NotifyToWait, "NotifyToWait"},
-    {0x00440000, GetSharedFont, "GetSharedFont"},
-    {0x00450040, nullptr, "GetWirelessRebootInfo"},
-    {0x00460104, Wrap, "Wrap"},
-    {0x00470104, Unwrap, "Unwrap"},
-    {0x00480100, nullptr, "GetProgramInfo"},
-    {0x00490180, nullptr, "Reboot"},
-    {0x004A0040, nullptr, "GetCaptureInfo"},
-    {0x004B00C2, AppletUtility, "AppletUtility"},
-    {0x004C0000, nullptr, "SetFatalErrDispMode"},
-    {0x004D0080, nullptr, "GetAppletProgramInfo"},
-    {0x004E0000, nullptr, "HardwareResetAsync"},
-    {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"},
-    {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"},
-    {0x00510080, GetStartupArgument, "GetStartupArgument"},
-    {0x00520104, nullptr, "Wrap1"},
-    {0x00530104, nullptr, "Unwrap1"},
-    {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"},
-    {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"},
-    {0x00570044, nullptr, "WakeupApplication2"},
-    {0x00580002, nullptr, "GetProgramID"},
-    {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"},
-    {0x01020000, CheckNew3DS, "CheckNew3DS"},
-    {0x01040000, nullptr, "IsStandardMemoryLayout"},
-    {0x01050100, nullptr, "IsTitleAllowed"},
-};
-
-APT_S_Interface::APT_S_Interface() : Interface(MaxAPTSessions) {
-    Register(FunctionTable);
-}
-
-} // namespace APT
-} // namespace Service

+ 0 - 29
src/core/hle/service/apt/apt_s.h

@@ -1,29 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace APT {
-
-// Application and title launching service. These services handle signaling for home/power button as
-// well. Only one session for either APT service can be open at a time, normally processes close the
-// service handle immediately once finished using the service. The commands for APT:U and APT:S are
-// exactly the same, however certain commands are only accessible with APT:S(NS module will call
-// svcBreak when the command isn't accessible). See http://3dbrew.org/wiki/NS#APT_Services.
-
-/// Interface to "APT:S" service
-class APT_S_Interface : public Service::Interface {
-public:
-    APT_S_Interface();
-
-    std::string GetPortName() const override {
-        return "APT:S";
-    }
-};
-
-} // namespace APT
-} // namespace Service

+ 0 - 107
src/core/hle/service/apt/apt_u.cpp

@@ -1,107 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/apt/apt.h"
-#include "core/hle/service/apt/apt_u.h"
-
-namespace Service {
-namespace APT {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010040, GetLockHandle, "GetLockHandle"},
-    {0x00020080, Initialize, "Initialize"},
-    {0x00030040, Enable, "Enable"},
-    {0x00040040, nullptr, "Finalize"},
-    {0x00050040, GetAppletManInfo, "GetAppletManInfo"},
-    {0x00060040, GetAppletInfo, "GetAppletInfo"},
-    {0x00070000, nullptr, "GetLastSignaledAppletId"},
-    {0x00080000, nullptr, "CountRegisteredApplet"},
-    {0x00090040, IsRegistered, "IsRegistered"},
-    {0x000A0040, nullptr, "GetAttribute"},
-    {0x000B0040, InquireNotification, "InquireNotification"},
-    {0x000C0104, SendParameter, "SendParameter"},
-    {0x000D0080, ReceiveParameter, "ReceiveParameter"},
-    {0x000E0080, GlanceParameter, "GlanceParameter"},
-    {0x000F0100, CancelParameter, "CancelParameter"},
-    {0x001000C2, nullptr, "DebugFunc"},
-    {0x001100C0, nullptr, "MapProgramIdForDebug"},
-    {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"},
-    {0x00130000, nullptr, "GetPreparationState"},
-    {0x00140040, nullptr, "SetPreparationState"},
-    {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"},
-    {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"},
-    {0x00170040, nullptr, "FinishPreloadingLibraryApplet"},
-    {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"},
-    {0x00190040, nullptr, "PrepareToStartSystemApplet"},
-    {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"},
-    {0x001B00C4, nullptr, "StartApplication"},
-    {0x001C0000, nullptr, "WakeupApplication"},
-    {0x001D0000, nullptr, "CancelApplication"},
-    {0x001E0084, StartLibraryApplet, "StartLibraryApplet"},
-    {0x001F0084, nullptr, "StartSystemApplet"},
-    {0x00200044, nullptr, "StartNewestHomeMenu"},
-    {0x00210000, nullptr, "OrderToCloseApplication"},
-    {0x00220040, nullptr, "PrepareToCloseApplication"},
-    {0x00230040, nullptr, "PrepareToJumpToApplication"},
-    {0x00240044, nullptr, "JumpToApplication"},
-    {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"},
-    {0x00260000, nullptr, "PrepareToCloseSystemApplet"},
-    {0x00270044, nullptr, "CloseApplication"},
-    {0x00280044, nullptr, "CloseLibraryApplet"},
-    {0x00290044, nullptr, "CloseSystemApplet"},
-    {0x002A0000, nullptr, "OrderToCloseSystemApplet"},
-    {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"},
-    {0x002C0044, nullptr, "JumpToHomeMenu"},
-    {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"},
-    {0x002E0044, nullptr, "LeaveHomeMenu"},
-    {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"},
-    {0x00300044, nullptr, "LeaveResidentApplet"},
-    {0x00310100, nullptr, "PrepareToDoApplicationJump"},
-    {0x00320084, nullptr, "DoApplicationJump"},
-    {0x00330000, nullptr, "GetProgramIdOnApplicationJump"},
-    {0x00340084, nullptr, "SendDeliverArg"},
-    {0x00350080, nullptr, "ReceiveDeliverArg"},
-    {0x00360040, nullptr, "LoadSysMenuArg"},
-    {0x00370042, nullptr, "StoreSysMenuArg"},
-    {0x00380040, nullptr, "PreloadResidentApplet"},
-    {0x00390040, nullptr, "PrepareToStartResidentApplet"},
-    {0x003A0044, nullptr, "StartResidentApplet"},
-    {0x003B0040, CancelLibraryApplet, "CancelLibraryApplet"},
-    {0x003C0042, nullptr, "SendDspSleep"},
-    {0x003D0042, nullptr, "SendDspWakeUp"},
-    {0x003E0080, nullptr, "ReplySleepQuery"},
-    {0x003F0040, nullptr, "ReplySleepNotificationComplete"},
-    {0x00400042, nullptr, "SendCaptureBufferInfo"},
-    {0x00410040, nullptr, "ReceiveCaptureBufferInfo"},
-    {0x00420080, nullptr, "SleepSystem"},
-    {0x00430040, NotifyToWait, "NotifyToWait"},
-    {0x00440000, GetSharedFont, "GetSharedFont"},
-    {0x00450040, nullptr, "GetWirelessRebootInfo"},
-    {0x00460104, Wrap, "Wrap"},
-    {0x00470104, Unwrap, "Unwrap"},
-    {0x00480100, nullptr, "GetProgramInfo"},
-    {0x00490180, nullptr, "Reboot"},
-    {0x004A0040, nullptr, "GetCaptureInfo"},
-    {0x004B00C2, AppletUtility, "AppletUtility"},
-    {0x004C0000, nullptr, "SetFatalErrDispMode"},
-    {0x004D0080, nullptr, "GetAppletProgramInfo"},
-    {0x004E0000, nullptr, "HardwareResetAsync"},
-    {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"},
-    {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"},
-    {0x00510080, GetStartupArgument, "GetStartupArgument"},
-    {0x00520104, nullptr, "Wrap1"},
-    {0x00530104, nullptr, "Unwrap1"},
-    {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"},
-    {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"},
-    {0x00580002, nullptr, "GetProgramID"},
-    {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"},
-    {0x01020000, CheckNew3DS, "CheckNew3DS"},
-};
-
-APT_U_Interface::APT_U_Interface() : Interface(MaxAPTSessions) {
-    Register(FunctionTable);
-}
-
-} // namespace APT
-} // namespace Service

+ 0 - 29
src/core/hle/service/apt/apt_u.h

@@ -1,29 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace APT {
-
-// Application and title launching service. These services handle signaling for home/power button as
-// well. Only one session for either APT service can be open at a time, normally processes close the
-// service handle immediately once finished using the service. The commands for APT:U and APT:S are
-// exactly the same, however certain commands are only accessible with APT:S(NS module will call
-// svcBreak when the command isn't accessible). See http://3dbrew.org/wiki/NS#APT_Services.
-
-/// Interface to "APT:U" service
-class APT_U_Interface : public Service::Interface {
-public:
-    APT_U_Interface();
-
-    std::string GetPortName() const override {
-        return "APT:U";
-    }
-};
-
-} // namespace APT
-} // namespace Service

+ 0 - 110
src/core/hle/service/apt/bcfnt/bcfnt.cpp

@@ -1,110 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/apt/bcfnt/bcfnt.h"
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace APT {
-namespace BCFNT {
-
-void RelocateSharedFont(Kernel::SharedPtr<Kernel::SharedMemory> shared_font, VAddr new_address) {
-    static const u32 SharedFontStartOffset = 0x80;
-    const u8* cfnt_ptr = shared_font->GetPointer(SharedFontStartOffset);
-
-    CFNT cfnt;
-    memcpy(&cfnt, cfnt_ptr, sizeof(cfnt));
-
-    u32 assumed_cmap_offset = 0;
-    u32 assumed_cwdh_offset = 0;
-    u32 assumed_tglp_offset = 0;
-    u32 first_cmap_offset = 0;
-    u32 first_cwdh_offset = 0;
-    u32 first_tglp_offset = 0;
-
-    // First discover the location of sections so that the rebase offset can be auto-detected
-    u32 current_offset = SharedFontStartOffset + cfnt.header_size;
-    for (unsigned block = 0; block < cfnt.num_blocks; ++block) {
-        const u8* data = shared_font->GetPointer(current_offset);
-
-        SectionHeader section_header;
-        memcpy(&section_header, data, sizeof(section_header));
-
-        if (first_cmap_offset == 0 && memcmp(section_header.magic, "CMAP", 4) == 0) {
-            first_cmap_offset = current_offset;
-        } else if (first_cwdh_offset == 0 && memcmp(section_header.magic, "CWDH", 4) == 0) {
-            first_cwdh_offset = current_offset;
-        } else if (first_tglp_offset == 0 && memcmp(section_header.magic, "TGLP", 4) == 0) {
-            first_tglp_offset = current_offset;
-        } else if (memcmp(section_header.magic, "FINF", 4) == 0) {
-            BCFNT::FINF finf;
-            memcpy(&finf, data, sizeof(finf));
-
-            assumed_cmap_offset = finf.cmap_offset - sizeof(SectionHeader);
-            assumed_cwdh_offset = finf.cwdh_offset - sizeof(SectionHeader);
-            assumed_tglp_offset = finf.tglp_offset - sizeof(SectionHeader);
-        }
-
-        current_offset += section_header.section_size;
-    }
-
-    u32 previous_base = assumed_cmap_offset - first_cmap_offset;
-    ASSERT(previous_base == assumed_cwdh_offset - first_cwdh_offset);
-    ASSERT(previous_base == assumed_tglp_offset - first_tglp_offset);
-
-    u32 offset = new_address - previous_base;
-
-    // Reset pointer back to start of sections and do the actual rebase
-    current_offset = SharedFontStartOffset + cfnt.header_size;
-    for (unsigned block = 0; block < cfnt.num_blocks; ++block) {
-        u8* data = shared_font->GetPointer(current_offset);
-
-        SectionHeader section_header;
-        memcpy(&section_header, data, sizeof(section_header));
-
-        if (memcmp(section_header.magic, "FINF", 4) == 0) {
-            BCFNT::FINF finf;
-            memcpy(&finf, data, sizeof(finf));
-
-            // Relocate the offsets in the FINF section
-            finf.cmap_offset += offset;
-            finf.cwdh_offset += offset;
-            finf.tglp_offset += offset;
-
-            memcpy(data, &finf, sizeof(finf));
-        } else if (memcmp(section_header.magic, "CMAP", 4) == 0) {
-            BCFNT::CMAP cmap;
-            memcpy(&cmap, data, sizeof(cmap));
-
-            // Relocate the offsets in the CMAP section
-            if (cmap.next_cmap_offset != 0)
-                cmap.next_cmap_offset += offset;
-
-            memcpy(data, &cmap, sizeof(cmap));
-        } else if (memcmp(section_header.magic, "CWDH", 4) == 0) {
-            BCFNT::CWDH cwdh;
-            memcpy(&cwdh, data, sizeof(cwdh));
-
-            // Relocate the offsets in the CWDH section
-            if (cwdh.next_cwdh_offset != 0)
-                cwdh.next_cwdh_offset += offset;
-
-            memcpy(data, &cwdh, sizeof(cwdh));
-        } else if (memcmp(section_header.magic, "TGLP", 4) == 0) {
-            BCFNT::TGLP tglp;
-            memcpy(&tglp, data, sizeof(tglp));
-
-            // Relocate the offsets in the TGLP section
-            tglp.sheet_data_offset += offset;
-
-            memcpy(data, &tglp, sizeof(tglp));
-        }
-
-        current_offset += section_header.section_size;
-    }
-}
-
-} // namespace BCFNT
-} // namespace APT
-} // namespace Service

+ 0 - 92
src/core/hle/service/apt/bcfnt/bcfnt.h

@@ -1,92 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "common/swap.h"
-#include "core/hle/kernel/shared_memory.h"
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace APT {
-namespace BCFNT { ///< BCFNT Shared Font file structures
-
-struct CFNT {
-    u8 magic[4];
-    u16_le endianness;
-    u16_le header_size;
-    u32_le version;
-    u32_le file_size;
-    u32_le num_blocks;
-};
-
-struct SectionHeader {
-    u8 magic[4];
-    u32_le section_size;
-};
-
-struct FINF {
-    u8 magic[4];
-    u32_le section_size;
-    u8 font_type;
-    u8 line_feed;
-    u16_le alter_char_index;
-    u8 default_width[3];
-    u8 encoding;
-    u32_le tglp_offset;
-    u32_le cwdh_offset;
-    u32_le cmap_offset;
-    u8 height;
-    u8 width;
-    u8 ascent;
-    u8 reserved;
-};
-
-struct TGLP {
-    u8 magic[4];
-    u32_le section_size;
-    u8 cell_width;
-    u8 cell_height;
-    u8 baseline_position;
-    u8 max_character_width;
-    u32_le sheet_size;
-    u16_le num_sheets;
-    u16_le sheet_image_format;
-    u16_le num_columns;
-    u16_le num_rows;
-    u16_le sheet_width;
-    u16_le sheet_height;
-    u32_le sheet_data_offset;
-};
-
-struct CMAP {
-    u8 magic[4];
-    u32_le section_size;
-    u16_le code_begin;
-    u16_le code_end;
-    u16_le mapping_method;
-    u16_le reserved;
-    u32_le next_cmap_offset;
-};
-
-struct CWDH {
-    u8 magic[4];
-    u32_le section_size;
-    u16_le start_index;
-    u16_le end_index;
-    u32_le next_cwdh_offset;
-};
-
-/**
- * Relocates the internal addresses of the BCFNT Shared Font to the new base. The current base will
- * be auto-detected based on the file headers.
- *
- * @param shared_font SharedMemory object that contains the Shared Font
- * @param new_address New base for the offsets in the structure.
- */
-void RelocateSharedFont(Kernel::SharedPtr<Kernel::SharedMemory> shared_font, VAddr new_address);
-
-} // namespace BCFNT
-} // namespace APT
-} // namespace Service

+ 0 - 994
src/core/hle/service/boss/boss.cpp

@@ -1,994 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <cinttypes>
-#include "common/logging/log.h"
-#include "core/hle/ipc.h"
-#include "core/hle/result.h"
-#include "core/hle/service/boss/boss.h"
-#include "core/hle/service/boss/boss_p.h"
-#include "core/hle/service/boss/boss_u.h"
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace BOSS {
-
-static u32 new_arrival_flag;
-static u32 ns_data_new_flag;
-static u32 output_flag;
-
-void InitializeSession(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u64 unk_param = ((u64)cmd_buff[1] | ((u64)cmd_buff[2] << 32));
-    u32 translation = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-
-    if (translation != IPC::CallingPidDesc()) {
-        cmd_buff[0] = IPC::MakeHeader(0, 0x1, 0); // 0x40
-        cmd_buff[1] = IPC::ERR_INVALID_BUFFER_DESCRIPTOR.raw;
-        LOG_ERROR(Service_BOSS, "The translation was invalid, translation=0x%08X", translation);
-        return;
-    }
-
-    cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS,
-                "(STUBBED) unk_param=0x%016" PRIX64 ", translation=0x%08X, unk_param4=0x%08X",
-                unk_param, translation, unk_param4);
-}
-
-void RegisterStorage(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_flag = cmd_buff[4] & 0xFF;
-
-    cmd_buff[0] = IPC::MakeHeader(0x2, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(
-        Service_BOSS,
-        "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, unk_flag=0x%08X",
-        unk_param1, unk_param2, unk_param3, unk_flag);
-}
-
-void UnregisterStorage(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0x3, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) called");
-}
-
-void GetStorageInfo(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0x4, 0x2, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) called");
-}
-
-void RegisterPrivateRootCa(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x5, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
-                translation, buff_addr, buff_size);
-}
-
-void RegisterPrivateClientCert(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 translation1 = cmd_buff[3];
-    u32 buff1_addr = cmd_buff[4];
-    u32 buff1_size = (translation1 >> 4);
-    u32 translation2 = cmd_buff[5];
-    u32 buff2_addr = cmd_buff[6];
-    u32 buff2_size = (translation2 >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x6, 0x1, 0x4);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff1_size << 4 | 0xA);
-    cmd_buff[3] = buff1_addr;
-    cmd_buff[2] = (buff2_size << 4 | 0xA);
-    cmd_buff[3] = buff2_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
-                              "translation1=0x%08X, buff1_addr=0x%08X, buff1_size=0x%08X, "
-                              "translation2=0x%08X, buff2_addr=0x%08X, buff2_size=0x%08X",
-                unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2,
-                buff2_addr, buff2_size);
-}
-
-void GetNewArrivalFlag(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0x7, 0x2, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = new_arrival_flag;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) new_arrival_flag=%u", new_arrival_flag);
-}
-
-void RegisterNewArrivalEvent(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-
-    cmd_buff[0] = IPC::MakeHeader(0x8, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X", unk_param1,
-                unk_param2);
-}
-
-void SetOptoutFlag(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    output_flag = cmd_buff[1] & 0xFF;
-
-    cmd_buff[0] = IPC::MakeHeader(0x9, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "output_flag=%u", output_flag);
-}
-
-void GetOptoutFlag(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0xA, 0x2, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = output_flag;
-
-    LOG_WARNING(Service_BOSS, "output_flag=%u", output_flag);
-}
-
-void RegisterTask(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 unk_param3 = cmd_buff[3] & 0xFF;
-    u32 translation = cmd_buff[4];
-    u32 buff_addr = cmd_buff[5];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0xB, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
-}
-
-void UnregisterTask(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0xC, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, translation, buff_addr, buff_size);
-}
-
-void ReconfigureTask(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0xD, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, translation, buff_addr, buff_size);
-}
-
-void GetTaskIdList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0xE, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) called");
-}
-
-void GetStepIdList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0xF, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
-                translation, buff_addr, buff_size);
-}
-
-void GetNsDataIdList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-    u32 translation = cmd_buff[5];
-    u32 buff_addr = cmd_buff[6];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x10, 0x3, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (16 bit value)
-    cmd_buff[3] = 0; // stub 0 (16 bit value)
-    cmd_buff[4] = (buff_size << 4 | 0xC);
-    cmd_buff[5] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "unk_param4=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
-}
-
-void GetOwnNsDataIdList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-    u32 translation = cmd_buff[5];
-    u32 buff_addr = cmd_buff[6];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x11, 0x3, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (16 bit value)
-    cmd_buff[3] = 0; // stub 0 (16 bit value)
-    cmd_buff[4] = (buff_size << 4 | 0xC);
-    cmd_buff[5] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "unk_param4=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
-}
-
-void GetNewDataNsDataIdList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-    u32 translation = cmd_buff[5];
-    u32 buff_addr = cmd_buff[6];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x12, 0x3, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (16 bit value)
-    cmd_buff[3] = 0; // stub 0 (16 bit value)
-    cmd_buff[4] = (buff_size << 4 | 0xC);
-    cmd_buff[5] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "unk_param4=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
-}
-
-void GetOwnNewDataNsDataIdList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-    u32 translation = cmd_buff[5];
-    u32 buff_addr = cmd_buff[6];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x13, 0x3, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (16 bit value)
-    cmd_buff[3] = 0; // stub 0 (16 bit value)
-    cmd_buff[4] = (buff_size << 4 | 0xC);
-    cmd_buff[5] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "unk_param4=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
-}
-
-void SendProperty(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x14, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, translation, buff_addr, buff_size);
-}
-
-void SendPropertyHandle(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[2] & 0xFF;
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x15, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void ReceiveProperty(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 buff_size = cmd_buff[2];
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-
-    cmd_buff[0] = IPC::MakeHeader(0x16, 0x2, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32 bit value)
-    cmd_buff[2] = (buff_size << 4 | 0xC);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, buff_size=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X",
-                unk_param1, buff_size, translation, buff_addr);
-}
-
-void UpdateTaskInterval(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x17, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, translation, buff_addr, buff_size);
-}
-
-void UpdateTaskCount(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 buff_size = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-
-    cmd_buff[0] = IPC::MakeHeader(0x18, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X",
-                buff_size, unk_param2, translation, buff_addr);
-}
-
-void GetTaskInterval(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x19, 0x2, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 ( 32bit value)
-    cmd_buff[3] = (buff_size << 4 | 0xA);
-    cmd_buff[4] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void GetTaskCount(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x1A, 0x2, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 ( 32bit value)
-    cmd_buff[3] = (buff_size << 4 | 0xA);
-    cmd_buff[4] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void GetTaskServiceStatus(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x1B, 0x2, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 ( 8bit value)
-    cmd_buff[3] = (buff_size << 4 | 0xA);
-    cmd_buff[4] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void StartTask(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x1C, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void StartTaskImmediate(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x1D, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void CancelTask(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x1E, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void GetTaskFinishHandle(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0x1F, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0;
-    cmd_buff[3] = 0; // stub 0(This should be a handle of task_finish ?)
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) called");
-}
-
-void GetTaskState(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 buff_size = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 translation = cmd_buff[3];
-    u32 buff_addr = cmd_buff[4];
-
-    cmd_buff[0] = IPC::MakeHeader(0x20, 0x4, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (8 bit value)
-    cmd_buff[3] = 0; // stub 0 (32 bit value)
-    cmd_buff[4] = 0; // stub 0 (8 bit value)
-    cmd_buff[5] = (buff_size << 4 | 0xA);
-    cmd_buff[6] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X",
-                buff_size, unk_param2, translation, buff_addr);
-}
-
-void GetTaskResult(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x21, 0x4, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (8 bit value)
-    cmd_buff[3] = 0; // stub 0 (32 bit value)
-    cmd_buff[4] = 0; // stub 0 (8 bit value)
-    cmd_buff[5] = (buff_size << 4 | 0xA);
-    cmd_buff[6] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void GetTaskCommErrorCode(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x22, 0x4, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32 bit value)
-    cmd_buff[3] = 0; // stub 0 (32 bit value)
-    cmd_buff[4] = 0; // stub 0 (8 bit value)
-    cmd_buff[5] = (buff_size << 4 | 0xA);
-    cmd_buff[6] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void GetTaskStatus(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 unk_param3 = cmd_buff[3] & 0xFF;
-    u32 translation = cmd_buff[4];
-    u32 buff_addr = cmd_buff[5];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x23, 0x2, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (8 bit value)
-    cmd_buff[3] = (buff_size << 4 | 0xA);
-    cmd_buff[4] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
-}
-
-void GetTaskError(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 translation = cmd_buff[4];
-    u32 buff_addr = cmd_buff[5];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x24, 0x2, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (8 bit value)
-    cmd_buff[3] = (buff_size << 4 | 0xA);
-    cmd_buff[4] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, translation, buff_addr, buff_size);
-}
-
-void GetTaskInfo(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 translation = cmd_buff[4];
-    u32 buff_addr = cmd_buff[5];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x25, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, translation, buff_addr, buff_size);
-}
-
-void DeleteNsData(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-
-    cmd_buff[0] = IPC::MakeHeader(0x26, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
-}
-
-void GetNsDataHeaderInfo(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 unk_param3 = cmd_buff[3];
-    u32 translation = cmd_buff[4];
-    u32 buff_addr = cmd_buff[5];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x27, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xC);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
-}
-
-void ReadNsData(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-    u32 translation = cmd_buff[5];
-    u32 buff_addr = cmd_buff[6];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x28, 0x3, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32bit value)
-    cmd_buff[3] = 0; // stub 0 (32bit value)
-    cmd_buff[4] = (buff_size << 4 | 0xC);
-    cmd_buff[5] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "unk_param4=0x%08X, translation=0x%08X, "
-                              "buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
-}
-
-void SetNsDataAdditionalInfo(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-
-    cmd_buff[0] = IPC::MakeHeader(0x29, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X", unk_param1,
-                unk_param2);
-}
-
-void GetNsDataAdditionalInfo(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-
-    cmd_buff[0] = IPC::MakeHeader(0x2A, 0x2, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32bit value)
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
-}
-
-void SetNsDataNewFlag(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    ns_data_new_flag = cmd_buff[2] & 0xFF;
-
-    cmd_buff[0] = IPC::MakeHeader(0x2B, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, ns_data_new_flag=0x%08X", unk_param1,
-                ns_data_new_flag);
-}
-
-void GetNsDataNewFlag(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-
-    cmd_buff[0] = IPC::MakeHeader(0x2C, 0x2, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = ns_data_new_flag;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, ns_data_new_flag=0x%08X", unk_param1,
-                ns_data_new_flag);
-}
-
-void GetNsDataLastUpdate(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-
-    cmd_buff[0] = IPC::MakeHeader(0x2D, 0x3, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32bit value)
-    cmd_buff[3] = 0; // stub 0 (32bit value)
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
-}
-
-void GetErrorCode(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-
-    cmd_buff[0] = IPC::MakeHeader(0x2E, 0x2, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32bit value)
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
-}
-
-void RegisterStorageEntry(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-    u32 unk_param5 = cmd_buff[5] & 0xFF;
-
-    cmd_buff[0] = IPC::MakeHeader(0x2F, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED)  unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "unk_param4=0x%08X, unk_param5=0x%08X",
-                unk_param1, unk_param2, unk_param3, unk_param4, unk_param5);
-}
-
-void GetStorageEntryInfo(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0x30, 0x3, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32bit value)
-    cmd_buff[3] = 0; // stub 0 (16bit value)
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) called");
-}
-
-void SetStorageOption(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1] & 0xFF;
-    u32 unk_param2 = cmd_buff[2];
-    u32 unk_param3 = cmd_buff[3];
-    u32 unk_param4 = cmd_buff[4];
-
-    cmd_buff[0] = IPC::MakeHeader(0x31, 0x1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED)  unk_param1=0x%08X, unk_param2=0x%08X, "
-                              "unk_param3=0x%08X, unk_param4=0x%08X",
-                unk_param1, unk_param2, unk_param3, unk_param4);
-}
-
-void GetStorageOption(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[0] = IPC::MakeHeader(0x32, 0x5, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (32bit value)
-    cmd_buff[3] = 0; // stub 0 (8bit value)
-    cmd_buff[4] = 0; // stub 0 (16bit value)
-    cmd_buff[5] = 0; // stub 0 (16bit value)
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) called");
-}
-
-void StartBgImmediate(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x33, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff_size << 4 | 0xA);
-    cmd_buff[3] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void GetTaskActivePriority(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 translation = cmd_buff[2];
-    u32 buff_addr = cmd_buff[3];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x34, 0x2, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0; // stub 0 (8bit value)
-    cmd_buff[3] = (buff_size << 4 | 0xA);
-    cmd_buff[4] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X",
-                unk_param1, translation, buff_addr, buff_size);
-}
-
-void RegisterImmediateTask(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2] & 0xFF;
-    u32 unk_param3 = cmd_buff[3] & 0xFF;
-    u32 translation = cmd_buff[4];
-    u32 buff_addr = cmd_buff[5];
-    u32 buff_size = (translation >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x35, 0x1, 0x2);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[3] = (buff_size << 4 | 0xA);
-    cmd_buff[4] = buff_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
-                              "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
-                unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
-}
-
-void SetTaskQuery(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 translation1 = cmd_buff[3];
-    u32 buff1_addr = cmd_buff[4];
-    u32 buff1_size = (translation1 >> 4);
-    u32 translation2 = cmd_buff[5];
-    u32 buff2_addr = cmd_buff[6];
-    u32 buff2_size = (translation2 >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x36, 0x1, 0x4);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff1_size << 4 | 0xA);
-    cmd_buff[3] = buff1_addr;
-    cmd_buff[2] = (buff2_size << 4 | 0xA);
-    cmd_buff[3] = buff2_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
-                              "translation1=0x%08X, buff1_addr=0x%08X, buff1_size=0x%08X, "
-                              "translation2=0x%08X, buff2_addr=0x%08X, buff2_size=0x%08X",
-                unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2,
-                buff2_addr, buff2_size);
-}
-
-void GetTaskQuery(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    // TODO(JamePeng): Figure out the meaning of these parameters
-    u32 unk_param1 = cmd_buff[1];
-    u32 unk_param2 = cmd_buff[2];
-    u32 translation1 = cmd_buff[3];
-    u32 buff1_addr = cmd_buff[4];
-    u32 buff1_size = (translation1 >> 4);
-    u32 translation2 = cmd_buff[5];
-    u32 buff2_addr = cmd_buff[6];
-    u32 buff2_size = (translation2 >> 4);
-
-    cmd_buff[0] = IPC::MakeHeader(0x37, 0x1, 0x4);
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = (buff1_size << 4 | 0xA);
-    cmd_buff[3] = buff1_addr;
-    cmd_buff[2] = (buff2_size << 4 | 0xC);
-    cmd_buff[3] = buff2_addr;
-
-    LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
-                              "translation1=0x%08X, buff1_addr=0x%08X, buff1_size=0x%08X, "
-                              "translation2=0x%08X, buff2_addr=0x%08X, buff2_size=0x%08X",
-                unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2,
-                buff2_addr, buff2_size);
-}
-
-void Init() {
-    using namespace Kernel;
-
-    AddService(new BOSS_P_Interface);
-    AddService(new BOSS_U_Interface);
-
-    new_arrival_flag = 0;
-    ns_data_new_flag = 0;
-    output_flag = 0;
-}
-
-void Shutdown() {}
-
-} // namespace BOSS
-
-} // namespace Service

+ 0 - 802
src/core/hle/service/boss/boss.h

@@ -1,802 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace BOSS {
-
-/**
- * BOSS::InitializeSession service function
- *  Inputs:
- *      0 : Header Code[0x00010082]
- *      1 : u32 lower 64bit value
- *      2 : u32 higher 64bit value
- *      3 : 0x20
- *      4 : u32 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void InitializeSession(Service::Interface* self);
-
-/**
- * BOSS::RegisterStorage service function
- *  Inputs:
- *      0 : Header Code[0x00020010]
- *      1 : u32 unknown1
- *      2 : u32 unknown2
- *      3 : u32 unknown3
- *      4 : u8 unknown_flag
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void RegisterStorage(Service::Interface* self);
-
-/**
- * BOSS::UnregisterStorage service function
- *  Inputs:
- *      0 : Header Code[0x00030000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void UnregisterStorage(Service::Interface* self);
-
-/**
- * BOSS::GetStorageInfo service function
- *  Inputs:
- *      0 : Header Code[0x00040000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- */
-void GetStorageInfo(Service::Interface* self);
-
-/**
- * BOSS::RegisterPrivateRootCa service function
- *  Inputs:
- *      0 : Header Code[0x00050042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void RegisterPrivateRootCa(Service::Interface* self);
-
-/**
- * BOSS::RegisterPrivateClientCert service function
- *  Inputs:
- *      0 : Header Code[0x00060084]
- *      1 : u32 unknown value
- *      2 : u32 unknown value
- *      3 : MappedBufferDesc1(permission = R)
- *      4 : u32 buff_addr1
- *      5 : MappedBufferDesc2(permission = R)
- *      6 : u32 buff_addr2
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff1_size << 4 | 0xA
- *      3 : u32 buff_addr1
- *      4 : buff2_size << 4 | 0xA
- *      5 : u32 buff_addr2
- */
-void RegisterPrivateClientCert(Service::Interface* self);
-
-/**
- * BOSS::GetNewArrivalFlag service function
- *  Inputs:
- *      0 : Header Code[0x00070000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 flag
- */
-void GetNewArrivalFlag(Service::Interface* self);
-
-/**
- * BOSS::RegisterNewArrivalEvent service function
- *  Inputs:
- *      0 : Header Code[0x00080002]
- *      1 : u32 unknown1
- *      2 : u32 unknown2
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void RegisterNewArrivalEvent(Service::Interface* self);
-
-/**
- * BOSS::SetOptoutFlag service function
- *  Inputs:
- *      0 : Header Code[0x00090040]
- *      1 : u8 output_flag
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetOptoutFlag(Service::Interface* self);
-
-/**
- * BOSS::GetOptoutFlag service function
- *  Inputs:
- *      0 : Header Code[0x000A0000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 output_flag
- */
-void GetOptoutFlag(Service::Interface* self);
-
-/**
- * BOSS::RegisterTask service function
- *  Inputs:
- *      0 : Header Code[0x000B00C2]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : u8 unknown value
- *      4 : MappedBufferDesc1(permission = R)
- *      5 : buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void RegisterTask(Service::Interface* self);
-
-/**
- * BOSS::UnregisterTask service function
- *  Inputs:
- *      0 : Header Code[0x000C0082]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : MappedBufferDesc1(permission = R)
- *      4 : buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void UnregisterTask(Service::Interface* self);
-
-/**
- * BOSS::ReconfigureTask service function
- *  Inputs:
- *      0 : Header Code[0x000D0082]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : MappedBufferDesc1(permission = R)
- *      4 : buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void ReconfigureTask(Service::Interface* self);
-
-/**
- * BOSS::GetTaskIdList service function
- *  Inputs:
- *      0 : Header Code[0x000E0000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void GetTaskIdList(Service::Interface* self);
-
-/**
- * BOSS::GetStepIdList service function
- *  Inputs:
- *      0 : Header Code[0x000F0042]
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void GetStepIdList(Service::Interface* self);
-
-/**
- * BOSS::GetNsDataIdList service function
- *  Inputs:
- *      0 : Header Code[0x00100102]
- *      1 : u32 unknown1
- *      2 : u32 unknown2
- *      3 : u32 unknown3
- *      4 : u32 unknown4
- *      5 : MappedBufferDesc(permission = W)
- *      6 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u16 unknown value
- *      3 : u16 unknown value
- *      4 : buff_size << 4 | 0xC
- *      5 : u32 buff_addr
- */
-void GetNsDataIdList(Service::Interface* self);
-
-/**
- * BOSS::GetOwnNsDataIdList service function
- *  Inputs:
- *      0 : Header Code[0x00110102]
- *      1 : u32 unknown1
- *      2 : u32 unknown2
- *      3 : u32 unknown3
- *      4 : u32 unknown4
- *      5 : MappedBufferDesc(permission = W)
- *      6 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u16 unknown value
- *      3 : u16 unknown value
- *      4 : buff_size << 4 | 0xC
- *      5 : u32 buff_addr
- */
-void GetOwnNsDataIdList(Service::Interface* self);
-
-/**
- * BOSS::GetNewDataNsDataIdList service function
- *  Inputs:
- *      0 : Header Code[0x00120102]
- *      1 : u32 unknown1
- *      2 : u32 unknown2
- *      3 : u32 unknown3
- *      4 : u32 unknown4
- *      5 : MappedBufferDesc(permission = W)
- *      6 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u16 unknown value
- *      3 : u16 unknown value
- *      4 : buff_size << 4 | 0xC
- *      5 : u32 buff_addr
- */
-void GetNewDataNsDataIdList(Service::Interface* self);
-
-/**
- * BOSS::GetOwnNewDataNsDataIdList service function
- *  Inputs:
- *      0 : Header Code[0x00130102]
- *      1 : u32 unknown1
- *      2 : u32 unknown2
- *      3 : u32 unknown3
- *      4 : u32 unknown4
- *      5 : MappedBufferDesc(permission = W)
- *      6 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u16 unknown value
- *      3 : u16 unknown value
-
- */
-void GetOwnNewDataNsDataIdList(Service::Interface* self);
-
-/**
- * BOSS::SendProperty service function
- *  Inputs:
- *      0 : Header Code[0x00140082]
- *      1 : u16 unknown value
- *      2 : u32 unknown value
- *      3 : MappedBufferDesc(permission = R)
- *      4 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void SendProperty(Service::Interface* self);
-
-/**
- * BOSS::SendPropertyHandle service function
- *  Inputs:
- *      0 : Header Code[0x00150042]
- *      2 : u8 unknown value
- *      3 : MappedBufferDesc(permission = R)
- *      4 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void SendPropertyHandle(Service::Interface* self);
-
-/**
- * BOSS::ReceiveProperty service function
- *  Inputs:
- *      0 : Header Code[0x00160082]
- *      1 : u16 unknown1
- *      2 : u32 buff_size
- *      3 : MappedBufferDesc(permission = W)
- *      4 : u32 buff addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- *      3 : u16 unknown value
- *      4 : buff_size << 4 | 0xC
- *      5 : u32 buff_addr
- */
-void ReceiveProperty(Service::Interface* self);
-
-/**
- * BOSS::UpdateTaskInterval service function
- *  Inputs:
- *      0 : Header Code[0x00170082]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : MappedBufferDesc1(permission = R)
- *      4 : buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void UpdateTaskInterval(Service::Interface* self);
-
-/**
- * BOSS::UpdateTaskCount service function
- *  Inputs:
- *      0 : Header Code[0x00180082]
- *      1 : u32 buff_size
- *      2 : u32 unknown2
- *      3 : MappedBufferDesc(permission = R)
- *      4 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void UpdateTaskCount(Service::Interface* self);
-
-/**
- * BOSS::GetTaskInterval service function
- *  Inputs:
- *      0 : Header Code[0x00190042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- *      3 : buff_size << 4 | 0xA
- *      4 : u32 buff_addr
- */
-void GetTaskInterval(Service::Interface* self);
-
-/**
- * BOSS::GetTaskCount service function
- *  Inputs:
- *      0 : Header Code[0x001A0042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- *      3 : buff_size << 4 | 0xA
- *      4 : u32 buff_addr
- */
-void GetTaskCount(Service::Interface* self);
-
-/**
- * BOSS::GetTaskServiceStatus service function
- *  Inputs:
- *      0 : Header Code[0x001B0042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 unknown value
- *      3 : buff_size << 4 | 0xA
- *      4 : u32 buff_addr
- */
-void GetTaskServiceStatus(Service::Interface* self);
-
-/**
- * BOSS::StartTask service function
- *  Inputs:
- *      0 : Header Code[0x001C0042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void StartTask(Service::Interface* self);
-
-/**
- * BOSS::StartTaskImmediate service function
- *  Inputs:
- *      0 : Header Code[0x001D0042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void StartTaskImmediate(Service::Interface* self);
-
-/**
- * BOSS::CancelTask service function
- *  Inputs:
- *      0 : Header Code[0x001E0042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void CancelTask(Service::Interface* self);
-
-/**
- * BOSS::GetTaskFinishHandle service function
- *  Inputs:
- *      0 : Header Code[0x001F0000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : 0
- *      3 : Task Finish Handle
- */
-void GetTaskFinishHandle(Service::Interface* self);
-
-/**
- * BOSS::GetTaskState service function
- *  Inputs:
- *      0 : Header Code[0x00200082]
- *      1 : u32 buff_size
- *      2 : u8 unknown value
- *      3 : MappedBufferDesc(permission = R)
- *      4 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 unknown value
- *      3 : u32 unknown value
- *      4 : u8 unknown value
- *      5 : buff_size << 4 | 0xA
- *      6 : u32 buff_addr
- */
-void GetTaskState(Service::Interface* self);
-
-/**
- * BOSS::GetTaskResult service function
- *  Inputs:
- *      0 : Header Code[0x00210042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 unknown value
- *      3 : u32 unknown value
- *      4 : u8 unknown value
- *      5 : buff_size << 4 | 0xA
- *      6 : u32 buff_addr
- */
-void GetTaskResult(Service::Interface* self);
-
-/**
- * BOSS::GetTaskCommErrorCode service function
- *  Inputs:
- *      0 : Header Code[0x00220042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- *      3 : u32 unknown value
- *      4 : u8 unknown value
- *      5 : buff_size << 4 | 0xA
- *      6 : u32 buff_addr
- */
-void GetTaskCommErrorCode(Service::Interface* self);
-
-/**
- * BOSS::GetTaskStatus service function
- *  Inputs:
- *      0 : Header Code[0x002300C2]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : u8 unknown value
- *      4 : MappedBufferDesc(permission = R)
- *      5 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 unknown value
- *      3 : buff_size << 4 | 0xA
- *      4 : u32 buff_addr
- */
-void GetTaskStatus(Service::Interface* self);
-
-/**
- * BOSS::GetTaskError service function
- *  Inputs:
- *      0 : Header Code[0x00240082]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : MappedBufferDesc(permission = R)
- *      4 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 unknown value
- *      3 : buff_size << 4 | 0xA
- *      4 : u32 buff_addr
- */
-void GetTaskError(Service::Interface* self);
-
-/**
- * BOSS::GetTaskInfo service function
- *  Inputs:
- *      0 : Header Code[0x00250082]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : MappedBufferDesc(permission = R)
- *      4 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void GetTaskInfo(Service::Interface* self);
-
-/**
- * BOSS::DeleteNsData service function
- *  Inputs:
- *      0 : Header Code[0x00260040]
- *      1 : u32 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void DeleteNsData(Service::Interface* self);
-
-/**
- * BOSS::GetNsDataHeaderInfo service function
- *  Inputs:
- *      0 : Header Code[0x002700C2]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : u32 unknown value
- *      4 : MappedBufferDesc(permission = W)
- *      5 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xC
- *      3 : u32 buff_addr
- */
-void GetNsDataHeaderInfo(Service::Interface* self);
-
-/**
- * BOSS::ReadNsData service function
- *  Inputs:
- *      0 : Header Code[0x00280102]
- *      1 : u32 unknown value
- *      2 : u32 unknown value
- *      3 : u32 unknown value
- *      4 : u32 unknown value
- *      5 : MappedBufferDesc(permission = W)
- *      6 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- *      3 : u32 unknown value
- *      4 : buff_size << 4 | 0xC
- *      5 : u32 buff_addr
- */
-void ReadNsData(Service::Interface* self);
-
-/**
- * BOSS::SetNsDataAdditionalInfo service function
- *  Inputs:
- *      0 : Header Code[0x00290080]
- *      1 : u32 unknown value
- *      2 : u32 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetNsDataAdditionalInfo(Service::Interface* self);
-
-/**
- * BOSS::GetNsDataAdditionalInfo service function
- *  Inputs:
- *      0 : Header Code[0x002A0040]
- *      1 : u32 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- */
-void GetNsDataAdditionalInfo(Service::Interface* self);
-
-/**
- * BOSS::SetNsDataNewFlag service function
- *  Inputs:
- *      0 : Header Code[0x002B0080]
- *      1 : u32 unknown value
- *      2 : u8 flag
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetNsDataNewFlag(Service::Interface* self);
-
-/**
- * BOSS::GetNsDataNewFlag service function
- *  Inputs:
- *      0 : Header Code[0x002C0040]
- *      1 : u32 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 flag
- */
-void GetNsDataNewFlag(Service::Interface* self);
-
-/**
- * BOSS::GetNsDataLastUpdate service function
- *  Inputs:
- *      0 : Header Code[0x002D0040]
- *      1 : u32 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- *      3 : u32 unknown value
- */
-void GetNsDataLastUpdate(Service::Interface* self);
-
-/**
- * BOSS::GetErrorCode service function
- *  Inputs:
- *      0 : Header Code[0x002E0040]
- *      1 : u8 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- */
-void GetErrorCode(Service::Interface* self);
-
-/**
- * BOSS::RegisterStorageEntry service function
- *  Inputs:
- *      0 : Header Code[0x002F0140]
- *      1 : u32 unknown value
- *      2 : u32 unknown value
- *      3 : u32 unknown value
- *      4 : u16 unknown value
- *      5 : u8 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void RegisterStorageEntry(Service::Interface* self);
-
-/**
- * BOSS::GetStorageEntryInfo service function
- *  Inputs:
- *      0 : Header Code[0x00300000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u32 unknown value
- *      3 : u16 unknown value
- */
-void GetStorageEntryInfo(Service::Interface* self);
-
-/**
- * BOSS::SetStorageOption service function
- *  Inputs:
- *      0 : Header Code[0x00310100]
- *      1 : u8 unknown value
- *      2 : u32 unknown value
- *      3 : u16 unknown value
- *      4 : u16 unknown value
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetStorageOption(Service::Interface* self);
-
-/**
- * BOSS::GetStorageOption service function
- *  Inputs:
- *      0 : Header Code[0x00320000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 unknown value
- *      3 : u32 unknown value
- *      4 : u16 unknown value
- *      5 : u16 unknown value
- */
-void GetStorageOption(Service::Interface* self);
-
-/**
- * BOSS::StartBgImmediate service function
- *  Inputs:
- *      0 : Header Code[0x00330042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void StartBgImmediate(Service::Interface* self);
-
-/**
- * BOSS::GetTaskActivePriority service function
- *  Inputs:
- *      0 : Header Code[0x00340042]
- *      1 : u32 unknown value
- *      2 : MappedBufferDesc(permission = R)
- *      3 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : u8 unknown value
- *      3 : buff_size << 4 | 0xA
- *      4 : u32 buff_addr
- */
-void GetTaskActivePriority(Service::Interface* self);
-
-/**
- * BOSS::RegisterImmediateTask service function
- *  Inputs:
- *      0 : Header Code[0x003500C2]
- *      1 : u32 unknown value
- *      2 : u8 unknown value
- *      3 : u8 unknown value
- *      4 : MappedBufferDesc(permission = R)
- *      5 : u32 buff_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff_size << 4 | 0xA
- *      3 : u32 buff_addr
- */
-void RegisterImmediateTask(Service::Interface* self);
-
-/**
- * BOSS::SetTaskQuery service function
- *  Inputs:
- *      0 : Header Code[0x00360084]
- *      1 : u32 unknown value
- *      2 : u32 unknown value
- *      3 : MappedBufferDesc1(permission = R)
- *      4 : u32 buff1_addr
- *      5 : MappedBufferDesc2(permission = R)
- *      6 : u32 buff2_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff1_size << 4 | 0xA
- *      3 : u32 buff1_addr
- *      4 : buff2_size << 4 | 0xA
- *      5 : u32 buff2_addr
- */
-void SetTaskQuery(Service::Interface* self);
-
-/**
- * BOSS::GetTaskQuery service function
- *  Inputs:
- *      0 : Header Code[0x00370084]
- *      1 : u32 unknown value
- *      2 : u32 unknown value
- *      3 : MappedBufferDesc1(permission = R)
- *      4 : u32 buff1_addr
- *      5 : MappedBufferDesc2(permission = W)
- *      6 : u32 buff2_addr
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : buff1_size << 4 | 0xA
- *      3 : u32 buff1_addr
- *      4 : buff2_size << 4 | 0xC
- *      5 : u32 buff2_addr
- */
-void GetTaskQuery(Service::Interface* self);
-
-/// Initialize BOSS service(s)
-void Init();
-
-/// Shutdown BOSS service(s)
-void Shutdown();
-
-} // namespace BOSS
-} // namespace Service

+ 0 - 86
src/core/hle/service/boss/boss_p.cpp

@@ -1,86 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/boss/boss.h"
-#include "core/hle/service/boss/boss_p.h"
-
-namespace Service {
-namespace BOSS {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    // boss:u shared commands
-    {0x00010082, InitializeSession, "InitializeSession"},
-    {0x00020100, RegisterStorage, "RegisterStorage"},
-    {0x00030000, UnregisterStorage, "UnregisterStorage"},
-    {0x00040000, GetStorageInfo, "GetStorageInfo"},
-    {0x00050042, RegisterPrivateRootCa, "RegisterPrivateRootCa"},
-    {0x00060084, RegisterPrivateClientCert, "RegisterPrivateClientCert"},
-    {0x00070000, GetNewArrivalFlag, "GetNewArrivalFlag"},
-    {0x00080002, RegisterNewArrivalEvent, "RegisterNewArrivalEvent"},
-    {0x00090040, SetOptoutFlag, "SetOptoutFlag"},
-    {0x000A0000, GetOptoutFlag, "GetOptoutFlag"},
-    {0x000B00C2, RegisterTask, "RegisterTask"},
-    {0x000C0082, UnregisterTask, "UnregisterTask"},
-    {0x000D0082, ReconfigureTask, "ReconfigureTask"},
-    {0x000E0000, GetTaskIdList, "GetTaskIdList"},
-    {0x000F0042, GetStepIdList, "GetStepIdList"},
-    {0x00100102, GetNsDataIdList, "GetNsDataIdList"},
-    {0x00110102, GetOwnNsDataIdList, "GetOwnNsDataIdList"},
-    {0x00120102, GetNewDataNsDataIdList, "GetNewDataNsDataIdList"},
-    {0x00130102, GetOwnNewDataNsDataIdList, "GetOwnNewDataNsDataIdList"},
-    {0x00140082, SendProperty, "SendProperty"},
-    {0x00150042, SendPropertyHandle, "SendPropertyHandle"},
-    {0x00160082, ReceiveProperty, "ReceiveProperty"},
-    {0x00170082, UpdateTaskInterval, "UpdateTaskInterval"},
-    {0x00180082, UpdateTaskCount, "UpdateTaskCount"},
-    {0x00190042, GetTaskInterval, "GetTaskInterval"},
-    {0x001A0042, GetTaskCount, "GetTaskCount"},
-    {0x001B0042, GetTaskServiceStatus, "GetTaskServiceStatus"},
-    {0x001C0042, StartTask, "StartTask"},
-    {0x001D0042, StartTaskImmediate, "StartTaskImmediate"},
-    {0x001E0042, CancelTask, "CancelTask"},
-    {0x001F0000, GetTaskFinishHandle, "GetTaskFinishHandle"},
-    {0x00200082, GetTaskState, "GetTaskState"},
-    {0x00210042, GetTaskResult, "GetTaskResult"},
-    {0x00220042, GetTaskCommErrorCode, "GetTaskCommErrorCode"},
-    {0x002300C2, GetTaskStatus, "GetTaskStatus"},
-    {0x00240082, GetTaskError, "GetTaskError"},
-    {0x00250082, GetTaskInfo, "GetTaskInfo"},
-    {0x00260040, DeleteNsData, "DeleteNsData"},
-    {0x002700C2, GetNsDataHeaderInfo, "GetNsDataHeaderInfo"},
-    {0x00280102, ReadNsData, "ReadNsData"},
-    {0x00290080, SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"},
-    {0x002A0040, GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"},
-    {0x002B0080, SetNsDataNewFlag, "SetNsDataNewFlag"},
-    {0x002C0040, GetNsDataNewFlag, "GetNsDataNewFlag"},
-    {0x002D0040, GetNsDataLastUpdate, "GetNsDataLastUpdate"},
-    {0x002E0040, GetErrorCode, "GetErrorCode"},
-    {0x002F0140, RegisterStorageEntry, "RegisterStorageEntry"},
-    {0x00300000, GetStorageEntryInfo, "GetStorageEntryInfo"},
-    {0x00310100, SetStorageOption, "SetStorageOption"},
-    {0x00320000, GetStorageOption, "GetStorageOption"},
-    {0x00330042, StartBgImmediate, "StartBgImmediate"},
-    {0x00340042, GetTaskActivePriority, "GetTaskActivePriority"},
-    {0x003500C2, RegisterImmediateTask, "RegisterImmediateTask"},
-    {0x00360084, SetTaskQuery, "SetTaskQuery"},
-    {0x00370084, GetTaskQuery, "GetTaskQuery"},
-    // boss:p
-    {0x04010082, nullptr, "InitializeSessionPrivileged"},
-    {0x04040080, nullptr, "GetAppNewFlag"},
-    {0x040D0182, nullptr, "GetNsDataIdListPrivileged"},
-    {0x040E0182, nullptr, "GetNsDataIdListPrivileged1"},
-    {0x04130082, nullptr, "SendPropertyPrivileged"},
-    {0x041500C0, nullptr, "DeleteNsDataPrivileged"},
-    {0x04160142, nullptr, "GetNsDataHeaderInfoPrivileged"},
-    {0x04170182, nullptr, "ReadNsDataPrivileged"},
-    {0x041A0100, nullptr, "SetNsDataNewFlagPrivileged"},
-    {0x041B00C0, nullptr, "GetNsDataNewFlagPrivileged"},
-};
-
-BOSS_P_Interface::BOSS_P_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace BOSS
-} // namespace Service

+ 0 - 22
src/core/hle/service/boss/boss_p.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace BOSS {
-
-class BOSS_P_Interface : public Service::Interface {
-public:
-    BOSS_P_Interface();
-
-    std::string GetPortName() const override {
-        return "boss:P";
-    }
-};
-
-} // namespace BOSS
-} // namespace Service

+ 0 - 74
src/core/hle/service/boss/boss_u.cpp

@@ -1,74 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/boss/boss.h"
-#include "core/hle/service/boss/boss_u.h"
-
-namespace Service {
-namespace BOSS {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010082, InitializeSession, "InitializeSession"},
-    {0x00020100, RegisterStorage, "RegisterStorage"},
-    {0x00030000, UnregisterStorage, "UnregisterStorage"},
-    {0x00040000, GetStorageInfo, "GetStorageInfo"},
-    {0x00050042, RegisterPrivateRootCa, "RegisterPrivateRootCa"},
-    {0x00060084, RegisterPrivateClientCert, "RegisterPrivateClientCert"},
-    {0x00070000, GetNewArrivalFlag, "GetNewArrivalFlag"},
-    {0x00080002, RegisterNewArrivalEvent, "RegisterNewArrivalEvent"},
-    {0x00090040, SetOptoutFlag, "SetOptoutFlag"},
-    {0x000A0000, GetOptoutFlag, "GetOptoutFlag"},
-    {0x000B00C2, RegisterTask, "RegisterTask"},
-    {0x000C0082, UnregisterTask, "UnregisterTask"},
-    {0x000D0082, ReconfigureTask, "ReconfigureTask"},
-    {0x000E0000, GetTaskIdList, "GetTaskIdList"},
-    {0x000F0042, GetStepIdList, "GetStepIdList"},
-    {0x00100102, GetNsDataIdList, "GetNsDataIdList"},
-    {0x00110102, GetOwnNsDataIdList, "GetOwnNsDataIdList"},
-    {0x00120102, GetNewDataNsDataIdList, "GetNewDataNsDataIdList"},
-    {0x00130102, GetOwnNewDataNsDataIdList, "GetOwnNewDataNsDataIdList"},
-    {0x00140082, SendProperty, "SendProperty"},
-    {0x00150042, SendPropertyHandle, "SendPropertyHandle"},
-    {0x00160082, ReceiveProperty, "ReceiveProperty"},
-    {0x00170082, UpdateTaskInterval, "UpdateTaskInterval"},
-    {0x00180082, UpdateTaskCount, "UpdateTaskCount"},
-    {0x00190042, GetTaskInterval, "GetTaskInterval"},
-    {0x001A0042, GetTaskCount, "GetTaskCount"},
-    {0x001B0042, GetTaskServiceStatus, "GetTaskServiceStatus"},
-    {0x001C0042, StartTask, "StartTask"},
-    {0x001D0042, StartTaskImmediate, "StartTaskImmediate"},
-    {0x001E0042, CancelTask, "CancelTask"},
-    {0x001F0000, GetTaskFinishHandle, "GetTaskFinishHandle"},
-    {0x00200082, GetTaskState, "GetTaskState"},
-    {0x00210042, GetTaskResult, "GetTaskResult"},
-    {0x00220042, GetTaskCommErrorCode, "GetTaskCommErrorCode"},
-    {0x002300C2, GetTaskStatus, "GetTaskStatus"},
-    {0x00240082, GetTaskError, "GetTaskError"},
-    {0x00250082, GetTaskInfo, "GetTaskInfo"},
-    {0x00260040, DeleteNsData, "DeleteNsData"},
-    {0x002700C2, GetNsDataHeaderInfo, "GetNsDataHeaderInfo"},
-    {0x00280102, ReadNsData, "ReadNsData"},
-    {0x00290080, SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"},
-    {0x002A0040, GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"},
-    {0x002B0080, SetNsDataNewFlag, "SetNsDataNewFlag"},
-    {0x002C0040, GetNsDataNewFlag, "GetNsDataNewFlag"},
-    {0x002D0040, GetNsDataLastUpdate, "GetNsDataLastUpdate"},
-    {0x002E0040, GetErrorCode, "GetErrorCode"},
-    {0x002F0140, RegisterStorageEntry, "RegisterStorageEntry"},
-    {0x00300000, GetStorageEntryInfo, "GetStorageEntryInfo"},
-    {0x00310100, SetStorageOption, "SetStorageOption"},
-    {0x00320000, GetStorageOption, "GetStorageOption"},
-    {0x00330042, StartBgImmediate, "StartBgImmediate"},
-    {0x00340042, GetTaskActivePriority, "GetTaskActivePriority"},
-    {0x003500C2, RegisterImmediateTask, "RegisterImmediateTask"},
-    {0x00360084, SetTaskQuery, "SetTaskQuery"},
-    {0x00370084, GetTaskQuery, "GetTaskQuery"},
-};
-
-BOSS_U_Interface::BOSS_U_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace BOSS
-} // namespace Service

+ 0 - 22
src/core/hle/service/boss/boss_u.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace BOSS {
-
-class BOSS_U_Interface : public Service::Interface {
-public:
-    BOSS_U_Interface();
-
-    std::string GetPortName() const override {
-        return "boss:U";
-    }
-};
-
-} // namespace BOSS
-} // namespace Service

+ 0 - 1106
src/core/hle/service/cam/cam.cpp

@@ -1,1106 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <algorithm>
-#include <array>
-#include <future>
-#include <memory>
-#include <vector>
-#include "common/bit_set.h"
-#include "common/logging/log.h"
-#include "core/core_timing.h"
-#include "core/frontend/camera/factory.h"
-#include "core/hle/ipc.h"
-#include "core/hle/ipc_helpers.h"
-#include "core/hle/kernel/event.h"
-#include "core/hle/result.h"
-#include "core/hle/service/cam/cam.h"
-#include "core/hle/service/cam/cam_c.h"
-#include "core/hle/service/cam/cam_q.h"
-#include "core/hle/service/cam/cam_s.h"
-#include "core/hle/service/cam/cam_u.h"
-#include "core/hle/service/service.h"
-#include "core/memory.h"
-#include "core/settings.h"
-
-namespace Service {
-namespace CAM {
-
-namespace {
-
-struct ContextConfig {
-    Flip flip;
-    Effect effect;
-    OutputFormat format;
-    Resolution resolution;
-};
-
-struct CameraConfig {
-    std::unique_ptr<Camera::CameraInterface> impl;
-    std::array<ContextConfig, 2> contexts;
-    int current_context;
-    FrameRate frame_rate;
-};
-
-struct PortConfig {
-    int camera_id;
-
-    bool is_active;            // set when the port is activated by an Activate call.
-    bool is_pending_receiving; // set if SetReceiving is called when is_busy = false. When
-                               // StartCapture is called then, this will trigger a receiving
-                               // process and reset itself.
-    bool is_busy;      // set when StartCapture is called and reset when StopCapture is called.
-    bool is_receiving; // set when there is an ongoing receiving process.
-
-    bool is_trimming;
-    u16 x0; // x-coordinate of starting position for trimming
-    u16 y0; // y-coordinate of starting position for trimming
-    u16 x1; // x-coordinate of ending position for trimming
-    u16 y1; // y-coordinate of ending position for trimming
-
-    u16 transfer_bytes;
-
-    Kernel::SharedPtr<Kernel::Event> completion_event;
-    Kernel::SharedPtr<Kernel::Event> buffer_error_interrupt_event;
-    Kernel::SharedPtr<Kernel::Event> vsync_interrupt_event;
-
-    std::future<std::vector<u16>> capture_result; // will hold the received frame.
-    VAddr dest;                                   // the destination address of a receiving process
-    u32 dest_size;                                // the destination size of a receiving process
-
-    void Clear() {
-        completion_event->Clear();
-        buffer_error_interrupt_event->Clear();
-        vsync_interrupt_event->Clear();
-        is_receiving = false;
-        is_active = false;
-        is_pending_receiving = false;
-        is_busy = false;
-        is_trimming = false;
-        x0 = 0;
-        y0 = 0;
-        x1 = 0;
-        y1 = 0;
-        transfer_bytes = 256;
-    }
-};
-
-// built-in resolution parameters
-constexpr std::array<Resolution, 8> PRESET_RESOLUTION{{
-    {640, 480, 0, 0, 639, 479},  // VGA
-    {320, 240, 0, 0, 639, 479},  // QVGA
-    {160, 120, 0, 0, 639, 479},  // QQVGA
-    {352, 288, 26, 0, 613, 479}, // CIF
-    {176, 144, 26, 0, 613, 479}, // QCIF
-    {256, 192, 0, 0, 639, 479},  // DS_LCD
-    {512, 384, 0, 0, 639, 479},  // DS_LCDx4
-    {400, 240, 0, 48, 639, 431}, // CTR_TOP_LCD
-}};
-
-// latency in ms for each frame rate option
-constexpr std::array<int, 13> LATENCY_BY_FRAME_RATE{{
-    67,  // Rate_15
-    67,  // Rate_15_To_5
-    67,  // Rate_15_To_2
-    100, // Rate_10
-    118, // Rate_8_5
-    200, // Rate_5
-    50,  // Rate_20
-    50,  // Rate_20_To_5
-    33,  // Rate_30
-    33,  // Rate_30_To_5
-    67,  // Rate_15_To_10
-    50,  // Rate_20_To_10
-    33,  // Rate_30_To_10
-}};
-
-std::array<CameraConfig, NumCameras> cameras;
-std::array<PortConfig, 2> ports;
-int completion_event_callback;
-
-const ResultCode ERROR_INVALID_ENUM_VALUE(ErrorDescription::InvalidEnumValue, ErrorModule::CAM,
-                                          ErrorSummary::InvalidArgument, ErrorLevel::Usage);
-const ResultCode ERROR_OUT_OF_RANGE(ErrorDescription::OutOfRange, ErrorModule::CAM,
-                                    ErrorSummary::InvalidArgument, ErrorLevel::Usage);
-
-void CompletionEventCallBack(u64 port_id, int) {
-    PortConfig& port = ports[port_id];
-    const CameraConfig& camera = cameras[port.camera_id];
-    const auto buffer = port.capture_result.get();
-
-    if (port.is_trimming) {
-        u32 trim_width;
-        u32 trim_height;
-        const int original_width = camera.contexts[camera.current_context].resolution.width;
-        const int original_height = camera.contexts[camera.current_context].resolution.height;
-        if (port.x1 <= port.x0 || port.y1 <= port.y0 || port.x1 > original_width ||
-            port.y1 > original_height) {
-            LOG_ERROR(Service_CAM, "Invalid trimming coordinates x0=%u, y0=%u, x1=%u, y1=%u",
-                      port.x0, port.y0, port.x1, port.y1);
-            trim_width = 0;
-            trim_height = 0;
-        } else {
-            trim_width = port.x1 - port.x0;
-            trim_height = port.y1 - port.y0;
-        }
-
-        u32 trim_size = (port.x1 - port.x0) * (port.y1 - port.y0) * 2;
-        if (port.dest_size != trim_size) {
-            LOG_ERROR(Service_CAM, "The destination size (%u) doesn't match the source (%u)!",
-                      port.dest_size, trim_size);
-        }
-
-        const u32 src_offset = port.y0 * original_width + port.x0;
-        const u16* src_ptr = buffer.data() + src_offset;
-        // Note: src_size_left is int because it can be negative if the buffer size doesn't match.
-        int src_size_left = static_cast<int>((buffer.size() - src_offset) * sizeof(u16));
-        VAddr dest_ptr = port.dest;
-        // Note: dest_size_left and line_bytes are int to match the type of src_size_left.
-        int dest_size_left = static_cast<int>(port.dest_size);
-        const int line_bytes = static_cast<int>(trim_width * sizeof(u16));
-
-        for (u32 y = 0; y < trim_height; ++y) {
-            int copy_length = std::min({line_bytes, dest_size_left, src_size_left});
-            if (copy_length <= 0) {
-                break;
-            }
-            Memory::WriteBlock(dest_ptr, src_ptr, copy_length);
-            dest_ptr += copy_length;
-            dest_size_left -= copy_length;
-            src_ptr += original_width;
-            src_size_left -= original_width * sizeof(u16);
-        }
-    } else {
-        std::size_t buffer_size = buffer.size() * sizeof(u16);
-        if (port.dest_size != buffer_size) {
-            LOG_ERROR(Service_CAM, "The destination size (%u) doesn't match the source (%zu)!",
-                      port.dest_size, buffer_size);
-        }
-        Memory::WriteBlock(port.dest, buffer.data(), std::min<size_t>(port.dest_size, buffer_size));
-    }
-
-    port.is_receiving = false;
-    port.completion_event->Signal();
-}
-
-// Starts a receiving process on the specified port. This can only be called when is_busy = true and
-// is_receiving = false.
-void StartReceiving(int port_id) {
-    PortConfig& port = ports[port_id];
-    port.is_receiving = true;
-
-    // launches a capture task asynchronously
-    const CameraConfig& camera = cameras[port.camera_id];
-    port.capture_result =
-        std::async(std::launch::async, &Camera::CameraInterface::ReceiveFrame, camera.impl.get());
-
-    // schedules a completion event according to the frame rate. The event will block on the
-    // capture task if it is not finished within the expected time
-    CoreTiming::ScheduleEvent(
-        msToCycles(LATENCY_BY_FRAME_RATE[static_cast<int>(camera.frame_rate)]),
-        completion_event_callback, port_id);
-}
-
-// Cancels any ongoing receiving processes at the specified port. This is used by functions that
-// stop capturing.
-// TODO: what is the exact behaviour on real 3DS when stopping capture during an ongoing process?
-//       Will the completion event still be signaled?
-void CancelReceiving(int port_id) {
-    if (!ports[port_id].is_receiving)
-        return;
-    LOG_WARNING(Service_CAM, "tries to cancel an ongoing receiving process.");
-    CoreTiming::UnscheduleEvent(completion_event_callback, port_id);
-    ports[port_id].capture_result.wait();
-    ports[port_id].is_receiving = false;
-}
-
-// Activates the specified port with the specfied camera.
-static void ActivatePort(int port_id, int camera_id) {
-    if (ports[port_id].is_busy && ports[port_id].camera_id != camera_id) {
-        CancelReceiving(port_id);
-        cameras[ports[port_id].camera_id].impl->StopCapture();
-        ports[port_id].is_busy = false;
-    }
-    ports[port_id].is_active = true;
-    ports[port_id].camera_id = camera_id;
-}
-
-template <int max_index>
-class CommandParamBitSet : public BitSet8 {
-public:
-    explicit CommandParamBitSet(u8 command_param) : BitSet8(command_param) {}
-
-    bool IsValid() const {
-        return m_val < (1 << max_index);
-    }
-
-    bool IsSingle() const {
-        return IsValid() && Count() == 1;
-    }
-};
-
-using PortSet = CommandParamBitSet<2>;
-using ContextSet = CommandParamBitSet<2>;
-using CameraSet = CommandParamBitSet<3>;
-
-} // namespace
-
-void StartCapture(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x01, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    if (port_select.IsValid()) {
-        for (int i : port_select) {
-            if (!ports[i].is_busy) {
-                if (!ports[i].is_active) {
-                    // This doesn't return an error, but seems to put the camera in an undefined
-                    // state
-                    LOG_ERROR(Service_CAM, "port %u hasn't been activated", i);
-                } else {
-                    cameras[ports[i].camera_id].impl->StartCapture();
-                    ports[i].is_busy = true;
-                    if (ports[i].is_pending_receiving) {
-                        ports[i].is_pending_receiving = false;
-                        StartReceiving(i);
-                    }
-                }
-            } else {
-                LOG_WARNING(Service_CAM, "port %u already started", i);
-            }
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u", port_select.m_val);
-}
-
-void StopCapture(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x02, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    if (port_select.IsValid()) {
-        for (int i : port_select) {
-            if (ports[i].is_busy) {
-                CancelReceiving(i);
-                cameras[ports[i].camera_id].impl->StopCapture();
-                ports[i].is_busy = false;
-            } else {
-                LOG_WARNING(Service_CAM, "port %u already stopped", i);
-            }
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u", port_select.m_val);
-}
-
-void IsBusy(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x03, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-
-    if (port_select.IsValid()) {
-        bool is_busy = true;
-        // Note: the behaviour on no or both ports selected are verified against real 3DS.
-        for (int i : port_select) {
-            is_busy &= ports[i].is_busy;
-        }
-        rb.Push(RESULT_SUCCESS);
-        rb.Push(is_busy);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.Skip(1, false);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u", port_select.m_val);
-}
-
-void ClearBuffer(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x04, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS);
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called, port_select=%u", port_select.m_val);
-}
-
-void GetVsyncInterruptEvent(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x05, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
-    if (port_select.IsSingle()) {
-        int port = *port_select.begin();
-        rb.Push(RESULT_SUCCESS);
-        rb.PushCopyHandles(
-            Kernel::g_handle_table.Create(ports[port].vsync_interrupt_event).Unwrap());
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.PushCopyHandles(0);
-    }
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called, port_select=%u", port_select.m_val);
-}
-
-void GetBufferErrorInterruptEvent(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x06, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
-    if (port_select.IsSingle()) {
-        int port = *port_select.begin();
-        rb.Push(RESULT_SUCCESS);
-        rb.PushCopyHandles(
-            Kernel::g_handle_table.Create(ports[port].buffer_error_interrupt_event).Unwrap());
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.PushCopyHandles(0);
-    }
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called, port_select=%u", port_select.m_val);
-}
-
-void SetReceiving(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x07, 4, 2);
-    const VAddr dest = rp.Pop<u32>();
-    const PortSet port_select(rp.Pop<u8>());
-    const u32 image_size = rp.Pop<u32>();
-    const u16 trans_unit = rp.Pop<u16>();
-    rp.PopHandle(); // Handle to destination process. not used
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
-    if (port_select.IsSingle()) {
-        int port_id = *port_select.begin();
-        PortConfig& port = ports[port_id];
-        CancelReceiving(port_id);
-        port.completion_event->Clear();
-        port.dest = dest;
-        port.dest_size = image_size;
-
-        if (port.is_busy) {
-            StartReceiving(port_id);
-        } else {
-            port.is_pending_receiving = true;
-        }
-
-        rb.Push(RESULT_SUCCESS);
-        rb.PushCopyHandles(Kernel::g_handle_table.Create(port.completion_event).Unwrap());
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.PushCopyHandles(0);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, addr=0x%X, port_select=%u, image_size=%u, trans_unit=%u", dest,
-              port_select.m_val, image_size, trans_unit);
-}
-
-void IsFinishedReceiving(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x08, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    if (port_select.IsSingle()) {
-        int port = *port_select.begin();
-        bool is_busy = ports[port].is_receiving || ports[port].is_pending_receiving;
-        rb.Push(RESULT_SUCCESS);
-        rb.Push(!is_busy);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.Skip(1, false);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u", port_select.m_val);
-}
-
-void SetTransferLines(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x09, 4, 0);
-    const PortSet port_select(rp.Pop<u8>());
-    const u16 transfer_lines = rp.Pop<u16>();
-    const u16 width = rp.Pop<u16>();
-    const u16 height = rp.Pop<u16>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (port_select.IsValid()) {
-        for (int i : port_select) {
-            ports[i].transfer_bytes = transfer_lines * width * 2;
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called, port_select=%u, lines=%u, width=%u, height=%u",
-                port_select.m_val, transfer_lines, width, height);
-}
-
-void GetMaxLines(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x0A, 2, 0);
-    const u16 width = rp.Pop<u16>();
-    const u16 height = rp.Pop<u16>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-
-    // Note: the result of the algorithm below are hwtested with width < 640 and with height < 480
-    constexpr u32 MIN_TRANSFER_UNIT = 256;
-    constexpr u32 MAX_BUFFER_SIZE = 2560;
-    if (width * height * 2 % MIN_TRANSFER_UNIT != 0) {
-        rb.Push(ERROR_OUT_OF_RANGE);
-        rb.Skip(1, false);
-    } else {
-        u32 lines = MAX_BUFFER_SIZE / width;
-        if (lines > height) {
-            lines = height;
-        }
-        ResultCode result = RESULT_SUCCESS;
-        while (height % lines != 0 || (lines * width * 2 % MIN_TRANSFER_UNIT != 0)) {
-            --lines;
-            if (lines == 0) {
-                result = ERROR_OUT_OF_RANGE;
-                break;
-            }
-        }
-        rb.Push(result);
-        rb.Push(lines);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, width=%u, height=%u", width, height);
-}
-
-void SetTransferBytes(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x0B, 4, 0);
-    const PortSet port_select(rp.Pop<u8>());
-    const u16 transfer_bytes = rp.Pop<u16>();
-    const u16 width = rp.Pop<u16>();
-    const u16 height = rp.Pop<u16>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (port_select.IsValid()) {
-        for (int i : port_select) {
-            ports[i].transfer_bytes = transfer_bytes;
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_WARNING(Service_CAM, "(STUBBED)called, port_select=%u, bytes=%u, width=%u, height=%u",
-                port_select.m_val, transfer_bytes, width, height);
-}
-
-void GetTransferBytes(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x0C, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    if (port_select.IsSingle()) {
-        int port = *port_select.begin();
-        rb.Push(RESULT_SUCCESS);
-        rb.Push(ports[port].transfer_bytes);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.Skip(1, false);
-    }
-
-    LOG_WARNING(Service_CAM, "(STUBBED)called, port_select=%u", port_select.m_val);
-}
-
-void GetMaxBytes(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x0D, 2, 0);
-    const u16 width = rp.Pop<u16>();
-    const u16 height = rp.Pop<u16>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-
-    // Note: the result of the algorithm below are hwtested with width < 640 and with height < 480
-    constexpr u32 MIN_TRANSFER_UNIT = 256;
-    constexpr u32 MAX_BUFFER_SIZE = 2560;
-    if (width * height * 2 % MIN_TRANSFER_UNIT != 0) {
-        rb.Push(ERROR_OUT_OF_RANGE);
-        rb.Skip(1, false);
-    } else {
-        u32 bytes = MAX_BUFFER_SIZE;
-
-        while (width * height * 2 % bytes != 0) {
-            bytes -= MIN_TRANSFER_UNIT;
-        }
-
-        rb.Push(RESULT_SUCCESS);
-        rb.Push(bytes);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, width=%u, height=%u", width, height);
-}
-
-void SetTrimming(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x0E, 2, 0);
-    const PortSet port_select(rp.Pop<u8>());
-    const bool trim = rp.Pop<bool>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (port_select.IsValid()) {
-        for (int i : port_select) {
-            ports[i].is_trimming = trim;
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u, trim=%d", port_select.m_val, trim);
-}
-
-void IsTrimming(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x0F, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    if (port_select.IsSingle()) {
-        int port = *port_select.begin();
-        rb.Push(RESULT_SUCCESS);
-        rb.Push(ports[port].is_trimming);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.Skip(1, false);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u", port_select.m_val);
-}
-
-void SetTrimmingParams(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x10, 5, 0);
-    const PortSet port_select(rp.Pop<u8>());
-    const u16 x0 = rp.Pop<u16>();
-    const u16 y0 = rp.Pop<u16>();
-    const u16 x1 = rp.Pop<u16>();
-    const u16 y1 = rp.Pop<u16>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (port_select.IsValid()) {
-        for (int i : port_select) {
-            ports[i].x0 = x0;
-            ports[i].y0 = y0;
-            ports[i].x1 = x1;
-            ports[i].y1 = y1;
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u, x0=%u, y0=%u, x1=%u, y1=%u", port_select.m_val,
-              x0, y0, x1, y1);
-}
-
-void GetTrimmingParams(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x11, 1, 0);
-    const PortSet port_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(5, 0);
-    if (port_select.IsSingle()) {
-        int port = *port_select.begin();
-        rb.Push(RESULT_SUCCESS);
-        rb.Push(ports[port].x0);
-        rb.Push(ports[port].y0);
-        rb.Push(ports[port].x1);
-        rb.Push(ports[port].y1);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-        rb.Skip(4, false);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u", port_select.m_val);
-}
-
-void SetTrimmingParamsCenter(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x12, 5, 0);
-    const PortSet port_select(rp.Pop<u8>());
-    const u16 trim_w = rp.Pop<u16>();
-    const u16 trim_h = rp.Pop<u16>();
-    const u16 cam_w = rp.Pop<u16>();
-    const u16 cam_h = rp.Pop<u16>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (port_select.IsValid()) {
-        for (int i : port_select) {
-            ports[i].x0 = (cam_w - trim_w) / 2;
-            ports[i].y0 = (cam_h - trim_h) / 2;
-            ports[i].x1 = ports[i].x0 + trim_w;
-            ports[i].y1 = ports[i].y0 + trim_h;
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid port_select=%u", port_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, port_select=%u, trim_w=%u, trim_h=%u, cam_w=%u, cam_h=%u",
-              port_select.m_val, trim_w, trim_h, cam_w, cam_h);
-}
-
-void Activate(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x13, 1, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid()) {
-        if (camera_select.m_val == 0) { // deactive all
-            for (int i = 0; i < 2; ++i) {
-                if (ports[i].is_busy) {
-                    CancelReceiving(i);
-                    cameras[ports[i].camera_id].impl->StopCapture();
-                    ports[i].is_busy = false;
-                }
-                ports[i].is_active = false;
-            }
-            rb.Push(RESULT_SUCCESS);
-        } else if (camera_select[0] && camera_select[1]) {
-            LOG_ERROR(Service_CAM, "camera 0 and 1 can't be both activated");
-            rb.Push(ERROR_INVALID_ENUM_VALUE);
-        } else {
-            if (camera_select[0]) {
-                ActivatePort(0, 0);
-            } else if (camera_select[1]) {
-                ActivatePort(0, 1);
-            }
-
-            if (camera_select[2]) {
-                ActivatePort(1, 2);
-            }
-            rb.Push(RESULT_SUCCESS);
-        }
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u", camera_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, camera_select=%u", camera_select.m_val);
-}
-
-void SwitchContext(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x14, 2, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-    const ContextSet context_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid() && context_select.IsSingle()) {
-        int context = *context_select.begin();
-        for (int camera : camera_select) {
-            cameras[camera].current_context = context;
-            const ContextConfig& context_config = cameras[camera].contexts[context];
-            cameras[camera].impl->SetFlip(context_config.flip);
-            cameras[camera].impl->SetEffect(context_config.effect);
-            cameras[camera].impl->SetFormat(context_config.format);
-            cameras[camera].impl->SetResolution(context_config.resolution);
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u, context_select=%u", camera_select.m_val,
-                  context_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, camera_select=%u, context_select=%u", camera_select.m_val,
-              context_select.m_val);
-}
-
-void FlipImage(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1D, 3, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-    const Flip flip = static_cast<Flip>(rp.Pop<u8>());
-    const ContextSet context_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid() && context_select.IsValid()) {
-        for (int camera : camera_select) {
-            for (int context : context_select) {
-                cameras[camera].contexts[context].flip = flip;
-                if (cameras[camera].current_context == context) {
-                    cameras[camera].impl->SetFlip(flip);
-                }
-            }
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u, context_select=%u", camera_select.m_val,
-                  context_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, camera_select=%u, flip=%d, context_select=%u",
-              camera_select.m_val, static_cast<int>(flip), context_select.m_val);
-}
-
-void SetDetailSize(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1E, 8, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-    Resolution resolution;
-    resolution.width = rp.Pop<u16>();
-    resolution.height = rp.Pop<u16>();
-    resolution.crop_x0 = rp.Pop<u16>();
-    resolution.crop_y0 = rp.Pop<u16>();
-    resolution.crop_x1 = rp.Pop<u16>();
-    resolution.crop_y1 = rp.Pop<u16>();
-    const ContextSet context_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid() && context_select.IsValid()) {
-        for (int camera : camera_select) {
-            for (int context : context_select) {
-                cameras[camera].contexts[context].resolution = resolution;
-                if (cameras[camera].current_context == context) {
-                    cameras[camera].impl->SetResolution(resolution);
-                }
-            }
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u, context_select=%u", camera_select.m_val,
-                  context_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, camera_select=%u, width=%u, height=%u, crop_x0=%u, crop_y0=%u, "
-                           "crop_x1=%u, crop_y1=%u, context_select=%u",
-              camera_select.m_val, resolution.width, resolution.height, resolution.crop_x0,
-              resolution.crop_y0, resolution.crop_x1, resolution.crop_y1, context_select.m_val);
-}
-
-void SetSize(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1F, 3, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-    const u8 size = rp.Pop<u8>();
-    const ContextSet context_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid() && context_select.IsValid()) {
-        for (int camera : camera_select) {
-            for (int context : context_select) {
-                cameras[camera].contexts[context].resolution = PRESET_RESOLUTION[size];
-                if (cameras[camera].current_context == context) {
-                    cameras[camera].impl->SetResolution(PRESET_RESOLUTION[size]);
-                }
-            }
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u, context_select=%u", camera_select.m_val,
-                  context_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, camera_select=%u, size=%u, context_select=%u",
-              camera_select.m_val, size, context_select.m_val);
-}
-
-void SetFrameRate(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x20, 2, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-    const FrameRate frame_rate = static_cast<FrameRate>(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid()) {
-        for (int camera : camera_select) {
-            cameras[camera].frame_rate = frame_rate;
-            // TODO(wwylele): consider hinting the actual camera with the expected frame rate
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u", camera_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called, camera_select=%u, frame_rate=%d",
-                camera_select.m_val, static_cast<int>(frame_rate));
-}
-
-void SetEffect(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x22, 3, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-    const Effect effect = static_cast<Effect>(rp.Pop<u8>());
-    const ContextSet context_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid() && context_select.IsValid()) {
-        for (int camera : camera_select) {
-            for (int context : context_select) {
-                cameras[camera].contexts[context].effect = effect;
-                if (cameras[camera].current_context == context) {
-                    cameras[camera].impl->SetEffect(effect);
-                }
-            }
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u, context_select=%u", camera_select.m_val,
-                  context_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, camera_select=%u, effect=%d, context_select=%u",
-              camera_select.m_val, static_cast<int>(effect), context_select.m_val);
-}
-
-void SetOutputFormat(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x25, 3, 0);
-    const CameraSet camera_select(rp.Pop<u8>());
-    const OutputFormat format = static_cast<OutputFormat>(rp.Pop<u8>());
-    const ContextSet context_select(rp.Pop<u8>());
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    if (camera_select.IsValid() && context_select.IsValid()) {
-        for (int camera : camera_select) {
-            for (int context : context_select) {
-                cameras[camera].contexts[context].format = format;
-                if (cameras[camera].current_context == context) {
-                    cameras[camera].impl->SetFormat(format);
-                }
-            }
-        }
-        rb.Push(RESULT_SUCCESS);
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u, context_select=%u", camera_select.m_val,
-                  context_select.m_val);
-        rb.Push(ERROR_INVALID_ENUM_VALUE);
-    }
-
-    LOG_DEBUG(Service_CAM, "called, camera_select=%u, format=%d, context_select=%u",
-              camera_select.m_val, static_cast<int>(format), context_select.m_val);
-}
-
-void SynchronizeVsyncTiming(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x29, 2, 0);
-    const u8 camera_select1 = rp.Pop<u8>();
-    const u8 camera_select2 = rp.Pop<u8>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS);
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called, camera_select1=%u, camera_select2=%u",
-                camera_select1, camera_select2);
-}
-
-void GetStereoCameraCalibrationData(Service::Interface* self) {
-    IPC::RequestBuilder rb =
-        IPC::RequestParser(Kernel::GetCommandBuffer(), 0x2B, 0, 0).MakeBuilder(17, 0);
-
-    // Default values taken from yuriks' 3DS. Valid data is required here or games using the
-    // calibration get stuck in an infinite CPU loop.
-    StereoCameraCalibrationData data = {};
-    data.isValidRotationXY = 0;
-    data.scale = 1.001776f;
-    data.rotationZ = 0.008322907f;
-    data.translationX = -87.70484f;
-    data.translationY = -7.640977f;
-    data.rotationX = 0.0f;
-    data.rotationY = 0.0f;
-    data.angleOfViewRight = 64.66875f;
-    data.angleOfViewLeft = 64.76067f;
-    data.distanceToChart = 250.0f;
-    data.distanceCameras = 35.0f;
-    data.imageWidth = 640;
-    data.imageHeight = 480;
-
-    rb.Push(RESULT_SUCCESS);
-    rb.PushRaw(data);
-
-    LOG_TRACE(Service_CAM, "called");
-}
-
-void SetPackageParameterWithoutContext(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x33, 11, 0);
-
-    PackageParameterWithoutContext package;
-    rp.PopRaw(package);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS);
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called");
-}
-
-template <typename PackageParameterType>
-static ResultCode SetPackageParameter(const PackageParameterType& package) {
-    const CameraSet camera_select(package.camera_select);
-    const ContextSet context_select(package.context_select);
-
-    if (camera_select.IsValid() && context_select.IsValid()) {
-        for (int camera_id : camera_select) {
-            CameraConfig& camera = cameras[camera_id];
-            for (int context_id : context_select) {
-                ContextConfig& context = camera.contexts[context_id];
-                context.effect = package.effect;
-                context.flip = package.flip;
-                context.resolution = package.GetResolution();
-                if (context_id == camera.current_context) {
-                    camera.impl->SetEffect(context.effect);
-                    camera.impl->SetFlip(context.flip);
-                    camera.impl->SetResolution(context.resolution);
-                }
-            }
-        }
-        return RESULT_SUCCESS;
-    } else {
-        LOG_ERROR(Service_CAM, "invalid camera_select=%u, context_select=%u", package.camera_select,
-                  package.context_select);
-        return ERROR_INVALID_ENUM_VALUE;
-    }
-}
-
-Resolution PackageParameterWithContext::GetResolution() const {
-    return PRESET_RESOLUTION[static_cast<int>(size)];
-}
-
-void SetPackageParameterWithContext(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x34, 5, 0);
-
-    PackageParameterWithContext package;
-    rp.PopRaw(package);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    ResultCode result = SetPackageParameter(package);
-    rb.Push(result);
-
-    LOG_DEBUG(Service_CAM, "called");
-}
-
-void SetPackageParameterWithContextDetail(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x35, 7, 0);
-
-    PackageParameterWithContextDetail package;
-    rp.PopRaw(package);
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    ResultCode result = SetPackageParameter(package);
-    rb.Push(result);
-
-    LOG_DEBUG(Service_CAM, "called");
-}
-
-void GetSuitableY2rStandardCoefficient(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x36, 0, 0);
-    IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
-    rb.Push(RESULT_SUCCESS);
-    rb.Push<u32>(0);
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called");
-}
-
-void PlayShutterSound(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x38, 1, 0);
-    u8 sound_id = rp.Pop<u8>();
-
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-    rb.Push(RESULT_SUCCESS);
-
-    LOG_WARNING(Service_CAM, "(STUBBED) called, sound_id=%d", sound_id);
-}
-
-void DriverInitialize(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x39, 0, 0);
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    for (int camera_id = 0; camera_id < NumCameras; ++camera_id) {
-        CameraConfig& camera = cameras[camera_id];
-        camera.current_context = 0;
-        for (int context_id = 0; context_id < 2; ++context_id) {
-            // Note: the following default values are verified against real 3DS
-            ContextConfig& context = camera.contexts[context_id];
-            context.flip = camera_id == 1 ? Flip::Horizontal : Flip::None;
-            context.effect = Effect::None;
-            context.format = OutputFormat::YUV422;
-            context.resolution =
-                context_id == 0 ? PRESET_RESOLUTION[5 /*DS_LCD*/] : PRESET_RESOLUTION[0 /*VGA*/];
-        }
-        camera.impl = Camera::CreateCamera(Settings::values.camera_name[camera_id],
-                                           Settings::values.camera_config[camera_id]);
-        camera.impl->SetFlip(camera.contexts[0].flip);
-        camera.impl->SetEffect(camera.contexts[0].effect);
-        camera.impl->SetFormat(camera.contexts[0].format);
-        camera.impl->SetResolution(camera.contexts[0].resolution);
-    }
-
-    for (PortConfig& port : ports) {
-        port.Clear();
-    }
-
-    rb.Push(RESULT_SUCCESS);
-
-    LOG_DEBUG(Service_CAM, "called");
-}
-
-void DriverFinalize(Service::Interface* self) {
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x3A, 0, 0);
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
-
-    CancelReceiving(0);
-    CancelReceiving(1);
-
-    for (CameraConfig& camera : cameras) {
-        camera.impl = nullptr;
-    }
-
-    rb.Push(RESULT_SUCCESS);
-
-    LOG_DEBUG(Service_CAM, "called");
-}
-
-void Init() {
-    using namespace Kernel;
-
-    AddService(new CAM_C_Interface);
-    AddService(new CAM_Q_Interface);
-    AddService(new CAM_S_Interface);
-    AddService(new CAM_U_Interface);
-
-    for (PortConfig& port : ports) {
-        port.completion_event = Event::Create(ResetType::Sticky, "CAM_U::completion_event");
-        port.buffer_error_interrupt_event =
-            Event::Create(ResetType::OneShot, "CAM_U::buffer_error_interrupt_event");
-        port.vsync_interrupt_event =
-            Event::Create(ResetType::OneShot, "CAM_U::vsync_interrupt_event");
-    }
-    completion_event_callback =
-        CoreTiming::RegisterEvent("CAM_U::CompletionEventCallBack", CompletionEventCallBack);
-}
-
-void Shutdown() {
-    CancelReceiving(0);
-    CancelReceiving(1);
-    for (PortConfig& port : ports) {
-        port.completion_event = nullptr;
-        port.buffer_error_interrupt_event = nullptr;
-        port.vsync_interrupt_event = nullptr;
-    }
-    for (CameraConfig& camera : cameras) {
-        camera.impl = nullptr;
-    }
-}
-
-} // namespace CAM
-
-} // namespace Service

+ 0 - 686
src/core/hle/service/cam/cam.h

@@ -1,686 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "common/common_funcs.h"
-#include "common/common_types.h"
-#include "common/swap.h"
-#include "core/hle/kernel/kernel.h"
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CAM {
-
-enum CameraIndex {
-    OuterRightCamera = 0,
-    InnerCamera = 1,
-    OuterLeftCamera = 2,
-
-    NumCameras = 3,
-};
-
-enum class Effect : u8 {
-    None = 0,
-    Mono = 1,
-    Sepia = 2,
-    Negative = 3,
-    Negafilm = 4,
-    Sepia01 = 5,
-};
-
-enum class Flip : u8 {
-    None = 0,
-    Horizontal = 1,
-    Vertical = 2,
-    Reverse = 3,
-};
-
-enum class Size : u8 {
-    VGA = 0,
-    QVGA = 1,
-    QQVGA = 2,
-    CIF = 3,
-    QCIF = 4,
-    DS_LCD = 5,
-    DS_LCDx4 = 6,
-    CTR_TOP_LCD = 7,
-    CTR_BOTTOM_LCD = QVGA,
-};
-
-enum class FrameRate : u8 {
-    Rate_15 = 0,
-    Rate_15_To_5 = 1,
-    Rate_15_To_2 = 2,
-    Rate_10 = 3,
-    Rate_8_5 = 4,
-    Rate_5 = 5,
-    Rate_20 = 6,
-    Rate_20_To_5 = 7,
-    Rate_30 = 8,
-    Rate_30_To_5 = 9,
-    Rate_15_To_10 = 10,
-    Rate_20_To_10 = 11,
-    Rate_30_To_10 = 12,
-};
-
-enum class ShutterSoundType : u8 {
-    Normal = 0,
-    Movie = 1,
-    MovieEnd = 2,
-};
-
-enum class WhiteBalance : u8 {
-    BalanceAuto = 0,
-    Balance3200K = 1,
-    Balance4150K = 2,
-    Balance5200K = 3,
-    Balance6000K = 4,
-    Balance7000K = 5,
-    BalanceMax = 6,
-    BalanceNormal = BalanceAuto,
-    BalanceTungsten = Balance3200K,
-    BalanceWhiteFluorescentLight = Balance4150K,
-    BalanceDaylight = Balance5200K,
-    BalanceCloudy = Balance6000K,
-    BalanceHorizon = Balance6000K,
-    BalanceShade = Balance7000K,
-};
-
-enum class PhotoMode : u8 {
-    Normal = 0,
-    Portrait = 1,
-    Landscape = 2,
-    Nightview = 3,
-    Letter0 = 4,
-};
-
-enum class LensCorrection : u8 {
-    Off = 0,
-    On70 = 1,
-    On90 = 2,
-    Dark = Off,
-    Normal = On70,
-    Bright = On90,
-};
-
-enum class Contrast : u8 {
-    Pattern01 = 1,
-    Pattern02 = 2,
-    Pattern03 = 3,
-    Pattern04 = 4,
-    Pattern05 = 5,
-    Pattern06 = 6,
-    Pattern07 = 7,
-    Pattern08 = 8,
-    Pattern09 = 9,
-    Pattern10 = 10,
-    Pattern11 = 11,
-    Low = Pattern05,
-    Normal = Pattern06,
-    High = Pattern07,
-};
-
-enum class OutputFormat : u8 {
-    YUV422 = 0,
-    RGB565 = 1,
-};
-
-/// Stereo camera calibration data.
-struct StereoCameraCalibrationData {
-    u8 isValidRotationXY; ///< Bool indicating whether the X and Y rotation data is valid.
-    INSERT_PADDING_BYTES(3);
-    float_le scale;        ///< Scale to match the left camera image with the right.
-    float_le rotationZ;    ///< Z axis rotation to match the left camera image with the right.
-    float_le translationX; ///< X axis translation to match the left camera image with the right.
-    float_le translationY; ///< Y axis translation to match the left camera image with the right.
-    float_le rotationX;    ///< X axis rotation to match the left camera image with the right.
-    float_le rotationY;    ///< Y axis rotation to match the left camera image with the right.
-    float_le angleOfViewRight; ///< Right camera angle of view.
-    float_le angleOfViewLeft;  ///< Left camera angle of view.
-    float_le distanceToChart;  ///< Distance between cameras and measurement chart.
-    float_le distanceCameras;  ///< Distance between left and right cameras.
-    s16_le imageWidth;         ///< Image width.
-    s16_le imageHeight;        ///< Image height.
-    INSERT_PADDING_BYTES(16);
-};
-static_assert(sizeof(StereoCameraCalibrationData) == 64,
-              "StereoCameraCalibrationData structure size is wrong");
-
-/**
- * Resolution parameters for the camera.
- * The native resolution of 3DS camera is 640 * 480. The captured image will be cropped in the
- * region [crop_x0, crop_x1] * [crop_y0, crop_y1], and then scaled to size width * height as the
- * output image. Note that all cropping coordinates are inclusive.
- */
-struct Resolution {
-    u16 width;
-    u16 height;
-    u16 crop_x0;
-    u16 crop_y0;
-    u16 crop_x1;
-    u16 crop_y1;
-};
-
-struct PackageParameterWithoutContext {
-    u8 camera_select;
-    s8 exposure;
-    WhiteBalance white_balance;
-    s8 sharpness;
-    bool auto_exposure;
-    bool auto_white_balance;
-    FrameRate frame_rate;
-    PhotoMode photo_mode;
-    Contrast contrast;
-    LensCorrection lens_correction;
-    bool noise_filter;
-    u8 padding;
-    s16 auto_exposure_window_x;
-    s16 auto_exposure_window_y;
-    s16 auto_exposure_window_width;
-    s16 auto_exposure_window_height;
-    s16 auto_white_balance_window_x;
-    s16 auto_white_balance_window_y;
-    s16 auto_white_balance_window_width;
-    s16 auto_white_balance_window_height;
-    INSERT_PADDING_WORDS(4);
-};
-
-static_assert(sizeof(PackageParameterWithoutContext) == 44,
-              "PackageParameterCameraWithoutContext structure size is wrong");
-
-struct PackageParameterWithContext {
-    u8 camera_select;
-    u8 context_select;
-    Flip flip;
-    Effect effect;
-    Size size;
-    INSERT_PADDING_BYTES(3);
-    INSERT_PADDING_WORDS(3);
-
-    Resolution GetResolution() const;
-};
-
-static_assert(sizeof(PackageParameterWithContext) == 20,
-              "PackageParameterWithContext structure size is wrong");
-
-struct PackageParameterWithContextDetail {
-    u8 camera_select;
-    u8 context_select;
-    Flip flip;
-    Effect effect;
-    Resolution resolution;
-    INSERT_PADDING_WORDS(3);
-
-    Resolution GetResolution() const {
-        return resolution;
-    }
-};
-
-static_assert(sizeof(PackageParameterWithContextDetail) == 28,
-              "PackageParameterWithContextDetail structure size is wrong");
-
-/**
- * Starts capturing at the selected port.
- *  Inputs:
- *      0: 0x00010040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x00010040
- *      1: ResultCode
- */
-void StartCapture(Service::Interface* self);
-
-/**
- * Stops capturing from the selected port.
- *  Inputs:
- *      0: 0x00020040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x00020040
- *      1: ResultCode
- */
-void StopCapture(Service::Interface* self);
-
-/**
- * Gets whether the selected port is currently capturing.
- *  Inputs:
- *      0: 0x00030040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x00030080
- *      1: ResultCode
- *      2: 0 if not capturing, 1 if capturing
- */
-void IsBusy(Service::Interface* self);
-
-/**
- * Clears the buffer of selected ports.
- *  Inputs:
- *      0: 0x00040040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x00040040
- *      2: ResultCode
- */
-void ClearBuffer(Service::Interface* self);
-
-/**
- * Unknown
- *  Inputs:
- *      0: 0x00050040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x00050042
- *      1: ResultCode
- *      2: Descriptor: Handle
- *      3: Event handle
- */
-void GetVsyncInterruptEvent(Service::Interface* self);
-
-/**
- * Unknown
- *  Inputs:
- *      0: 0x00060040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x00060042
- *      1: ResultCode
- *      2: Descriptor: Handle
- *      3: Event handle
- */
-void GetBufferErrorInterruptEvent(Service::Interface* self);
-
-/**
- * Sets the target buffer to receive a frame of image data and starts the transfer. Each camera
- * port has its own event to signal the end of the transfer.
- *
- *  Inputs:
- *      0: 0x00070102
- *      1: Destination address in calling process
- *      2: u8 selected port
- *      3: Image size (in bytes)
- *      4: u16 Transfer unit size (in bytes)
- *      5: Descriptor: Handle
- *      6: Handle to destination process
- *  Outputs:
- *      0: 0x00070042
- *      1: ResultCode
- *      2: Descriptor: Handle
- *      3: Handle to event signalled when transfer finishes
- */
-void SetReceiving(Service::Interface* self);
-
-/**
- * Gets whether the selected port finished receiving a frame.
- *  Inputs:
- *      0: 0x00080040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x00080080
- *      1: ResultCode
- *      2: 0 if not finished, 1 if finished
- */
-void IsFinishedReceiving(Service::Interface* self);
-
-/**
- * Sets the number of lines the buffer contains.
- *  Inputs:
- *      0: 0x00090100
- *      1: u8 selected port
- *      2: u16 Number of lines to transfer
- *      3: u16 Width
- *      4: u16 Height
- *  Outputs:
- *      0: 0x00090040
- *      1: ResultCode
- * @todo figure out how the "buffer" actually works.
- */
-void SetTransferLines(Service::Interface* self);
-
-/**
- * Gets the maximum number of lines that fit in the buffer
- *  Inputs:
- *      0: 0x000A0080
- *      1: u16 Width
- *      2: u16 Height
- *  Outputs:
- *      0: 0x000A0080
- *      1: ResultCode
- *      2: Maximum number of lines that fit in the buffer
- * @todo figure out how the "buffer" actually works.
- */
-void GetMaxLines(Service::Interface* self);
-
-/**
- * Sets the number of bytes the buffer contains.
- *  Inputs:
- *      0: 0x000B0100
- *      1: u8 selected port
- *      2: u16 Number of bytes to transfer
- *      3: u16 Width
- *      4: u16 Height
- *  Outputs:
- *      0: 0x000B0040
- *      1: ResultCode
- * @todo figure out how the "buffer" actually works.
- */
-void SetTransferBytes(Service::Interface* self);
-
-/**
- * Gets the number of bytes to the buffer contains.
- *  Inputs:
- *      0: 0x000C0040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x000C0080
- *      1: ResultCode
- *      2: The number of bytes the buffer contains
- * @todo figure out how the "buffer" actually works.
- */
-void GetTransferBytes(Service::Interface* self);
-
-/**
- * Gets the maximum number of bytes that fit in the buffer.
- *  Inputs:
- *      0: 0x000D0080
- *      1: u16 Width
- *      2: u16 Height
- *  Outputs:
- *      0: 0x000D0080
- *      1: ResultCode
- *      2: Maximum number of bytes that fit in the buffer
- * @todo figure out how the "buffer" actually works.
- */
-void GetMaxBytes(Service::Interface* self);
-
-/**
- * Enables or disables trimming.
- *  Inputs:
- *      0: 0x000E0080
- *      1: u8 selected port
- *      2: u8 bool Enable trimming if true
- *  Outputs:
- *      0: 0x000E0040
- *      1: ResultCode
- */
-void SetTrimming(Service::Interface* self);
-
-/**
- * Gets whether trimming is enabled.
- *  Inputs:
- *      0: 0x000F0040
- *      1: u8 selected port
- *  Outputs:
- *      0: 0x000F0080
- *      1: ResultCode
- *      2: u8 bool Enable trimming if true
- */
-void IsTrimming(Service::Interface* self);
-
-/**
- * Sets the position to trim.
- *  Inputs:
- *      0: 0x00100140
- *      1: u8 selected port
- *      2: x start
- *      3: y start
- *      4: x end (exclusive)
- *      5: y end (exclusive)
- *  Outputs:
- *      0: 0x00100040
- *      1: ResultCode
- */
-void SetTrimmingParams(Service::Interface* self);
-
-/**
- * Gets the position to trim.
- *  Inputs:
- *      0: 0x00110040
- *      1: u8 selected port
- *
- *  Outputs:
- *      0: 0x00110140
- *      1: ResultCode
- *      2: x start
- *      3: y start
- *      4: x end (exclusive)
- *      5: y end (exclusive)
- */
-void GetTrimmingParams(Service::Interface* self);
-
-/**
- * Sets the position to trim by giving the width and height. The trimming window is always at the
- * center.
- *  Inputs:
- *      0: 0x00120140
- *      1: u8 selected port
- *      2: s16 Trim width
- *      3: s16 Trim height
- *      4: s16 Camera width
- *      5: s16 Camera height
- *  Outputs:
- *      0: 0x00120040
- *      1: ResultCode
- */
-void SetTrimmingParamsCenter(Service::Interface* self);
-
-/**
- * Selects up to two physical cameras to enable.
- *  Inputs:
- *      0: 0x00130040
- *      1: u8 selected camera
- *  Outputs:
- *      0: 0x00130040
- *      1: ResultCode
- */
-void Activate(Service::Interface* self);
-
-/**
- * Switches the context of camera settings.
- *  Inputs:
- *      0: 0x00140080
- *      1: u8 selected camera
- *      2: u8 selected context
- *  Outputs:
- *      0: 0x00140040
- *      1: ResultCode
- */
-void SwitchContext(Service::Interface* self);
-
-/**
- * Sets flipping of images
- *  Inputs:
- *      0: 0x001D00C0
- *      1: u8 selected camera
- *      2: u8 Type of flipping to perform (`Flip` enum)
- *      3: u8 selected context
- *  Outputs:
- *      0: 0x001D0040
- *      1: ResultCode
- */
-void FlipImage(Service::Interface* self);
-
-/**
- * Sets camera resolution from custom parameters. For more details see the Resolution struct.
- *  Inputs:
- *      0: 0x001E0200
- *      1: u8 selected camera
- *      2: width
- *      3: height
- *      4: crop x0
- *      5: crop y0
- *      6: crop x1
- *      7: crop y1
- *      8: u8 selected context
- *  Outputs:
- *      0: 0x001E0040
- *      1: ResultCode
- */
-void SetDetailSize(Service::Interface* self);
-
-/**
- * Sets camera resolution from preset resolution parameters.
- *  Inputs:
- *      0: 0x001F00C0
- *      1: u8 selected camera
- *      2: u8 Camera frame resolution (`Size` enum)
- *      3: u8 selected context
- *  Outputs:
- *      0: 0x001F0040
- *      1: ResultCode
- */
-void SetSize(Service::Interface* self);
-
-/**
- * Sets camera framerate.
- *  Inputs:
- *      0: 0x00200080
- *      1: u8 selected camera
- *      2: u8 Camera framerate (`FrameRate` enum)
- *  Outputs:
- *      0: 0x00200040
- *      1: ResultCode
- */
-void SetFrameRate(Service::Interface* self);
-
-/**
- * Sets effect on the output image
- *  Inputs:
- *      0: 0x002200C0
- *      1: u8 selected camera
- *      2: u8 image effect (`Effect` enum)
- *      3: u8 selected context
- *  Outputs:
- *      0: 0x00220040
- *      1: ResultCode
- */
-void SetEffect(Service::Interface* self);
-
-/**
- * Sets format of the output image
- *  Inputs:
- *      0: 0x002500C0
- *      1: u8 selected camera
- *      2: u8 image format (`OutputFormat` enum)
- *      3: u8 selected context
- *  Outputs:
- *      0: 0x00250040
- *      1: ResultCode
- */
-void SetOutputFormat(Service::Interface* self);
-
-/**
- * Synchronizes the V-Sync timing of two cameras.
- *  Inputs:
- *      0: 0x00290080
- *      1: u8 selected camera 1
- *      2: u8 selected camera 2
- *  Outputs:
- *      0: 0x00280040
- *      1: ResultCode
- */
-void SynchronizeVsyncTiming(Service::Interface* self);
-
-/**
- * Returns calibration data relating the outside cameras to eachother, for use in AR applications.
- *
- *  Inputs:
- *      0: 0x002B0000
- *  Outputs:
- *      0: 0x002B0440
- *      1: ResultCode
- *      2-17: `StereoCameraCalibrationData` structure with calibration values
- */
-void GetStereoCameraCalibrationData(Service::Interface* self);
-
-/**
- * Batch-configures context-free settings.
- *
- *  Inputs:
- *      0: 0x003302C0
- *      1-7: struct PachageParameterWithoutContext
- *      8-11: unused
- *  Outputs:
- *      0: 0x00330040
- *      1: ResultCode
- */
-void SetPackageParameterWithoutContext(Service::Interface* self);
-
-/**
- * Batch-configures context-related settings with preset resolution parameters.
- *
- *  Inputs:
- *      0: 0x00340140
- *      1-2: struct PackageParameterWithContext
- *      3-5: unused
- *  Outputs:
- *      0: 0x00340040
- *      1: ResultCode
- */
-void SetPackageParameterWithContext(Service::Interface* self);
-
-/**
- * Batch-configures context-related settings with custom resolution parameters
- *
- *  Inputs:
- *      0: 0x003501C0
- *      1-4: struct PackageParameterWithContextDetail
- *      5-7: unused
- *  Outputs:
- *      0: 0x00350040
- *      1: ResultCode
- */
-void SetPackageParameterWithContextDetail(Service::Interface* self);
-
-/**
- * Unknown
- *  Inputs:
- *      0: 0x00360000
- *  Outputs:
- *      0: 0x00360080
- *      1: ResultCode
- *      2: ?
- */
-void GetSuitableY2rStandardCoefficient(Service::Interface* self);
-
-/**
- * Unknown
- *  Inputs:
- *      0: 0x00380040
- *      1: u8 Sound ID
- *  Outputs:
- *      0: 0x00380040
- *      1: ResultCode
- */
-void PlayShutterSound(Service::Interface* self);
-
-/**
- * Initializes the camera driver. Must be called before using other functions.
- *  Inputs:
- *      0: 0x00390000
- *  Outputs:
- *      0: 0x00390040
- *      1: ResultCode
- */
-void DriverInitialize(Service::Interface* self);
-
-/**
- * Shuts down the camera driver.
- *  Inputs:
- *      0: 0x003A0000
- *  Outputs:
- *      0: 0x003A0040
- *      1: ResultCode
- */
-void DriverFinalize(Service::Interface* self);
-
-/// Initialize CAM service(s)
-void Init();
-
-/// Shutdown CAM service(s)
-void Shutdown();
-
-} // namespace CAM
-} // namespace Service

+ 0 - 18
src/core/hle/service/cam/cam_c.cpp

@@ -1,18 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/cam/cam_c.h"
-
-namespace Service {
-namespace CAM {
-
-// Empty arrays are illegal -- commented out until an entry is added.
-// const Interface::FunctionInfo FunctionTable[] = { };
-
-CAM_C_Interface::CAM_C_Interface() {
-    // Register(FunctionTable);
-}
-
-} // namespace CAM
-} // namespace Service

+ 0 - 22
src/core/hle/service/cam/cam_c.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CAM {
-
-class CAM_C_Interface : public Service::Interface {
-public:
-    CAM_C_Interface();
-
-    std::string GetPortName() const override {
-        return "cam:c";
-    }
-};
-
-} // namespace CAM
-} // namespace Service

+ 0 - 18
src/core/hle/service/cam/cam_q.cpp

@@ -1,18 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/cam/cam_q.h"
-
-namespace Service {
-namespace CAM {
-
-// Empty arrays are illegal -- commented out until an entry is added.
-// const Interface::FunctionInfo FunctionTable[] = { };
-
-CAM_Q_Interface::CAM_Q_Interface() {
-    // Register(FunctionTable);
-}
-
-} // namespace CAM
-} // namespace Service

+ 0 - 22
src/core/hle/service/cam/cam_q.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CAM {
-
-class CAM_Q_Interface : public Service::Interface {
-public:
-    CAM_Q_Interface();
-
-    std::string GetPortName() const override {
-        return "cam:q";
-    }
-};
-
-} // namespace CAM
-} // namespace Service

+ 0 - 18
src/core/hle/service/cam/cam_s.cpp

@@ -1,18 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/cam/cam_s.h"
-
-namespace Service {
-namespace CAM {
-
-// Empty arrays are illegal -- commented out until an entry is added.
-// const Interface::FunctionInfo FunctionTable[] = { };
-
-CAM_S_Interface::CAM_S_Interface() {
-    // Register(FunctionTable);
-}
-
-} // namespace CAM
-} // namespace Service

+ 0 - 22
src/core/hle/service/cam/cam_s.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CAM {
-
-class CAM_S_Interface : public Service::Interface {
-public:
-    CAM_S_Interface();
-
-    std::string GetPortName() const override {
-        return "cam:s";
-    }
-};
-
-} // namespace CAM
-} // namespace Service

+ 0 - 81
src/core/hle/service/cam/cam_u.cpp

@@ -1,81 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/cam/cam.h"
-#include "core/hle/service/cam/cam_u.h"
-
-namespace Service {
-namespace CAM {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010040, StartCapture, "StartCapture"},
-    {0x00020040, StopCapture, "StopCapture"},
-    {0x00030040, IsBusy, "IsBusy"},
-    {0x00040040, ClearBuffer, "ClearBuffer"},
-    {0x00050040, GetVsyncInterruptEvent, "GetVsyncInterruptEvent"},
-    {0x00060040, GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"},
-    {0x00070102, SetReceiving, "SetReceiving"},
-    {0x00080040, IsFinishedReceiving, "IsFinishedReceiving"},
-    {0x00090100, SetTransferLines, "SetTransferLines"},
-    {0x000A0080, GetMaxLines, "GetMaxLines"},
-    {0x000B0100, SetTransferBytes, "SetTransferBytes"},
-    {0x000C0040, GetTransferBytes, "GetTransferBytes"},
-    {0x000D0080, GetMaxBytes, "GetMaxBytes"},
-    {0x000E0080, SetTrimming, "SetTrimming"},
-    {0x000F0040, IsTrimming, "IsTrimming"},
-    {0x00100140, SetTrimmingParams, "SetTrimmingParams"},
-    {0x00110040, GetTrimmingParams, "GetTrimmingParams"},
-    {0x00120140, SetTrimmingParamsCenter, "SetTrimmingParamsCenter"},
-    {0x00130040, Activate, "Activate"},
-    {0x00140080, SwitchContext, "SwitchContext"},
-    {0x00150080, nullptr, "SetExposure"},
-    {0x00160080, nullptr, "SetWhiteBalance"},
-    {0x00170080, nullptr, "SetWhiteBalanceWithoutBaseUp"},
-    {0x00180080, nullptr, "SetSharpness"},
-    {0x00190080, nullptr, "SetAutoExposure"},
-    {0x001A0040, nullptr, "IsAutoExposure"},
-    {0x001B0080, nullptr, "SetAutoWhiteBalance"},
-    {0x001C0040, nullptr, "IsAutoWhiteBalance"},
-    {0x001D00C0, FlipImage, "FlipImage"},
-    {0x001E0200, SetDetailSize, "SetDetailSize"},
-    {0x001F00C0, SetSize, "SetSize"},
-    {0x00200080, SetFrameRate, "SetFrameRate"},
-    {0x00210080, nullptr, "SetPhotoMode"},
-    {0x002200C0, SetEffect, "SetEffect"},
-    {0x00230080, nullptr, "SetContrast"},
-    {0x00240080, nullptr, "SetLensCorrection"},
-    {0x002500C0, SetOutputFormat, "SetOutputFormat"},
-    {0x00260140, nullptr, "SetAutoExposureWindow"},
-    {0x00270140, nullptr, "SetAutoWhiteBalanceWindow"},
-    {0x00280080, nullptr, "SetNoiseFilter"},
-    {0x00290080, SynchronizeVsyncTiming, "SynchronizeVsyncTiming"},
-    {0x002A0080, nullptr, "GetLatestVsyncTiming"},
-    {0x002B0000, GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"},
-    {0x002C0400, nullptr, "SetStereoCameraCalibrationData"},
-    {0x002D00C0, nullptr, "WriteRegisterI2c"},
-    {0x002E00C0, nullptr, "WriteMcuVariableI2c"},
-    {0x002F0080, nullptr, "ReadRegisterI2cExclusive"},
-    {0x00300080, nullptr, "ReadMcuVariableI2cExclusive"},
-    {0x00310180, nullptr, "SetImageQualityCalibrationData"},
-    {0x00320000, nullptr, "GetImageQualityCalibrationData"},
-    {0x003302C0, SetPackageParameterWithoutContext, "SetPackageParameterWithoutContext"},
-    {0x00340140, SetPackageParameterWithContext, "SetPackageParameterWithContext"},
-    {0x003501C0, SetPackageParameterWithContextDetail, "SetPackageParameterWithContextDetail"},
-    {0x00360000, GetSuitableY2rStandardCoefficient, "GetSuitableY2rStandardCoefficient"},
-    {0x00370202, nullptr, "PlayShutterSoundWithWave"},
-    {0x00380040, PlayShutterSound, "PlayShutterSound"},
-    {0x00390000, DriverInitialize, "DriverInitialize"},
-    {0x003A0000, DriverFinalize, "DriverFinalize"},
-    {0x003B0000, nullptr, "GetActivatedCamera"},
-    {0x003C0000, nullptr, "GetSleepCamera"},
-    {0x003D0040, nullptr, "SetSleepCamera"},
-    {0x003E0040, nullptr, "SetBrightnessSynchronization"},
-};
-
-CAM_U_Interface::CAM_U_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace CAM
-} // namespace Service

+ 0 - 22
src/core/hle/service/cam/cam_u.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included..
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CAM {
-
-class CAM_U_Interface : public Service::Interface {
-public:
-    CAM_U_Interface();
-
-    std::string GetPortName() const override {
-        return "cam:u";
-    }
-};
-
-} // namespace CAM
-} // namespace Service

+ 0 - 66
src/core/hle/service/cecd/cecd.cpp

@@ -1,66 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "common/logging/log.h"
-#include "core/hle/ipc.h"
-#include "core/hle/kernel/event.h"
-#include "core/hle/kernel/handle_table.h"
-#include "core/hle/result.h"
-#include "core/hle/service/cecd/cecd.h"
-#include "core/hle/service/cecd/cecd_ndm.h"
-#include "core/hle/service/cecd/cecd_s.h"
-#include "core/hle/service/cecd/cecd_u.h"
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CECD {
-
-static Kernel::SharedPtr<Kernel::Event> cecinfo_event;
-static Kernel::SharedPtr<Kernel::Event> change_state_event;
-
-void GetCecStateAbbreviated(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    cmd_buff[2] = static_cast<u32>(CecStateAbbreviated::CEC_STATE_ABBREV_IDLE);
-
-    LOG_WARNING(Service_CECD, "(STUBBED) called");
-}
-
-void GetCecInfoEventHandle(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;                                    // No error
-    cmd_buff[3] = Kernel::g_handle_table.Create(cecinfo_event).Unwrap(); // Event handle
-
-    LOG_WARNING(Service_CECD, "(STUBBED) called");
-}
-
-void GetChangeStateEventHandle(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;                                         // No error
-    cmd_buff[3] = Kernel::g_handle_table.Create(change_state_event).Unwrap(); // Event handle
-
-    LOG_WARNING(Service_CECD, "(STUBBED) called");
-}
-
-void Init() {
-    AddService(new CECD_NDM);
-    AddService(new CECD_S);
-    AddService(new CECD_U);
-
-    cecinfo_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD::cecinfo_event");
-    change_state_event =
-        Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD::change_state_event");
-}
-
-void Shutdown() {
-    cecinfo_event = nullptr;
-    change_state_event = nullptr;
-}
-
-} // namespace CECD
-
-} // namespace Service

+ 0 - 60
src/core/hle/service/cecd/cecd.h

@@ -1,60 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-namespace Service {
-
-class Interface;
-
-namespace CECD {
-
-enum class CecStateAbbreviated {
-    CEC_STATE_ABBREV_IDLE = 1,      ///< Corresponds to CEC_STATE_IDLE
-    CEC_STATE_ABBREV_NOT_LOCAL = 2, ///< Corresponds to CEC_STATEs *FINISH*, *POST, and OVER_BOSS
-    CEC_STATE_ABBREV_SCANNING = 3,  ///< Corresponds to CEC_STATE_SCANNING
-    CEC_STATE_ABBREV_WLREADY =
-        4, ///< Corresponds to CEC_STATE_WIRELESS_READY when some unknown bool is true
-    CEC_STATE_ABBREV_OTHER = 5, ///< Corresponds to CEC_STATEs besides *FINISH*, *POST, and
-                                /// OVER_BOSS and those listed here
-};
-
-/**
- * GetCecStateAbbreviated service function
- *  Inputs:
- *      0: 0x000E0000
- *  Outputs:
- *      1: ResultCode
- *      2: CecStateAbbreviated
- */
-void GetCecStateAbbreviated(Service::Interface* self);
-
-/**
- * GetCecInfoEventHandle service function
- *  Inputs:
- *      0: 0x000F0000
- *  Outputs:
- *      1: ResultCode
- *      3: Event Handle
- */
-void GetCecInfoEventHandle(Service::Interface* self);
-
-/**
- * GetChangeStateEventHandle service function
- *  Inputs:
- *      0: 0x00100000
- *  Outputs:
- *      1: ResultCode
- *      3: Event Handle
- */
-void GetChangeStateEventHandle(Service::Interface* self);
-
-/// Initialize CECD service(s)
-void Init();
-
-/// Shutdown CECD service(s)
-void Shutdown();
-
-} // namespace CECD
-} // namespace Service

+ 0 - 23
src/core/hle/service/cecd/cecd_ndm.cpp

@@ -1,23 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/cecd/cecd.h"
-#include "core/hle/service/cecd/cecd_ndm.h"
-
-namespace Service {
-namespace CECD {
-
-static const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010000, nullptr, "Initialize"},
-    {0x00020000, nullptr, "Deinitialize"},
-    {0x00030000, nullptr, "ResumeDaemon"},
-    {0x00040040, nullptr, "SuspendDaemon"},
-};
-
-CECD_NDM::CECD_NDM() {
-    Register(FunctionTable);
-}
-
-} // namespace CECD
-} // namespace Service

+ 0 - 22
src/core/hle/service/cecd/cecd_ndm.h

@@ -1,22 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CECD {
-
-class CECD_NDM : public Interface {
-public:
-    CECD_NDM();
-
-    std::string GetPortName() const override {
-        return "cecd:ndm";
-    }
-};
-
-} // namespace CECD
-} // namespace Service

+ 0 - 36
src/core/hle/service/cecd/cecd_s.cpp

@@ -1,36 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/cecd/cecd.h"
-#include "core/hle/service/cecd/cecd_s.h"
-
-namespace Service {
-namespace CECD {
-
-static const Interface::FunctionInfo FunctionTable[] = {
-    // cecd:u shared commands
-    {0x000100C2, nullptr, "OpenRawFile"},
-    {0x00020042, nullptr, "ReadRawFile"},
-    {0x00030104, nullptr, "ReadMessage"},
-    {0x00040106, nullptr, "ReadMessageWithHMAC"},
-    {0x00050042, nullptr, "WriteRawFile"},
-    {0x00060104, nullptr, "WriteMessage"},
-    {0x00070106, nullptr, "WriteMessageWithHMAC"},
-    {0x00080102, nullptr, "Delete"},
-    {0x000A00C4, nullptr, "GetSystemInfo"},
-    {0x000B0040, nullptr, "RunCommand"},
-    {0x000C0040, nullptr, "RunCommandAlt"},
-    {0x000E0000, GetCecStateAbbreviated, "GetCecStateAbbreviated"},
-    {0x000F0000, GetCecInfoEventHandle, "GetCecInfoEventHandle"},
-    {0x00100000, GetChangeStateEventHandle, "GetChangeStateEventHandle"},
-    {0x00110104, nullptr, "OpenAndWrite"},
-    {0x00120104, nullptr, "OpenAndRead"},
-};
-
-CECD_S::CECD_S() {
-    Register(FunctionTable);
-}
-
-} // namespace CECD
-} // namespace Service

+ 0 - 22
src/core/hle/service/cecd/cecd_s.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CECD {
-
-class CECD_S : public Interface {
-public:
-    CECD_S();
-
-    std::string GetPortName() const override {
-        return "cecd:s";
-    }
-};
-
-} // namespace CECD
-} // namespace Service

+ 0 - 36
src/core/hle/service/cecd/cecd_u.cpp

@@ -1,36 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/cecd/cecd.h"
-#include "core/hle/service/cecd/cecd_u.h"
-
-namespace Service {
-namespace CECD {
-
-static const Interface::FunctionInfo FunctionTable[] = {
-    // cecd:u shared commands
-    {0x000100C2, nullptr, "OpenRawFile"},
-    {0x00020042, nullptr, "ReadRawFile"},
-    {0x00030104, nullptr, "ReadMessage"},
-    {0x00040106, nullptr, "ReadMessageWithHMAC"},
-    {0x00050042, nullptr, "WriteRawFile"},
-    {0x00060104, nullptr, "WriteMessage"},
-    {0x00070106, nullptr, "WriteMessageWithHMAC"},
-    {0x00080102, nullptr, "Delete"},
-    {0x000A00C4, nullptr, "GetSystemInfo"},
-    {0x000B0040, nullptr, "RunCommand"},
-    {0x000C0040, nullptr, "RunCommandAlt"},
-    {0x000E0000, GetCecStateAbbreviated, "GetCecStateAbbreviated"},
-    {0x000F0000, GetCecInfoEventHandle, "GetCecInfoEventHandle"},
-    {0x00100000, GetChangeStateEventHandle, "GetChangeStateEventHandle"},
-    {0x00110104, nullptr, "OpenAndWrite"},
-    {0x00120104, nullptr, "OpenAndRead"},
-};
-
-CECD_U::CECD_U() {
-    Register(FunctionTable);
-}
-
-} // namespace CECD
-} // namespace Service

+ 0 - 22
src/core/hle/service/cecd/cecd_u.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CECD {
-
-class CECD_U : public Interface {
-public:
-    CECD_U();
-
-    std::string GetPortName() const override {
-        return "cecd:u";
-    }
-};
-
-} // namespace CECD
-} // namespace Service

+ 0 - 143
src/core/hle/service/csnd_snd.cpp

@@ -1,143 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <cstring>
-#include "common/alignment.h"
-#include "core/hle/ipc.h"
-#include "core/hle/kernel/handle_table.h"
-#include "core/hle/kernel/mutex.h"
-#include "core/hle/kernel/shared_memory.h"
-#include "core/hle/service/csnd_snd.h"
-#include "core/memory.h"
-
-namespace Service {
-namespace CSND {
-
-struct Type0Command {
-    // command id and next command offset
-    u32 command_id;
-    u32 finished;
-    u32 flags;
-    u8 parameters[20];
-};
-static_assert(sizeof(Type0Command) == 0x20, "Type0Command structure size is wrong");
-
-static Kernel::SharedPtr<Kernel::SharedMemory> shared_memory = nullptr;
-static Kernel::SharedPtr<Kernel::Mutex> mutex = nullptr;
-
-/**
- * CSND_SND::Initialize service function
- *  Inputs:
- *      0 : Header Code[0x00010140]
- *      1 : Shared memory block size, for mem-block creation
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Handle-list header
- *      3 : Mutex handle
- *      4 : Shared memory block handle
- */
-static void Initialize(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 size = Common::AlignUp(cmd_buff[1], Memory::PAGE_SIZE);
-
-    using Kernel::MemoryPermission;
-    shared_memory = Kernel::SharedMemory::Create(nullptr, size, MemoryPermission::ReadWrite,
-                                                 MemoryPermission::ReadWrite, 0,
-                                                 Kernel::MemoryRegion::BASE, "CSND:SharedMemory");
-
-    mutex = Kernel::Mutex::Create(false, 0, "CSND:mutex");
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = IPC::CopyHandleDesc(2);
-    cmd_buff[3] = Kernel::g_handle_table.Create(mutex).Unwrap();
-    cmd_buff[4] = Kernel::g_handle_table.Create(shared_memory).Unwrap();
-
-    LOG_WARNING(Service_CSND, "(STUBBED) called");
-}
-
-/**
- * CSND_SND::Shutdown service function
- *  Inputs:
- *      0 : Header Code[0x00020000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-static void Shutdown(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    shared_memory = nullptr;
-    mutex = nullptr;
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    LOG_WARNING(Service_CSND, "(STUBBED) called");
-}
-
-/**
- * CSND_SND::ExecuteCommands service function
- *  Inputs:
- *      0 : Header Code[0x00030040]
- *      1 : Command offset in shared memory.
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Available channel bit mask
- */
-static void ExecuteCommands(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    if (shared_memory == nullptr) {
-        cmd_buff[1] = 1;
-        LOG_ERROR(Service_CSND, "called, shared memory not allocated");
-        return;
-    }
-
-    VAddr addr = cmd_buff[1];
-    u8* ptr = shared_memory->GetPointer(addr);
-
-    Type0Command command;
-    std::memcpy(&command, ptr, sizeof(Type0Command));
-    command.finished |= 1;
-    std::memcpy(ptr, &command, sizeof(Type0Command));
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-
-    LOG_WARNING(Service_CSND, "(STUBBED) called, addr=0x%08X", addr);
-}
-
-/**
- * CSND_SND::AcquireSoundChannels service function
- *  Inputs:
- *      0 : Header Code[0x00050000]
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : Available channel bit mask
- */
-static void AcquireSoundChannels(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0xFFFFFF00;
-    LOG_WARNING(Service_CSND, "(STUBBED) called");
-}
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010140, Initialize, "Initialize"},
-    {0x00020000, Shutdown, "Shutdown"},
-    {0x00030040, ExecuteCommands, "ExecuteCommands"},
-    {0x00040080, nullptr, "ExecuteType1Commands"},
-    {0x00050000, AcquireSoundChannels, "AcquireSoundChannels"},
-    {0x00060000, nullptr, "ReleaseSoundChannels"},
-    {0x00070000, nullptr, "AcquireCaptureDevice"},
-    {0x00080040, nullptr, "ReleaseCaptureDevice"},
-    {0x00090082, nullptr, "FlushDataCache"},
-    {0x000A0082, nullptr, "StoreDataCache"},
-    {0x000B0082, nullptr, "InvalidateDataCache"},
-    {0x000C0000, nullptr, "Reset"},
-};
-
-CSND_SND::CSND_SND() {
-    Register(FunctionTable);
-}
-
-} // namespace CSND
-} // namespace Service

+ 0 - 22
src/core/hle/service/csnd_snd.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace CSND {
-
-class CSND_SND final : public Interface {
-public:
-    CSND_SND();
-
-    std::string GetPortName() const override {
-        return "csnd:SND";
-    }
-};
-
-} // namespace CSND
-} // namespace Service

+ 0 - 23
src/core/hle/service/dlp/dlp.cpp

@@ -1,23 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/dlp/dlp.h"
-#include "core/hle/service/dlp/dlp_clnt.h"
-#include "core/hle/service/dlp/dlp_fkcl.h"
-#include "core/hle/service/dlp/dlp_srvr.h"
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace DLP {
-
-void Init() {
-    AddService(new DLP_CLNT_Interface);
-    AddService(new DLP_FKCL_Interface);
-    AddService(new DLP_SRVR_Interface);
-}
-
-void Shutdown() {}
-
-} // namespace DLP
-} // namespace Service

+ 0 - 17
src/core/hle/service/dlp/dlp.h

@@ -1,17 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-namespace Service {
-namespace DLP {
-
-/// Initializes the DLP services.
-void Init();
-
-/// Shuts down the DLP services.
-void Shutdown();
-
-} // namespace DLP
-} // namespace Service

+ 0 - 38
src/core/hle/service/dlp/dlp_clnt.cpp

@@ -1,38 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/dlp/dlp_clnt.h"
-
-namespace Service {
-namespace DLP {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x000100C3, nullptr, "Initialize"},
-    {0x00020000, nullptr, "Finalize"},
-    {0x00030000, nullptr, "GetEventDesc"},
-    {0x00040000, nullptr, "GetChannel"},
-    {0x00050180, nullptr, "StartScan"},
-    {0x00060000, nullptr, "StopScan"},
-    {0x00070080, nullptr, "GetServerInfo"},
-    {0x00080100, nullptr, "GetTitleInfo"},
-    {0x00090040, nullptr, "GetTitleInfoInOrder"},
-    {0x000A0080, nullptr, "DeleteScanInfo"},
-    {0x000B0100, nullptr, "PrepareForSystemDownload"},
-    {0x000C0000, nullptr, "StartSystemDownload"},
-    {0x000D0100, nullptr, "StartTitleDownload"},
-    {0x000E0000, nullptr, "GetMyStatus"},
-    {0x000F0040, nullptr, "GetConnectingNodes"},
-    {0x00100040, nullptr, "GetNodeInfo"},
-    {0x00110000, nullptr, "GetWirelessRebootPassphrase"},
-    {0x00120000, nullptr, "StopSession"},
-    {0x00130100, nullptr, "GetCupVersion"},
-    {0x00140100, nullptr, "GetDupAvailability"},
-};
-
-DLP_CLNT_Interface::DLP_CLNT_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace DLP
-} // namespace Service

+ 0 - 22
src/core/hle/service/dlp/dlp_clnt.h

@@ -1,22 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace DLP {
-
-class DLP_CLNT_Interface final : public Interface {
-public:
-    DLP_CLNT_Interface();
-
-    std::string GetPortName() const override {
-        return "dlp:CLNT";
-    }
-};
-
-} // namespace DLP
-} // namespace Service

+ 0 - 35
src/core/hle/service/dlp/dlp_fkcl.cpp

@@ -1,35 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/dlp/dlp_fkcl.h"
-
-namespace Service {
-namespace DLP {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010083, nullptr, "Initialize"},
-    {0x00020000, nullptr, "Finalize"},
-    {0x00030000, nullptr, "GetEventDesc"},
-    {0x00040000, nullptr, "GetChannels"},
-    {0x00050180, nullptr, "StartScan"},
-    {0x00060000, nullptr, "StopScan"},
-    {0x00070080, nullptr, "GetServerInfo"},
-    {0x00080100, nullptr, "GetTitleInfo"},
-    {0x00090040, nullptr, "GetTitleInfoInOrder"},
-    {0x000A0080, nullptr, "DeleteScanInfo"},
-    {0x000B0100, nullptr, "StartFakeSession"},
-    {0x000C0000, nullptr, "GetMyStatus"},
-    {0x000D0040, nullptr, "GetConnectingNodes"},
-    {0x000E0040, nullptr, "GetNodeInfo"},
-    {0x000F0000, nullptr, "GetWirelessRebootPassphrase"},
-    {0x00100000, nullptr, "StopSession"},
-    {0x00110203, nullptr, "Initialize2"},
-};
-
-DLP_FKCL_Interface::DLP_FKCL_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace DLP
-} // namespace Service

+ 0 - 22
src/core/hle/service/dlp/dlp_fkcl.h

@@ -1,22 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace DLP {
-
-class DLP_FKCL_Interface final : public Interface {
-public:
-    DLP_FKCL_Interface();
-
-    std::string GetPortName() const override {
-        return "dlp:FKCL";
-    }
-};
-
-} // namespace DLP
-} // namespace Service

+ 0 - 47
src/core/hle/service/dlp/dlp_srvr.cpp

@@ -1,47 +0,0 @@
-// Copyright 2016 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/result.h"
-#include "core/hle/service/dlp/dlp_srvr.h"
-
-namespace Service {
-namespace DLP {
-
-static void IsChild(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw;
-    cmd_buff[2] = 0;
-
-    LOG_WARNING(Service_DLP, "(STUBBED) called");
-}
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010183, nullptr, "Initialize"},
-    {0x00020000, nullptr, "Finalize"},
-    {0x00030000, nullptr, "GetServerState"},
-    {0x00040000, nullptr, "GetEventDescription"},
-    {0x00050080, nullptr, "StartAccepting"},
-    {0x00060000, nullptr, "EndAccepting"},
-    {0x00070000, nullptr, "StartDistribution"},
-    {0x000800C0, nullptr, "SendWirelessRebootPassphrase"},
-    {0x00090040, nullptr, "AcceptClient"},
-    {0x000A0040, nullptr, "DisconnectClient"},
-    {0x000B0042, nullptr, "GetConnectingClients"},
-    {0x000C0040, nullptr, "GetClientInfo"},
-    {0x000D0040, nullptr, "GetClientState"},
-    {0x000E0040, IsChild, "IsChild"},
-    {0x000F0303, nullptr, "InitializeWithName"},
-    {0x00100000, nullptr, "GetDupNoticeNeed"},
-};
-
-DLP_SRVR_Interface::DLP_SRVR_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace DLP
-} // namespace Service

+ 0 - 22
src/core/hle/service/dlp/dlp_srvr.h

@@ -1,22 +0,0 @@
-// Copyright 2016 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace DLP {
-
-class DLP_SRVR_Interface final : public Interface {
-public:
-    DLP_SRVR_Interface();
-
-    std::string GetPortName() const override {
-        return "dlp:SRVR";
-    }
-};
-
-} // namespace DLP
-} // namespace Service

+ 0 - 266
src/core/hle/service/err_f.cpp

@@ -1,266 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include <array>
-#include <chrono>
-#include <iomanip>
-#include <sstream>
-#include "common/bit_field.h"
-#include "common/common_types.h"
-#include "common/logging/log.h"
-#include "core/core.h"
-#include "core/hle/ipc.h"
-#include "core/hle/result.h"
-#include "core/hle/service/err_f.h"
-
-namespace Service {
-namespace ERR {
-
-enum class FatalErrType : u32 {
-    Generic = 0,
-    Corrupted = 1,
-    CardRemoved = 2,
-    Exception = 3,
-    ResultFailure = 4,
-    Logged = 5,
-};
-
-enum class ExceptionType : u32 {
-    PrefetchAbort = 0,
-    DataAbort = 1,
-    Undefined = 2,
-    VectorFP = 3,
-};
-
-struct ExceptionInfo {
-    u8 exception_type;
-    INSERT_PADDING_BYTES(3);
-    u32 sr;
-    u32 ar;
-    u32 fpexc;
-    u32 fpinst;
-    u32 fpinst2;
-};
-static_assert(sizeof(ExceptionInfo) == 0x18, "ExceptionInfo struct has incorrect size");
-
-struct ExceptionContext final {
-    std::array<u32, 16> arm_regs;
-    u32 cpsr;
-};
-static_assert(sizeof(ExceptionContext) == 0x44, "ExceptionContext struct has incorrect size");
-
-struct ExceptionData {
-    ExceptionInfo exception_info;
-    ExceptionContext exception_context;
-    INSERT_PADDING_WORDS(1);
-};
-static_assert(sizeof(ExceptionData) == 0x60, "ExceptionData struct has incorrect size");
-
-// This is used instead of ResultCode from result.h
-// because we can't have non-trivial data members in unions.
-union RSL {
-    u32 raw;
-
-    BitField<0, 10, u32> description;
-    BitField<10, 8, u32> module;
-    BitField<21, 6, u32> summary;
-    BitField<27, 5, u32> level;
-};
-
-struct ErrInfo {
-    struct ErrInfoCommon {
-        u8 specifier;          // 0x0
-        u8 rev_high;           // 0x1
-        u16 rev_low;           // 0x2
-        RSL result_code;       // 0x4
-        u32 pc_address;        // 0x8
-        u32 pid;               // 0xC
-        u32 title_id_low;      // 0x10
-        u32 title_id_high;     // 0x14
-        u32 app_title_id_low;  // 0x18
-        u32 app_title_id_high; // 0x1C
-    } errinfo_common;
-    static_assert(sizeof(ErrInfoCommon) == 0x20, "ErrInfoCommon struct has incorrect size");
-
-    union {
-        struct {
-            char data[0x60]; // 0x20
-        } generic;
-
-        struct {
-            ExceptionData exception_data; // 0x20
-        } exception;
-
-        struct {
-            char message[0x60]; // 0x20
-        } result_failure;
-    };
-};
-
-static std::string GetErrType(u8 type_code) {
-    switch (static_cast<FatalErrType>(type_code)) {
-    case FatalErrType::Generic:
-        return "Generic";
-    case FatalErrType::Corrupted:
-        return "Corrupted";
-    case FatalErrType::CardRemoved:
-        return "CardRemoved";
-    case FatalErrType::Exception:
-        return "Exception";
-    case FatalErrType::ResultFailure:
-        return "ResultFailure";
-    case FatalErrType::Logged:
-        return "Logged";
-    default:
-        return "Unknown Error Type";
-    }
-}
-
-static std::string GetExceptionType(u8 type_code) {
-    switch (static_cast<ExceptionType>(type_code)) {
-    case ExceptionType::PrefetchAbort:
-        return "Prefetch Abort";
-    case ExceptionType::DataAbort:
-        return "Data Abort";
-    case ExceptionType::Undefined:
-        return "Undefined Exception";
-    case ExceptionType::VectorFP:
-        return "Vector Floating Point Exception";
-    default:
-        return "Unknown Exception Type";
-    }
-}
-
-static std::string GetCurrentSystemTime() {
-    auto now = std::chrono::system_clock::now();
-    auto time = std::chrono::system_clock::to_time_t(now);
-
-    std::stringstream time_stream;
-    time_stream << std::put_time(std::localtime(&time), "%Y/%m/%d %H:%M:%S");
-    return time_stream.str();
-}
-
-static void LogGenericInfo(const ErrInfo::ErrInfoCommon& errinfo_common) {
-    LOG_CRITICAL(Service_ERR, "PID: 0x%08X", errinfo_common.pid);
-    LOG_CRITICAL(Service_ERR, "REV: 0x%08X_0x%08X", errinfo_common.rev_high,
-                 errinfo_common.rev_low);
-    LOG_CRITICAL(Service_ERR, "TID: 0x%08X_0x%08X", errinfo_common.title_id_high,
-                 errinfo_common.title_id_low);
-    LOG_CRITICAL(Service_ERR, "AID: 0x%08X_0x%08X", errinfo_common.app_title_id_high,
-                 errinfo_common.app_title_id_low);
-    LOG_CRITICAL(Service_ERR, "ADR: 0x%08X", errinfo_common.pc_address);
-
-    LOG_CRITICAL(Service_ERR, "RSL: 0x%08X", errinfo_common.result_code.raw);
-    LOG_CRITICAL(Service_ERR, "  Level: %u", errinfo_common.result_code.level.Value());
-    LOG_CRITICAL(Service_ERR, "  Summary: %u", errinfo_common.result_code.summary.Value());
-    LOG_CRITICAL(Service_ERR, "  Module: %u", errinfo_common.result_code.module.Value());
-    LOG_CRITICAL(Service_ERR, "  Desc: %u", errinfo_common.result_code.description.Value());
-}
-
-/* ThrowFatalError function
- * Inputs:
- *       0 : Header code [0x00010800]
- *    1-32 : FatalErrInfo
- * Outputs:
- *       0 : Header code
- *       1 : Result code
- */
-static void ThrowFatalError(Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    LOG_CRITICAL(Service_ERR, "Fatal error");
-    const ErrInfo* errinfo = reinterpret_cast<ErrInfo*>(&cmd_buff[1]);
-    LOG_CRITICAL(Service_ERR, "Fatal error type: %s",
-                 GetErrType(errinfo->errinfo_common.specifier).c_str());
-    Core::System::GetInstance().SetStatus(Core::System::ResultStatus::ErrorUnknown);
-
-    // Generic Info
-    LogGenericInfo(errinfo->errinfo_common);
-
-    switch (static_cast<FatalErrType>(errinfo->errinfo_common.specifier)) {
-    case FatalErrType::Generic:
-    case FatalErrType::Corrupted:
-    case FatalErrType::CardRemoved:
-    case FatalErrType::Logged: {
-        LOG_CRITICAL(Service_ERR, "Datetime: %s", GetCurrentSystemTime().c_str());
-        break;
-    }
-    case FatalErrType::Exception: {
-        const auto& errtype = errinfo->exception;
-
-        // Register Info
-        LOG_CRITICAL(Service_ERR, "ARM Registers:");
-        for (u32 index = 0; index < errtype.exception_data.exception_context.arm_regs.size();
-             ++index) {
-            if (index < 13) {
-                LOG_DEBUG(Service_ERR, "r%u=0x%08X", index,
-                          errtype.exception_data.exception_context.arm_regs.at(index));
-            } else if (index == 13) {
-                LOG_CRITICAL(Service_ERR, "SP=0x%08X",
-                             errtype.exception_data.exception_context.arm_regs.at(index));
-            } else if (index == 14) {
-                LOG_CRITICAL(Service_ERR, "LR=0x%08X",
-                             errtype.exception_data.exception_context.arm_regs.at(index));
-            } else if (index == 15) {
-                LOG_CRITICAL(Service_ERR, "PC=0x%08X",
-                             errtype.exception_data.exception_context.arm_regs.at(index));
-            }
-        }
-        LOG_CRITICAL(Service_ERR, "CPSR=0x%08X", errtype.exception_data.exception_context.cpsr);
-
-        // Exception Info
-        LOG_CRITICAL(
-            Service_ERR, "EXCEPTION TYPE: %s",
-            GetExceptionType(errtype.exception_data.exception_info.exception_type).c_str());
-        switch (static_cast<ExceptionType>(errtype.exception_data.exception_info.exception_type)) {
-        case ExceptionType::PrefetchAbort:
-            LOG_CRITICAL(Service_ERR, "IFSR: 0x%08X", errtype.exception_data.exception_info.sr);
-            LOG_CRITICAL(Service_ERR, "r15: 0x%08X", errtype.exception_data.exception_info.ar);
-        case ExceptionType::DataAbort:
-            LOG_CRITICAL(Service_ERR, "DFSR: 0x%08X", errtype.exception_data.exception_info.sr);
-            LOG_CRITICAL(Service_ERR, "DFAR: 0x%08X", errtype.exception_data.exception_info.ar);
-            break;
-        case ExceptionType::VectorFP:
-            LOG_CRITICAL(Service_ERR, "FPEXC: 0x%08X",
-                         errtype.exception_data.exception_info.fpinst);
-            LOG_CRITICAL(Service_ERR, "FINST: 0x%08X",
-                         errtype.exception_data.exception_info.fpinst);
-            LOG_CRITICAL(Service_ERR, "FINST2: 0x%08X",
-                         errtype.exception_data.exception_info.fpinst2);
-            break;
-        case ExceptionType::Undefined:
-            break; // Not logging exception_info for this case
-        }
-        LOG_CRITICAL(Service_ERR, "Datetime: %s", GetCurrentSystemTime().c_str());
-        break;
-    }
-
-    case FatalErrType::ResultFailure: {
-        const auto& errtype = errinfo->result_failure;
-
-        // Failure Message
-        LOG_CRITICAL(Service_ERR, "Failure Message: %s", errtype.message);
-        LOG_CRITICAL(Service_ERR, "Datetime: %s", GetCurrentSystemTime().c_str());
-        break;
-    }
-
-    } // switch FatalErrType
-
-    cmd_buff[0] = IPC::MakeHeader(0x1, 1, 0);
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-}
-
-const Interface::FunctionInfo FunctionTable[] = {
-    // clang-format off
-    {0x00010800, ThrowFatalError, "ThrowFatalError"},
-    {0x00020042, nullptr, "SetUserString"},
-    // clang-format on
-};
-
-ERR_F::ERR_F() {
-    Register(FunctionTable);
-}
-
-} // namespace ERR
-} // namespace Service

+ 0 - 22
src/core/hle/service/err_f.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace ERR {
-
-class ERR_F final : public Interface {
-public:
-    ERR_F();
-
-    std::string GetPortName() const override {
-        return "err:f";
-    }
-};
-
-} // namespace ERR
-} // namespace Service

+ 0 - 174
src/core/hle/service/frd/frd.cpp

@@ -1,174 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "common/assert.h"
-#include "common/logging/log.h"
-#include "common/string_util.h"
-#include "core/hle/ipc.h"
-#include "core/hle/ipc_helpers.h"
-#include "core/hle/result.h"
-#include "core/hle/service/frd/frd.h"
-#include "core/hle/service/frd/frd_a.h"
-#include "core/hle/service/frd/frd_u.h"
-#include "core/hle/service/service.h"
-#include "core/memory.h"
-
-namespace Service {
-namespace FRD {
-
-static FriendKey my_friend_key = {0, 0, 0ull};
-static MyPresence my_presence = {};
-
-void GetMyPresence(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 shifted_out_size = cmd_buff[64];
-    u32 my_presence_addr = cmd_buff[65];
-
-    ASSERT(shifted_out_size == ((sizeof(MyPresence) << 14) | 2));
-
-    Memory::WriteBlock(my_presence_addr, &my_presence, sizeof(MyPresence));
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-
-    LOG_WARNING(Service_FRD, "(STUBBED) called");
-}
-
-void GetFriendKeyList(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 unknown = cmd_buff[1];
-    u32 frd_count = cmd_buff[2];
-    u32 frd_key_addr = cmd_buff[65];
-
-    FriendKey zero_key = {};
-    for (u32 i = 0; i < frd_count; ++i) {
-        Memory::WriteBlock(frd_key_addr + i * sizeof(FriendKey), &zero_key, sizeof(FriendKey));
-    }
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    cmd_buff[2] = 0;                  // 0 friends
-    LOG_WARNING(Service_FRD, "(STUBBED) called, unknown=%d, frd_count=%d, frd_key_addr=0x%08X",
-                unknown, frd_count, frd_key_addr);
-}
-
-void GetFriendProfile(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 count = cmd_buff[1];
-    u32 frd_key_addr = cmd_buff[3];
-    u32 profiles_addr = cmd_buff[65];
-
-    Profile zero_profile = {};
-    for (u32 i = 0; i < count; ++i) {
-        Memory::WriteBlock(profiles_addr + i * sizeof(Profile), &zero_profile, sizeof(Profile));
-    }
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    LOG_WARNING(Service_FRD,
-                "(STUBBED) called, count=%d, frd_key_addr=0x%08X, profiles_addr=0x%08X", count,
-                frd_key_addr, profiles_addr);
-}
-
-void GetFriendAttributeFlags(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    u32 count = cmd_buff[1];
-    u32 frd_key_addr = cmd_buff[3];
-    u32 attr_flags_addr = cmd_buff[65];
-
-    for (u32 i = 0; i < count; ++i) {
-        // TODO:(mailwl) figure out AttributeFlag size and zero all buffer. Assume 1 byte
-        Memory::Write8(attr_flags_addr + i, 0);
-    }
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    LOG_WARNING(Service_FRD,
-                "(STUBBED) called, count=%d, frd_key_addr=0x%08X, attr_flags_addr=0x%08X", count,
-                frd_key_addr, attr_flags_addr);
-}
-
-void GetMyFriendKey(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    std::memcpy(&cmd_buff[2], &my_friend_key, sizeof(FriendKey));
-    LOG_WARNING(Service_FRD, "(STUBBED) called");
-}
-
-void GetMyScreenName(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-    // TODO: (mailwl) get the name from config
-    Common::UTF8ToUTF16("Citra").copy(reinterpret_cast<char16_t*>(&cmd_buff[2]), 11);
-    LOG_WARNING(Service_FRD, "(STUBBED) called");
-}
-
-void UnscrambleLocalFriendCode(Service::Interface* self) {
-    const size_t scrambled_friend_code_size = 12;
-    const size_t friend_code_size = 8;
-
-    IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1C, 1, 2);
-    const u32 friend_code_count = rp.Pop<u32>();
-    size_t in_buffer_size;
-    const VAddr scrambled_friend_codes = rp.PopStaticBuffer(&in_buffer_size, false);
-    ASSERT_MSG(in_buffer_size == (friend_code_count * scrambled_friend_code_size),
-               "Wrong input buffer size");
-
-    size_t out_buffer_size;
-    VAddr unscrambled_friend_codes = rp.PeekStaticBuffer(0, &out_buffer_size);
-    ASSERT_MSG(out_buffer_size == (friend_code_count * friend_code_size),
-               "Wrong output buffer size");
-
-    for (u32 current = 0; current < friend_code_count; ++current) {
-        // TODO(B3N30): Unscramble the codes and compare them against the friend list
-        //              Only write 0 if the code isn't in friend list, otherwise write the
-        //              unscrambled one
-        //
-        // Code for unscrambling (should be compared to HW):
-        // std::array<u16, 6> scambled_friend_code;
-        // Memory::ReadBlock(scrambled_friend_codes+(current*scrambled_friend_code_size),
-        // scambled_friend_code.data(), scrambled_friend_code_size); std::array<u16, 4>
-        // unscrambled_friend_code; unscrambled_friend_code[0] = scambled_friend_code[0] ^
-        // scambled_friend_code[5]; unscrambled_friend_code[1] = scambled_friend_code[1] ^
-        // scambled_friend_code[5]; unscrambled_friend_code[2] = scambled_friend_code[2] ^
-        // scambled_friend_code[5]; unscrambled_friend_code[3] = scambled_friend_code[3] ^
-        // scambled_friend_code[5];
-
-        u64 result = 0ull;
-        Memory::WriteBlock(unscrambled_friend_codes + (current * sizeof(result)), &result,
-                           sizeof(result));
-    }
-
-    LOG_WARNING(Service_FRD, "(STUBBED) called");
-    IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
-    rb.Push(RESULT_SUCCESS);
-    rb.PushStaticBuffer(unscrambled_friend_codes, out_buffer_size, 0);
-}
-
-void SetClientSdkVersion(Service::Interface* self) {
-    u32* cmd_buff = Kernel::GetCommandBuffer();
-
-    const u32 version = cmd_buff[1];
-
-    self->SetVersion(version);
-
-    LOG_WARNING(Service_FRD, "(STUBBED) called, version: 0x%08X", version);
-
-    cmd_buff[1] = RESULT_SUCCESS.raw; // No error
-}
-
-void Init() {
-    using namespace Kernel;
-
-    AddService(new FRD_A_Interface);
-    AddService(new FRD_U_Interface);
-}
-
-void Shutdown() {}
-
-} // namespace FRD
-
-} // namespace Service

+ 0 - 127
src/core/hle/service/frd/frd.h

@@ -1,127 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "common/common_types.h"
-
-namespace Service {
-
-class Interface;
-
-namespace FRD {
-
-struct FriendKey {
-    u32 friend_id;
-    u32 unknown;
-    u64 friend_code;
-};
-
-struct MyPresence {
-    u8 unknown[0x12C];
-};
-
-struct Profile {
-    u8 region;
-    u8 country;
-    u8 area;
-    u8 language;
-    u32 unknown;
-};
-
-/**
- * FRD::GetMyPresence service function
- *  Inputs:
- *      64 : sizeof (MyPresence) << 14 | 2
- *      65 : Address of MyPresence structure
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void GetMyPresence(Service::Interface* self);
-
-/**
- * FRD::GetFriendKeyList service function
- *  Inputs:
- *      1 : Unknown
- *      2 : Max friends count
- *      65 : Address of FriendKey List
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : FriendKey count filled
- */
-void GetFriendKeyList(Service::Interface* self);
-
-/**
- * FRD::GetFriendProfile service function
- *  Inputs:
- *      1 : Friends count
- *      2 : Friends count << 18 | 2
- *      3 : Address of FriendKey List
- *      64 : (count * sizeof (Profile)) << 10 | 2
- *      65 : Address of Profiles List
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void GetFriendProfile(Service::Interface* self);
-
-/**
- * FRD::GetFriendAttributeFlags service function
- *  Inputs:
- *      1 : Friends count
- *      2 : Friends count << 18 | 2
- *      3 : Address of FriendKey List
- *      65 : Address of AttributeFlags
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void GetFriendAttributeFlags(Service::Interface* self);
-
-/**
- * FRD::GetMyFriendKey service function
- *  Inputs:
- *      none
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2-5 : FriendKey
- */
-void GetMyFriendKey(Service::Interface* self);
-
-/**
- * FRD::GetMyScreenName service function
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- *      2 : UTF16 encoded name (max 11 symbols)
- */
-void GetMyScreenName(Service::Interface* self);
-
-/**
- * FRD::UnscrambleLocalFriendCode service function
- *  Inputs:
- *      1 : Friend code count
- *      2 : ((count * 12) << 14) | 0x402
- *      3 : Pointer to encoded friend codes. Each is 12 bytes large
- *      64 : ((count * 8) << 14) | 2
- *      65 : Pointer to write decoded local friend codes to. Each is 8 bytes large.
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void UnscrambleLocalFriendCode(Service::Interface* self);
-
-/**
- * FRD::SetClientSdkVersion service function
- *  Inputs:
- *      1 : Used SDK Version
- *  Outputs:
- *      1 : Result of function, 0 on success, otherwise error code
- */
-void SetClientSdkVersion(Service::Interface* self);
-
-/// Initialize FRD service(s)
-void Init();
-
-/// Shutdown FRD service(s)
-void Shutdown();
-
-} // namespace FRD
-} // namespace Service

+ 0 - 18
src/core/hle/service/frd/frd_a.cpp

@@ -1,18 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/frd/frd_a.h"
-
-namespace Service {
-namespace FRD {
-
-// Empty arrays are illegal -- commented out until an entry is added.
-// const Interface::FunctionInfo FunctionTable[] = { };
-
-FRD_A_Interface::FRD_A_Interface() {
-    // Register(FunctionTable);
-}
-
-} // namespace FRD
-} // namespace Service

+ 0 - 22
src/core/hle/service/frd/frd_a.h

@@ -1,22 +0,0 @@
-// Copyright 2015 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace FRD {
-
-class FRD_A_Interface : public Service::Interface {
-public:
-    FRD_A_Interface();
-
-    std::string GetPortName() const override {
-        return "frd:a";
-    }
-};
-
-} // namespace FRD
-} // namespace Service

+ 0 - 72
src/core/hle/service/frd/frd_u.cpp

@@ -1,72 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/frd/frd.h"
-#include "core/hle/service/frd/frd_u.h"
-
-namespace Service {
-namespace FRD {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010000, nullptr, "HasLoggedIn"},
-    {0x00020000, nullptr, "IsOnline"},
-    {0x00030000, nullptr, "Login"},
-    {0x00040000, nullptr, "Logout"},
-    {0x00050000, GetMyFriendKey, "GetMyFriendKey"},
-    {0x00060000, nullptr, "GetMyPreference"},
-    {0x00070000, nullptr, "GetMyProfile"},
-    {0x00080000, GetMyPresence, "GetMyPresence"},
-    {0x00090000, GetMyScreenName, "GetMyScreenName"},
-    {0x000A0000, nullptr, "GetMyMii"},
-    {0x000B0000, nullptr, "GetMyLocalAccountId"},
-    {0x000C0000, nullptr, "GetMyPlayingGame"},
-    {0x000D0000, nullptr, "GetMyFavoriteGame"},
-    {0x000E0000, nullptr, "GetMyNcPrincipalId"},
-    {0x000F0000, nullptr, "GetMyComment"},
-    {0x00100040, nullptr, "GetMyPassword"},
-    {0x00110080, GetFriendKeyList, "GetFriendKeyList"},
-    {0x00120042, nullptr, "GetFriendPresence"},
-    {0x00130142, nullptr, "GetFriendScreenName"},
-    {0x00140044, nullptr, "GetFriendMii"},
-    {0x00150042, GetFriendProfile, "GetFriendProfile"},
-    {0x00160042, nullptr, "GetFriendRelationship"},
-    {0x00170042, GetFriendAttributeFlags, "GetFriendAttributeFlags"},
-    {0x00180044, nullptr, "GetFriendPlayingGame"},
-    {0x00190042, nullptr, "GetFriendFavoriteGame"},
-    {0x001A00C4, nullptr, "GetFriendInfo"},
-    {0x001B0080, nullptr, "IsIncludedInFriendList"},
-    {0x001C0042, UnscrambleLocalFriendCode, "UnscrambleLocalFriendCode"},
-    {0x001D0002, nullptr, "UpdateGameModeDescription"},
-    {0x001E02C2, nullptr, "UpdateGameMode"},
-    {0x001F0042, nullptr, "SendInvitation"},
-    {0x00200002, nullptr, "AttachToEventNotification"},
-    {0x00210040, nullptr, "SetNotificationMask"},
-    {0x00220040, nullptr, "GetEventNotification"},
-    {0x00230000, nullptr, "GetLastResponseResult"},
-    {0x00240040, nullptr, "PrincipalIdToFriendCode"},
-    {0x00250080, nullptr, "FriendCodeToPrincipalId"},
-    {0x00260080, nullptr, "IsValidFriendCode"},
-    {0x00270040, nullptr, "ResultToErrorCode"},
-    {0x00280244, nullptr, "RequestGameAuthentication"},
-    {0x00290000, nullptr, "GetGameAuthenticationData"},
-    {0x002A0204, nullptr, "RequestServiceLocator"},
-    {0x002B0000, nullptr, "GetServiceLocatorData"},
-    {0x002C0002, nullptr, "DetectNatProperties"},
-    {0x002D0000, nullptr, "GetNatProperties"},
-    {0x002E0000, nullptr, "GetServerTimeInterval"},
-    {0x002F0040, nullptr, "AllowHalfAwake"},
-    {0x00300000, nullptr, "GetServerTypes"},
-    {0x00310082, nullptr, "GetFriendComment"},
-    {0x00320042, SetClientSdkVersion, "SetClientSdkVersion"},
-    {0x00330000, nullptr, "GetMyApproachContext"},
-    {0x00340046, nullptr, "AddFriendWithApproach"},
-    {0x00350082, nullptr, "DecryptApproachContext"},
-};
-
-FRD_U_Interface::FRD_U_Interface() {
-    Register(FunctionTable);
-}
-
-} // namespace FRD
-} // namespace Service

+ 0 - 22
src/core/hle/service/frd/frd_u.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace FRD {
-
-class FRD_U_Interface : public Service::Interface {
-public:
-    FRD_U_Interface();
-
-    std::string GetPortName() const override {
-        return "frd:u";
-    }
-};
-
-} // namespace FRD
-} // namespace Service

+ 0 - 72
src/core/hle/service/http_c.cpp

@@ -1,72 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "core/hle/service/http_c.h"
-
-namespace Service {
-namespace HTTP {
-
-const Interface::FunctionInfo FunctionTable[] = {
-    {0x00010044, nullptr, "Initialize"},
-    {0x00020082, nullptr, "CreateContext"},
-    {0x00030040, nullptr, "CloseContext"},
-    {0x00040040, nullptr, "CancelConnection"},
-    {0x00050040, nullptr, "GetRequestState"},
-    {0x00060040, nullptr, "GetDownloadSizeState"},
-    {0x00070040, nullptr, "GetRequestError"},
-    {0x00080042, nullptr, "InitializeConnectionSession"},
-    {0x00090040, nullptr, "BeginRequest"},
-    {0x000A0040, nullptr, "BeginRequestAsync"},
-    {0x000B0082, nullptr, "ReceiveData"},
-    {0x000C0102, nullptr, "ReceiveDataTimeout"},
-    {0x000D0146, nullptr, "SetProxy"},
-    {0x000E0040, nullptr, "SetProxyDefault"},
-    {0x000F00C4, nullptr, "SetBasicAuthorization"},
-    {0x00100080, nullptr, "SetSocketBufferSize"},
-    {0x001100C4, nullptr, "AddRequestHeader"},
-    {0x001200C4, nullptr, "AddPostDataAscii"},
-    {0x001300C4, nullptr, "AddPostDataBinary"},
-    {0x00140082, nullptr, "AddPostDataRaw"},
-    {0x00150080, nullptr, "SetPostDataType"},
-    {0x001600C4, nullptr, "SendPostDataAscii"},
-    {0x00170144, nullptr, "SendPostDataAsciiTimeout"},
-    {0x001800C4, nullptr, "SendPostDataBinary"},
-    {0x00190144, nullptr, "SendPostDataBinaryTimeout"},
-    {0x001A0082, nullptr, "SendPostDataRaw"},
-    {0x001B0102, nullptr, "SendPOSTDataRawTimeout"},
-    {0x001C0080, nullptr, "SetPostDataEncoding"},
-    {0x001D0040, nullptr, "NotifyFinishSendPostData"},
-    {0x001E00C4, nullptr, "GetResponseHeader"},
-    {0x001F0144, nullptr, "GetResponseHeaderTimeout"},
-    {0x00200082, nullptr, "GetResponseData"},
-    {0x00210102, nullptr, "GetResponseDataTimeout"},
-    {0x00220040, nullptr, "GetResponseStatusCode"},
-    {0x002300C0, nullptr, "GetResponseStatusCodeTimeout"},
-    {0x00240082, nullptr, "AddTrustedRootCA"},
-    {0x00250080, nullptr, "AddDefaultCert"},
-    {0x00260080, nullptr, "SelectRootCertChain"},
-    {0x002700C4, nullptr, "SetClientCert"},
-    {0x002B0080, nullptr, "SetSSLOpt"},
-    {0x002C0080, nullptr, "SetSSLClearOpt"},
-    {0x002D0000, nullptr, "CreateRootCertChain"},
-    {0x002E0040, nullptr, "DestroyRootCertChain"},
-    {0x002F0082, nullptr, "RootCertChainAddCert"},
-    {0x00300080, nullptr, "RootCertChainAddDefaultCert"},
-    {0x00310080, nullptr, "RootCertChainRemoveCert"},
-    {0x00320084, nullptr, "OpenClientCertContext"},
-    {0x00330040, nullptr, "OpenDefaultClientCertContext"},
-    {0x00340040, nullptr, "CloseClientCertContext"},
-    {0x00350186, nullptr, "SetDefaultProxy"},
-    {0x00360000, nullptr, "ClearDNSCache"},
-    {0x00370080, nullptr, "SetKeepAlive"},
-    {0x003800C0, nullptr, "SetPostDataTypeSize"},
-    {0x00390000, nullptr, "Finalize"},
-};
-
-HTTP_C::HTTP_C() {
-    Register(FunctionTable);
-}
-
-} // namespace HTTP
-} // namespace Service

+ 0 - 22
src/core/hle/service/http_c.h

@@ -1,22 +0,0 @@
-// Copyright 2014 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include "core/hle/service/service.h"
-
-namespace Service {
-namespace HTTP {
-
-class HTTP_C final : public Interface {
-public:
-    HTTP_C();
-
-    std::string GetPortName() const override {
-        return "http:C";
-    }
-};
-
-} // namespace HTTP
-} // namespace Service

+ 0 - 231
src/core/hle/service/ir/extra_hid.cpp

@@ -1,231 +0,0 @@
-// Copyright 2017 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#include "common/alignment.h"
-#include "common/bit_field.h"
-#include "common/string_util.h"
-#include "core/core_timing.h"
-#include "core/hle/service/ir/extra_hid.h"
-#include "core/settings.h"
-
-namespace Service {
-namespace IR {
-
-enum class RequestID : u8 {
-    /**
-     * ConfigureHIDPolling request
-     * Starts HID input polling, or changes the polling interval if it is already started.
-     *  Inputs:
-     *     byte 0: request ID
-     *     byte 1: polling interval in ms
-     *     byte 2: unknown
-     */
-    ConfigureHIDPolling = 1,
-
-    /**
-     * ReadCalibrationData request
-     * Reads the calibration data stored in circle pad pro.
-     *  Inputs:
-     *     byte 0: request ID
-     *     byte 1: expected response time in ms?
-     *     byte 2-3: data offset (aligned to 0x10)
-     *     byte 4-5: data size (aligned to 0x10)
-     */
-    ReadCalibrationData = 2,
-
-    // TODO(wwylele): there are three more request types (id = 3, 4 and 5)
-};
-
-enum class ResponseID : u8 {
-
-    /**
-     * PollHID response
-     * Sends current HID status
-     *  Output:
-     *     byte 0: response ID
-     *     byte 1-3: Right circle pad position. This three bytes are two little-endian 12-bit
-     *         fields. The first one is for x-axis and the second one is for y-axis.
-     *     byte 4: bit[0:4] battery level; bit[5] ZL button; bit[6] ZR button; bit[7] R button
-     *         Note that for the three button fields, the bit is set when the button is NOT pressed.
-     *     byte 5: unknown
-     */
-    PollHID = 0x10,
-
-    /**
-     * ReadCalibrationData response
-     * Sends the calibration data reads from circle pad pro.
-     *  Output:
-     *     byte 0: resonse ID
-     *     byte 1-2: data offset (aligned to 0x10)
-     *     byte 3-4: data size (aligned to 0x10)
-     *     byte 5-...: calibration data
-     */
-    ReadCalibrationData = 0x11,
-};
-
-ExtraHID::ExtraHID(SendFunc send_func) : IRDevice(send_func) {
-    LoadInputDevices();
-
-    // The data below was retrieved from a New 3DS
-    // TODO(wwylele): this data is probably writable (via request 3?) and thus should be saved to
-    // and loaded from somewhere.
-    calibration_data = std::array<u8, 0x40>{{
-        // 0x00
-        0x00, 0x00, 0x08, 0x80, 0x85, 0xEB, 0x11, 0x3F,
-        // 0x08
-        0x85, 0xEB, 0x11, 0x3F, 0xFF, 0xFF, 0xFF, 0xF5,
-        // 0x10
-        0xFF, 0x00, 0x08, 0x80, 0x85, 0xEB, 0x11, 0x3F,
-        // 0x18
-        0x85, 0xEB, 0x11, 0x3F, 0xFF, 0xFF, 0xFF, 0x65,
-        // 0x20
-        0xFF, 0x00, 0x08, 0x80, 0x85, 0xEB, 0x11, 0x3F,
-        // 0x28
-        0x85, 0xEB, 0x11, 0x3F, 0xFF, 0xFF, 0xFF, 0x65,
-        // 0x30
-        0xFF, 0x00, 0x08, 0x80, 0x85, 0xEB, 0x11, 0x3F,
-        // 0x38
-        0x85, 0xEB, 0x11, 0x3F, 0xFF, 0xFF, 0xFF, 0x65,
-    }};
-
-    hid_polling_callback_id =
-        CoreTiming::RegisterEvent("ExtraHID::SendHIDStatus", [this](u64, int cycles_late) {
-            SendHIDStatus();
-            CoreTiming::ScheduleEvent(msToCycles(hid_period) - cycles_late,
-                                      hid_polling_callback_id);
-        });
-}
-
-ExtraHID::~ExtraHID() {
-    OnDisconnect();
-}
-
-void ExtraHID::OnConnect() {}
-
-void ExtraHID::OnDisconnect() {
-    CoreTiming::UnscheduleEvent(hid_polling_callback_id, 0);
-}
-
-void ExtraHID::HandleConfigureHIDPollingRequest(const std::vector<u8>& request) {
-    if (request.size() != 3) {
-        LOG_ERROR(Service_IR, "Wrong request size (%zu): %s", request.size(),
-                  Common::ArrayToString(request.data(), request.size()).c_str());
-        return;
-    }
-
-    // Change HID input polling interval
-    CoreTiming::UnscheduleEvent(hid_polling_callback_id, 0);
-    hid_period = request[1];
-    CoreTiming::ScheduleEvent(msToCycles(hid_period), hid_polling_callback_id);
-}
-
-void ExtraHID::HandleReadCalibrationDataRequest(const std::vector<u8>& request_buf) {
-    struct ReadCalibrationDataRequest {
-        RequestID request_id;
-        u8 expected_response_time;
-        u16_le offset;
-        u16_le size;
-    };
-    static_assert(sizeof(ReadCalibrationDataRequest) == 6,
-                  "ReadCalibrationDataRequest has wrong size");
-
-    if (request_buf.size() != sizeof(ReadCalibrationDataRequest)) {
-        LOG_ERROR(Service_IR, "Wrong request size (%zu): %s", request_buf.size(),
-                  Common::ArrayToString(request_buf.data(), request_buf.size()).c_str());
-        return;
-    }
-
-    ReadCalibrationDataRequest request;
-    std::memcpy(&request, request_buf.data(), sizeof(request));
-
-    const u16 offset = Common::AlignDown(request.offset, 16);
-    const u16 size = Common::AlignDown(request.size, 16);
-
-    if (offset + size > calibration_data.size()) {
-        LOG_ERROR(Service_IR, "Read beyond the end of calibration data! (offset=%u, size=%u)",
-                  offset, size);
-        return;
-    }
-
-    std::vector<u8> response(5);
-    response[0] = static_cast<u8>(ResponseID::ReadCalibrationData);
-    std::memcpy(&response[1], &request.offset, sizeof(request.offset));
-    std::memcpy(&response[3], &request.size, sizeof(request.size));
-    response.insert(response.end(), calibration_data.begin() + offset,
-                    calibration_data.begin() + offset + size);
-    Send(response);
-}
-
-void ExtraHID::OnReceive(const std::vector<u8>& data) {
-    switch (static_cast<RequestID>(data[0])) {
-    case RequestID::ConfigureHIDPolling:
-        HandleConfigureHIDPollingRequest(data);
-        break;
-    case RequestID::ReadCalibrationData:
-        HandleReadCalibrationDataRequest(data);
-        break;
-    default:
-        LOG_ERROR(Service_IR, "Unknown request: %s",
-                  Common::ArrayToString(data.data(), data.size()).c_str());
-        break;
-    }
-}
-
-void ExtraHID::SendHIDStatus() {
-    if (is_device_reload_pending.exchange(false))
-        LoadInputDevices();
-
-    struct {
-        union {
-            BitField<0, 8, u32_le> header;
-            BitField<8, 12, u32_le> c_stick_x;
-            BitField<20, 12, u32_le> c_stick_y;
-        } c_stick;
-        union {
-            BitField<0, 5, u8> battery_level;
-            BitField<5, 1, u8> zl_not_held;
-            BitField<6, 1, u8> zr_not_held;
-            BitField<7, 1, u8> r_not_held;
-        } buttons;
-        u8 unknown;
-    } response;
-    static_assert(sizeof(response) == 6, "HID status response has wrong size!");
-
-    constexpr int C_STICK_CENTER = 0x800;
-    // TODO(wwylele): this value is not accurately measured. We currently assume that the axis can
-    // take values in the whole range of a 12-bit integer.
-    constexpr int C_STICK_RADIUS = 0x7FF;
-
-    float x, y;
-    std::tie(x, y) = c_stick->GetStatus();
-
-    response.c_stick.header.Assign(static_cast<u8>(ResponseID::PollHID));
-    response.c_stick.c_stick_x.Assign(static_cast<u32>(C_STICK_CENTER + C_STICK_RADIUS * x));
-    response.c_stick.c_stick_y.Assign(static_cast<u32>(C_STICK_CENTER + C_STICK_RADIUS * y));
-    response.buttons.battery_level.Assign(0x1F);
-    response.buttons.zl_not_held.Assign(!zl->GetStatus());
-    response.buttons.zr_not_held.Assign(!zr->GetStatus());
-    response.buttons.r_not_held.Assign(1);
-    response.unknown = 0;
-
-    std::vector<u8> response_buffer(sizeof(response));
-    memcpy(response_buffer.data(), &response, sizeof(response));
-    Send(response_buffer);
-}
-
-void ExtraHID::RequestInputDevicesReload() {
-    is_device_reload_pending.store(true);
-}
-
-void ExtraHID::LoadInputDevices() {
-    zl = Input::CreateDevice<Input::ButtonDevice>(
-        Settings::values.buttons[Settings::NativeButton::ZL]);
-    zr = Input::CreateDevice<Input::ButtonDevice>(
-        Settings::values.buttons[Settings::NativeButton::ZR]);
-    c_stick = Input::CreateDevice<Input::AnalogDevice>(
-        Settings::values.analogs[Settings::NativeAnalog::CStick]);
-}
-
-} // namespace IR
-} // namespace Service

+ 0 - 48
src/core/hle/service/ir/extra_hid.h

@@ -1,48 +0,0 @@
-// Copyright 2017 Citra Emulator Project
-// Licensed under GPLv2 or any later version
-// Refer to the license.txt file included.
-
-#pragma once
-
-#include <array>
-#include <atomic>
-#include "core/frontend/input.h"
-#include "core/hle/service/ir/ir_user.h"
-
-namespace Service {
-namespace IR {
-
-/**
- * An IRDevice emulating Circle Pad Pro or New 3DS additional HID hardware.
- * This device sends periodic udates at a rate configured by the 3DS, and sends calibration data if
- * requested.
- */
-class ExtraHID final : public IRDevice {
-public:
-    explicit ExtraHID(SendFunc send_func);
-    ~ExtraHID();
-
-    void OnConnect() override;
-    void OnDisconnect() override;
-    void OnReceive(const std::vector<u8>& data) override;
-
-    /// Requests input devices reload from current settings. Called when the input settings change.
-    void RequestInputDevicesReload();
-
-private:
-    void SendHIDStatus();
-    void HandleConfigureHIDPollingRequest(const std::vector<u8>& request);
-    void HandleReadCalibrationDataRequest(const std::vector<u8>& request);
-    void LoadInputDevices();
-
-    u8 hid_period;
-    int hid_polling_callback_id;
-    std::array<u8, 0x40> calibration_data;
-    std::unique_ptr<Input::ButtonDevice> zl;
-    std::unique_ptr<Input::ButtonDevice> zr;
-    std::unique_ptr<Input::AnalogDevice> c_stick;
-    std::atomic<bool> is_device_reload_pending;
-};
-
-} // namespace IR
-} // namespace Service

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff