summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.travis-upload.sh2
-rw-r--r--CMakeLists.txt26
-rw-r--r--CONTRIBUTING.md21
-rw-r--r--README.md2
-rw-r--r--externals/microprofile/microprofile.h8
-rw-r--r--externals/microprofile/microprofileui.h1
-rwxr-xr-xhooks/pre-commit8
-rw-r--r--src/audio_core/hle/dsp.cpp4
-rw-r--r--src/audio_core/hle/pipe.cpp4
-rw-r--r--src/citra/CMakeLists.txt2
-rw-r--r--src/citra_qt/CMakeLists.txt2
-rw-r--r--src/citra_qt/debugger/graphics_vertex_shader.cpp4
-rw-r--r--src/citra_qt/debugger/registers.cpp2
-rw-r--r--src/citra_qt/game_list_p.h2
-rw-r--r--src/common/file_util.cpp25
-rw-r--r--src/common/hash.cpp2
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/common/logging/text_formatter.h2
-rw-r--r--src/common/swap.h7
-rw-r--r--src/common/thread.cpp12
-rw-r--r--src/common/vector_math.h3
-rw-r--r--src/common/x64/cpu_detect.cpp8
-rw-r--r--src/core/gdbstub/gdbstub.cpp2
-rw-r--r--src/core/hle/kernel/memory.cpp2
-rw-r--r--src/core/hle/kernel/thread.cpp2
-rw-r--r--src/core/hle/service/boss/boss.cpp967
-rw-r--r--src/core/hle/service/boss/boss.h785
-rw-r--r--src/core/hle/service/boss/boss_u.cpp60
-rw-r--r--src/core/hle/service/frd/frd.cpp2
-rw-r--r--src/core/hle/service/ldr_ro/cro_helper.cpp2
-rw-r--r--src/core/hle/service/soc_u.cpp8
-rw-r--r--src/core/loader/ncch.cpp2
-rw-r--r--src/core/loader/ncch.h2
-rw-r--r--src/video_core/command_processor.cpp2
-rw-r--r--src/video_core/shader/shader.cpp4
-rw-r--r--src/video_core/shader/shader_interpreter.cpp74
37 files changed, 1950 insertions, 113 deletions
diff --git a/.travis-upload.sh b/.travis-upload.sh
index 7838bf079..1bec74b3d 100755
--- a/.travis-upload.sh
+++ b/.travis-upload.sh
@@ -1,4 +1,4 @@
1if [ "$TRAVIS_BRANCH" = "master" ]; then 1if [ "$TRAVIS_EVENT_TYPE" = "push" ]&&[ "$TRAVIS_BRANCH" = "master" ]; then
2 GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" 2 GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`"
3 GITREV="`git show -s --format='%h'`" 3 GITREV="`git show -s --format='%h'`"
4 4
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7a24f04f..26dec8f86 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,6 +105,15 @@ else()
105 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE) 105 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE)
106endif() 106endif()
107 107
108# Set file offset size to 64 bits.
109#
110# On modern Unixes, this is typically already the case. The lone exception is
111# glibc, which may default to 32 bits. glibc allows this to be configured
112# by setting _FILE_OFFSET_BITS.
113if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
114 add_definitions(-D_FILE_OFFSET_BITS=64)
115endif()
116
108add_definitions(-DSINGLETHREADED) 117add_definitions(-DSINGLETHREADED)
109# CMake seems to only define _DEBUG on Windows 118# CMake seems to only define _DEBUG on Windows
110set_property(DIRECTORY APPEND PROPERTY 119set_property(DIRECTORY APPEND PROPERTY
@@ -160,23 +169,30 @@ endif()
160 169
161IF (APPLE) 170IF (APPLE)
162 FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related 171 FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related
163 set(PLATFORM_LIBRARIES iconv ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY}) 172 set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY})
164 173
165 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") 174 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
166 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") 175 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
167ELSEIF(MINGW) 176ELSEIF(MINGW)
168 # GCC does not support codecvt, so use iconv instead
169 # PSAPI is the Process Status API 177 # PSAPI is the Process Status API
170 set(PLATFORM_LIBRARIES winmm ws2_32 psapi iconv) 178 set(PLATFORM_LIBRARIES winmm ws2_32 psapi)
171 179
172 # WSAPoll functionality doesn't exist before WinNT 6.x (Vista and up) 180 # WSAPoll functionality doesn't exist before WinNT 6.x (Vista and up)
173 add_definitions(-D_WIN32_WINNT=0x0600) 181 add_definitions(-D_WIN32_WINNT=0x0600)
174ELSEIF(WIN32) 182ELSEIF(WIN32)
175 set(PLATFORM_LIBRARIES winmm ws2_32) 183 set(PLATFORM_LIBRARIES winmm ws2_32)
176ELSE() 184ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$")
177 set(PLATFORM_LIBRARIES rt) 185 set(PLATFORM_LIBRARIES rt)
178ENDIF (APPLE) 186ENDIF (APPLE)
179 187
188# MINGW: GCC does not support codecvt, so use iconv instead
189if (UNIX OR MINGW)
190 find_library(ICONV_LIBRARY NAMES iconv)
191 if (ICONV_LIBRARY)
192 list(APPEND PLATFORM_LIBRARIES ${ICONV_LIBRARY})
193 endif()
194endif()
195
180if (ENABLE_QT) 196if (ENABLE_QT)
181 if (CITRA_USE_BUNDLED_QT) 197 if (CITRA_USE_BUNDLED_QT)
182 if (MSVC14 AND ARCHITECTURE_x86_64) 198 if (MSVC14 AND ARCHITECTURE_x86_64)
@@ -253,7 +269,7 @@ add_subdirectory(src)
253# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html 269# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
254# http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html 270# http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
255# http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html 271# http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
256if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") 272if(ENABLE_QT AND UNIX AND NOT APPLE)
257 install(FILES "${CMAKE_SOURCE_DIR}/dist/citra.desktop" 273 install(FILES "${CMAKE_SOURCE_DIR}/dist/citra.desktop"
258 DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications") 274 DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
259 install(FILES "${CMAKE_SOURCE_DIR}/dist/citra.svg" 275 install(FILES "${CMAKE_SOURCE_DIR}/dist/citra.svg"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c2735f564..3d6a87651 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,21 +1,19 @@
1# Reporting Issues 1# Reporting Issues
2 2
3**The issue tracker is not a support forum.** Unless you can provide precise *technical information* regarding an issue, you *should not post in it*. If you need support, first read the [FAQ](https://github.com/citra-emu/citra/wiki/FAQ) and then either visit our IRC channel or ask in a general emulation forum such as [/r/emulation](https://www.reddit.com/r/emulation/). If you post support questions, generic messages to the developers or vague reports without technical details, they will be closed and locked. 3**The issue tracker is not a support forum.** Unless you can provide precise *technical information* regarding an issue, you *should not post in it*. If you need support, first read the [FAQ](https://github.com/citra-emu/citra/wiki/FAQ) and then either visit our IRC channel, [our forum](https://discuss.citra-emu.org/) or ask in a general emulation forum such as [/r/emulation](https://www.reddit.com/r/emulation/). If you post support questions, generic messages to the developers or vague reports without technical details, they will be closed and locked.
4 4
5If you believe you have a valid issue report, please post text or a screenshot from the log (the console window that opens alongside Citra) and build version (hex string visible in the titlebar and zip filename), as well as your hardware and software information if applicable. 5If you believe you have a valid issue report, please post text or a screenshot from the log (the console window that opens alongside Citra) and build version (hex string visible in the titlebar and zip filename), as well as your hardware and software information if applicable.
6 6
7While issues about specific games not booting are valid bugs, we are currently not interested in them unless you have several games which fail with the same or similar messages. (In which case please file only a single issue about it.) There are too many non-working games right now to file individual issues for every one of them.
8
9# Contributing 7# Contributing
10Citra is a brand new project, so we have a great opportunity to keep things clean and well organized early on. As such, coding style is very important when making commits. They aren't very strict rules since we want to be flexible and we understand that under certain circumstances some of them can be counterproductive. Just try to follow as many of them as possible: 8Citra is a brand new project, so we have a great opportunity to keep things clean and well organized early on. As such, coding style is very important when making commits. We run clang-format on our CI to check the code. Please use it to format your code when contributing. However, it doesn't cover all the rules below. Some of them aren't very strict rules since we want to be flexible and we understand that under certain circumstances some of them can be counterproductive. Just try to follow as many of them as possible:
11 9
12### General Rules 10### General Rules
13* A lot of code was taken from other projects (e.g. Dolphin, PPSSPP, Gekko, SkyEye). In general, when editing other people's code, follow the style of the module you're in (or better yet, fix the style if it drastically differs from our guide). 11* A lot of code was taken from other projects (e.g. Dolphin, PPSSPP, Gekko, SkyEye). In general, when editing other people's code, follow the style of the module you're in (or better yet, fix the style if it drastically differs from our guide).
14* Line width is typically 100 characters, but this isn't strictly enforced. Please do not use 80-characters. 12* Line width is typically 100 characters. Please do not use 80-characters.
15* Don't ever introduce new external dependencies into Core 13* Don't ever introduce new external dependencies into Core
16* Don't use any platform specific code in Core 14* Don't use any platform specific code in Core
17* Use namespaces often 15* Use namespaces often
18* Avoid the use of C-style casts and instead prefer C++-style `static_cast` and `reinterpret_cast`. Never use `const_cast` or `dynamic_cast` (we build with RTTI disabled). The only exception to this rule is for casting between two numeric types, where C-style casts are encouraged for brevity and readability. 16* Avoid the use of C-style casts and instead prefer C++-style `static_cast` and `reinterpret_cast`. Try to avoid using `dynamic_cast`. Never use `const_cast`. The only exception to this rule is for casting between two numeric types, where C-style casts are encouraged for brevity and readability.
19 17
20### Naming Rules 18### Naming Rules
21* Functions: `PascalCase` 19* Functions: `PascalCase`
@@ -59,9 +57,9 @@ char* g_some_pointer; // Pointer * and reference & stick to the type name
59 57
60/// A colorful enum. 58/// A colorful enum.
61enum SomeEnum { 59enum SomeEnum {
62 COLOR_RED, ///< The color of fire. 60 ColorRed, ///< The color of fire.
63 COLOR_GREEN, ///< The color of grass. 61 ColorGreen, ///< The color of grass.
64 COLOR_BLUE, ///< Not actually the color of water. 62 ColorBlue, ///< Not actually the color of water.
65}; 63};
66 64
67/** 65/**
@@ -79,7 +77,7 @@ void FooBar() {
79 5, 77 5,
80 25, 78 25,
81 7, 79 7,
82 42 80 42,
83 }; 81 };
84 82
85 if (note == the_space_after_the_if) { 83 if (note == the_space_after_the_if) {
@@ -88,9 +86,6 @@ void FooBar() {
88 // Use a space after the // when commenting 86 // Use a space after the // when commenting
89 } 87 }
90 88
91 // Comment directly above code when possible
92 if (some_condition) single_statement();
93
94 // Place a single space after the for loop semicolons, prefer pre-increment 89 // Place a single space after the for loop semicolons, prefer pre-increment
95 for (int i = 0; i != 25; ++i) { 90 for (int i = 0; i != 25; ++i) {
96 // This is how we write loops 91 // This is how we write loops
diff --git a/README.md b/README.md
index 13919a37d..c266eaeba 100644
--- a/README.md
+++ b/README.md
@@ -35,4 +35,4 @@ If you like, you can [donate by PayPal](https://www.paypal.com/cgi-bin/webscr?cm
35* Eventually 3D displays to get proper 3D output working 35* Eventually 3D displays to get proper 3D output working
36* ... etc ... 36* ... etc ...
37 37
38We also more than gladly accept used 3DS consoles, preferrably ones with firmware 4.5 or lower! If you would like to give yours away, don't hesitate to join our IRC channel #citra on [Freenode](http://webchat.freenode.net/?channels=citra) and talk to neobrain or bunnei. Mind you, IRC is slow-paced, so it might be a while until people reply. If you're in a hurry you can just leave contact details in the channel or via private message and we'll get back to you. 38We also more than gladly accept used 3DS consoles, preferably ones with firmware 4.5 or lower! If you would like to give yours away, don't hesitate to join our IRC channel #citra on [Freenode](http://webchat.freenode.net/?channels=citra) and talk to neobrain or bunnei. Mind you, IRC is slow-paced, so it might be a while until people reply. If you're in a hurry you can just leave contact details in the channel or via private message and we'll get back to you.
diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h
index d1ae0c1c2..30613b3b0 100644
--- a/externals/microprofile/microprofile.h
+++ b/externals/microprofile/microprofile.h
@@ -206,7 +206,7 @@ int64_t MicroProfileGetTick();
206#define MP_GETCURRENTTHREADID() GetCurrentThreadId() 206#define MP_GETCURRENTTHREADID() GetCurrentThreadId()
207typedef uint32_t ThreadIdType; 207typedef uint32_t ThreadIdType;
208 208
209#elif defined(__linux__) 209#elif !defined(_WIN32)
210#include <unistd.h> 210#include <unistd.h>
211#include <time.h> 211#include <time.h>
212inline int64_t MicroProfileTicksPerSecondCpu() 212inline int64_t MicroProfileTicksPerSecondCpu()
@@ -510,7 +510,7 @@ typedef int MpSocket;
510#endif 510#endif
511 511
512 512
513#if defined(__APPLE__) || defined(__linux__) 513#ifndef _WIN32
514typedef pthread_t MicroProfileThread; 514typedef pthread_t MicroProfileThread;
515#elif defined(_WIN32) 515#elif defined(_WIN32)
516typedef HANDLE MicroProfileThread; 516typedef HANDLE MicroProfileThread;
@@ -907,7 +907,7 @@ int64_t MicroProfileGetTick()
907 907
908typedef void* (*MicroProfileThreadFunc)(void*); 908typedef void* (*MicroProfileThreadFunc)(void*);
909 909
910#if defined(__APPLE__) || defined(__linux__) 910#ifndef _WIN32
911typedef pthread_t MicroProfileThread; 911typedef pthread_t MicroProfileThread;
912void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) 912void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func)
913{ 913{
@@ -959,7 +959,7 @@ inline void MicroProfileThreadJoin(MicroProfileThread* pThread)
959#define MP_INVALID_SOCKET(f) (f == INVALID_SOCKET) 959#define MP_INVALID_SOCKET(f) (f == INVALID_SOCKET)
960#endif 960#endif
961 961
962#if defined(__APPLE__) 962#ifndef _WIN32
963#include <sys/socket.h> 963#include <sys/socket.h>
964#include <netinet/in.h> 964#include <netinet/in.h>
965#include <fcntl.h> 965#include <fcntl.h>
diff --git a/externals/microprofile/microprofileui.h b/externals/microprofile/microprofileui.h
index 45bec8af6..66a73abc5 100644
--- a/externals/microprofile/microprofileui.h
+++ b/externals/microprofile/microprofileui.h
@@ -172,6 +172,7 @@ MICROPROFILEUI_API void MicroProfileCustomGroupAddTimer(const char* pCustomName,
172#ifdef _WIN32 172#ifdef _WIN32
173#define snprintf _snprintf 173#define snprintf _snprintf
174#endif 174#endif
175#include <stdio.h>
175#include <stdlib.h> 176#include <stdlib.h>
176#include <stdarg.h> 177#include <stdarg.h>
177#include <math.h> 178#include <math.h>
diff --git a/hooks/pre-commit b/hooks/pre-commit
index 6dd281c4a..04fdaf8ec 100755
--- a/hooks/pre-commit
+++ b/hooks/pre-commit
@@ -1,4 +1,4 @@
1#!/bin/bash 1#!/bin/sh
2 2
3# Enforce citra's whitespace policy 3# Enforce citra's whitespace policy
4git config --local core.whitespace tab-in-indent,trailing-space 4git config --local core.whitespace tab-in-indent,trailing-space
@@ -10,7 +10,7 @@ if ! git diff --cached --check -- $paths_to_check ; then
10 cat<<END 10 cat<<END
11 11
12Error: This commit would contain trailing spaces or tabs, which is against this repo's policy. 12Error: This commit would contain trailing spaces or tabs, which is against this repo's policy.
13Please correct those issues before commiting. (Use 'git diff --check' for more details) 13Please correct those issues before committing. (Use 'git diff --check' for more details)
14If you know what you are doing, you can try 'git commit --no-verify' to bypass the check 14If you know what you are doing, you can try 'git commit --no-verify' to bypass the check
15END 15END
16 exit 1 16 exit 1
@@ -32,7 +32,7 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do
32 if ! echo "$f" | egrep -q "^src/"; then 32 if ! echo "$f" | egrep -q "^src/"; then
33 continue 33 continue
34 fi 34 fi
35 d=$(diff -u "$f" <(clang-format "$f")) 35 d=$(clang-format "$f" | diff -u "$f" -)
36 if ! [ -z "$d" ]; then 36 if ! [ -z "$d" ]; then
37 echo "!!! $f not compliant to coding style, here is the fix:" 37 echo "!!! $f not compliant to coding style, here is the fix:"
38 echo "$d" 38 echo "$d"
@@ -40,4 +40,4 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do
40 fi 40 fi
41done 41done
42 42
43exit "$fail" 43exit "${fail-0}"
diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp
index 58690970a..31421fdc6 100644
--- a/src/audio_core/hle/dsp.cpp
+++ b/src/audio_core/hle/dsp.cpp
@@ -23,12 +23,12 @@ static size_t CurrentRegionIndex() {
23 // This function only returns a 0 or 1. 23 // This function only returns a 0 or 1.
24 24
25 if (g_regions[0].frame_counter == 0xFFFFu && g_regions[1].frame_counter != 0xFFFEu) { 25 if (g_regions[0].frame_counter == 0xFFFFu && g_regions[1].frame_counter != 0xFFFEu) {
26 // Wraparound has occured. 26 // Wraparound has occurred.
27 return 1; 27 return 1;
28 } 28 }
29 29
30 if (g_regions[1].frame_counter == 0xFFFFu && g_regions[0].frame_counter != 0xFFFEu) { 30 if (g_regions[1].frame_counter == 0xFFFFu && g_regions[0].frame_counter != 0xFFFEu) {
31 // Wraparound has occured. 31 // Wraparound has occurred.
32 return 0; 32 return 0;
33 } 33 }
34 34
diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp
index b472c81d8..bc69acbc2 100644
--- a/src/audio_core/hle/pipe.cpp
+++ b/src/audio_core/hle/pipe.cpp
@@ -117,7 +117,7 @@ void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
117 } 117 }
118 118
119 enum class StateChange { 119 enum class StateChange {
120 Initalize = 0, 120 Initialize = 0,
121 Shutdown = 1, 121 Shutdown = 1,
122 Wakeup = 2, 122 Wakeup = 2,
123 Sleep = 3, 123 Sleep = 3,
@@ -130,7 +130,7 @@ void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
130 // sleeping and reset it back after wakeup on behalf of the DSP. 130 // sleeping and reset it back after wakeup on behalf of the DSP.
131 131
132 switch (static_cast<StateChange>(buffer[0])) { 132 switch (static_cast<StateChange>(buffer[0])) {
133 case StateChange::Initalize: 133 case StateChange::Initialize:
134 LOG_INFO(Audio_DSP, "Application has requested initialization of DSP hardware"); 134 LOG_INFO(Audio_DSP, "Application has requested initialization of DSP hardware");
135 ResetPipes(); 135 ResetPipes();
136 AudioPipeWriteStructAddresses(); 136 AudioPipeWriteStructAddresses();
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index 43fa06b4e..f9c488a1a 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -23,7 +23,7 @@ if (MSVC)
23endif() 23endif()
24target_link_libraries(citra ${PLATFORM_LIBRARIES} Threads::Threads) 24target_link_libraries(citra ${PLATFORM_LIBRARIES} Threads::Threads)
25 25
26if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") 26if(UNIX AND NOT APPLE)
27 install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") 27 install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
28endif() 28endif()
29 29
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index b3c01ddd8..384875450 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -104,7 +104,7 @@ target_link_libraries(citra-qt core video_core audio_core common qhexedit)
104target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) 104target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS})
105target_link_libraries(citra-qt ${PLATFORM_LIBRARIES} Threads::Threads) 105target_link_libraries(citra-qt ${PLATFORM_LIBRARIES} Threads::Threads)
106 106
107if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") 107if(UNIX AND NOT APPLE)
108 install(TARGETS citra-qt RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") 108 install(TARGETS citra-qt RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
109endif() 109endif()
110 110
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp
index 0b4320da5..96b40db1e 100644
--- a/src/citra_qt/debugger/graphics_vertex_shader.cpp
+++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp
@@ -424,7 +424,7 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(
424 // Create an HBoxLayout to store the widgets used to specify a particular attribute 424 // Create an HBoxLayout to store the widgets used to specify a particular attribute
425 // and store it in a QWidget to allow for easy hiding and unhiding. 425 // and store it in a QWidget to allow for easy hiding and unhiding.
426 auto row_layout = new QHBoxLayout; 426 auto row_layout = new QHBoxLayout;
427 // Remove unecessary padding between rows 427 // Remove unnecessary padding between rows
428 row_layout->setContentsMargins(0, 0, 0, 0); 428 row_layout->setContentsMargins(0, 0, 0, 0);
429 429
430 row_layout->addWidget(new QLabel(tr("Attribute %1").arg(i, 2))); 430 row_layout->addWidget(new QLabel(tr("Attribute %1").arg(i, 2)));
@@ -590,7 +590,7 @@ void GraphicsVertexShaderWidget::OnCycleIndexChanged(int index) {
590 .arg(record.dest_out.w.ToFloat32()); 590 .arg(record.dest_out.w.ToFloat32());
591 591
592 if (record.mask & Pica::Shader::DebugDataRecord::ADDR_REG_OUT) 592 if (record.mask & Pica::Shader::DebugDataRecord::ADDR_REG_OUT)
593 text += tr("Addres Registers: %1, %2\n") 593 text += tr("Address Registers: %1, %2\n")
594 .arg(record.address_registers[0]) 594 .arg(record.address_registers[0])
595 .arg(record.address_registers[1]); 595 .arg(record.address_registers[1]);
596 if (record.mask & Pica::Shader::DebugDataRecord::CMP_RESULT) 596 if (record.mask & Pica::Shader::DebugDataRecord::CMP_RESULT)
diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp
index 0b644432f..4c529d3c3 100644
--- a/src/citra_qt/debugger/registers.cpp
+++ b/src/citra_qt/debugger/registers.cpp
@@ -136,7 +136,7 @@ void RegistersWidget::UpdateCPSRValues() {
136 cpsr->child(2)->setText(1, QString::number((cpsr_val >> 6) & 1)); // F - FIQ disable 136 cpsr->child(2)->setText(1, QString::number((cpsr_val >> 6) & 1)); // F - FIQ disable
137 cpsr->child(3)->setText(1, QString::number((cpsr_val >> 7) & 1)); // I - IRQ disable 137 cpsr->child(3)->setText(1, QString::number((cpsr_val >> 7) & 1)); // I - IRQ disable
138 cpsr->child(4)->setText(1, QString::number((cpsr_val >> 8) & 1)); // A - Imprecise abort 138 cpsr->child(4)->setText(1, QString::number((cpsr_val >> 8) & 1)); // A - Imprecise abort
139 cpsr->child(5)->setText(1, QString::number((cpsr_val >> 9) & 1)); // E - Data endianess 139 cpsr->child(5)->setText(1, QString::number((cpsr_val >> 9) & 1)); // E - Data endianness
140 cpsr->child(6)->setText(1, 140 cpsr->child(6)->setText(1,
141 QString::number((cpsr_val >> 10) & 0x3F)); // IT - If-Then state (DNM) 141 QString::number((cpsr_val >> 10) & 0x3F)); // IT - If-Then state (DNM)
142 cpsr->child(7)->setText(1, 142 cpsr->child(7)->setText(1,
diff --git a/src/citra_qt/game_list_p.h b/src/citra_qt/game_list_p.h
index 60ab4cf02..5ca3fe991 100644
--- a/src/citra_qt/game_list_p.h
+++ b/src/citra_qt/game_list_p.h
@@ -64,7 +64,7 @@ public:
64 * A specialization of GameListItem for path values. 64 * A specialization of GameListItem for path values.
65 * This class ensures that for every full path value it holds, a correct string representation 65 * This class ensures that for every full path value it holds, a correct string representation
66 * of just the filename (with no extension) will be displayed to the user. 66 * of just the filename (with no extension) will be displayed to the user.
67 * If this class recieves valid SMDH data, it will also display game icons and titles. 67 * If this class receives valid SMDH data, it will also display game icons and titles.
68 */ 68 */
69class GameListItemPath : public GameListItem { 69class GameListItemPath : public GameListItem {
70 70
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 14cbcac6b..407ed047a 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -23,8 +23,8 @@
23#define fseeko _fseeki64 23#define fseeko _fseeki64
24#define ftello _ftelli64 24#define ftello _ftelli64
25#define atoll _atoi64 25#define atoll _atoi64
26#define stat64 _stat64 26#define stat _stat64
27#define fstat64 _fstat64 27#define fstat _fstat64
28#define fileno _fileno 28#define fileno _fileno
29#else 29#else
30#ifdef __APPLE__ 30#ifdef __APPLE__
@@ -52,11 +52,6 @@
52#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) 52#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
53#endif 53#endif
54 54
55#ifdef BSD4_4
56#define stat64 stat
57#define fstat64 fstat
58#endif
59
60// This namespace has various generic functions related to files and paths. 55// This namespace has various generic functions related to files and paths.
61// The code still needs a ton of cleanup. 56// The code still needs a ton of cleanup.
62// REMEMBER: strdup considered harmful! 57// REMEMBER: strdup considered harmful!
@@ -76,7 +71,7 @@ static void StripTailDirSlashes(std::string& fname) {
76 71
77// Returns true if file filename exists 72// Returns true if file filename exists
78bool Exists(const std::string& filename) { 73bool Exists(const std::string& filename) {
79 struct stat64 file_info; 74 struct stat file_info;
80 75
81 std::string copy(filename); 76 std::string copy(filename);
82 StripTailDirSlashes(copy); 77 StripTailDirSlashes(copy);
@@ -88,7 +83,7 @@ bool Exists(const std::string& filename) {
88 83
89 int result = _wstat64(Common::UTF8ToUTF16W(copy).c_str(), &file_info); 84 int result = _wstat64(Common::UTF8ToUTF16W(copy).c_str(), &file_info);
90#else 85#else
91 int result = stat64(copy.c_str(), &file_info); 86 int result = stat(copy.c_str(), &file_info);
92#endif 87#endif
93 88
94 return (result == 0); 89 return (result == 0);
@@ -96,7 +91,7 @@ bool Exists(const std::string& filename) {
96 91
97// Returns true if filename is a directory 92// Returns true if filename is a directory
98bool IsDirectory(const std::string& filename) { 93bool IsDirectory(const std::string& filename) {
99 struct stat64 file_info; 94 struct stat file_info;
100 95
101 std::string copy(filename); 96 std::string copy(filename);
102 StripTailDirSlashes(copy); 97 StripTailDirSlashes(copy);
@@ -108,7 +103,7 @@ bool IsDirectory(const std::string& filename) {
108 103
109 int result = _wstat64(Common::UTF8ToUTF16W(copy).c_str(), &file_info); 104 int result = _wstat64(Common::UTF8ToUTF16W(copy).c_str(), &file_info);
110#else 105#else
111 int result = stat64(copy.c_str(), &file_info); 106 int result = stat(copy.c_str(), &file_info);
112#endif 107#endif
113 108
114 if (result < 0) { 109 if (result < 0) {
@@ -339,11 +334,11 @@ u64 GetSize(const std::string& filename) {
339 return 0; 334 return 0;
340 } 335 }
341 336
342 struct stat64 buf; 337 struct stat buf;
343#ifdef _WIN32 338#ifdef _WIN32
344 if (_wstat64(Common::UTF8ToUTF16W(filename).c_str(), &buf) == 0) 339 if (_wstat64(Common::UTF8ToUTF16W(filename).c_str(), &buf) == 0)
345#else 340#else
346 if (stat64(filename.c_str(), &buf) == 0) 341 if (stat(filename.c_str(), &buf) == 0)
347#endif 342#endif
348 { 343 {
349 LOG_TRACE(Common_Filesystem, "%s: %lld", filename.c_str(), (long long)buf.st_size); 344 LOG_TRACE(Common_Filesystem, "%s: %lld", filename.c_str(), (long long)buf.st_size);
@@ -356,8 +351,8 @@ u64 GetSize(const std::string& filename) {
356 351
357// Overloaded GetSize, accepts file descriptor 352// Overloaded GetSize, accepts file descriptor
358u64 GetSize(const int fd) { 353u64 GetSize(const int fd) {
359 struct stat64 buf; 354 struct stat buf;
360 if (fstat64(fd, &buf) != 0) { 355 if (fstat(fd, &buf) != 0) {
361 LOG_ERROR(Common_Filesystem, "GetSize: stat failed %i: %s", fd, GetLastErrorMsg()); 356 LOG_ERROR(Common_Filesystem, "GetSize: stat failed %i: %s", fd, GetLastErrorMsg());
362 return 0; 357 return 0;
363 } 358 }
diff --git a/src/common/hash.cpp b/src/common/hash.cpp
index 5aa5118eb..2309320bb 100644
--- a/src/common/hash.cpp
+++ b/src/common/hash.cpp
@@ -31,7 +31,7 @@ static FORCE_INLINE u64 fmix64(u64 k) {
31 return k; 31 return k;
32} 32}
33 33
34// This is the 128-bit variant of the MurmurHash3 hash function that is targetted for 64-bit 34// This is the 128-bit variant of the MurmurHash3 hash function that is targeted for 64-bit
35// platforms (MurmurHash3_x64_128). It was taken from: 35// platforms (MurmurHash3_x64_128). It was taken from:
36// https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp 36// https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp
37void MurmurHash3_128(const void* key, int len, u32 seed, void* out) { 37void MurmurHash3_128(const void* key, int len, u32 seed, void* out) {
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 9a13a9e90..88209081d 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -37,6 +37,7 @@ namespace Log {
37 SUB(Service, FS) \ 37 SUB(Service, FS) \
38 SUB(Service, ERR) \ 38 SUB(Service, ERR) \
39 SUB(Service, APT) \ 39 SUB(Service, APT) \
40 SUB(Service, BOSS) \
40 SUB(Service, GSP) \ 41 SUB(Service, GSP) \
41 SUB(Service, AC) \ 42 SUB(Service, AC) \
42 SUB(Service, AM) \ 43 SUB(Service, AM) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index a4b4750de..8d3a2d03e 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -54,6 +54,7 @@ enum class Class : ClassType {
54 Service_FS, ///< The FS (Filesystem) service implementation 54 Service_FS, ///< The FS (Filesystem) service implementation
55 Service_ERR, ///< The ERR (Error) port implementation 55 Service_ERR, ///< The ERR (Error) port implementation
56 Service_APT, ///< The APT (Applets) service 56 Service_APT, ///< The APT (Applets) service
57 Service_BOSS, ///< The BOSS (SpotPass) service
57 Service_GSP, ///< The GSP (GPU control) service 58 Service_GSP, ///< The GSP (GPU control) service
58 Service_AC, ///< The AC (WiFi status) service 59 Service_AC, ///< The AC (WiFi status) service
59 Service_AM, ///< The AM (Application manager) service 60 Service_AM, ///< The AM (Application manager) service
diff --git a/src/common/logging/text_formatter.h b/src/common/logging/text_formatter.h
index 0da102bc6..749268310 100644
--- a/src/common/logging/text_formatter.h
+++ b/src/common/logging/text_formatter.h
@@ -17,7 +17,7 @@ struct Entry;
17 * 17 *
18 * @param path The input file path as a null-terminated string 18 * @param path The input file path as a null-terminated string
19 * @param root The name of the root source directory as a null-terminated string. Path up to and 19 * @param root The name of the root source directory as a null-terminated string. Path up to and
20 * including the last occurence of this name will be stripped 20 * including the last occurrence of this name will be stripped
21 * @return A pointer to the same string passed as `path`, but starting at the trimmed portion 21 * @return A pointer to the same string passed as `path`, but starting at the trimmed portion
22 */ 22 */
23const char* TrimSourcePath(const char* path, const char* root = "src"); 23const char* TrimSourcePath(const char* path, const char* root = "src");
diff --git a/src/common/swap.h b/src/common/swap.h
index e241c9f73..d94cbe6b2 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -21,7 +21,8 @@
21#include <cstdlib> 21#include <cstdlib>
22#elif defined(__linux__) 22#elif defined(__linux__)
23#include <byteswap.h> 23#include <byteswap.h>
24#elif defined(__FreeBSD__) 24#elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || \
25 defined(__NetBSD__) || defined(__OpenBSD__)
25#include <sys/endian.h> 26#include <sys/endian.h>
26#endif 27#endif
27#include <cstring> 28#include <cstring>
@@ -101,7 +102,9 @@ inline __attribute__((always_inline)) u32 swap32(u32 _data) {
101inline __attribute__((always_inline)) u64 swap64(u64 _data) { 102inline __attribute__((always_inline)) u64 swap64(u64 _data) {
102 return __builtin_bswap64(_data); 103 return __builtin_bswap64(_data);
103} 104}
104#elif __FreeBSD__ 105#elif defined(__Bitrig__) || defined(__OpenBSD__)
106// swap16, swap32, swap64 are left as is
107#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
105inline u16 swap16(u16 _data) { 108inline u16 swap16(u16 _data) {
106 return bswap16(_data); 109 return bswap16(_data);
107} 110}
diff --git a/src/common/thread.cpp b/src/common/thread.cpp
index 6e7b39b9a..9bb2f4e1d 100644
--- a/src/common/thread.cpp
+++ b/src/common/thread.cpp
@@ -8,7 +8,7 @@
8#elif defined(_WIN32) 8#elif defined(_WIN32)
9#include <Windows.h> 9#include <Windows.h>
10#else 10#else
11#if defined(BSD4_4) || defined(__OpenBSD__) 11#if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
12#include <pthread_np.h> 12#include <pthread_np.h>
13#else 13#else
14#include <pthread.h> 14#include <pthread.h>
@@ -19,6 +19,10 @@
19#include <unistd.h> 19#include <unistd.h>
20#endif 20#endif
21 21
22#ifdef __FreeBSD__
23#define cpu_set_t cpuset_t
24#endif
25
22namespace Common { 26namespace Common {
23 27
24int CurrentThreadId() { 28int CurrentThreadId() {
@@ -86,7 +90,7 @@ void SetCurrentThreadName(const char* szThreadName) {
86void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) { 90void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) {
87#ifdef __APPLE__ 91#ifdef __APPLE__
88 thread_policy_set(pthread_mach_thread_np(thread), THREAD_AFFINITY_POLICY, (integer_t*)&mask, 1); 92 thread_policy_set(pthread_mach_thread_np(thread), THREAD_AFFINITY_POLICY, (integer_t*)&mask, 1);
89#elif (defined __linux__ || defined BSD4_4) && !(defined ANDROID) 93#elif (defined __linux__ || defined __FreeBSD__) && !(defined ANDROID)
90 cpu_set_t cpu_set; 94 cpu_set_t cpu_set;
91 CPU_ZERO(&cpu_set); 95 CPU_ZERO(&cpu_set);
92 96
@@ -117,8 +121,10 @@ void SwitchCurrentThread() {
117void SetCurrentThreadName(const char* szThreadName) { 121void SetCurrentThreadName(const char* szThreadName) {
118#ifdef __APPLE__ 122#ifdef __APPLE__
119 pthread_setname_np(szThreadName); 123 pthread_setname_np(szThreadName);
120#elif defined(__OpenBSD__) 124#elif defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
121 pthread_set_name_np(pthread_self(), szThreadName); 125 pthread_set_name_np(pthread_self(), szThreadName);
126#elif defined(__NetBSD__)
127 pthread_setname_np(pthread_self(), "%s", (void*)szThreadName);
122#else 128#else
123 pthread_setname_np(pthread_self(), szThreadName); 129 pthread_setname_np(pthread_self(), szThreadName);
124#endif 130#endif
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index 2d56f168c..a57d86d88 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -60,7 +60,6 @@ public:
60 } 60 }
61 61
62 Vec2() = default; 62 Vec2() = default;
63 Vec2(const T a[2]) : x(a[0]), y(a[1]) {}
64 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {} 63 Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
65 64
66 template <typename T2> 65 template <typename T2>
@@ -199,7 +198,6 @@ public:
199 } 198 }
200 199
201 Vec3() = default; 200 Vec3() = default;
202 Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) {}
203 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {} 201 Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {}
204 202
205 template <typename T2> 203 template <typename T2>
@@ -405,7 +403,6 @@ public:
405 } 403 }
406 404
407 Vec4() = default; 405 Vec4() = default;
408 Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) {}
409 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {} 406 Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {}
410 407
411 template <typename T2> 408 template <typename T2>
diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp
index 6ddf9b70c..370ae2c80 100644
--- a/src/common/x64/cpu_detect.cpp
+++ b/src/common/x64/cpu_detect.cpp
@@ -12,13 +12,15 @@ namespace Common {
12 12
13#ifndef _MSC_VER 13#ifndef _MSC_VER
14 14
15#ifdef __FreeBSD__ 15#if defined(__DragonFly__) || defined(__FreeBSD__)
16#include <machine/cpufunc.h> 16// clang-format off
17#include <sys/types.h> 17#include <sys/types.h>
18#include <machine/cpufunc.h>
19// clang-format on
18#endif 20#endif
19 21
20static inline void __cpuidex(int info[4], int function_id, int subfunction_id) { 22static inline void __cpuidex(int info[4], int function_id, int subfunction_id) {
21#ifdef __FreeBSD__ 23#if defined(__DragonFly__) || defined(__FreeBSD__)
22 // Despite the name, this is just do_cpuid() with ECX as second input. 24 // Despite the name, this is just do_cpuid() with ECX as second input.
23 cpuid_count((u_int)function_id, (u_int)subfunction_id, (u_int*)info); 25 cpuid_count((u_int)function_id, (u_int)subfunction_id, (u_int*)info);
24#else 26#else
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index 7fc72d801..ceb993ea1 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -413,7 +413,7 @@ static void HandleQuery() {
413 413
414 if (strcmp(query, "TStatus") == 0) { 414 if (strcmp(query, "TStatus") == 0) {
415 SendReply("T0"); 415 SendReply("T0");
416 } else if (strncmp(query, "Supported:", strlen("Supported:")) == 0) { 416 } else if (strncmp(query, "Supported", strlen("Supported")) == 0) {
417 // PacketSize needs to be large enough for target xml 417 // PacketSize needs to be large enough for target xml
418 SendReply("PacketSize=800;qXfer:features:read+"); 418 SendReply("PacketSize=800;qXfer:features:read+");
419 } else if (strncmp(query, "Xfer:features:read:target.xml:", 419 } else if (strncmp(query, "Xfer:features:read:target.xml:",
diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp
index e65fd5c41..33c165197 100644
--- a/src/core/hle/kernel/memory.cpp
+++ b/src/core/hle/kernel/memory.cpp
@@ -23,7 +23,7 @@ namespace Kernel {
23 23
24static MemoryRegionInfo memory_regions[3]; 24static MemoryRegionInfo memory_regions[3];
25 25
26/// Size of the APPLICATION, SYSTEM and BASE memory regions (respectively) for each sytem 26/// Size of the APPLICATION, SYSTEM and BASE memory regions (respectively) for each system
27/// memory configuration type. 27/// memory configuration type.
28static const u32 memory_region_sizes[8][3] = { 28static const u32 memory_region_sizes[8][3] = {
29 // Old 3DS layouts 29 // Old 3DS layouts
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index c4eeeee56..84d6d24c6 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -204,7 +204,7 @@ static std::tuple<u32*, u32*> GetWaitSynchTimeoutParameterRegister(Thread* threa
204} 204}
205 205
206/** 206/**
207 * Updates the WaitSynchronization timeout paramter according to the difference 207 * Updates the WaitSynchronization timeout parameter according to the difference
208 * between ticks of the last WaitSynchronization call and the incoming one. 208 * between ticks of the last WaitSynchronization call and the incoming one.
209 * @param timeout_low a pointer to the register for the low part of the timeout parameter 209 * @param timeout_low a pointer to the register for the low part of the timeout parameter
210 * @param timeout_high a pointer to the register for the high part of the timeout parameter 210 * @param timeout_high a pointer to the register for the high part of the timeout parameter
diff --git a/src/core/hle/service/boss/boss.cpp b/src/core/hle/service/boss/boss.cpp
index 757a8c2c7..6ab16ccd5 100644
--- a/src/core/hle/service/boss/boss.cpp
+++ b/src/core/hle/service/boss/boss.cpp
@@ -10,11 +10,978 @@
10namespace Service { 10namespace Service {
11namespace BOSS { 11namespace BOSS {
12 12
13static u32 new_arrival_flag;
14static u32 ns_data_new_flag;
15static u32 output_flag;
16
17void InitializeSession(Service::Interface* self) {
18 u32* cmd_buff = Kernel::GetCommandBuffer();
19 // TODO(JamePeng): Figure out the meaning of these parameters
20 u64 unk_param = ((u64)cmd_buff[1] | ((u64)cmd_buff[2] << 32));
21 u32 translation = cmd_buff[3];
22 u32 unk_param4 = cmd_buff[4];
23
24 if (translation != IPC::CallingPidDesc()) {
25 cmd_buff[0] = IPC::MakeHeader(0, 0x1, 0); // 0x40
26 cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS,
27 ErrorSummary::WrongArgument, ErrorLevel::Permanent)
28 .raw;
29 LOG_ERROR(Service_BOSS, "The translation was invalid, translation=0x%08X", translation);
30 return;
31 }
32
33 cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0);
34 cmd_buff[1] = RESULT_SUCCESS.raw;
35
36 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param=0x%016X, translation=0x%08X, unk_param4=0x%08X",
37 unk_param, translation, unk_param4);
38}
39
40void RegisterStorage(Service::Interface* self) {
41 u32* cmd_buff = Kernel::GetCommandBuffer();
42 // TODO(JamePeng): Figure out the meaning of these parameters
43 u32 unk_param1 = cmd_buff[1];
44 u32 unk_param2 = cmd_buff[2];
45 u32 unk_param3 = cmd_buff[3];
46 u32 unk_flag = cmd_buff[4] & 0xFF;
47
48 cmd_buff[0] = IPC::MakeHeader(0x2, 0x1, 0);
49 cmd_buff[1] = RESULT_SUCCESS.raw;
50
51 LOG_WARNING(
52 Service_BOSS,
53 "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, unk_flag=0x%08X",
54 unk_param1, unk_param2, unk_param3, unk_flag);
55}
56
57void UnregisterStorage(Service::Interface* self) {
58 u32* cmd_buff = Kernel::GetCommandBuffer();
59
60 cmd_buff[0] = IPC::MakeHeader(0x3, 0x1, 0);
61 cmd_buff[1] = RESULT_SUCCESS.raw;
62
63 LOG_WARNING(Service_BOSS, "(STUBBED) called");
64}
65
66void GetStorageInfo(Service::Interface* self) {
67 u32* cmd_buff = Kernel::GetCommandBuffer();
68
69 cmd_buff[0] = IPC::MakeHeader(0x4, 0x2, 0);
70 cmd_buff[1] = RESULT_SUCCESS.raw;
71 cmd_buff[2] = 0; // stub 0
72
73 LOG_WARNING(Service_BOSS, "(STUBBED) called");
74}
75
76void RegisterPrivateRootCa(Service::Interface* self) {
77 u32* cmd_buff = Kernel::GetCommandBuffer();
78
79 u32 translation = cmd_buff[2];
80 u32 buff_addr = cmd_buff[3];
81 u32 buff_size = (translation >> 4);
82
83 cmd_buff[0] = IPC::MakeHeader(0x5, 0x1, 0x2);
84 cmd_buff[1] = RESULT_SUCCESS.raw;
85 cmd_buff[2] = (buff_size << 4 | 0xA);
86 cmd_buff[3] = buff_addr;
87
88 LOG_WARNING(Service_BOSS, "(STUBBED) translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
89 translation, buff_addr, buff_size);
90}
91
92void RegisterPrivateClientCert(Service::Interface* self) {
93 u32* cmd_buff = Kernel::GetCommandBuffer();
94 // TODO(JamePeng): Figure out the meaning of these parameters
95 u32 unk_param1 = cmd_buff[1];
96 u32 unk_param2 = cmd_buff[2];
97 u32 translation1 = cmd_buff[3];
98 u32 buff1_addr = cmd_buff[4];
99 u32 buff1_size = (translation1 >> 4);
100 u32 translation2 = cmd_buff[5];
101 u32 buff2_addr = cmd_buff[6];
102 u32 buff2_size = (translation2 >> 4);
103
104 cmd_buff[0] = IPC::MakeHeader(0x6, 0x1, 0x4);
105 cmd_buff[1] = RESULT_SUCCESS.raw;
106 cmd_buff[2] = (buff1_size << 4 | 0xA);
107 cmd_buff[3] = buff1_addr;
108 cmd_buff[2] = (buff2_size << 4 | 0xA);
109 cmd_buff[3] = buff2_addr;
110
111 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
112 "translation1=0x%08X, buff1_addr=0x%08X, buff1_size=0x%08X, "
113 "translation2=0x%08X, buff2_addr=0x%08X, buff2_size=0x%08X",
114 unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2,
115 buff2_addr, buff2_size);
116}
117
118void GetNewArrivalFlag(Service::Interface* self) {
119 u32* cmd_buff = Kernel::GetCommandBuffer();
120
121 cmd_buff[0] = IPC::MakeHeader(0x7, 0x2, 0);
122 cmd_buff[1] = RESULT_SUCCESS.raw;
123 cmd_buff[2] = new_arrival_flag;
124
125 LOG_WARNING(Service_BOSS, "(STUBBED) new_arrival_flag=%u", new_arrival_flag);
126}
127
128void RegisterNewArrivalEvent(Service::Interface* self) {
129 u32* cmd_buff = Kernel::GetCommandBuffer();
130 // TODO(JamePeng): Figure out the meaning of these parameters
131 u32 unk_param1 = cmd_buff[1];
132 u32 unk_param2 = cmd_buff[2];
133
134 cmd_buff[0] = IPC::MakeHeader(0x8, 0x1, 0);
135 cmd_buff[1] = RESULT_SUCCESS.raw;
136
137 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X", unk_param1,
138 unk_param2);
139}
140
141void SetOptoutFlag(Service::Interface* self) {
142 u32* cmd_buff = Kernel::GetCommandBuffer();
143
144 output_flag = cmd_buff[1] & 0xFF;
145
146 cmd_buff[0] = IPC::MakeHeader(0x9, 0x1, 0);
147 cmd_buff[1] = RESULT_SUCCESS.raw;
148
149 LOG_WARNING(Service_BOSS, "output_flag=%u", output_flag);
150}
151
152void GetOptoutFlag(Service::Interface* self) {
153 u32* cmd_buff = Kernel::GetCommandBuffer();
154
155 cmd_buff[0] = IPC::MakeHeader(0xA, 0x2, 0);
156 cmd_buff[1] = RESULT_SUCCESS.raw;
157 cmd_buff[2] = output_flag;
158
159 LOG_WARNING(Service_BOSS, "output_flag=%u", output_flag);
160}
161
162void RegisterTask(Service::Interface* self) {
163 u32* cmd_buff = Kernel::GetCommandBuffer();
164 // TODO(JamePeng): Figure out the meaning of these parameters
165 u32 unk_param1 = cmd_buff[1];
166 u32 unk_param2 = cmd_buff[2] & 0xFF;
167 u32 unk_param3 = cmd_buff[3] & 0xFF;
168 u32 translation = cmd_buff[4];
169 u32 buff_addr = cmd_buff[5];
170 u32 buff_size = (translation >> 4);
171
172 cmd_buff[0] = IPC::MakeHeader(0xB, 0x1, 0x2);
173 cmd_buff[1] = RESULT_SUCCESS.raw;
174 cmd_buff[2] = (buff_size << 4 | 0xA);
175 cmd_buff[3] = buff_addr;
176
177 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
178 "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
179 unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
180}
181
182void UnregisterTask(Service::Interface* self) {
183 u32* cmd_buff = Kernel::GetCommandBuffer();
184 // TODO(JamePeng): Figure out the meaning of these parameters
185 u32 unk_param1 = cmd_buff[1];
186 u32 unk_param2 = cmd_buff[2] & 0xFF;
187 u32 translation = cmd_buff[3];
188 u32 buff_addr = cmd_buff[4];
189 u32 buff_size = (translation >> 4);
190
191 cmd_buff[0] = IPC::MakeHeader(0xC, 0x1, 0x2);
192 cmd_buff[1] = RESULT_SUCCESS.raw;
193 cmd_buff[2] = (buff_size << 4 | 0xA);
194 cmd_buff[3] = buff_addr;
195
196 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
197 "buff_addr=0x%08X, buff_size=0x%08X",
198 unk_param1, unk_param2, translation, buff_addr, buff_size);
199}
200
201void ReconfigureTask(Service::Interface* self) {
202 u32* cmd_buff = Kernel::GetCommandBuffer();
203 // TODO(JamePeng): Figure out the meaning of these parameters
204 u32 unk_param1 = cmd_buff[1];
205 u32 unk_param2 = cmd_buff[2] & 0xFF;
206 u32 translation = cmd_buff[3];
207 u32 buff_addr = cmd_buff[4];
208 u32 buff_size = (translation >> 4);
209
210 cmd_buff[0] = IPC::MakeHeader(0xD, 0x1, 0x2);
211 cmd_buff[1] = RESULT_SUCCESS.raw;
212 cmd_buff[2] = (buff_size << 4 | 0xA);
213 cmd_buff[3] = buff_addr;
214
215 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
216 "buff_addr=0x%08X, buff_size=0x%08X",
217 unk_param1, unk_param2, translation, buff_addr, buff_size);
218}
219
220void GetTaskIdList(Service::Interface* self) {
221 u32* cmd_buff = Kernel::GetCommandBuffer();
222
223 cmd_buff[0] = IPC::MakeHeader(0xE, 0x1, 0);
224 cmd_buff[1] = RESULT_SUCCESS.raw;
225
226 LOG_WARNING(Service_BOSS, "(STUBBED) called");
227}
228
229void GetStepIdList(Service::Interface* self) {
230 u32* cmd_buff = Kernel::GetCommandBuffer();
231
232 u32 translation = cmd_buff[2];
233 u32 buff_addr = cmd_buff[3];
234 u32 buff_size = (translation >> 4);
235
236 cmd_buff[0] = IPC::MakeHeader(0xF, 0x1, 0x2);
237 cmd_buff[1] = RESULT_SUCCESS.raw;
238 cmd_buff[2] = (buff_size << 4 | 0xA);
239 cmd_buff[3] = buff_addr;
240
241 LOG_WARNING(Service_BOSS, "(STUBBED) translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
242 translation, buff_addr, buff_size);
243}
244
245void GetNsDataIdList(Service::Interface* self) {
246 u32* cmd_buff = Kernel::GetCommandBuffer();
247 // TODO(JamePeng): Figure out the meaning of these parameters
248 u32 unk_param1 = cmd_buff[1];
249 u32 unk_param2 = cmd_buff[2];
250 u32 unk_param3 = cmd_buff[3];
251 u32 unk_param4 = cmd_buff[4];
252 u32 translation = cmd_buff[5];
253 u32 buff_addr = cmd_buff[6];
254 u32 buff_size = (translation >> 4);
255
256 cmd_buff[0] = IPC::MakeHeader(0x10, 0x3, 0x2);
257 cmd_buff[1] = RESULT_SUCCESS.raw;
258 cmd_buff[2] = 0; // stub 0 (16 bit value)
259 cmd_buff[3] = 0; // stub 0 (16 bit value)
260 cmd_buff[4] = (buff_size << 4 | 0xC);
261 cmd_buff[5] = buff_addr;
262
263 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
264 "unk_param4=0x%08X, translation=0x%08X, "
265 "buff_addr=0x%08X, buff_size=0x%08X",
266 unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
267}
268
269void GetOwnNsDataIdList(Service::Interface* self) {
270 u32* cmd_buff = Kernel::GetCommandBuffer();
271 // TODO(JamePeng): Figure out the meaning of these parameters
272 u32 unk_param1 = cmd_buff[1];
273 u32 unk_param2 = cmd_buff[2];
274 u32 unk_param3 = cmd_buff[3];
275 u32 unk_param4 = cmd_buff[4];
276 u32 translation = cmd_buff[5];
277 u32 buff_addr = cmd_buff[6];
278 u32 buff_size = (translation >> 4);
279
280 cmd_buff[0] = IPC::MakeHeader(0x11, 0x3, 0x2);
281 cmd_buff[1] = RESULT_SUCCESS.raw;
282 cmd_buff[2] = 0; // stub 0 (16 bit value)
283 cmd_buff[3] = 0; // stub 0 (16 bit value)
284 cmd_buff[4] = (buff_size << 4 | 0xC);
285 cmd_buff[5] = buff_addr;
286
287 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
288 "unk_param4=0x%08X, translation=0x%08X, "
289 "buff_addr=0x%08X, buff_size=0x%08X",
290 unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
291}
292
293void GetNewDataNsDataIdList(Service::Interface* self) {
294 u32* cmd_buff = Kernel::GetCommandBuffer();
295 // TODO(JamePeng): Figure out the meaning of these parameters
296 u32 unk_param1 = cmd_buff[1];
297 u32 unk_param2 = cmd_buff[2];
298 u32 unk_param3 = cmd_buff[3];
299 u32 unk_param4 = cmd_buff[4];
300 u32 translation = cmd_buff[5];
301 u32 buff_addr = cmd_buff[6];
302 u32 buff_size = (translation >> 4);
303
304 cmd_buff[0] = IPC::MakeHeader(0x12, 0x3, 0x2);
305 cmd_buff[1] = RESULT_SUCCESS.raw;
306 cmd_buff[2] = 0; // stub 0 (16 bit value)
307 cmd_buff[3] = 0; // stub 0 (16 bit value)
308 cmd_buff[4] = (buff_size << 4 | 0xC);
309 cmd_buff[5] = buff_addr;
310
311 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
312 "unk_param4=0x%08X, translation=0x%08X, "
313 "buff_addr=0x%08X, buff_size=0x%08X",
314 unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
315}
316
317void GetOwnNewDataNsDataIdList(Service::Interface* self) {
318 u32* cmd_buff = Kernel::GetCommandBuffer();
319 // TODO(JamePeng): Figure out the meaning of these parameters
320 u32 unk_param1 = cmd_buff[1];
321 u32 unk_param2 = cmd_buff[2];
322 u32 unk_param3 = cmd_buff[3];
323 u32 unk_param4 = cmd_buff[4];
324 u32 translation = cmd_buff[5];
325 u32 buff_addr = cmd_buff[6];
326 u32 buff_size = (translation >> 4);
327
328 cmd_buff[0] = IPC::MakeHeader(0x13, 0x3, 0x2);
329 cmd_buff[1] = RESULT_SUCCESS.raw;
330 cmd_buff[2] = 0; // stub 0 (16 bit value)
331 cmd_buff[3] = 0; // stub 0 (16 bit value)
332 cmd_buff[4] = (buff_size << 4 | 0xC);
333 cmd_buff[5] = buff_addr;
334
335 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
336 "unk_param4=0x%08X, translation=0x%08X, "
337 "buff_addr=0x%08X, buff_size=0x%08X",
338 unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
339}
340
341void SendProperty(Service::Interface* self) {
342 u32* cmd_buff = Kernel::GetCommandBuffer();
343 // TODO(JamePeng): Figure out the meaning of these parameters
344 u32 unk_param1 = cmd_buff[1];
345 u32 unk_param2 = cmd_buff[2];
346 u32 translation = cmd_buff[3];
347 u32 buff_addr = cmd_buff[4];
348 u32 buff_size = (translation >> 4);
349
350 cmd_buff[0] = IPC::MakeHeader(0x14, 0x1, 0x2);
351 cmd_buff[1] = RESULT_SUCCESS.raw;
352 cmd_buff[2] = (buff_size << 4 | 0xA);
353 cmd_buff[3] = buff_addr;
354
355 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
356 "buff_addr=0x%08X, buff_size=0x%08X",
357 unk_param1, unk_param2, translation, buff_addr, buff_size);
358}
359
360void SendPropertyHandle(Service::Interface* self) {
361 u32* cmd_buff = Kernel::GetCommandBuffer();
362 // TODO(JamePeng): Figure out the meaning of these parameters
363 u32 unk_param1 = cmd_buff[2] & 0xFF;
364 u32 translation = cmd_buff[3];
365 u32 buff_addr = cmd_buff[4];
366 u32 buff_size = (translation >> 4);
367
368 cmd_buff[0] = IPC::MakeHeader(0x15, 0x1, 0x2);
369 cmd_buff[1] = RESULT_SUCCESS.raw;
370 cmd_buff[2] = (buff_size << 4 | 0xA);
371 cmd_buff[3] = buff_addr;
372
373 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
374 "buff_addr=0x%08X, buff_size=0x%08X",
375 unk_param1, translation, buff_addr, buff_size);
376}
377
378void ReceiveProperty(Service::Interface* self) {
379 u32* cmd_buff = Kernel::GetCommandBuffer();
380 // TODO(JamePeng): Figure out the meaning of these parameters
381 u32 unk_param1 = cmd_buff[1];
382 u32 buff_size = cmd_buff[2];
383 u32 translation = cmd_buff[3];
384 u32 buff_addr = cmd_buff[4];
385
386 cmd_buff[0] = IPC::MakeHeader(0x16, 0x2, 0x2);
387 cmd_buff[1] = RESULT_SUCCESS.raw;
388 cmd_buff[2] = 0; // stub 0 (32 bit value)
389 cmd_buff[2] = (buff_size << 4 | 0xC);
390 cmd_buff[3] = buff_addr;
391
392 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, buff_size=0x%08X, "
393 "translation=0x%08X, buff_addr=0x%08X",
394 unk_param1, buff_size, translation, buff_addr);
395}
396
397void UpdateTaskInterval(Service::Interface* self) {
398 u32* cmd_buff = Kernel::GetCommandBuffer();
399 // TODO(JamePeng): Figure out the meaning of these parameters
400 u32 unk_param1 = cmd_buff[1];
401 u32 unk_param2 = cmd_buff[2] & 0xFF;
402 u32 translation = cmd_buff[3];
403 u32 buff_addr = cmd_buff[4];
404 u32 buff_size = (translation >> 4);
405
406 cmd_buff[0] = IPC::MakeHeader(0x17, 0x1, 0x2);
407 cmd_buff[1] = RESULT_SUCCESS.raw;
408 cmd_buff[2] = (buff_size << 4 | 0xA);
409 cmd_buff[3] = buff_addr;
410
411 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
412 "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
413 unk_param1, unk_param2, translation, buff_addr, buff_size);
414}
415
416void UpdateTaskCount(Service::Interface* self) {
417 u32* cmd_buff = Kernel::GetCommandBuffer();
418
419 u32 buff_size = cmd_buff[1];
420 u32 unk_param2 = cmd_buff[2]; // TODO(JamePeng): Figure out the meaning of these parameters
421 u32 translation = cmd_buff[3];
422 u32 buff_addr = cmd_buff[4];
423
424 cmd_buff[0] = IPC::MakeHeader(0x18, 0x1, 0x2);
425 cmd_buff[1] = RESULT_SUCCESS.raw;
426 cmd_buff[2] = (buff_size << 4 | 0xA);
427 cmd_buff[3] = buff_addr;
428
429 LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
430 "translation=0x%08X, buff_addr=0x%08X",
431 buff_size, unk_param2, translation, buff_addr);
432}
433
434void GetTaskInterval(Service::Interface* self) {
435 u32* cmd_buff = Kernel::GetCommandBuffer();
436
437 u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
438 u32 translation = cmd_buff[2];
439 u32 buff_addr = cmd_buff[3];
440 u32 buff_size = (translation >> 4);
441
442 cmd_buff[0] = IPC::MakeHeader(0x19, 0x2, 0x2);
443 cmd_buff[1] = RESULT_SUCCESS.raw;
444 cmd_buff[2] = 0; // stub 0 ( 32bit value)
445 cmd_buff[3] = (buff_size << 4 | 0xA);
446 cmd_buff[4] = buff_addr;
447
448 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
449 "buff_addr=0x%08X, buff_size=0x%08X",
450 unk_param1, translation, buff_addr, buff_size);
451}
452
453void GetTaskCount(Service::Interface* self) {
454 u32* cmd_buff = Kernel::GetCommandBuffer();
455
456 u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
457 u32 translation = cmd_buff[2];
458 u32 buff_addr = cmd_buff[3];
459 u32 buff_size = (translation >> 4);
460
461 cmd_buff[0] = IPC::MakeHeader(0x1A, 0x2, 0x2);
462 cmd_buff[1] = RESULT_SUCCESS.raw;
463 cmd_buff[2] = 0; // stub 0 ( 32bit value)
464 cmd_buff[3] = (buff_size << 4 | 0xA);
465 cmd_buff[4] = buff_addr;
466
467 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
468 "buff_addr=0x%08X, buff_size=0x%08X",
469 unk_param1, translation, buff_addr, buff_size);
470}
471
472void GetTaskServiceStatus(Service::Interface* self) {
473 u32* cmd_buff = Kernel::GetCommandBuffer();
474
475 u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
476 u32 translation = cmd_buff[2];
477 u32 buff_addr = cmd_buff[3];
478 u32 buff_size = (translation >> 4);
479
480 cmd_buff[0] = IPC::MakeHeader(0x1B, 0x2, 0x2);
481 cmd_buff[1] = RESULT_SUCCESS.raw;
482 cmd_buff[2] = 0; // stub 0 ( 8bit value)
483 cmd_buff[3] = (buff_size << 4 | 0xA);
484 cmd_buff[4] = buff_addr;
485
486 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
487 "buff_addr=0x%08X, buff_size=0x%08X",
488 unk_param1, translation, buff_addr, buff_size);
489}
490
491void StartTask(Service::Interface* self) {
492 u32* cmd_buff = Kernel::GetCommandBuffer();
493
494 u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
495 u32 translation = cmd_buff[2];
496 u32 buff_addr = cmd_buff[3];
497 u32 buff_size = (translation >> 4);
498
499 cmd_buff[0] = IPC::MakeHeader(0x1C, 0x1, 0x2);
500 cmd_buff[1] = RESULT_SUCCESS.raw;
501 cmd_buff[2] = (buff_size << 4 | 0xA);
502 cmd_buff[3] = buff_addr;
503
504 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
505 "buff_addr=0x%08X, buff_size=0x%08X",
506 unk_param1, translation, buff_addr, buff_size);
507}
508
509void StartTaskImmediate(Service::Interface* self) {
510 u32* cmd_buff = Kernel::GetCommandBuffer();
511
512 u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
513 u32 translation = cmd_buff[2];
514 u32 buff_addr = cmd_buff[3];
515 u32 buff_size = (translation >> 4);
516
517 cmd_buff[0] = IPC::MakeHeader(0x1D, 0x1, 0x2);
518 cmd_buff[1] = RESULT_SUCCESS.raw;
519 cmd_buff[2] = (buff_size << 4 | 0xA);
520 cmd_buff[3] = buff_addr;
521
522 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
523 "buff_addr=0x%08X, buff_size=0x%08X",
524 unk_param1, translation, buff_addr, buff_size);
525}
526
527void CancelTask(Service::Interface* self) {
528 u32* cmd_buff = Kernel::GetCommandBuffer();
529 // TODO(JamePeng): Figure out the meaning of these parameters
530 u32 unk_param1 = cmd_buff[1];
531 u32 translation = cmd_buff[2];
532 u32 buff_addr = cmd_buff[3];
533 u32 buff_size = (translation >> 4);
534
535 cmd_buff[0] = IPC::MakeHeader(0x1E, 0x1, 0x2);
536 cmd_buff[1] = RESULT_SUCCESS.raw;
537 cmd_buff[2] = (buff_size << 4 | 0xA);
538 cmd_buff[3] = buff_addr;
539
540 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
541 "buff_addr=0x%08X, buff_size=0x%08X",
542 unk_param1, translation, buff_addr, buff_size);
543}
544
545void GetTaskFinishHandle(Service::Interface* self) {
546 u32* cmd_buff = Kernel::GetCommandBuffer();
547
548 cmd_buff[0] = IPC::MakeHeader(0x1F, 0x1, 0x2);
549 cmd_buff[1] = RESULT_SUCCESS.raw;
550 cmd_buff[2] = 0;
551 cmd_buff[3] = 0; // stub 0(This should be a handle of task_finish ?)
552
553 LOG_WARNING(Service_BOSS, "(STUBBED) called");
554}
555
556void GetTaskState(Service::Interface* self) {
557 u32* cmd_buff = Kernel::GetCommandBuffer();
558 // TODO(JamePeng): Figure out the meaning of these parameters
559 u32 buff_size = cmd_buff[1];
560 u32 unk_param2 = cmd_buff[2] & 0xFF;
561 u32 translation = cmd_buff[3];
562 u32 buff_addr = cmd_buff[4];
563
564 cmd_buff[0] = IPC::MakeHeader(0x20, 0x4, 0x2);
565 cmd_buff[1] = RESULT_SUCCESS.raw;
566 cmd_buff[2] = 0; // stub 0 (8 bit value)
567 cmd_buff[3] = 0; // stub 0 (32 bit value)
568 cmd_buff[4] = 0; // stub 0 (8 bit value)
569 cmd_buff[5] = (buff_size << 4 | 0xA);
570 cmd_buff[6] = buff_addr;
571
572 LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
573 "translation=0x%08X, buff_addr=0x%08X",
574 buff_size, unk_param2, translation, buff_addr);
575}
576
577void GetTaskResult(Service::Interface* self) {
578 u32* cmd_buff = Kernel::GetCommandBuffer();
579 // TODO(JamePeng): Figure out the meaning of these parameters
580 u32 unk_param1 = cmd_buff[1];
581 u32 translation = cmd_buff[2];
582 u32 buff_addr = cmd_buff[3];
583 u32 buff_size = (translation >> 4);
584
585 cmd_buff[0] = IPC::MakeHeader(0x21, 0x4, 0x2);
586 cmd_buff[1] = RESULT_SUCCESS.raw;
587 cmd_buff[2] = 0; // stub 0 (8 bit value)
588 cmd_buff[3] = 0; // stub 0 (32 bit value)
589 cmd_buff[4] = 0; // stub 0 (8 bit value)
590 cmd_buff[5] = (buff_size << 4 | 0xA);
591 cmd_buff[6] = buff_addr;
592
593 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
594 "buff_addr=0x%08X, buff_size=0x%08X",
595 unk_param1, translation, buff_addr, buff_size);
596}
597
598void GetTaskCommErrorCode(Service::Interface* self) {
599 u32* cmd_buff = Kernel::GetCommandBuffer();
600 // TODO(JamePeng): Figure out the meaning of these parameters
601 u32 unk_param1 = cmd_buff[1];
602 u32 translation = cmd_buff[2];
603 u32 buff_addr = cmd_buff[3];
604 u32 buff_size = (translation >> 4);
605
606 cmd_buff[0] = IPC::MakeHeader(0x22, 0x4, 0x2);
607 cmd_buff[1] = RESULT_SUCCESS.raw;
608 cmd_buff[2] = 0; // stub 0 (32 bit value)
609 cmd_buff[3] = 0; // stub 0 (32 bit value)
610 cmd_buff[4] = 0; // stub 0 (8 bit value)
611 cmd_buff[5] = (buff_size << 4 | 0xA);
612 cmd_buff[6] = buff_addr;
613
614 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, translation=0x%08X, "
615 "buff_addr=0x%08X, buff_size=0x%08X",
616 unk_param1, translation, buff_addr, buff_size);
617}
618
619void GetTaskStatus(Service::Interface* self) {
620 u32* cmd_buff = Kernel::GetCommandBuffer();
621 // TODO(JamePeng): Figure out the meaning of these parameters
622 u32 unk_param1 = cmd_buff[1];
623 u32 unk_param2 = cmd_buff[2] & 0xFF;
624 u32 unk_param3 = cmd_buff[3] & 0xFF;
625 u32 translation = cmd_buff[4];
626 u32 buff_addr = cmd_buff[5];
627 u32 buff_size = (translation >> 4);
628
629 cmd_buff[0] = IPC::MakeHeader(0x23, 0x2, 0x2);
630 cmd_buff[1] = RESULT_SUCCESS.raw;
631 cmd_buff[2] = 0; // stub 0 (8 bit value)
632 cmd_buff[3] = (buff_size << 4 | 0xA);
633 cmd_buff[4] = buff_addr;
634
635 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
636 "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
637 unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
638}
639
640void GetTaskError(Service::Interface* self) {
641 u32* cmd_buff = Kernel::GetCommandBuffer();
642 // TODO(JamePeng): Figure out the meaning of these parameters
643 u32 unk_param1 = cmd_buff[1];
644 u32 unk_param2 = cmd_buff[2] & 0xFF;
645 u32 translation = cmd_buff[4];
646 u32 buff_addr = cmd_buff[5];
647 u32 buff_size = (translation >> 4);
648
649 cmd_buff[0] = IPC::MakeHeader(0x24, 0x2, 0x2);
650 cmd_buff[1] = RESULT_SUCCESS.raw;
651 cmd_buff[2] = 0; // stub 0 (8 bit value)
652 cmd_buff[3] = (buff_size << 4 | 0xA);
653 cmd_buff[4] = buff_addr;
654
655 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
656 "buff_addr=0x%08X, buff_size=0x%08X",
657 unk_param1, unk_param2, translation, buff_addr, buff_size);
658}
659
660void GetTaskInfo(Service::Interface* self) {
661 u32* cmd_buff = Kernel::GetCommandBuffer();
662 // TODO(JamePeng): Figure out the meaning of these parameters
663 u32 unk_param1 = cmd_buff[1];
664 u32 unk_param2 = cmd_buff[2] & 0xFF;
665 u32 translation = cmd_buff[4];
666 u32 buff_addr = cmd_buff[5];
667 u32 buff_size = (translation >> 4);
668
669 cmd_buff[0] = IPC::MakeHeader(0x25, 0x1, 0x2);
670 cmd_buff[1] = RESULT_SUCCESS.raw;
671 cmd_buff[2] = (buff_size << 4 | 0xA);
672 cmd_buff[3] = buff_addr;
673
674 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, translation=0x%08X, "
675 "buff_addr=0x%08X, buff_size=0x%08X",
676 unk_param1, unk_param2, translation, buff_addr, buff_size);
677}
678
679void DeleteNsData(Service::Interface* self) {
680 u32* cmd_buff = Kernel::GetCommandBuffer();
681 // TODO(JamePeng): Figure out the meaning of these parameters
682 u32 unk_param1 = cmd_buff[1];
683
684 cmd_buff[0] = IPC::MakeHeader(0x26, 0x1, 0);
685 cmd_buff[1] = RESULT_SUCCESS.raw;
686
687 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
688}
689
690void GetNsDataHeaderInfo(Service::Interface* self) {
691 u32* cmd_buff = Kernel::GetCommandBuffer();
692 // TODO(JamePeng): Figure out the meaning of these parameters
693 u32 unk_param1 = cmd_buff[1];
694 u32 unk_param2 = cmd_buff[2] & 0xFF;
695 u32 unk_param3 = cmd_buff[3];
696 u32 translation = cmd_buff[4];
697 u32 buff_addr = cmd_buff[5];
698 u32 buff_size = (translation >> 4);
699
700 cmd_buff[0] = IPC::MakeHeader(0x27, 0x1, 0x2);
701 cmd_buff[1] = RESULT_SUCCESS.raw;
702 cmd_buff[2] = (buff_size << 4 | 0xC);
703 cmd_buff[3] = buff_addr;
704
705 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
706 "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
707 unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
708}
709
710void ReadNsData(Service::Interface* self) {
711 u32* cmd_buff = Kernel::GetCommandBuffer();
712 // TODO(JamePeng): Figure out the meaning of these parameters
713 u32 unk_param1 = cmd_buff[1];
714 u32 unk_param2 = cmd_buff[2];
715 u32 unk_param3 = cmd_buff[3];
716 u32 unk_param4 = cmd_buff[4];
717 u32 translation = cmd_buff[5];
718 u32 buff_addr = cmd_buff[6];
719 u32 buff_size = (translation >> 4);
720
721 cmd_buff[0] = IPC::MakeHeader(0x28, 0x3, 0x2);
722 cmd_buff[1] = RESULT_SUCCESS.raw;
723 cmd_buff[2] = 0; // stub 0 (32bit value)
724 cmd_buff[3] = 0; // stub 0 (32bit value)
725 cmd_buff[4] = (buff_size << 4 | 0xC);
726 cmd_buff[5] = buff_addr;
727
728 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
729 "unk_param4=0x%08X, translation=0x%08X, "
730 "buff_addr=0x%08X, buff_size=0x%08X",
731 unk_param1, unk_param2, unk_param3, unk_param4, translation, buff_addr, buff_size);
732}
733
734void SetNsDataAdditionalInfo(Service::Interface* self) {
735 u32* cmd_buff = Kernel::GetCommandBuffer();
736 // TODO(JamePeng): Figure out the meaning of these parameters
737 u32 unk_param1 = cmd_buff[1];
738 u32 unk_param2 = cmd_buff[2];
739
740 cmd_buff[0] = IPC::MakeHeader(0x29, 0x1, 0);
741 cmd_buff[1] = RESULT_SUCCESS.raw;
742
743 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X", unk_param1,
744 unk_param2);
745}
746
747void GetNsDataAdditionalInfo(Service::Interface* self) {
748 u32* cmd_buff = Kernel::GetCommandBuffer();
749 // TODO(JamePeng): Figure out the meaning of these parameters
750 u32 unk_param1 = cmd_buff[1];
751
752 cmd_buff[0] = IPC::MakeHeader(0x2A, 0x2, 0);
753 cmd_buff[1] = RESULT_SUCCESS.raw;
754 cmd_buff[2] = 0; // stub 0 (32bit value)
755
756 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
757}
758
759void SetNsDataNewFlag(Service::Interface* self) {
760 u32* cmd_buff = Kernel::GetCommandBuffer();
761 // TODO(JamePeng): Figure out the meaning of these parameters
762 u32 unk_param1 = cmd_buff[1];
763 ns_data_new_flag = cmd_buff[2] & 0xFF;
764
765 cmd_buff[0] = IPC::MakeHeader(0x2B, 0x1, 0);
766 cmd_buff[1] = RESULT_SUCCESS.raw;
767
768 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, ns_data_new_flag=0x%08X", unk_param1,
769 ns_data_new_flag);
770}
771
772void GetNsDataNewFlag(Service::Interface* self) {
773 u32* cmd_buff = Kernel::GetCommandBuffer();
774 // TODO(JamePeng): Figure out the meaning of these parameters
775 u32 unk_param1 = cmd_buff[1];
776
777 cmd_buff[0] = IPC::MakeHeader(0x2C, 0x2, 0);
778 cmd_buff[1] = RESULT_SUCCESS.raw;
779 cmd_buff[2] = ns_data_new_flag;
780
781 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, ns_data_new_flag=0x%08X", unk_param1,
782 ns_data_new_flag);
783}
784
785void GetNsDataLastUpdate(Service::Interface* self) {
786 u32* cmd_buff = Kernel::GetCommandBuffer();
787 // TODO(JamePeng): Figure out the meaning of these parameters
788 u32 unk_param1 = cmd_buff[1];
789
790 cmd_buff[0] = IPC::MakeHeader(0x2D, 0x3, 0);
791 cmd_buff[1] = RESULT_SUCCESS.raw;
792 cmd_buff[2] = 0; // stub 0 (32bit value)
793 cmd_buff[3] = 0; // stub 0 (32bit value)
794
795 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
796}
797
798void GetErrorCode(Service::Interface* self) {
799 u32* cmd_buff = Kernel::GetCommandBuffer();
800 // TODO(JamePeng): Figure out the meaning of these parameters
801 u32 unk_param1 = cmd_buff[1];
802
803 cmd_buff[0] = IPC::MakeHeader(0x2E, 0x2, 0);
804 cmd_buff[1] = RESULT_SUCCESS.raw;
805 cmd_buff[2] = 0; // stub 0 (32bit value)
806
807 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X", unk_param1);
808}
809
810void RegisterStorageEntry(Service::Interface* self) {
811 u32* cmd_buff = Kernel::GetCommandBuffer();
812 // TODO(JamePeng): Figure out the meaning of these parameters
813 u32 unk_param1 = cmd_buff[1];
814 u32 unk_param2 = cmd_buff[2];
815 u32 unk_param3 = cmd_buff[3];
816 u32 unk_param4 = cmd_buff[4];
817 u32 unk_param5 = cmd_buff[5] & 0xFF;
818
819 cmd_buff[0] = IPC::MakeHeader(0x2F, 0x1, 0);
820 cmd_buff[1] = RESULT_SUCCESS.raw;
821
822 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
823 "unk_param4=0x%08X, unk_param5=0x%08X",
824 unk_param1, unk_param2, unk_param3, unk_param4, unk_param5);
825}
826
827void GetStorageEntryInfo(Service::Interface* self) {
828 u32* cmd_buff = Kernel::GetCommandBuffer();
829
830 cmd_buff[0] = IPC::MakeHeader(0x30, 0x3, 0);
831 cmd_buff[1] = RESULT_SUCCESS.raw;
832 cmd_buff[2] = 0; // stub 0 (32bit value)
833 cmd_buff[3] = 0; // stub 0 (16bit value)
834
835 LOG_WARNING(Service_BOSS, "(STUBBED) called");
836}
837
838void SetStorageOption(Service::Interface* self) {
839 u32* cmd_buff = Kernel::GetCommandBuffer();
840 // TODO(JamePeng): Figure out the meaning of these parameters
841 u32 unk_param1 = cmd_buff[1] & 0xFF;
842 u32 unk_param2 = cmd_buff[2];
843 u32 unk_param3 = cmd_buff[3];
844 u32 unk_param4 = cmd_buff[4];
845
846 cmd_buff[0] = IPC::MakeHeader(0x31, 0x1, 0);
847 cmd_buff[1] = RESULT_SUCCESS.raw;
848
849 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
850 "unk_param3=0x%08X, unk_param4=0x%08X",
851 unk_param1, unk_param2, unk_param3, unk_param4);
852}
853
854void GetStorageOption(Service::Interface* self) {
855 u32* cmd_buff = Kernel::GetCommandBuffer();
856
857 cmd_buff[0] = IPC::MakeHeader(0x32, 0x5, 0);
858 cmd_buff[1] = RESULT_SUCCESS.raw;
859 cmd_buff[2] = 0; // stub 0 (32bit value)
860 cmd_buff[3] = 0; // stub 0 (8bit value)
861 cmd_buff[4] = 0; // stub 0 (16bit value)
862 cmd_buff[5] = 0; // stub 0 (16bit value)
863
864 LOG_WARNING(Service_BOSS, "(STUBBED) called");
865}
866
867void StartBgImmediate(Service::Interface* self) {
868 u32* cmd_buff = Kernel::GetCommandBuffer();
869
870 u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
871 u32 translation = cmd_buff[2];
872 u32 buff_addr = cmd_buff[3];
873 u32 buff_size = (translation >> 4);
874
875 cmd_buff[0] = IPC::MakeHeader(0x33, 0x1, 0x2);
876 cmd_buff[1] = RESULT_SUCCESS.raw;
877 cmd_buff[2] = (buff_size << 4 | 0xA);
878 cmd_buff[3] = buff_addr;
879
880 LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
881 "translation=0x%08X, buff_addr=0x%08X",
882 unk_param1, translation, buff_addr, buff_size);
883}
884
885void GetTaskActivePriority(Service::Interface* self) {
886 u32* cmd_buff = Kernel::GetCommandBuffer();
887
888 u32 unk_param1 = cmd_buff[1]; // TODO(JamePeng): Figure out the meaning of these parameters
889 u32 translation = cmd_buff[2];
890 u32 buff_addr = cmd_buff[3];
891 u32 buff_size = (translation >> 4);
892
893 cmd_buff[0] = IPC::MakeHeader(0x34, 0x2, 0x2);
894 cmd_buff[1] = RESULT_SUCCESS.raw;
895 cmd_buff[2] = 0; // stub 0 (8bit value)
896 cmd_buff[3] = (buff_size << 4 | 0xA);
897 cmd_buff[4] = buff_addr;
898
899 LOG_WARNING(Service_BOSS, "(STUBBED) buff_size=0x%08X, unk_param2=0x%08X, "
900 "translation=0x%08X, buff_addr=0x%08X",
901 unk_param1, translation, buff_addr, buff_size);
902}
903
904void RegisterImmediateTask(Service::Interface* self) {
905 u32* cmd_buff = Kernel::GetCommandBuffer();
906 // TODO(JamePeng): Figure out the meaning of these parameters
907 u32 unk_param1 = cmd_buff[1];
908 u32 unk_param2 = cmd_buff[2] & 0xFF;
909 u32 unk_param3 = cmd_buff[3] & 0xFF;
910 u32 translation = cmd_buff[4];
911 u32 buff_addr = cmd_buff[5];
912 u32 buff_size = (translation >> 4);
913
914 cmd_buff[0] = IPC::MakeHeader(0x35, 0x1, 0x2);
915 cmd_buff[1] = RESULT_SUCCESS.raw;
916 cmd_buff[3] = (buff_size << 4 | 0xA);
917 cmd_buff[4] = buff_addr;
918
919 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, unk_param3=0x%08X, "
920 "translation=0x%08X, buff_addr=0x%08X, buff_size=0x%08X",
921 unk_param1, unk_param2, unk_param3, translation, buff_addr, buff_size);
922}
923
924void SetTaskQuery(Service::Interface* self) {
925 u32* cmd_buff = Kernel::GetCommandBuffer();
926 // TODO(JamePeng): Figure out the meaning of these parameters
927 u32 unk_param1 = cmd_buff[1];
928 u32 unk_param2 = cmd_buff[2];
929 u32 translation1 = cmd_buff[3];
930 u32 buff1_addr = cmd_buff[4];
931 u32 buff1_size = (translation1 >> 4);
932 u32 translation2 = cmd_buff[5];
933 u32 buff2_addr = cmd_buff[6];
934 u32 buff2_size = (translation2 >> 4);
935
936 cmd_buff[0] = IPC::MakeHeader(0x36, 0x1, 0x4);
937 cmd_buff[1] = RESULT_SUCCESS.raw;
938 cmd_buff[2] = (buff1_size << 4 | 0xA);
939 cmd_buff[3] = buff1_addr;
940 cmd_buff[2] = (buff2_size << 4 | 0xA);
941 cmd_buff[3] = buff2_addr;
942
943 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
944 "translation1=0x%08X, buff1_addr=0x%08X, buff1_size=0x%08X, "
945 "translation2=0x%08X, buff2_addr=0x%08X, buff2_size=0x%08X",
946 unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2,
947 buff2_addr, buff2_size);
948}
949
950void GetTaskQuery(Service::Interface* self) {
951 u32* cmd_buff = Kernel::GetCommandBuffer();
952 // TODO(JamePeng): Figure out the meaning of these parameters
953 u32 unk_param1 = cmd_buff[1];
954 u32 unk_param2 = cmd_buff[2];
955 u32 translation1 = cmd_buff[3];
956 u32 buff1_addr = cmd_buff[4];
957 u32 buff1_size = (translation1 >> 4);
958 u32 translation2 = cmd_buff[5];
959 u32 buff2_addr = cmd_buff[6];
960 u32 buff2_size = (translation2 >> 4);
961
962 cmd_buff[0] = IPC::MakeHeader(0x37, 0x1, 0x4);
963 cmd_buff[1] = RESULT_SUCCESS.raw;
964 cmd_buff[2] = (buff1_size << 4 | 0xA);
965 cmd_buff[3] = buff1_addr;
966 cmd_buff[2] = (buff2_size << 4 | 0xC);
967 cmd_buff[3] = buff2_addr;
968
969 LOG_WARNING(Service_BOSS, "(STUBBED) unk_param1=0x%08X, unk_param2=0x%08X, "
970 "translation1=0x%08X, buff1_addr=0x%08X, buff1_size=0x%08X, "
971 "translation2=0x%08X, buff2_addr=0x%08X, buff2_size=0x%08X",
972 unk_param1, unk_param2, translation1, buff1_addr, buff1_size, translation2,
973 buff2_addr, buff2_size);
974}
975
13void Init() { 976void Init() {
14 using namespace Kernel; 977 using namespace Kernel;
15 978
16 AddService(new BOSS_P_Interface); 979 AddService(new BOSS_P_Interface);
17 AddService(new BOSS_U_Interface); 980 AddService(new BOSS_U_Interface);
981
982 new_arrival_flag = 0;
983 ns_data_new_flag = 0;
984 output_flag = 0;
18} 985}
19 986
20void Shutdown() {} 987void Shutdown() {}
diff --git a/src/core/hle/service/boss/boss.h b/src/core/hle/service/boss/boss.h
index d3b5d7101..8cdc663c8 100644
--- a/src/core/hle/service/boss/boss.h
+++ b/src/core/hle/service/boss/boss.h
@@ -4,9 +4,794 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/service/service.h"
8
7namespace Service { 9namespace Service {
8namespace BOSS { 10namespace BOSS {
9 11
12/**
13 * BOSS::InitializeSession service function
14 * Inputs:
15 * 0 : Header Code[0x00010082]
16 * 1 : u32 lower 64bit value
17 * 2 : u32 higher 64bit value
18 * 3 : 0x20
19 * 4 : u32 unknown value
20 * Outputs:
21 * 1 : Result of function, 0 on success, otherwise error code
22 */
23void InitializeSession(Service::Interface* self);
24
25/**
26 * BOSS::RegisterStorage service function
27 * Inputs:
28 * 0 : Header Code[0x00020010]
29 * 1 : u32 unknown1
30 * 2 : u32 unknown2
31 * 3 : u32 unknown3
32 * 4 : u8 unknown_flag
33 * Outputs:
34 * 1 : Result of function, 0 on success, otherwise error code
35 */
36void RegisterStorage(Service::Interface* self);
37
38/**
39 * BOSS::UnregisterStorage service function
40 * Inputs:
41 * 0 : Header Code[0x00030000]
42 * Outputs:
43 * 1 : Result of function, 0 on success, otherwise error code
44 */
45void UnregisterStorage(Service::Interface* self);
46
47/**
48 * BOSS::GetStorageInfo service function
49 * Inputs:
50 * 0 : Header Code[0x00040000]
51 * Outputs:
52 * 1 : Result of function, 0 on success, otherwise error code
53 * 2 : u32 unknown value
54 */
55void GetStorageInfo(Service::Interface* self);
56
57/**
58 * BOSS::RegisterPrivateRootCa service function
59 * Inputs:
60 * 0 : Header Code[0x00050042]
61 * 1 : u32 unknown value
62 * 2 : MappedBufferDesc(permission = R)
63 * 3 : u32 buff_addr
64 * Outputs:
65 * 1 : Result of function, 0 on success, otherwise error code
66 * 2 : buff_size << 4 | 0xA
67 * 3 : u32 buff_addr
68 */
69void RegisterPrivateRootCa(Service::Interface* self);
70
71/**
72 * BOSS::RegisterPrivateClientCert service function
73 * Inputs:
74 * 0 : Header Code[0x00060084]
75 * 1 : u32 unknown value
76 * 2 : u32 unknown value
77 * 3 : MappedBufferDesc1(permission = R)
78 * 4 : u32 buff_addr1
79 * 5 : MappedBufferDesc2(permission = R)
80 * 6 : u32 buff_addr2
81 * Outputs:
82 * 1 : Result of function, 0 on success, otherwise error code
83 * 2 : buff1_size << 4 | 0xA
84 * 3 : u32 buff_addr1
85 * 4 : buff2_size << 4 | 0xA
86 * 5 : u32 buff_addr2
87 */
88void RegisterPrivateClientCert(Service::Interface* self);
89
90/**
91 * BOSS::GetNewArrivalFlag service function
92 * Inputs:
93 * 0 : Header Code[0x00070000]
94 * Outputs:
95 * 1 : Result of function, 0 on success, otherwise error code
96 * 2 : u8 flag
97 */
98void GetNewArrivalFlag(Service::Interface* self);
99
100/**
101 * BOSS::RegisterNewArrivalEvent service function
102 * Inputs:
103 * 0 : Header Code[0x00080002]
104 * 1 : u32 unknown1
105 * 2 : u32 unknown2
106 * Outputs:
107 * 1 : Result of function, 0 on success, otherwise error code
108 */
109void RegisterNewArrivalEvent(Service::Interface* self);
110
111/**
112 * BOSS::SetOptoutFlag service function
113 * Inputs:
114 * 0 : Header Code[0x00090040]
115 * 1 : u8 output_flag
116 * Outputs:
117 * 1 : Result of function, 0 on success, otherwise error code
118 */
119void SetOptoutFlag(Service::Interface* self);
120
121/**
122 * BOSS::GetOptoutFlag service function
123 * Inputs:
124 * 0 : Header Code[0x000A0000]
125 * Outputs:
126 * 1 : Result of function, 0 on success, otherwise error code
127 * 2 : u8 output_flag
128 */
129void GetOptoutFlag(Service::Interface* self);
130
131/**
132 * BOSS::RegisterTask service function
133 * Inputs:
134 * 0 : Header Code[0x000B00C2]
135 * 1 : u32 unknown value
136 * 2 : u8 unknown value
137 * 3 : u8 unknown value
138 * 4 : MappedBufferDesc1(permission = R)
139 * 5 : buff_addr
140 * Outputs:
141 * 1 : Result of function, 0 on success, otherwise error code
142 * 2 : buff_size << 4 | 0xA
143 * 3 : u32 buff_addr
144 */
145void RegisterTask(Service::Interface* self);
146
147/**
148 * BOSS::UnregisterTask service function
149 * Inputs:
150 * 0 : Header Code[0x000C0082]
151 * 1 : u32 unknown value
152 * 2 : u8 unknown value
153 * 3 : MappedBufferDesc1(permission = R)
154 * 4 : buff_addr
155 * Outputs:
156 * 1 : Result of function, 0 on success, otherwise error code
157 * 2 : buff_size << 4 | 0xA
158 * 3 : u32 buff_addr
159 */
160void UnregisterTask(Service::Interface* self);
161
162/**
163 * BOSS::ReconfigureTask service function
164 * Inputs:
165 * 0 : Header Code[0x000D0082]
166 * 1 : u32 unknown value
167 * 2 : u8 unknown value
168 * 3 : MappedBufferDesc1(permission = R)
169 * 4 : buff_addr
170 * Outputs:
171 * 1 : Result of function, 0 on success, otherwise error code
172 * 2 : buff_size << 4 | 0xA
173 * 3 : u32 buff_addr
174 */
175void ReconfigureTask(Service::Interface* self);
176
177/**
178 * BOSS::GetTaskIdList service function
179 * Inputs:
180 * 0 : Header Code[0x000E0000]
181 * Outputs:
182 * 1 : Result of function, 0 on success, otherwise error code
183 */
184void GetTaskIdList(Service::Interface* self);
185
186/**
187 * BOSS::GetStepIdList service function
188 * Inputs:
189 * 0 : Header Code[0x000F0042]
190 * 2 : MappedBufferDesc(permission = R)
191 * 3 : u32 buff_addr
192 *
193 * Outputs:
194 * 1 : Result of function, 0 on success, otherwise error code
195 * 2 : buff_size << 4 | 0xA
196 * 3 : u32 buff_addr
197 */
198void GetStepIdList(Service::Interface* self);
199
200/**
201 * BOSS::GetNsDataIdList service function
202 * Inputs:
203 * 0 : Header Code[0x00100102]
204 * 1 : u32 unknown1
205 * 2 : u32 unknown2
206 * 3 : u32 unknown3
207 * 4 : u32 unknown4
208 * 5 : MappedBufferDesc(permission = W)
209 * 6 : u32 buff_addr
210 * Outputs:
211 * 1 : Result of function, 0 on success, otherwise error code
212 * 2 : u16 unknown value
213 * 3 : u16 unknown value
214 * 4 : buff_size << 4 | 0xC
215 * 5 : u32 buff_addr
216 */
217void GetNsDataIdList(Service::Interface* self);
218
219/**
220 * BOSS::GetOwnNsDataIdList service function
221 * Inputs:
222 * 0 : Header Code[0x00110102]
223 * 1 : u32 unknown1
224 * 2 : u32 unknown2
225 * 3 : u32 unknown3
226 * 4 : u32 unknown4
227 * 5 : MappedBufferDesc(permission = W)
228 * 6 : u32 buff_addr
229 * Outputs:
230 * 1 : Result of function, 0 on success, otherwise error code
231 * 2 : u16 unknown value
232 * 3 : u16 unknown value
233 * 4 : buff_size << 4 | 0xC
234 * 5 : u32 buff_addr
235 */
236void GetOwnNsDataIdList(Service::Interface* self);
237
238/**
239 * BOSS::GetNewDataNsDataIdList service function
240 * Inputs:
241 * 0 : Header Code[0x00120102]
242 * 1 : u32 unknown1
243 * 2 : u32 unknown2
244 * 3 : u32 unknown3
245 * 4 : u32 unknown4
246 * 5 : MappedBufferDesc(permission = W)
247 * 6 : u32 buff_addr
248 * Outputs:
249 * 1 : Result of function, 0 on success, otherwise error code
250 * 2 : u16 unknown value
251 * 3 : u16 unknown value
252 * 4 : buff_size << 4 | 0xC
253 * 5 : u32 buff_addr
254 */
255void GetNewDataNsDataIdList(Service::Interface* self);
256
257/**
258 * BOSS::GetOwnNewDataNsDataIdList service function
259 * Inputs:
260 * 0 : Header Code[0x00130102]
261 * 1 : u32 unknown1
262 * 2 : u32 unknown2
263 * 3 : u32 unknown3
264 * 4 : u32 unknown4
265 * 5 : MappedBufferDesc(permission = W)
266 * 6 : u32 buff_addr
267 * Outputs:
268 * 1 : Result of function, 0 on success, otherwise error code
269 * 2 : u16 unknown value
270 * 3 : u16 unknown value
271
272 */
273void GetOwnNewDataNsDataIdList(Service::Interface* self);
274
275/**
276 * BOSS::SendProperty service function
277 * Inputs:
278 * 0 : Header Code[0x00140082]
279 * 1 : u16 unknown value
280 * 2 : u32 unknown value
281 * 3 : MappedBufferDesc(permission = R)
282 * 4 : u32 buff_addr
283 * Outputs:
284 * 1 : Result of function, 0 on success, otherwise error code
285 * 2 : buff_size << 4 | 0xA
286 * 3 : u32 buff_addr
287 */
288void SendProperty(Service::Interface* self);
289
290/**
291 * BOSS::SendPropertyHandle service function
292 * Inputs:
293 * 0 : Header Code[0x00150042]
294 * 2 : u8 unknown value
295 * 3 : MappedBufferDesc(permission = R)
296 * 4 : u32 buff_addr
297 * Outputs:
298 * 1 : Result of function, 0 on success, otherwise error code
299 * 2 : buff_size << 4 | 0xA
300 * 3 : u32 buff_addr
301 */
302void SendPropertyHandle(Service::Interface* self);
303
304/**
305 * BOSS::ReceiveProperty service function
306 * Inputs:
307 * 0 : Header Code[0x00160082]
308 * 1 : u16 unknown1
309 * 2 : u32 buff_size
310 * 3 : MappedBufferDesc(permission = W)
311 * 4 : u32 buff addr
312 * Outputs:
313 * 1 : Result of function, 0 on success, otherwise error code
314 * 2 : u32 unknown value
315 * 3 : u16 unknown value
316 * 4 : buff_size << 4 | 0xC
317 * 5 : u32 buff_addr
318 */
319void ReceiveProperty(Service::Interface* self);
320
321/**
322 * BOSS::UpdateTaskInterval service function
323 * Inputs:
324 * 0 : Header Code[0x00170082]
325 * 1 : u32 unknown value
326 * 2 : u8 unknown value
327 * 3 : MappedBufferDesc1(permission = R)
328 * 4 : buff_addr
329 * Outputs:
330 * 1 : Result of function, 0 on success, otherwise error code
331 * 2 : buff_size << 4 | 0xA
332 * 3 : u32 buff_addr
333 */
334void UpdateTaskInterval(Service::Interface* self);
335
336/**
337 * BOSS::UpdateTaskCount service function
338 * Inputs:
339 * 0 : Header Code[0x00180082]
340 * 1 : u32 buff_size
341 * 2 : u32 unknown2
342 * 3 : MappedBufferDesc(permission = R)
343 * 4 : u32 buff_addr
344 * Outputs:
345 * 1 : Result of function, 0 on success, otherwise error code
346 * 2 : buff_size << 4 | 0xA
347 * 3 : u32 buff_addr
348 */
349void UpdateTaskCount(Service::Interface* self);
350
351/**
352 * BOSS::GetTaskInterval service function
353 * Inputs:
354 * 0 : Header Code[0x00190042]
355 * 1 : u32 unknown value
356 * 2 : MappedBufferDesc(permission = R)
357 * 3 : u32 buff_addr
358 * Outputs:
359 * 1 : Result of function, 0 on success, otherwise error code
360 * 2 : u32 unknown value
361 * 3 : buff_size << 4 | 0xA
362 * 4 : u32 buff_addr
363 */
364void GetTaskInterval(Service::Interface* self);
365
366/**
367 * BOSS::GetTaskCount service function
368 * Inputs:
369 * 0 : Header Code[0x001A0042]
370 * 1 : u32 unknown value
371 * 2 : MappedBufferDesc(permission = R)
372 * 3 : u32 buff_addr
373 * Outputs:
374 * 1 : Result of function, 0 on success, otherwise error code
375 * 2 : u32 unknown value
376 * 3 : buff_size << 4 | 0xA
377 * 4 : u32 buff_addr
378 */
379void GetTaskCount(Service::Interface* self);
380
381/**
382 * BOSS::GetTaskServiceStatus service function
383 * Inputs:
384 * 0 : Header Code[0x001B0042]
385 * 1 : u32 unknown value
386 * 2 : MappedBufferDesc(permission = R)
387 * 3 : u32 buff_addr
388 * Outputs:
389 * 1 : Result of function, 0 on success, otherwise error code
390 * 2 : u8 unknown value
391 * 3 : buff_size << 4 | 0xA
392 * 4 : u32 buff_addr
393 */
394void GetTaskServiceStatus(Service::Interface* self);
395
396/**
397 * BOSS::StartTask service function
398 * Inputs:
399 * 0 : Header Code[0x001C0042]
400 * 1 : u32 unknown value
401 * 2 : MappedBufferDesc(permission = R)
402 * 3 : u32 buff_addr
403 * Outputs:
404 * 1 : Result of function, 0 on success, otherwise error code
405 * 2 : buff_size << 4 | 0xA
406 * 3 : u32 buff_addr
407 */
408void StartTask(Service::Interface* self);
409
410/**
411 * BOSS::StartTaskImmediate service function
412 * Inputs:
413 * 0 : Header Code[0x001D0042]
414 * 1 : u32 unknown value
415 * 2 : MappedBufferDesc(permission = R)
416 * 3 : u32 buff_addr
417 * Outputs:
418 * 1 : Result of function, 0 on success, otherwise error code
419 * 2 : buff_size << 4 | 0xA
420 * 3 : u32 buff_addr
421 */
422void StartTaskImmediate(Service::Interface* self);
423
424/**
425 * BOSS::CancelTask service function
426 * Inputs:
427 * 0 : Header Code[0x001E0042]
428 * 1 : u32 unknown value
429 * 2 : MappedBufferDesc(permission = R)
430 * 3 : u32 buff_addr
431 * Outputs:
432 * 1 : Result of function, 0 on success, otherwise error code
433 * 2 : buff_size << 4 | 0xA
434 * 3 : u32 buff_addr
435 */
436void CancelTask(Service::Interface* self);
437
438/**
439 * BOSS::GetTaskFinishHandle service function
440 * Inputs:
441 * 0 : Header Code[0x001F0000]
442 * Outputs:
443 * 1 : Result of function, 0 on success, otherwise error code
444 * 2 : 0
445 * 3 : Task Finish Handle
446 */
447void GetTaskFinishHandle(Service::Interface* self);
448
449/**
450 * BOSS::GetTaskState service function
451 * Inputs:
452 * 0 : Header Code[0x00200082]
453 * 1 : u32 buff_size
454 * 2 : u8 unknown value
455 * 3 : MappedBufferDesc(permission = R)
456 * 4 : u32 buff_addr
457 * Outputs:
458 * 1 : Result of function, 0 on success, otherwise error code
459 * 2 : u8 unknown value
460 * 3 : u32 unknown value
461 * 4 : u8 unknown value
462 * 5 : buff_size << 4 | 0xA
463 * 6 : u32 buff_addr
464 */
465void GetTaskState(Service::Interface* self);
466
467/**
468 * BOSS::GetTaskResult service function
469 * Inputs:
470 * 0 : Header Code[0x00210042]
471 * 1 : u32 unknown value
472 * 2 : MappedBufferDesc(permission = R)
473 * 3 : u32 buff_addr
474 * Outputs:
475 * 1 : Result of function, 0 on success, otherwise error code
476 * 2 : u8 unknown value
477 * 3 : u32 unknown value
478 * 4 : u8 unknown value
479 * 5 : buff_size << 4 | 0xA
480 * 6 : u32 buff_addr
481 */
482void GetTaskResult(Service::Interface* self);
483
484/**
485 * BOSS::GetTaskCommErrorCode service function
486 * Inputs:
487 * 0 : Header Code[0x00220042]
488 * 1 : u32 unknown value
489 * 2 : MappedBufferDesc(permission = R)
490 * 3 : u32 buff_addr
491 * Outputs:
492 * 1 : Result of function, 0 on success, otherwise error code
493 * 2 : u32 unknown value
494 * 3 : u32 unknown value
495 * 4 : u8 unknown value
496 * 5 : buff_size << 4 | 0xA
497 * 6 : u32 buff_addr
498 */
499void GetTaskCommErrorCode(Service::Interface* self);
500
501/**
502 * BOSS::GetTaskStatus service function
503 * Inputs:
504 * 0 : Header Code[0x002300C2]
505 * 1 : u32 unknown value
506 * 2 : u8 unknown value
507 * 3 : u8 unknown value
508 * 4 : MappedBufferDesc(permission = R)
509 * 5 : u32 buff_addr
510 * Outputs:
511 * 1 : Result of function, 0 on success, otherwise error code
512 * 2 : u8 unknown value
513 * 3 : buff_size << 4 | 0xA
514 * 4 : u32 buff_addr
515 */
516void GetTaskStatus(Service::Interface* self);
517
518/**
519 * BOSS::GetTaskError service function
520 * Inputs:
521 * 0 : Header Code[0x00240082]
522 * 1 : u32 unknown value
523 * 2 : u8 unknown value
524 * 3 : MappedBufferDesc(permission = R)
525 * 4 : u32 buff_addr
526 * Outputs:
527 * 1 : Result of function, 0 on success, otherwise error code
528 * 2 : u8 unknown value
529 * 3 : buff_size << 4 | 0xA
530 * 4 : u32 buff_addr
531 */
532void GetTaskError(Service::Interface* self);
533
534/**
535 * BOSS::GetTaskInfo service function
536 * Inputs:
537 * 0 : Header Code[0x00250082]
538 * 1 : u32 unknown value
539 * 2 : u8 unknown value
540 * 3 : MappedBufferDesc(permission = R)
541 * 4 : u32 buff_addr
542 * Outputs:
543 * 1 : Result of function, 0 on success, otherwise error code
544 * 2 : buff_size << 4 | 0xA
545 * 3 : u32 buff_addr
546 */
547void GetTaskInfo(Service::Interface* self);
548
549/**
550 * BOSS::DeleteNsData service function
551 * Inputs:
552 * 0 : Header Code[0x00260040]
553 * 1 : u32 unknown value
554 * Outputs:
555 * 1 : Result of function, 0 on success, otherwise error code
556 */
557void DeleteNsData(Service::Interface* self);
558
559/**
560 * BOSS::GetNsDataHeaderInfo service function
561 * Inputs:
562 * 0 : Header Code[0x002700C2]
563 * 1 : u32 unknown value
564 * 2 : u8 unknown value
565 * 3 : u32 unknown value
566 * 4 : MappedBufferDesc(permission = W)
567 * 5 : u32 buff_addr
568 * Outputs:
569 * 1 : Result of function, 0 on success, otherwise error code
570 * 2 : buff_size << 4 | 0xC
571 * 3 : u32 buff_addr
572 */
573void GetNsDataHeaderInfo(Service::Interface* self);
574
575/**
576 * BOSS::ReadNsData service function
577 * Inputs:
578 * 0 : Header Code[0x00280102]
579 * 1 : u32 unknown value
580 * 2 : u32 unknown value
581 * 3 : u32 unknown value
582 * 4 : u32 unknown value
583 * 5 : MappedBufferDesc(permission = W)
584 * 6 : u32 buff_addr
585 * Outputs:
586 * 1 : Result of function, 0 on success, otherwise error code
587 * 2 : u32 unknown value
588 * 3 : u32 unknown value
589 * 4 : buff_size << 4 | 0xC
590 * 5 : u32 buff_addr
591 */
592void ReadNsData(Service::Interface* self);
593
594/**
595 * BOSS::SetNsDataAdditionalInfo service function
596 * Inputs:
597 * 0 : Header Code[0x00290080]
598 * 1 : u32 unknown value
599 * 2 : u32 unknown value
600 * Outputs:
601 * 1 : Result of function, 0 on success, otherwise error code
602 */
603void SetNsDataAdditionalInfo(Service::Interface* self);
604
605/**
606 * BOSS::GetNsDataAdditionalInfo service function
607 * Inputs:
608 * 0 : Header Code[0x002A0040]
609 * 1 : u32 unknown value
610 * Outputs:
611 * 1 : Result of function, 0 on success, otherwise error code
612 * 2 : u32 unknown value
613 */
614void GetNsDataAdditionalInfo(Service::Interface* self);
615
616/**
617 * BOSS::SetNsDataNewFlag service function
618 * Inputs:
619 * 0 : Header Code[0x002B0080]
620 * 1 : u32 unknown value
621 * 2 : u8 flag
622 * Outputs:
623 * 1 : Result of function, 0 on success, otherwise error code
624 */
625void SetNsDataNewFlag(Service::Interface* self);
626
627/**
628 * BOSS::GetNsDataNewFlag service function
629 * Inputs:
630 * 0 : Header Code[0x002C0040]
631 * 1 : u32 unknown value
632 * Outputs:
633 * 1 : Result of function, 0 on success, otherwise error code
634 * 2 : u8 flag
635 */
636void GetNsDataNewFlag(Service::Interface* self);
637
638/**
639 * BOSS::GetNsDataLastUpdate service function
640 * Inputs:
641 * 0 : Header Code[0x002D0040]
642 * 1 : u32 unknown value
643 * Outputs:
644 * 1 : Result of function, 0 on success, otherwise error code
645 * 2 : u32 unknown value
646 * 3 : u32 unknown value
647 */
648void GetNsDataLastUpdate(Service::Interface* self);
649
650/**
651 * BOSS::GetErrorCode service function
652 * Inputs:
653 * 0 : Header Code[0x002E0040]
654 * 1 : u8 unknown value
655 * Outputs:
656 * 1 : Result of function, 0 on success, otherwise error code
657 * 2 : u32 unknown value
658 */
659void GetErrorCode(Service::Interface* self);
660
661/**
662 * BOSS::RegisterStorageEntry service function
663 * Inputs:
664 * 0 : Header Code[0x002F0140]
665 * 1 : u32 unknown value
666 * 2 : u32 unknown value
667 * 3 : u32 unknown value
668 * 4 : u16 unknown value
669 * 5 : u8 unknown value
670 * Outputs:
671 * 1 : Result of function, 0 on success, otherwise error code
672 */
673void RegisterStorageEntry(Service::Interface* self);
674
675/**
676 * BOSS::GetStorageEntryInfo service function
677 * Inputs:
678 * 0 : Header Code[0x00300000]
679 * Outputs:
680 * 1 : Result of function, 0 on success, otherwise error code
681 * 2 : u32 unknown value
682 * 3 : u16 unknown value
683 */
684void GetStorageEntryInfo(Service::Interface* self);
685
686/**
687 * BOSS::SetStorageOption service function
688 * Inputs:
689 * 0 : Header Code[0x00310100]
690 * 1 : u8 unknown value
691 * 2 : u32 unknown value
692 * 3 : u16 unknown value
693 * 4 : u16 unknown value
694 * Outputs:
695 * 1 : Result of function, 0 on success, otherwise error code
696 */
697void SetStorageOption(Service::Interface* self);
698
699/**
700 * BOSS::GetStorageOption service function
701 * Inputs:
702 * 0 : Header Code[0x00320000]
703 * Outputs:
704 * 1 : Result of function, 0 on success, otherwise error code
705 * 2 : u8 unknown value
706 * 3 : u32 unknown value
707 * 4 : u16 unknown value
708 * 5 : u16 unknown value
709 */
710void GetStorageOption(Service::Interface* self);
711
712/**
713 * BOSS::StartBgImmediate service function
714 * Inputs:
715 * 0 : Header Code[0x00330042]
716 * 1 : u32 unknown value
717 * 2 : MappedBufferDesc(permission = R)
718 * 3 : u32 buff_addr
719 * Outputs:
720 * 1 : Result of function, 0 on success, otherwise error code
721 * 2 : buff_size << 4 | 0xA
722 * 3 : u32 buff_addr
723 */
724void StartBgImmediate(Service::Interface* self);
725
726/**
727 * BOSS::GetTaskActivePriority service function
728 * Inputs:
729 * 0 : Header Code[0x00340042]
730 * 1 : u32 unknown value
731 * 2 : MappedBufferDesc(permission = R)
732 * 3 : u32 buff_addr
733 * Outputs:
734 * 1 : Result of function, 0 on success, otherwise error code
735 * 2 : u8 unknown value
736 * 3 : buff_size << 4 | 0xA
737 * 4 : u32 buff_addr
738 */
739void GetTaskActivePriority(Service::Interface* self);
740
741/**
742 * BOSS::RegisterImmediateTask service function
743 * Inputs:
744 * 0 : Header Code[0x003500C2]
745 * 1 : u32 unknown value
746 * 2 : u8 unknown value
747 * 3 : u8 unknown value
748 * 4 : MappedBufferDesc(permission = R)
749 * 5 : u32 buff_addr
750 * Outputs:
751 * 1 : Result of function, 0 on success, otherwise error code
752 * 2 : buff_size << 4 | 0xA
753 * 3 : u32 buff_addr
754 */
755void RegisterImmediateTask(Service::Interface* self);
756
757/**
758 * BOSS::SetTaskQuery service function
759 * Inputs:
760 * 0 : Header Code[0x00360084]
761 * 1 : u32 unknown value
762 * 2 : u32 unknown value
763 * 3 : MappedBufferDesc1(permission = R)
764 * 4 : u32 buff1_addr
765 * 5 : MappedBufferDesc2(permission = R)
766 * 6 : u32 buff2_addr
767 * Outputs:
768 * 1 : Result of function, 0 on success, otherwise error code
769 * 2 : buff1_size << 4 | 0xA
770 * 3 : u32 buff1_addr
771 * 4 : buff2_size << 4 | 0xA
772 * 5 : u32 buff2_addr
773 */
774void SetTaskQuery(Service::Interface* self);
775
776/**
777 * BOSS::GetTaskQuery service function
778 * Inputs:
779 * 0 : Header Code[0x00370084]
780 * 1 : u32 unknown value
781 * 2 : u32 unknown value
782 * 3 : MappedBufferDesc1(permission = R)
783 * 4 : u32 buff1_addr
784 * 5 : MappedBufferDesc2(permission = W)
785 * 6 : u32 buff2_addr
786 * Outputs:
787 * 1 : Result of function, 0 on success, otherwise error code
788 * 2 : buff1_size << 4 | 0xA
789 * 3 : u32 buff1_addr
790 * 4 : buff2_size << 4 | 0xC
791 * 5 : u32 buff2_addr
792 */
793void GetTaskQuery(Service::Interface* self);
794
10/// Initialize BOSS service(s) 795/// Initialize BOSS service(s)
11void Init(); 796void Init();
12 797
diff --git a/src/core/hle/service/boss/boss_u.cpp b/src/core/hle/service/boss/boss_u.cpp
index 6affa23b1..371d702e0 100644
--- a/src/core/hle/service/boss/boss_u.cpp
+++ b/src/core/hle/service/boss/boss_u.cpp
@@ -2,16 +2,68 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/boss/boss.h"
5#include "core/hle/service/boss/boss_u.h" 6#include "core/hle/service/boss/boss_u.h"
6 7
7namespace Service { 8namespace Service {
8namespace BOSS { 9namespace BOSS {
9 10
10const Interface::FunctionInfo FunctionTable[] = { 11const Interface::FunctionInfo FunctionTable[] = {
11 {0x00020100, nullptr, "GetStorageInfo"}, 12 {0x00010082, InitializeSession, "InitializeSession"},
12 {0x000C0082, nullptr, "UnregisterTask"}, 13 {0x00020100, RegisterStorage, "RegisterStorage"},
13 {0x001E0042, nullptr, "CancelTask"}, 14 {0x00030000, UnregisterStorage, "UnregisterStorage"},
14 {0x00330042, nullptr, "StartBgImmediate"}, 15 {0x00040000, GetStorageInfo, "GetStorageInfo"},
16 {0x00050042, RegisterPrivateRootCa, "RegisterPrivateRootCa"},
17 {0x00060084, RegisterPrivateClientCert, "RegisterPrivateClientCert"},
18 {0x00070000, GetNewArrivalFlag, "GetNewArrivalFlag"},
19 {0x00080002, RegisterNewArrivalEvent, "RegisterNewArrivalEvent"},
20 {0x00090040, SetOptoutFlag, "SetOptoutFlag"},
21 {0x000A0000, GetOptoutFlag, "GetOptoutFlag"},
22 {0x000B00C2, RegisterTask, "RegisterTask"},
23 {0x000C0082, UnregisterTask, "UnregisterTask"},
24 {0x000D0082, ReconfigureTask, "ReconfigureTask"},
25 {0x000E0000, GetTaskIdList, "GetTaskIdList"},
26 {0x000F0042, GetStepIdList, "GetStepIdList"},
27 {0x00100102, GetNsDataIdList, "GetNsDataIdList"},
28 {0x00110102, GetOwnNsDataIdList, "GetOwnNsDataIdList"},
29 {0x00120102, GetNewDataNsDataIdList, "GetNewDataNsDataIdList"},
30 {0x00130102, GetOwnNewDataNsDataIdList, "GetOwnNewDataNsDataIdList"},
31 {0x00140082, SendProperty, "SendProperty"},
32 {0x00150042, SendPropertyHandle, "SendPropertyHandle"},
33 {0x00160082, ReceiveProperty, "ReceiveProperty"},
34 {0x00170082, UpdateTaskInterval, "UpdateTaskInterval"},
35 {0x00180082, UpdateTaskCount, "UpdateTaskCount"},
36 {0x00190042, GetTaskInterval, "GetTaskInterval"},
37 {0x001A0042, GetTaskCount, "GetTaskCount"},
38 {0x001B0042, GetTaskServiceStatus, "GetTaskServiceStatus"},
39 {0x001C0042, StartTask, "StartTask"},
40 {0x001D0042, StartTaskImmediate, "StartTaskImmediate"},
41 {0x001E0042, CancelTask, "CancelTask"},
42 {0x001F0000, GetTaskFinishHandle, "GetTaskFinishHandle"},
43 {0x00200082, GetTaskState, "GetTaskState"},
44 {0x00210042, GetTaskResult, "GetTaskResult"},
45 {0x00220042, GetTaskCommErrorCode, "GetTaskCommErrorCode"},
46 {0x002300C2, GetTaskStatus, "GetTaskStatus"},
47 {0x00240082, GetTaskError, "GetTaskError"},
48 {0x00250082, GetTaskInfo, "GetTaskInfo"},
49 {0x00260040, DeleteNsData, "DeleteNsData"},
50 {0x002700C2, GetNsDataHeaderInfo, "GetNsDataHeaderInfo"},
51 {0x00280102, ReadNsData, "ReadNsData"},
52 {0x00290080, SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"},
53 {0x002A0040, GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"},
54 {0x002B0080, SetNsDataNewFlag, "SetNsDataNewFlag"},
55 {0x002C0040, GetNsDataNewFlag, "GetNsDataNewFlag"},
56 {0x002D0040, GetNsDataLastUpdate, "GetNsDataLastUpdate"},
57 {0x002E0040, GetErrorCode, "GetErrorCode"},
58 {0x002F0140, RegisterStorageEntry, "RegisterStorageEntry"},
59 {0x00300000, GetStorageEntryInfo, "GetStorageEntryInfo"},
60 {0x00310100, SetStorageOption, "SetStorageOption"},
61 {0x00320000, GetStorageOption, "GetStorageOption"},
62 {0x00330042, StartBgImmediate, "StartBgImmediate"},
63 {0x00340042, GetTaskActivePriority, "GetTaskActivePriority"},
64 {0x003500C2, RegisterImmediateTask, "RegisterImmediateTask"},
65 {0x00360084, SetTaskQuery, "SetTaskQuery"},
66 {0x00370084, GetTaskQuery, "GetTaskQuery"},
15}; 67};
16 68
17BOSS_U_Interface::BOSS_U_Interface() { 69BOSS_U_Interface::BOSS_U_Interface() {
diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp
index fa5080535..1d16f8732 100644
--- a/src/core/hle/service/frd/frd.cpp
+++ b/src/core/hle/service/frd/frd.cpp
@@ -87,7 +87,7 @@ void GetMyFriendKey(Service::Interface* self) {
87 u32* cmd_buff = Kernel::GetCommandBuffer(); 87 u32* cmd_buff = Kernel::GetCommandBuffer();
88 88
89 cmd_buff[1] = RESULT_SUCCESS.raw; // No error 89 cmd_buff[1] = RESULT_SUCCESS.raw; // No error
90 Memory::WriteBlock(cmd_buff[2], &my_friend_key, sizeof(FriendKey)); 90 std::memcpy(&cmd_buff[2], &my_friend_key, sizeof(FriendKey));
91 LOG_WARNING(Service_FRD, "(STUBBED) called"); 91 LOG_WARNING(Service_FRD, "(STUBBED) called");
92} 92}
93 93
diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp
index b7d250312..4f0aa77eb 100644
--- a/src/core/hle/service/ldr_ro/cro_helper.cpp
+++ b/src/core/hle/service/ldr_ro/cro_helper.cpp
@@ -1227,7 +1227,7 @@ ResultCode CROHelper::Link(VAddr crs_address, bool link_on_load_bug_fix) {
1227 // The bug itself is: 1227 // The bug itself is:
1228 // If a relocation target is in .data segment, it will relocate to the 1228 // If a relocation target is in .data segment, it will relocate to the
1229 // user-specified buffer. But if this is linking during loading, 1229 // user-specified buffer. But if this is linking during loading,
1230 // the .data segment hasn't been tranfer from CRO to the buffer, 1230 // the .data segment hasn't been transfer from CRO to the buffer,
1231 // thus the relocation will be overwritten by data transfer. 1231 // thus the relocation will be overwritten by data transfer.
1232 // To fix this bug, we need temporarily restore the old .data segment 1232 // To fix this bug, we need temporarily restore the old .data segment
1233 // offset and apply imported symbols. 1233 // offset and apply imported symbols.
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index 4279b67fb..46b75db25 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -104,7 +104,9 @@ static const std::unordered_map<int, int> error_map = {{
104 {ERRNO(ENETUNREACH), 40}, 104 {ERRNO(ENETUNREACH), 40},
105 {ENFILE, 41}, 105 {ENFILE, 41},
106 {ERRNO(ENOBUFS), 42}, 106 {ERRNO(ENOBUFS), 42},
107#ifdef ENODATA
107 {ENODATA, 43}, 108 {ENODATA, 43},
109#endif
108 {ENODEV, 44}, 110 {ENODEV, 44},
109 {ENOENT, 45}, 111 {ENOENT, 45},
110 {ENOEXEC, 46}, 112 {ENOEXEC, 46},
@@ -114,8 +116,12 @@ static const std::unordered_map<int, int> error_map = {{
114 {ENOMSG, 50}, 116 {ENOMSG, 50},
115 {ERRNO(ENOPROTOOPT), 51}, 117 {ERRNO(ENOPROTOOPT), 51},
116 {ENOSPC, 52}, 118 {ENOSPC, 52},
119#ifdef ENOSR
117 {ENOSR, 53}, 120 {ENOSR, 53},
121#endif
122#ifdef ENOSTR
118 {ENOSTR, 54}, 123 {ENOSTR, 54},
124#endif
119 {ENOSYS, 55}, 125 {ENOSYS, 55},
120 {ERRNO(ENOTCONN), 56}, 126 {ERRNO(ENOTCONN), 56},
121 {ENOTDIR, 57}, 127 {ENOTDIR, 57},
@@ -136,7 +142,9 @@ static const std::unordered_map<int, int> error_map = {{
136 {ESPIPE, 72}, 142 {ESPIPE, 72},
137 {ESRCH, 73}, 143 {ESRCH, 73},
138 {ERRNO(ESTALE), 74}, 144 {ERRNO(ESTALE), 74},
145#ifdef ETIME
139 {ETIME, 75}, 146 {ETIME, 75},
147#endif
140 {ERRNO(ETIMEDOUT), 76}, 148 {ERRNO(ETIMEDOUT), 76},
141}}; 149}};
142 150
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index 2e4510857..fadd7b16b 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -163,7 +163,7 @@ ResultStatus AppLoader_NCCH::LoadExec() {
163 Kernel::g_current_process->ideal_processor = 163 Kernel::g_current_process->ideal_processor =
164 exheader_header.arm11_system_local_caps.ideal_processor; 164 exheader_header.arm11_system_local_caps.ideal_processor;
165 165
166 // Copy data while converting endianess 166 // Copy data while converting endianness
167 std::array<u32, ARRAY_SIZE(exheader_header.arm11_kernel_caps.descriptors)> kernel_caps; 167 std::array<u32, ARRAY_SIZE(exheader_header.arm11_kernel_caps.descriptors)> kernel_caps;
168 std::copy_n(exheader_header.arm11_kernel_caps.descriptors, kernel_caps.size(), 168 std::copy_n(exheader_header.arm11_kernel_caps.descriptors, kernel_caps.size(),
169 begin(kernel_caps)); 169 begin(kernel_caps));
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h
index 04350d006..f8718d063 100644
--- a/src/core/loader/ncch.h
+++ b/src/core/loader/ncch.h
@@ -11,7 +11,7 @@
11#include "core/loader/loader.h" 11#include "core/loader/loader.h"
12 12
13//////////////////////////////////////////////////////////////////////////////////////////////////// 13////////////////////////////////////////////////////////////////////////////////////////////////////
14/// NCCH header (Note: "NCCH" appears to be a publically unknown acronym) 14/// NCCH header (Note: "NCCH" appears to be a publicly unknown acronym)
15 15
16struct NCCH_Header { 16struct NCCH_Header {
17 u8 signature[0x100]; 17 u8 signature[0x100];
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index bb618cacd..fda91e29c 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -292,7 +292,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
292 } 292 }
293 } 293 }
294 294
295 // Retreive vertex from register data 295 // Retrieve vertex from register data
296 Shader::OutputVertex output_vertex = output_registers.ToVertex(regs.vs); 296 Shader::OutputVertex output_vertex = output_registers.ToVertex(regs.vs);
297 297
298 // Send to renderer 298 // Send to renderer
diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp
index 272f3ffe1..3febe739c 100644
--- a/src/video_core/shader/shader.cpp
+++ b/src/video_core/shader/shader.cpp
@@ -146,10 +146,8 @@ DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_
146 state.debug.max_opdesc_id = 0; 146 state.debug.max_opdesc_id = 0;
147 147
148 // Setup input register table 148 // Setup input register table
149 boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero()));
149 const auto& attribute_register_map = config.input_register_map; 150 const auto& attribute_register_map = config.input_register_map;
150 float24 dummy_register;
151 boost::fill(state.registers.input, &dummy_register);
152
153 for (unsigned i = 0; i < num_attributes; i++) 151 for (unsigned i = 0; i < num_attributes; i++)
154 state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i]; 152 state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i];
155 153
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp
index 501d00b6b..6abb6761f 100644
--- a/src/video_core/shader/shader_interpreter.cpp
+++ b/src/video_core/shader/shader_interpreter.cpp
@@ -116,32 +116,36 @@ void RunInterpreter(const ShaderSetup& setup, UnitState<Debug>& state, unsigned
116 : state.address_registers[instr.common.address_register_index - 1]; 116 : state.address_registers[instr.common.address_register_index - 1];
117 117
118 const float24* src1_ = LookupSourceRegister(instr.common.GetSrc1(is_inverted) + 118 const float24* src1_ = LookupSourceRegister(instr.common.GetSrc1(is_inverted) +
119 (!is_inverted * address_offset)); 119 (is_inverted ? 0 : address_offset));
120 const float24* src2_ = LookupSourceRegister(instr.common.GetSrc2(is_inverted) + 120 const float24* src2_ = LookupSourceRegister(instr.common.GetSrc2(is_inverted) +
121 (is_inverted * address_offset)); 121 (is_inverted ? address_offset : 0));
122 122
123 const bool negate_src1 = ((bool)swizzle.negate_src1 != false); 123 const bool negate_src1 = ((bool)swizzle.negate_src1 != false);
124 const bool negate_src2 = ((bool)swizzle.negate_src2 != false); 124 const bool negate_src2 = ((bool)swizzle.negate_src2 != false);
125 125
126 float24 src1[4] = { 126 float24 src1[4] = {
127 src1_[(int)swizzle.GetSelectorSrc1(0)], src1_[(int)swizzle.GetSelectorSrc1(1)], 127 src1_[(int)swizzle.src1_selector_0.Value()],
128 src1_[(int)swizzle.GetSelectorSrc1(2)], src1_[(int)swizzle.GetSelectorSrc1(3)], 128 src1_[(int)swizzle.src1_selector_1.Value()],
129 src1_[(int)swizzle.src1_selector_2.Value()],
130 src1_[(int)swizzle.src1_selector_3.Value()],
129 }; 131 };
130 if (negate_src1) { 132 if (negate_src1) {
131 src1[0] = src1[0] * float24::FromFloat32(-1); 133 src1[0] = -src1[0];
132 src1[1] = src1[1] * float24::FromFloat32(-1); 134 src1[1] = -src1[1];
133 src1[2] = src1[2] * float24::FromFloat32(-1); 135 src1[2] = -src1[2];
134 src1[3] = src1[3] * float24::FromFloat32(-1); 136 src1[3] = -src1[3];
135 } 137 }
136 float24 src2[4] = { 138 float24 src2[4] = {
137 src2_[(int)swizzle.GetSelectorSrc2(0)], src2_[(int)swizzle.GetSelectorSrc2(1)], 139 src2_[(int)swizzle.src2_selector_0.Value()],
138 src2_[(int)swizzle.GetSelectorSrc2(2)], src2_[(int)swizzle.GetSelectorSrc2(3)], 140 src2_[(int)swizzle.src2_selector_1.Value()],
141 src2_[(int)swizzle.src2_selector_2.Value()],
142 src2_[(int)swizzle.src2_selector_3.Value()],
139 }; 143 };
140 if (negate_src2) { 144 if (negate_src2) {
141 src2[0] = src2[0] * float24::FromFloat32(-1); 145 src2[0] = -src2[0];
142 src2[1] = src2[1] * float24::FromFloat32(-1); 146 src2[1] = -src2[1];
143 src2[2] = src2[2] * float24::FromFloat32(-1); 147 src2[2] = -src2[2];
144 src2[3] = src2[3] * float24::FromFloat32(-1); 148 src2[3] = -src2[3];
145 } 149 }
146 150
147 float24* dest = 151 float24* dest =
@@ -451,34 +455,40 @@ void RunInterpreter(const ShaderSetup& setup, UnitState<Debug>& state, unsigned
451 const bool negate_src3 = ((bool)swizzle.negate_src3 != false); 455 const bool negate_src3 = ((bool)swizzle.negate_src3 != false);
452 456
453 float24 src1[4] = { 457 float24 src1[4] = {
454 src1_[(int)swizzle.GetSelectorSrc1(0)], src1_[(int)swizzle.GetSelectorSrc1(1)], 458 src1_[(int)swizzle.src1_selector_0.Value()],
455 src1_[(int)swizzle.GetSelectorSrc1(2)], src1_[(int)swizzle.GetSelectorSrc1(3)], 459 src1_[(int)swizzle.src1_selector_1.Value()],
460 src1_[(int)swizzle.src1_selector_2.Value()],
461 src1_[(int)swizzle.src1_selector_3.Value()],
456 }; 462 };
457 if (negate_src1) { 463 if (negate_src1) {
458 src1[0] = src1[0] * float24::FromFloat32(-1); 464 src1[0] = -src1[0];
459 src1[1] = src1[1] * float24::FromFloat32(-1); 465 src1[1] = -src1[1];
460 src1[2] = src1[2] * float24::FromFloat32(-1); 466 src1[2] = -src1[2];
461 src1[3] = src1[3] * float24::FromFloat32(-1); 467 src1[3] = -src1[3];
462 } 468 }
463 float24 src2[4] = { 469 float24 src2[4] = {
464 src2_[(int)swizzle.GetSelectorSrc2(0)], src2_[(int)swizzle.GetSelectorSrc2(1)], 470 src2_[(int)swizzle.src2_selector_0.Value()],
465 src2_[(int)swizzle.GetSelectorSrc2(2)], src2_[(int)swizzle.GetSelectorSrc2(3)], 471 src2_[(int)swizzle.src2_selector_1.Value()],
472 src2_[(int)swizzle.src2_selector_2.Value()],
473 src2_[(int)swizzle.src2_selector_3.Value()],
466 }; 474 };
467 if (negate_src2) { 475 if (negate_src2) {
468 src2[0] = src2[0] * float24::FromFloat32(-1); 476 src2[0] = -src2[0];
469 src2[1] = src2[1] * float24::FromFloat32(-1); 477 src2[1] = -src2[1];
470 src2[2] = src2[2] * float24::FromFloat32(-1); 478 src2[2] = -src2[2];
471 src2[3] = src2[3] * float24::FromFloat32(-1); 479 src2[3] = -src2[3];
472 } 480 }
473 float24 src3[4] = { 481 float24 src3[4] = {
474 src3_[(int)swizzle.GetSelectorSrc3(0)], src3_[(int)swizzle.GetSelectorSrc3(1)], 482 src3_[(int)swizzle.src3_selector_0.Value()],
475 src3_[(int)swizzle.GetSelectorSrc3(2)], src3_[(int)swizzle.GetSelectorSrc3(3)], 483 src3_[(int)swizzle.src3_selector_1.Value()],
484 src3_[(int)swizzle.src3_selector_2.Value()],
485 src3_[(int)swizzle.src3_selector_3.Value()],
476 }; 486 };
477 if (negate_src3) { 487 if (negate_src3) {
478 src3[0] = src3[0] * float24::FromFloat32(-1); 488 src3[0] = -src3[0];
479 src3[1] = src3[1] * float24::FromFloat32(-1); 489 src3[1] = -src3[1];
480 src3[2] = src3[2] * float24::FromFloat32(-1); 490 src3[2] = -src3[2];
481 src3[3] = src3[3] * float24::FromFloat32(-1); 491 src3[3] = -src3[3];
482 } 492 }
483 493
484 float24* dest = 494 float24* dest =