Compare commits
111 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9e14707a0 | ||
|
|
d002af1412 | ||
|
|
869956a5df | ||
|
|
c2e0820ac2 | ||
|
|
c824648db5 | ||
|
|
6cd1482354 | ||
|
|
c82a4df000 | ||
|
|
467858633f | ||
|
|
1aafb0f3a3 | ||
|
|
2863e1edb9 | ||
|
|
c9845c486e | ||
|
|
a66204eb5c | ||
|
|
6022bc8394 | ||
|
|
f92594d744 | ||
|
|
3413f1f7ce | ||
|
|
11b4ab9685 | ||
|
|
1ec8d2123d | ||
|
|
72b90494e7 | ||
|
|
f4ba523992 | ||
|
|
b6b7d78ded | ||
|
|
eef097bdc7 | ||
|
|
88582b84a5 | ||
|
|
b27ab46bde | ||
|
|
b3298465cf | ||
|
|
9cba0f1794 | ||
|
|
1b7dc84132 | ||
|
|
b55dc9c85e | ||
|
|
78e974ba68 | ||
|
|
86095e62cc | ||
|
|
f6893969b3 | ||
|
|
deaf6f9e35 | ||
|
|
cf643df792 | ||
|
|
4900c51864 | ||
|
|
57eca6374a | ||
|
|
36e60c217a | ||
|
|
be4c7ed082 | ||
|
|
16b14aa7e3 | ||
|
|
b30aa7007e | ||
|
|
a5e9745380 | ||
|
|
aa0f596a6e | ||
|
|
98f0352728 | ||
|
|
10738588a4 | ||
|
|
8004af0d05 | ||
|
|
78a81614ee | ||
|
|
1a28f4fa8c | ||
|
|
212a6ab937 | ||
|
|
94f4009c3b | ||
|
|
5ecf152c8e | ||
|
|
f1423fcbc1 | ||
|
|
c97ff4460c | ||
|
|
12b05c719e | ||
|
|
b4bf099793 | ||
|
|
5e343edc9e | ||
|
|
d8f745382b | ||
|
|
c33abac275 | ||
|
|
d30110348b | ||
|
|
67bc2f5ecd | ||
|
|
666d53299c | ||
|
|
ac19e3d061 | ||
|
|
a6cab532f8 | ||
|
|
d4fb8a887c | ||
|
|
527ce12ce4 | ||
|
|
d89bfec5f5 | ||
|
|
1bfc0dc2db | ||
|
|
0a5832798a | ||
|
|
7504df52fc | ||
|
|
c1ccbf332f | ||
|
|
d732142b66 | ||
|
|
c2dbdefedf | ||
|
|
cd8bb6ea9b | ||
|
|
4369af6b7e | ||
|
|
3754e0fdfd | ||
|
|
15925b8293 | ||
|
|
0ee38e1363 | ||
|
|
0162a2d5cb | ||
|
|
33c0bf9dc5 | ||
|
|
ed2134784e | ||
|
|
8041d72a1f | ||
|
|
170ac3f9ee | ||
|
|
94c70693f9 | ||
|
|
1a9df83535 | ||
|
|
f934da0e43 | ||
|
|
010ea89013 | ||
|
|
4697025b73 | ||
|
|
56e2013c1f | ||
|
|
6afe9e0105 | ||
|
|
3357e8d9ba | ||
|
|
75da830c13 | ||
|
|
10d6b07161 | ||
|
|
99d86deb1f | ||
|
|
b326369704 | ||
|
|
8c8da93693 | ||
|
|
e9315ace9f | ||
|
|
a0933d92fc | ||
|
|
91e67ed430 | ||
|
|
d248b90c85 | ||
|
|
692639e9b7 | ||
|
|
0ce52b1da2 | ||
|
|
2c785bd06c | ||
|
|
39e60cfeb1 | ||
|
|
025d111308 | ||
|
|
1c31e2b3d2 | ||
|
|
1ad97c75a0 | ||
|
|
77fd0d47e7 | ||
|
|
1b8d798835 | ||
|
|
71ebc3e90d | ||
|
|
8529d84f31 | ||
|
|
47f96fe13a | ||
|
|
3b558eebee | ||
|
|
c875a7984e | ||
|
|
ec204a27dc |
39
.appveyor/UtilityFunctions.ps1
Normal file
@@ -0,0 +1,39 @@
|
||||
# Set-up Visual Studio Command Prompt environment for PowerShell
|
||||
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
|
||||
cmd /c "VsDevCmd.bat -arch=x64 & set" | foreach {
|
||||
if ($_ -match "=") {
|
||||
$v = $_.split("="); Set-Item -Force -Path "ENV:\$($v[0])" -Value "$($v[1])"
|
||||
}
|
||||
}
|
||||
popd
|
||||
|
||||
function Which ($search_path, $name) {
|
||||
($search_path).Split(";") | Get-ChildItem -Filter $name | Select -First 1 -Exp FullName
|
||||
}
|
||||
|
||||
function GetDeps ($search_path, $binary) {
|
||||
((dumpbin /dependents $binary).Where({ $_ -match "dependencies:"}, "SkipUntil") | Select-String "[^ ]*\.dll").Matches | foreach {
|
||||
Which $search_path $_.Value
|
||||
}
|
||||
}
|
||||
|
||||
function RecursivelyGetDeps ($search_path, $binary) {
|
||||
$final_deps = @()
|
||||
$deps_to_process = GetDeps $search_path $binary
|
||||
while ($deps_to_process.Count -gt 0) {
|
||||
$current, $deps_to_process = $deps_to_process
|
||||
if ($final_deps -contains $current) { continue }
|
||||
|
||||
# Is this a system dll file?
|
||||
# We use the same algorithm that cmake uses to determine this.
|
||||
if ($current -match "$([regex]::Escape($env:SystemRoot))\\sys") { continue }
|
||||
if ($current -match "$([regex]::Escape($env:WinDir))\\sys") { continue }
|
||||
if ($current -match "\\msvc[^\\]+dll") { continue }
|
||||
if ($current -match "\\api-ms-win-[^\\]+dll") { continue }
|
||||
|
||||
$final_deps += $current
|
||||
$new_deps = GetDeps $search_path $current
|
||||
$deps_to_process += ($new_deps | ?{-not ($final_deps -contains $_)})
|
||||
}
|
||||
return $final_deps
|
||||
}
|
||||
@@ -278,7 +278,7 @@ endif()
|
||||
if (ENABLE_QT)
|
||||
if (YUZU_USE_BUNDLED_QT)
|
||||
if (MSVC14 AND ARCHITECTURE_x86_64)
|
||||
set(QT_VER qt-5.7-msvc2015_64)
|
||||
set(QT_VER qt-5.10.0-msvc2015_64)
|
||||
else()
|
||||
message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable YUZU_USE_BUNDLED_QT and provide your own.")
|
||||
endif()
|
||||
|
||||
23
appveyor.yml
@@ -121,23 +121,16 @@ after_build:
|
||||
Get-ChildItem "$CMAKE_BINARY_DIR" -Filter "yuzu*.exe" | Copy-Item -destination $RELEASE_DIST
|
||||
Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST
|
||||
Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST
|
||||
|
||||
# copy all the dll dependencies to the release folder
|
||||
# hardcoded list because we don't build static and determining the list of dlls from the binary is a pain.
|
||||
$MingwDLLs = "Qt5Core.dll","Qt5Widgets.dll","Qt5Gui.dll","Qt5OpenGL.dll",
|
||||
# QT dll dependencies
|
||||
"libbz2-*.dll","libicudt*.dll","libicuin*.dll","libicuuc*.dll","libffi-*.dll",
|
||||
"libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll",
|
||||
"libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre2-16-*.dll","libpcre16-*.dll","libpng16-*.dll",
|
||||
# Runtime/Other dependencies
|
||||
"libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll"
|
||||
. "./.appveyor/UtilityFunctions.ps1"
|
||||
$DLLSearchPath = "C:\msys64\mingw64\bin;$env:PATH"
|
||||
$MingwDLLs = RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\yuzu.exe"
|
||||
$MingwDLLs += RecursivelyGetDeps $DLLSearchPath "$RELEASE_DIST\yuzu_cmd.exe"
|
||||
Write-Host "Detected the following dependencies:"
|
||||
Write-Host $MingwDLLs
|
||||
foreach ($file in $MingwDLLs) {
|
||||
Copy-Item -path "C:/msys64/mingw64/bin/$file" -force -destination "$RELEASE_DIST"
|
||||
}
|
||||
# the above list copies a few extra debug dlls that aren't needed (thanks globbing patterns!)
|
||||
# so we can remove them by hardcoding another list of extra dlls to remove
|
||||
$DebugDLLs = "libicudtd*.dll","libicuind*.dll","libicuucd*.dll"
|
||||
foreach ($file in $DebugDLLs) {
|
||||
Remove-Item -path "$RELEASE_DIST/$file"
|
||||
Copy-Item -path "$file" -force -destination "$RELEASE_DIST"
|
||||
}
|
||||
|
||||
# copy the qt windows plugin dll to platforms
|
||||
|
||||
5
dist/icons/icons.qrc
vendored
@@ -1,5 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="icons">
|
||||
<file>yuzu.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
BIN
dist/icons/yuzu.png
vendored
|
Before Width: | Height: | Size: 7.5 KiB |
11
dist/qt_themes/default/default.qrc
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<RCC>
|
||||
<qresource prefix="icons/default">
|
||||
<file alias="index.theme">icons/index.theme</file>
|
||||
|
||||
<file alias="16x16/checked.png">icons/16x16/checked.png</file>
|
||||
|
||||
<file alias="16x16/failed.png">icons/16x16/failed.png</file>
|
||||
|
||||
<file alias="256x256/yuzu.png">icons/256x256/yuzu.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
BIN
dist/qt_themes/default/icons/16x16/checked.png
vendored
Normal file
|
After Width: | Height: | Size: 451 B |
BIN
dist/qt_themes/default/icons/16x16/failed.png
vendored
Normal file
|
After Width: | Height: | Size: 428 B |
BIN
dist/qt_themes/default/icons/256x256/yuzu.png
vendored
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
10
dist/qt_themes/default/icons/index.theme
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
[Icon Theme]
|
||||
Name=default
|
||||
Comment=default theme
|
||||
Directories=16x16,256x256
|
||||
|
||||
[16x16]
|
||||
Size=16
|
||||
|
||||
[256x256]
|
||||
Size=256
|
||||
11
dist/qt_themes/qdarkstyle/icons/index.theme
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
[Icon Theme]
|
||||
Name=qdarkstyle
|
||||
Comment=dark theme
|
||||
Inherits=default
|
||||
Directories=16x16,256x256
|
||||
|
||||
[16x16]
|
||||
Size=16
|
||||
|
||||
[256x256]
|
||||
Size=256
|
||||
BIN
dist/qt_themes/qdarkstyle/rc/Hmovetoolbar.png
vendored
Normal file
|
After Width: | Height: | Size: 220 B |
BIN
dist/qt_themes/qdarkstyle/rc/Hsepartoolbar.png
vendored
Normal file
|
After Width: | Height: | Size: 172 B |
BIN
dist/qt_themes/qdarkstyle/rc/Vmovetoolbar.png
vendored
Normal file
|
After Width: | Height: | Size: 228 B |
BIN
dist/qt_themes/qdarkstyle/rc/Vsepartoolbar.png
vendored
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
dist/qt_themes/qdarkstyle/rc/branch_closed-on.png
vendored
Normal file
|
After Width: | Height: | Size: 147 B |
BIN
dist/qt_themes/qdarkstyle/rc/branch_closed.png
vendored
Normal file
|
After Width: | Height: | Size: 160 B |
BIN
dist/qt_themes/qdarkstyle/rc/branch_open-on.png
vendored
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
dist/qt_themes/qdarkstyle/rc/branch_open.png
vendored
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_checked.png
vendored
Normal file
|
After Width: | Height: | Size: 492 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_checked_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 491 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_checked_focus.png
vendored
Normal file
|
After Width: | Height: | Size: 252 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_indeterminate.png
vendored
Normal file
|
After Width: | Height: | Size: 493 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_indeterminate_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 492 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_indeterminate_focus.png
vendored
Normal file
|
After Width: | Height: | Size: 249 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_unchecked.png
vendored
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_unchecked_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
dist/qt_themes/qdarkstyle/rc/checkbox_unchecked_focus.png
vendored
Normal file
|
After Width: | Height: | Size: 240 B |
BIN
dist/qt_themes/qdarkstyle/rc/close-hover.png
vendored
Normal file
|
After Width: | Height: | Size: 598 B |
BIN
dist/qt_themes/qdarkstyle/rc/close-pressed.png
vendored
Normal file
|
After Width: | Height: | Size: 598 B |
BIN
dist/qt_themes/qdarkstyle/rc/close.png
vendored
Normal file
|
After Width: | Height: | Size: 586 B |
BIN
dist/qt_themes/qdarkstyle/rc/down_arrow.png
vendored
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
dist/qt_themes/qdarkstyle/rc/down_arrow_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
dist/qt_themes/qdarkstyle/rc/left_arrow.png
vendored
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
dist/qt_themes/qdarkstyle/rc/left_arrow_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
dist/qt_themes/qdarkstyle/rc/radio_checked.png
vendored
Normal file
|
After Width: | Height: | Size: 940 B |
BIN
dist/qt_themes/qdarkstyle/rc/radio_checked_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 972 B |
BIN
dist/qt_themes/qdarkstyle/rc/radio_checked_focus.png
vendored
Normal file
|
After Width: | Height: | Size: 846 B |
BIN
dist/qt_themes/qdarkstyle/rc/radio_unchecked.png
vendored
Normal file
|
After Width: | Height: | Size: 728 B |
BIN
dist/qt_themes/qdarkstyle/rc/radio_unchecked_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 760 B |
BIN
dist/qt_themes/qdarkstyle/rc/radio_unchecked_focus.png
vendored
Normal file
|
After Width: | Height: | Size: 646 B |
BIN
dist/qt_themes/qdarkstyle/rc/right_arrow.png
vendored
Normal file
|
After Width: | Height: | Size: 160 B |
BIN
dist/qt_themes/qdarkstyle/rc/right_arrow_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 160 B |
BIN
dist/qt_themes/qdarkstyle/rc/sizegrip.png
vendored
Normal file
|
After Width: | Height: | Size: 129 B |
BIN
dist/qt_themes/qdarkstyle/rc/stylesheet-branch-end.png
vendored
Normal file
|
After Width: | Height: | Size: 224 B |
BIN
dist/qt_themes/qdarkstyle/rc/stylesheet-branch-more.png
vendored
Normal file
|
After Width: | Height: | Size: 182 B |
BIN
dist/qt_themes/qdarkstyle/rc/stylesheet-vline.png
vendored
Normal file
|
After Width: | Height: | Size: 239 B |
BIN
dist/qt_themes/qdarkstyle/rc/transparent.png
vendored
Normal file
|
After Width: | Height: | Size: 195 B |
BIN
dist/qt_themes/qdarkstyle/rc/undock.png
vendored
Normal file
|
After Width: | Height: | Size: 578 B |
BIN
dist/qt_themes/qdarkstyle/rc/up_arrow.png
vendored
Normal file
|
After Width: | Height: | Size: 158 B |
BIN
dist/qt_themes/qdarkstyle/rc/up_arrow_disabled.png
vendored
Normal file
|
After Width: | Height: | Size: 159 B |
49
dist/qt_themes/qdarkstyle/style.qrc
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<RCC>
|
||||
<qresource prefix="icons/qdarkstyle">
|
||||
<file alias="index.theme">icons/index.theme</file>
|
||||
</qresource>
|
||||
<qresource prefix="qss_icons">
|
||||
<file>rc/up_arrow_disabled.png</file>
|
||||
<file>rc/Hmovetoolbar.png</file>
|
||||
<file>rc/stylesheet-branch-end.png</file>
|
||||
<file>rc/branch_closed-on.png</file>
|
||||
<file>rc/stylesheet-vline.png</file>
|
||||
<file>rc/branch_closed.png</file>
|
||||
<file>rc/branch_open-on.png</file>
|
||||
<file>rc/transparent.png</file>
|
||||
<file>rc/right_arrow_disabled.png</file>
|
||||
<file>rc/sizegrip.png</file>
|
||||
<file>rc/close.png</file>
|
||||
<file>rc/close-hover.png</file>
|
||||
<file>rc/close-pressed.png</file>
|
||||
<file>rc/down_arrow.png</file>
|
||||
<file>rc/Vmovetoolbar.png</file>
|
||||
<file>rc/left_arrow.png</file>
|
||||
<file>rc/stylesheet-branch-more.png</file>
|
||||
<file>rc/up_arrow.png</file>
|
||||
<file>rc/right_arrow.png</file>
|
||||
<file>rc/left_arrow_disabled.png</file>
|
||||
<file>rc/Hsepartoolbar.png</file>
|
||||
<file>rc/branch_open.png</file>
|
||||
<file>rc/Vsepartoolbar.png</file>
|
||||
<file>rc/down_arrow_disabled.png</file>
|
||||
<file>rc/undock.png</file>
|
||||
<file>rc/checkbox_checked_disabled.png</file>
|
||||
<file>rc/checkbox_checked_focus.png</file>
|
||||
<file>rc/checkbox_checked.png</file>
|
||||
<file>rc/checkbox_indeterminate.png</file>
|
||||
<file>rc/checkbox_indeterminate_focus.png</file>
|
||||
<file>rc/checkbox_unchecked_disabled.png</file>
|
||||
<file>rc/checkbox_unchecked_focus.png</file>
|
||||
<file>rc/checkbox_unchecked.png</file>
|
||||
<file>rc/radio_checked_disabled.png</file>
|
||||
<file>rc/radio_checked_focus.png</file>
|
||||
<file>rc/radio_checked.png</file>
|
||||
<file>rc/radio_unchecked_disabled.png</file>
|
||||
<file>rc/radio_unchecked_focus.png</file>
|
||||
<file>rc/radio_unchecked.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="qdarkstyle">
|
||||
<file>style.qss</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
1268
dist/qt_themes/qdarkstyle/style.qss
vendored
Normal file
1
externals/CMakeLists.txt
vendored
@@ -17,6 +17,7 @@ endif()
|
||||
|
||||
# libfmt
|
||||
add_subdirectory(fmt)
|
||||
add_library(fmt::fmt ALIAS fmt)
|
||||
|
||||
# getopt
|
||||
if (MSVC)
|
||||
|
||||
2
externals/dynarmic
vendored
2
externals/fmt
vendored
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Enforce citra's whitespace policy
|
||||
# Enforce yuzu's whitespace policy
|
||||
git config --local core.whitespace tab-in-indent,trailing-space
|
||||
|
||||
paths_to_check="src/ CMakeLists.txt"
|
||||
|
||||
@@ -89,7 +89,7 @@ endif()
|
||||
|
||||
create_target_directory_groups(common)
|
||||
|
||||
target_link_libraries(common PUBLIC Boost::boost microprofile)
|
||||
target_link_libraries(common PUBLIC Boost::boost fmt microprofile)
|
||||
if (ARCHITECTURE_x86_64)
|
||||
target_link_libraries(common PRIVATE xbyak)
|
||||
endif()
|
||||
|
||||
@@ -121,7 +121,7 @@ void CopyDir(const std::string& source_path, const std::string& dest_path);
|
||||
// Set the current directory to given directory
|
||||
bool SetCurrentDir(const std::string& directory);
|
||||
|
||||
// Returns a pointer to a string with a Citra data dir in the user's home
|
||||
// Returns a pointer to a string with a yuzu data dir in the user's home
|
||||
// directory. To be used in "multi-user" mode (that is, installed).
|
||||
const std::string& GetUserPath(const unsigned int DirIDX, const std::string& newPath = "");
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "common/logging/filter.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/logging/text_formatter.h"
|
||||
#include "common/string_util.h"
|
||||
|
||||
namespace Log {
|
||||
|
||||
@@ -42,6 +43,7 @@ namespace Log {
|
||||
SUB(Service, FS) \
|
||||
SUB(Service, HID) \
|
||||
SUB(Service, LM) \
|
||||
SUB(Service, NFP) \
|
||||
SUB(Service, NIFM) \
|
||||
SUB(Service, NS) \
|
||||
SUB(Service, NVDRV) \
|
||||
@@ -105,25 +107,20 @@ const char* GetLevelName(Level log_level) {
|
||||
}
|
||||
|
||||
Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
|
||||
const char* function, const char* format, va_list args) {
|
||||
const char* function, std::string message) {
|
||||
using std::chrono::duration_cast;
|
||||
using std::chrono::steady_clock;
|
||||
|
||||
static steady_clock::time_point time_origin = steady_clock::now();
|
||||
|
||||
std::array<char, 4 * 1024> formatting_buffer;
|
||||
|
||||
Entry entry;
|
||||
entry.timestamp = duration_cast<std::chrono::microseconds>(steady_clock::now() - time_origin);
|
||||
entry.log_class = log_class;
|
||||
entry.log_level = log_level;
|
||||
|
||||
snprintf(formatting_buffer.data(), formatting_buffer.size(), "%s:%s:%u", filename, function,
|
||||
line_nr);
|
||||
entry.location = std::string(formatting_buffer.data());
|
||||
|
||||
vsnprintf(formatting_buffer.data(), formatting_buffer.size(), format, args);
|
||||
entry.message = std::string(formatting_buffer.data());
|
||||
entry.filename = Common::TrimSourcePath(filename);
|
||||
entry.line_num = line_nr;
|
||||
entry.function = function;
|
||||
entry.message = std::move(message);
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -134,16 +131,29 @@ void SetFilter(Filter* new_filter) {
|
||||
filter = new_filter;
|
||||
}
|
||||
|
||||
void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
|
||||
void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num,
|
||||
const char* function, const char* format, ...) {
|
||||
if (filter != nullptr && !filter->CheckMessage(log_class, log_level))
|
||||
if (filter && !filter->CheckMessage(log_class, log_level))
|
||||
return;
|
||||
|
||||
std::array<char, 4 * 1024> formatting_buffer;
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
Entry entry = CreateEntry(log_class, log_level, filename, line_nr, function, format, args);
|
||||
vsnprintf(formatting_buffer.data(), formatting_buffer.size(), format, args);
|
||||
va_end(args);
|
||||
Entry entry = CreateEntry(log_class, log_level, filename, line_num, function,
|
||||
std::string(formatting_buffer.data()));
|
||||
|
||||
PrintColoredMessage(entry);
|
||||
}
|
||||
|
||||
void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num,
|
||||
const char* function, const char* format, const fmt::format_args& args) {
|
||||
if (filter && !filter->CheckMessage(log_class, log_level))
|
||||
return;
|
||||
Entry entry =
|
||||
CreateEntry(log_class, log_level, filename, line_num, function, fmt::vformat(format, args));
|
||||
|
||||
PrintColoredMessage(entry);
|
||||
}
|
||||
|
||||
} // namespace Log
|
||||
|
||||
@@ -22,13 +22,16 @@ struct Entry {
|
||||
std::chrono::microseconds timestamp;
|
||||
Class log_class;
|
||||
Level log_level;
|
||||
std::string location;
|
||||
std::string filename;
|
||||
unsigned int line_num;
|
||||
std::string function;
|
||||
std::string message;
|
||||
|
||||
Entry() = default;
|
||||
Entry(Entry&& o) = default;
|
||||
|
||||
Entry& operator=(Entry&& o) = default;
|
||||
Entry& operator=(const Entry& o) = default;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -44,7 +47,7 @@ const char* GetLevelName(Level log_level);
|
||||
|
||||
/// Creates a log entry by formatting the given source location, and message.
|
||||
Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
|
||||
const char* function, const char* format, va_list args);
|
||||
const char* function, std::string message);
|
||||
|
||||
void SetFilter(Filter* filter);
|
||||
} // namespace Log
|
||||
|
||||
@@ -65,14 +65,14 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin,
|
||||
const std::string::const_iterator end) {
|
||||
auto level_separator = std::find(begin, end, ':');
|
||||
if (level_separator == end) {
|
||||
LOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: %s",
|
||||
std::string(begin, end).c_str());
|
||||
NGLOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: %s",
|
||||
std::string(begin, end).c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
const Level level = GetLevelByName(level_separator + 1, end);
|
||||
if (level == Level::Count) {
|
||||
LOG_ERROR(Log, "Unknown log level in filter: %s", std::string(begin, end).c_str());
|
||||
NGLOG_ERROR(Log, "Unknown log level in filter: %s", std::string(begin, end).c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin,
|
||||
|
||||
const Class log_class = GetClassByName(begin, level_separator);
|
||||
if (log_class == Class::Count) {
|
||||
LOG_ERROR(Log, "Unknown log class in filter: %s", std::string(begin, end).c_str());
|
||||
NGLOG_ERROR(Log, "Unknown log class in filter: %s", std::string(begin, end).c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Log {
|
||||
class Filter {
|
||||
public:
|
||||
/// Initializes the filter with all classes having `default_level` as the minimum level.
|
||||
Filter(Level default_level);
|
||||
Filter(Level default_level = Level::Info);
|
||||
|
||||
/// Resets the filter so that all classes have `level` as the minimum displayed level.
|
||||
void ResetAll(Level level);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Log {
|
||||
@@ -59,6 +60,7 @@ enum class Class : ClassType {
|
||||
Service_FS, ///< The FS (Filesystem) service
|
||||
Service_HID, ///< The HID (Human interface device) service
|
||||
Service_LM, ///< The LM (Logger) service
|
||||
Service_NFP, ///< The NFP service
|
||||
Service_NIFM, ///< The NIFM (Network interface) service
|
||||
Service_NS, ///< The NS services
|
||||
Service_NVDRV, ///< The NVDRV (Nvidia driver) service
|
||||
@@ -85,12 +87,12 @@ enum class Class : ClassType {
|
||||
Loader, ///< ROM loader
|
||||
Input, ///< Input emulation
|
||||
Network, ///< Network emulation
|
||||
WebService, ///< Interface to Citra Web Services
|
||||
WebService, ///< Interface to yuzu Web Services
|
||||
Count ///< Total number of logging classes
|
||||
};
|
||||
|
||||
/// Logs a message to the global logger.
|
||||
void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
|
||||
void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num,
|
||||
const char* function,
|
||||
#ifdef _MSC_VER
|
||||
_Printf_format_string_
|
||||
@@ -102,6 +104,16 @@ void LogMessage(Class log_class, Level log_level, const char* filename, unsigned
|
||||
#endif
|
||||
;
|
||||
|
||||
/// Logs a message to the global logger, using fmt
|
||||
void LogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num,
|
||||
const char* function, const char* format, const fmt::format_args& args);
|
||||
|
||||
template <typename... Args>
|
||||
void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num,
|
||||
const char* function, const char* format, const Args&... args) {
|
||||
LogMessage(log_class, log_level, filename, line_num, function, format, fmt::make_args(args...));
|
||||
}
|
||||
|
||||
} // namespace Log
|
||||
|
||||
#define LOG_GENERIC(log_class, log_level, ...) \
|
||||
@@ -124,3 +136,28 @@ void LogMessage(Class log_class, Level log_level, const char* filename, unsigned
|
||||
LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Error, __VA_ARGS__)
|
||||
#define LOG_CRITICAL(log_class, ...) \
|
||||
LOG_GENERIC(::Log::Class::log_class, ::Log::Level::Critical, __VA_ARGS__)
|
||||
|
||||
// Define the fmt lib macros
|
||||
#ifdef _DEBUG
|
||||
#define NGLOG_TRACE(log_class, ...) \
|
||||
::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Trace, __FILE__, __LINE__, \
|
||||
__func__, __VA_ARGS__)
|
||||
#else
|
||||
#define NGLOG_TRACE(log_class, fmt, ...) (void(0))
|
||||
#endif
|
||||
|
||||
#define NGLOG_DEBUG(log_class, ...) \
|
||||
::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Debug, __FILE__, __LINE__, \
|
||||
__func__, __VA_ARGS__)
|
||||
#define NGLOG_INFO(log_class, ...) \
|
||||
::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Info, __FILE__, __LINE__, \
|
||||
__func__, __VA_ARGS__)
|
||||
#define NGLOG_WARNING(log_class, ...) \
|
||||
::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Warning, __FILE__, __LINE__, \
|
||||
__func__, __VA_ARGS__)
|
||||
#define NGLOG_ERROR(log_class, ...) \
|
||||
::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Error, __FILE__, __LINE__, \
|
||||
__func__, __VA_ARGS__)
|
||||
#define NGLOG_CRITICAL(log_class, ...) \
|
||||
::Log::FmtLogMessage(::Log::Class::log_class, ::Log::Level::Critical, __FILE__, __LINE__, \
|
||||
__func__, __VA_ARGS__)
|
||||
|
||||
@@ -18,50 +18,29 @@
|
||||
|
||||
namespace Log {
|
||||
|
||||
// TODO(bunnei): This should be moved to a generic path manipulation library
|
||||
const char* TrimSourcePath(const char* path, const char* root) {
|
||||
const char* p = path;
|
||||
|
||||
while (*p != '\0') {
|
||||
const char* next_slash = p;
|
||||
while (*next_slash != '\0' && *next_slash != '/' && *next_slash != '\\') {
|
||||
++next_slash;
|
||||
}
|
||||
|
||||
bool is_src = Common::ComparePartialString(p, next_slash, root);
|
||||
p = next_slash;
|
||||
|
||||
if (*p != '\0') {
|
||||
++p;
|
||||
}
|
||||
if (is_src) {
|
||||
path = p;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
void FormatLogMessage(const Entry& entry, char* out_text, size_t text_len) {
|
||||
std::string FormatLogMessage(const Entry& entry) {
|
||||
unsigned int time_seconds = static_cast<unsigned int>(entry.timestamp.count() / 1000000);
|
||||
unsigned int time_fractional = static_cast<unsigned int>(entry.timestamp.count() % 1000000);
|
||||
|
||||
const char* class_name = GetLogClassName(entry.log_class);
|
||||
const char* level_name = GetLevelName(entry.log_level);
|
||||
|
||||
snprintf(out_text, text_len, "[%4u.%06u] %s <%s> %s: %s", time_seconds, time_fractional,
|
||||
class_name, level_name, TrimSourcePath(entry.location.c_str()), entry.message.c_str());
|
||||
return fmt::format("[{:4d}.{:06d}] {} <{}> {}:{}:{}: {}", time_seconds, time_fractional,
|
||||
class_name, level_name, entry.filename, entry.function, entry.line_num,
|
||||
entry.message);
|
||||
}
|
||||
|
||||
void PrintMessage(const Entry& entry) {
|
||||
std::array<char, 4 * 1024> format_buffer;
|
||||
FormatLogMessage(entry, format_buffer.data(), format_buffer.size());
|
||||
fputs(format_buffer.data(), stderr);
|
||||
fputc('\n', stderr);
|
||||
auto str = FormatLogMessage(entry) + '\n';
|
||||
fputs(str.c_str(), stderr);
|
||||
}
|
||||
|
||||
void PrintColoredMessage(const Entry& entry) {
|
||||
#ifdef _WIN32
|
||||
static HANDLE console_handle = GetStdHandle(STD_ERROR_HANDLE);
|
||||
HANDLE console_handle = GetStdHandle(STD_ERROR_HANDLE);
|
||||
if (console_handle == INVALID_HANDLE_VALUE) {
|
||||
return;
|
||||
}
|
||||
|
||||
CONSOLE_SCREEN_BUFFER_INFO original_info = {0};
|
||||
GetConsoleScreenBufferInfo(console_handle, &original_info);
|
||||
|
||||
@@ -10,20 +10,8 @@ namespace Log {
|
||||
|
||||
struct Entry;
|
||||
|
||||
/**
|
||||
* Attempts to trim an arbitrary prefix from `path`, leaving only the part starting at `root`. It's
|
||||
* intended to be used to strip a system-specific build directory from the `__FILE__` macro,
|
||||
* leaving only the path relative to the sources root.
|
||||
*
|
||||
* @param path The input file path as a null-terminated string
|
||||
* @param root The name of the root source directory as a null-terminated string. Path up to and
|
||||
* including the last occurrence of this name will be stripped
|
||||
* @return A pointer to the same string passed as `path`, but starting at the trimmed portion
|
||||
*/
|
||||
const char* TrimSourcePath(const char* path, const char* root = "src");
|
||||
|
||||
/// Formats a log entry into the provided text buffer.
|
||||
void FormatLogMessage(const Entry& entry, char* out_text, size_t text_len);
|
||||
std::string FormatLogMessage(const Entry& entry);
|
||||
/// Formats and prints a log entry to stderr.
|
||||
void PrintMessage(const Entry& entry);
|
||||
/// Prints the same message as `PrintMessage`, but colored acoording to the severity level.
|
||||
|
||||
@@ -462,4 +462,27 @@ std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, size_t max_l
|
||||
|
||||
return std::string(buffer, len);
|
||||
}
|
||||
|
||||
const char* TrimSourcePath(const char* path, const char* root) {
|
||||
const char* p = path;
|
||||
|
||||
while (*p != '\0') {
|
||||
const char* next_slash = p;
|
||||
while (*next_slash != '\0' && *next_slash != '/' && *next_slash != '\\') {
|
||||
++next_slash;
|
||||
}
|
||||
|
||||
bool is_src = Common::ComparePartialString(p, next_slash, root);
|
||||
p = next_slash;
|
||||
|
||||
if (*p != '\0') {
|
||||
++p;
|
||||
}
|
||||
if (is_src) {
|
||||
path = p;
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
||||
@@ -134,4 +134,17 @@ bool ComparePartialString(InIt begin, InIt end, const char* other) {
|
||||
* NUL-terminated then the string ends at max_len characters.
|
||||
*/
|
||||
std::string StringFromFixedZeroTerminatedBuffer(const char* buffer, size_t max_len);
|
||||
|
||||
/**
|
||||
* Attempts to trim an arbitrary prefix from `path`, leaving only the part starting at `root`. It's
|
||||
* intended to be used to strip a system-specific build directory from the `__FILE__` macro,
|
||||
* leaving only the path relative to the sources root.
|
||||
*
|
||||
* @param path The input file path as a null-terminated string
|
||||
* @param root The name of the root source directory as a null-terminated string. Path up to and
|
||||
* including the last occurrence of this name will be stripped
|
||||
* @return A pointer to the same string passed as `path`, but starting at the trimmed portion
|
||||
*/
|
||||
const char* TrimSourcePath(const char* path, const char* root = "src");
|
||||
|
||||
} // namespace Common
|
||||
|
||||
@@ -103,7 +103,19 @@ inline __attribute__((always_inline)) u64 swap64(u64 _data) {
|
||||
return __builtin_bswap64(_data);
|
||||
}
|
||||
#elif defined(__Bitrig__) || defined(__OpenBSD__)
|
||||
// swap16, swap32, swap64 are left as is
|
||||
// redefine swap16, swap32, swap64 as inline functions
|
||||
#undef swap16
|
||||
#undef swap32
|
||||
#undef swap64
|
||||
inline u16 swap16(u16 _data) {
|
||||
return __swap16(_data);
|
||||
}
|
||||
inline u32 swap32(u32 _data) {
|
||||
return __swap32(_data);
|
||||
}
|
||||
inline u64 swap64(u64 _data) {
|
||||
return __swap64(_data);
|
||||
}
|
||||
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
inline u16 swap16(u16 _data) {
|
||||
return bswap16(_data);
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Telemetry {
|
||||
/// Field type, used for grouping fields together in the final submitted telemetry log
|
||||
enum class FieldType : u8 {
|
||||
None = 0, ///< No specified field group
|
||||
App, ///< Citra application fields (e.g. version, branch, etc.)
|
||||
App, ///< yuzu application fields (e.g. version, branch, etc.)
|
||||
Session, ///< Emulated session fields (e.g. title ID, log, etc.)
|
||||
Performance, ///< Emulated performance (e.g. fps, emulated CPU speed, etc.)
|
||||
UserFeedback, ///< User submitted feedback (e.g. star rating, user notes, etc.)
|
||||
|
||||
@@ -54,7 +54,7 @@ static CPUCaps Detect() {
|
||||
caps.num_cores = std::thread::hardware_concurrency();
|
||||
|
||||
// Assumes the CPU supports the CPUID instruction. Those that don't would likely not support
|
||||
// Citra at all anyway
|
||||
// yuzu at all anyway
|
||||
|
||||
int cpu_id[4];
|
||||
memset(caps.brand_string, 0, sizeof(caps.brand_string));
|
||||
|
||||
@@ -142,6 +142,10 @@ add_library(core STATIC
|
||||
hle/service/nifm/nifm_s.h
|
||||
hle/service/nifm/nifm_u.cpp
|
||||
hle/service/nifm/nifm_u.h
|
||||
hle/service/nfp/nfp.cpp
|
||||
hle/service/nfp/nfp.h
|
||||
hle/service/nfp/nfp_user.cpp
|
||||
hle/service/nfp/nfp_user.h
|
||||
hle/service/ns/ns.cpp
|
||||
hle/service/ns/ns.h
|
||||
hle/service/ns/pl_u.cpp
|
||||
@@ -189,8 +193,10 @@ add_library(core STATIC
|
||||
hle/service/sm/controller.h
|
||||
hle/service/sm/sm.cpp
|
||||
hle/service/sm/sm.h
|
||||
hle/service/sockets/bsd_u.cpp
|
||||
hle/service/sockets/bsd_u.h
|
||||
hle/service/sockets/bsd.cpp
|
||||
hle/service/sockets/bsd.h
|
||||
hle/service/sockets/nsd.cpp
|
||||
hle/service/sockets/nsd.h
|
||||
hle/service/sockets/sfdnsres.cpp
|
||||
hle/service/sockets/sfdnsres.h
|
||||
hle/service/sockets/sockets.cpp
|
||||
|
||||
@@ -148,19 +148,15 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
|
||||
|
||||
current_process = Kernel::Process::Create("main");
|
||||
|
||||
switch (Settings::values.cpu_core) {
|
||||
case Settings::CpuCore::Unicorn:
|
||||
cpu_core = std::make_shared<ARM_Unicorn>();
|
||||
break;
|
||||
case Settings::CpuCore::Dynarmic:
|
||||
default:
|
||||
if (Settings::values.use_cpu_jit) {
|
||||
#ifdef ARCHITECTURE_x86_64
|
||||
cpu_core = std::make_shared<ARM_Dynarmic>();
|
||||
#else
|
||||
cpu_core = std::make_shared<ARM_Unicorn>();
|
||||
LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");
|
||||
#endif
|
||||
break;
|
||||
} else {
|
||||
cpu_core = std::make_shared<ARM_Unicorn>();
|
||||
}
|
||||
|
||||
gpu_core = std::make_unique<Tegra::GPU>();
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "core/memory.h"
|
||||
#include "core/perf_stats.h"
|
||||
#include "core/telemetry_session.h"
|
||||
#include "video_core/debug_utils/debug_utils.h"
|
||||
#include "video_core/gpu.h"
|
||||
|
||||
class EmuWindow;
|
||||
@@ -135,6 +136,14 @@ public:
|
||||
return *app_loader;
|
||||
}
|
||||
|
||||
void SetGPUDebugContext(std::shared_ptr<Tegra::DebugContext> context) {
|
||||
debug_context = std::move(context);
|
||||
}
|
||||
|
||||
std::shared_ptr<Tegra::DebugContext> GetGPUDebugContext() const {
|
||||
return debug_context;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Initialize the emulated system.
|
||||
@@ -154,6 +163,8 @@ private:
|
||||
std::unique_ptr<Kernel::Scheduler> scheduler;
|
||||
std::unique_ptr<Tegra::GPU> gpu_core;
|
||||
|
||||
std::shared_ptr<Tegra::DebugContext> debug_context;
|
||||
|
||||
Kernel::SharedPtr<Kernel::Process> current_process;
|
||||
|
||||
/// When true, signals that a reschedule should happen
|
||||
|
||||
@@ -174,8 +174,9 @@ u64 Disk_Storage::GetSize() const {
|
||||
}
|
||||
|
||||
bool Disk_Storage::SetSize(const u64 size) const {
|
||||
LOG_WARNING(Service_FS, "(STUBBED) called");
|
||||
return false;
|
||||
file->Resize(size);
|
||||
file->Flush();
|
||||
return true;
|
||||
}
|
||||
|
||||
Disk_Directory::Disk_Directory(const std::string& path) : directory() {
|
||||
|
||||
@@ -268,8 +268,11 @@ std::vector<u8> HLERequestContext::ReadBuffer() const {
|
||||
|
||||
size_t HLERequestContext::WriteBuffer(const void* buffer, size_t size) const {
|
||||
const bool is_buffer_b{BufferDescriptorB().size() && BufferDescriptorB()[0].Size()};
|
||||
|
||||
ASSERT_MSG(size <= GetWriteBufferSize(), "Size %lx is too big", size);
|
||||
const size_t buffer_size{GetWriteBufferSize()};
|
||||
if (size > buffer_size) {
|
||||
LOG_CRITICAL(Core, "size (%016zx) is greater than buffer_size (%016zx)", size, buffer_size);
|
||||
size = buffer_size; // TODO(bunnei): This needs to be HW tested
|
||||
}
|
||||
|
||||
if (is_buffer_b) {
|
||||
Memory::WriteBlock(BufferDescriptorB()[0].Address(), buffer, size);
|
||||
|
||||
@@ -121,8 +121,9 @@ void Process::Run(VAddr entry_point, s32 main_thread_priority, u32 stack_size) {
|
||||
// TODO(bunnei): This is heap area that should be allocated by the kernel and not mapped as part
|
||||
// of the user address space.
|
||||
vm_manager
|
||||
.MapMemoryBlock(Memory::STACK_VADDR, std::make_shared<std::vector<u8>>(stack_size, 0), 0,
|
||||
stack_size, MemoryState::Mapped)
|
||||
.MapMemoryBlock(Memory::STACK_AREA_VADDR_END - stack_size,
|
||||
std::make_shared<std::vector<u8>>(stack_size, 0), 0, stack_size,
|
||||
MemoryState::Mapped)
|
||||
.Unwrap();
|
||||
misc_memory_used += stack_size;
|
||||
memory_region->used += stack_size;
|
||||
|
||||
@@ -756,8 +756,16 @@ static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static ResultCode SetThreadCoreMask(u64, u64, u64) {
|
||||
LOG_WARNING(Kernel_SVC, "(STUBBED) called");
|
||||
static ResultCode GetThreadCoreMask(Handle handle, u32* mask, u64* unknown) {
|
||||
LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x%08X", handle);
|
||||
*mask = 0x0;
|
||||
*unknown = 0xf;
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static ResultCode SetThreadCoreMask(Handle handle, u32 mask, u64 unknown) {
|
||||
LOG_WARNING(Kernel_SVC, "(STUBBED) called, handle=0x%08X, mask=0x%08X, unknown=0x%lx", handle,
|
||||
mask, unknown);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -809,7 +817,7 @@ static const FunctionDef SVC_Table[] = {
|
||||
{0x0B, SvcWrap<SleepThread>, "SleepThread"},
|
||||
{0x0C, SvcWrap<GetThreadPriority>, "GetThreadPriority"},
|
||||
{0x0D, SvcWrap<SetThreadPriority>, "SetThreadPriority"},
|
||||
{0x0E, nullptr, "GetThreadCoreMask"},
|
||||
{0x0E, SvcWrap<GetThreadCoreMask>, "GetThreadCoreMask"},
|
||||
{0x0F, SvcWrap<SetThreadCoreMask>, "SetThreadCoreMask"},
|
||||
{0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"},
|
||||
{0x11, nullptr, "SignalEvent"},
|
||||
|
||||
@@ -70,6 +70,21 @@ void SvcWrap() {
|
||||
FuncReturn(retval);
|
||||
}
|
||||
|
||||
template <ResultCode func(u32, u32, u64)>
|
||||
void SvcWrap() {
|
||||
FuncReturn(func((u32)(PARAM(0) & 0xFFFFFFFF), (u32)(PARAM(1) & 0xFFFFFFFF), PARAM(2)).raw);
|
||||
}
|
||||
|
||||
template <ResultCode func(u32, u32*, u64*)>
|
||||
void SvcWrap() {
|
||||
u32 param_1 = 0;
|
||||
u64 param_2 = 0;
|
||||
ResultCode retval = func((u32)(PARAM(2) & 0xFFFFFFFF), ¶m_1, ¶m_2);
|
||||
Core::CPU().SetReg(1, param_1);
|
||||
Core::CPU().SetReg(2, param_2);
|
||||
FuncReturn(retval.raw);
|
||||
}
|
||||
|
||||
template <ResultCode func(u64, u64, u32, u32)>
|
||||
void SvcWrap() {
|
||||
FuncReturn(
|
||||
|
||||
@@ -342,7 +342,7 @@ SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority,
|
||||
|
||||
// Initialize new "main" thread
|
||||
auto thread_res = Thread::Create("main", entry_point, priority, 0, THREADPROCESSORID_0,
|
||||
Memory::STACK_VADDR_END, owner_process);
|
||||
Memory::STACK_AREA_VADDR_END, owner_process);
|
||||
|
||||
SharedPtr<Thread> thread = std::move(thread_res).Unwrap();
|
||||
|
||||
|
||||
@@ -200,6 +200,9 @@ public:
|
||||
}
|
||||
|
||||
ResultVal& operator=(const ResultVal& o) {
|
||||
if (this == &o) {
|
||||
return *this;
|
||||
}
|
||||
if (!empty()) {
|
||||
if (!o.empty()) {
|
||||
object = o.object;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "core/hle/service/apm/apm.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||
#include "core/settings.h"
|
||||
|
||||
namespace Service {
|
||||
namespace AM {
|
||||
@@ -241,17 +242,20 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
|
||||
const bool use_docked_mode{Settings::values.use_docked_mode};
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(static_cast<u8>(OperationMode::Handheld));
|
||||
rb.Push(static_cast<u8>(use_docked_mode ? OperationMode::Docked : OperationMode::Handheld));
|
||||
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
||||
const bool use_docked_mode{Settings::values.use_docked_mode};
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push(static_cast<u32>(APM::PerformanceMode::Handheld));
|
||||
rb.Push(static_cast<u32>(use_docked_mode ? APM::PerformanceMode::Docked
|
||||
: APM::PerformanceMode::Handheld));
|
||||
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
}
|
||||
|
||||
@@ -59,12 +59,12 @@ private:
|
||||
AudioRendererResponseData response_data{};
|
||||
|
||||
response_data.section_0_size =
|
||||
response_data.state_entries.size() * sizeof(AudioRendererStateEntry);
|
||||
response_data.section_1_size = response_data.section_1.size();
|
||||
response_data.section_2_size = response_data.section_2.size();
|
||||
response_data.section_3_size = response_data.section_3.size();
|
||||
response_data.section_4_size = response_data.section_4.size();
|
||||
response_data.section_5_size = response_data.section_5.size();
|
||||
static_cast<u32>(response_data.state_entries.size() * sizeof(AudioRendererStateEntry));
|
||||
response_data.section_1_size = static_cast<u32>(response_data.section_1.size());
|
||||
response_data.section_2_size = static_cast<u32>(response_data.section_2.size());
|
||||
response_data.section_3_size = static_cast<u32>(response_data.section_3.size());
|
||||
response_data.section_4_size = static_cast<u32>(response_data.section_4.size());
|
||||
response_data.section_5_size = static_cast<u32>(response_data.section_5.size());
|
||||
response_data.total_size = sizeof(AudioRendererResponseData);
|
||||
|
||||
for (unsigned i = 0; i < response_data.state_entries.size(); i++) {
|
||||
@@ -156,7 +156,17 @@ public:
|
||||
IAudioDevice() : ServiceFramework("IAudioDevice") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0x0, &IAudioDevice::ListAudioDeviceName, "ListAudioDeviceName"},
|
||||
{0x1, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolume"}};
|
||||
{0x1, &IAudioDevice::SetAudioDeviceOutputVolume, "SetAudioDeviceOutputVolume"},
|
||||
{0x2, nullptr, "GetAudioDeviceOutputVolume"},
|
||||
{0x3, nullptr, "GetActiveAudioDeviceName"},
|
||||
{0x4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"},
|
||||
{0x5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"},
|
||||
{0x6, nullptr, "ListAudioDeviceNameAuto"},
|
||||
{0x7, nullptr, "SetAudioDeviceOutputVolumeAuto"},
|
||||
{0x8, nullptr, "GetAudioDeviceOutputVolumeAuto"},
|
||||
{0x10, nullptr, "GetActiveAudioDeviceNameAuto"},
|
||||
{0x11, nullptr, "QueryAudioDeviceInputEvent"},
|
||||
{0x12, nullptr, "QueryAudioDeviceOutputEvent"}};
|
||||
RegisterHandlers(functions);
|
||||
|
||||
buffer_event =
|
||||
@@ -189,8 +199,26 @@ private:
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
void QueryAudioDeviceSystemEvent(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_Audio, "(STUBBED) called");
|
||||
|
||||
buffer_event->Signal();
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushCopyObjects(buffer_event);
|
||||
}
|
||||
|
||||
void GetActiveChannelCount(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_Audio, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push<u32>(1);
|
||||
}
|
||||
|
||||
Kernel::SharedPtr<Kernel::Event> buffer_event;
|
||||
};
|
||||
|
||||
}; // namespace Audio
|
||||
|
||||
AudRenU::AudRenU() : ServiceFramework("audren:u") {
|
||||
static const FunctionInfo functions[] = {
|
||||
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
explicit IFile(std::unique_ptr<FileSys::StorageBackend>&& backend)
|
||||
: ServiceFramework("IFile"), backend(std::move(backend)) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IFile::Read, "Read"}, {1, &IFile::Write, "Write"}, {2, nullptr, "Flush"},
|
||||
{3, nullptr, "SetSize"}, {4, nullptr, "GetSize"},
|
||||
{0, &IFile::Read, "Read"}, {1, &IFile::Write, "Write"}, {2, nullptr, "Flush"},
|
||||
{3, &IFile::SetSize, "SetSize"}, {4, &IFile::GetSize, "GetSize"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
@@ -150,6 +150,25 @@ private:
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
void SetSize(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const u64 size = rp.Pop<u64>();
|
||||
backend->SetSize(size);
|
||||
LOG_DEBUG(Service_FS, "called, size=%" PRIu64, size);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
void GetSize(Kernel::HLERequestContext& ctx) {
|
||||
const u64 size = backend->GetSize();
|
||||
LOG_DEBUG(Service_FS, "called, size=%" PRIu64, size);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push<u64>(size);
|
||||
}
|
||||
};
|
||||
|
||||
class IDirectory final : public ServiceFramework<IDirectory> {
|
||||
|
||||
@@ -65,13 +65,14 @@ private:
|
||||
}
|
||||
|
||||
void UpdatePadCallback(u64 userdata, int cycles_late) {
|
||||
SharedMemory* mem = reinterpret_cast<SharedMemory*>(shared_mem->GetPointer());
|
||||
SharedMemory mem{};
|
||||
std::memcpy(&mem, shared_mem->GetPointer(), sizeof(SharedMemory));
|
||||
|
||||
if (is_device_reload_pending.exchange(false))
|
||||
LoadInputDevices();
|
||||
|
||||
// Set up controllers as neon red+blue Joy-Con attached to console
|
||||
ControllerHeader& controller_header = mem->controllers[Controller_Handheld].header;
|
||||
ControllerHeader& controller_header = mem.controllers[Controller_Handheld].header;
|
||||
controller_header.type = ControllerType_Handheld | ControllerType_JoyconPair;
|
||||
controller_header.single_colors_descriptor = ColorDesc_ColorsNonexistent;
|
||||
controller_header.right_color_body = JOYCON_BODY_NEON_RED;
|
||||
@@ -79,8 +80,8 @@ private:
|
||||
controller_header.left_color_body = JOYCON_BODY_NEON_BLUE;
|
||||
controller_header.left_color_buttons = JOYCON_BUTTONS_NEON_BLUE;
|
||||
|
||||
for (int layoutIdx = 0; layoutIdx < HID_NUM_LAYOUTS; layoutIdx++) {
|
||||
ControllerLayout& layout = mem->controllers[Controller_Handheld].layouts[layoutIdx];
|
||||
for (int index = 0; index < HID_NUM_LAYOUTS; index++) {
|
||||
ControllerLayout& layout = mem.controllers[Controller_Handheld].layouts[index];
|
||||
layout.header.num_entries = HID_NUM_ENTRIES;
|
||||
layout.header.max_entry_index = HID_NUM_ENTRIES - 1;
|
||||
|
||||
@@ -136,10 +137,25 @@ private:
|
||||
// layouts)
|
||||
}
|
||||
|
||||
// TODO(shinyquagsire23): Update touch info
|
||||
// TODO(bunnei): Properly implement the touch screen, the below will just write empty data
|
||||
|
||||
TouchScreen& touchscreen = mem.touchscreen;
|
||||
const u64 last_entry = touchscreen.header.latest_entry;
|
||||
const u64 curr_entry = (last_entry + 1) % touchscreen.entries.size();
|
||||
const u64 timestamp = CoreTiming::GetTicks();
|
||||
const u64 sample_counter = touchscreen.entries[last_entry].header.timestamp + 1;
|
||||
touchscreen.header.timestamp_ticks = timestamp;
|
||||
touchscreen.header.num_entries = touchscreen.entries.size();
|
||||
touchscreen.header.latest_entry = curr_entry;
|
||||
touchscreen.header.max_entry_index = touchscreen.entries.size();
|
||||
touchscreen.header.timestamp = timestamp;
|
||||
touchscreen.entries[curr_entry].header.timestamp = sample_counter;
|
||||
touchscreen.entries[curr_entry].header.num_touches = 0;
|
||||
|
||||
// TODO(shinyquagsire23): Signal events
|
||||
|
||||
std::memcpy(shared_mem->GetPointer(), &mem, sizeof(SharedMemory));
|
||||
|
||||
// Reschedule recurrent event
|
||||
CoreTiming::ScheduleEvent(pad_update_ticks - cycles_late, pad_update_event);
|
||||
}
|
||||
@@ -185,6 +201,7 @@ public:
|
||||
{66, &Hid::StartSixAxisSensor, "StartSixAxisSensor"},
|
||||
{79, &Hid::SetGyroscopeZeroDriftMode, "SetGyroscopeZeroDriftMode"},
|
||||
{100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"},
|
||||
{101, &Hid::GetSupportedNpadStyleSet, "GetSupportedNpadStyleSet"},
|
||||
{102, &Hid::SetSupportedNpadIdType, "SetSupportedNpadIdType"},
|
||||
{103, &Hid::ActivateNpad, "ActivateNpad"},
|
||||
{106, &Hid::AcquireNpadStyleSetUpdateEventHandle,
|
||||
@@ -265,6 +282,13 @@ private:
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
}
|
||||
|
||||
void GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push<u32>(0);
|
||||
LOG_WARNING(Service_HID, "(STUBBED) called");
|
||||
}
|
||||
|
||||
void SetSupportedNpadIdType(Kernel::HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
|
||||
28
src/core/hle/service/nfp/nfp.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/nfp/nfp.h"
|
||||
#include "core/hle/service/nfp/nfp_user.h"
|
||||
|
||||
namespace Service {
|
||||
namespace NFP {
|
||||
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)) {}
|
||||
|
||||
void Module::Interface::Unknown(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_NFP, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
auto module = std::make_shared<Module>();
|
||||
std::make_shared<NFP_User>(module)->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace NFP
|
||||
} // namespace Service
|
||||
28
src/core/hle/service/nfp/nfp.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service {
|
||||
namespace NFP {
|
||||
|
||||
class Module final {
|
||||
public:
|
||||
class Interface : public ServiceFramework<Interface> {
|
||||
public:
|
||||
Interface(std::shared_ptr<Module> module, const char* name);
|
||||
|
||||
void Unknown(Kernel::HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
};
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
|
||||
} // namespace NFP
|
||||
} // namespace Service
|
||||
19
src/core/hle/service/nfp/nfp_user.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/nfp/nfp_user.h"
|
||||
|
||||
namespace Service {
|
||||
namespace NFP {
|
||||
|
||||
NFP_User::NFP_User(std::shared_ptr<Module> module)
|
||||
: Module::Interface(std::move(module), "nfp:user") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &NFP_User::Unknown, "Unknown"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace NFP
|
||||
} // namespace Service
|
||||
18
src/core/hle/service/nfp/nfp_user.h
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/service/nfp/nfp.h"
|
||||
|
||||
namespace Service {
|
||||
namespace NFP {
|
||||
|
||||
class NFP_User final : public Module::Interface {
|
||||
public:
|
||||
explicit NFP_User(std::shared_ptr<Module> module);
|
||||
};
|
||||
|
||||
} // namespace NFP
|
||||
} // namespace Service
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "core/hle/service/friend/friend.h"
|
||||
#include "core/hle/service/hid/hid.h"
|
||||
#include "core/hle/service/lm/lm.h"
|
||||
#include "core/hle/service/nfp/nfp.h"
|
||||
#include "core/hle/service/nifm/nifm.h"
|
||||
#include "core/hle/service/ns/ns.h"
|
||||
#include "core/hle/service/nvdrv/nvdrv.h"
|
||||
@@ -111,15 +112,15 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext
|
||||
auto cmd_buf = ctx.CommandBuffer();
|
||||
std::string function_name = info == nullptr ? fmt::format("{}", ctx.GetCommand()) : info->name;
|
||||
|
||||
fmt::MemoryWriter w;
|
||||
w.write("function '{}': port='{}' cmd_buf={{[0]={:#x}", function_name, service_name,
|
||||
cmd_buf[0]);
|
||||
fmt::memory_buffer buf;
|
||||
fmt::format_to(buf, "function '{}': port='{}' cmd_buf={{[0]={:#x}", function_name, service_name,
|
||||
cmd_buf[0]);
|
||||
for (int i = 1; i <= 8; ++i) {
|
||||
w.write(", [{}]={:#x}", i, cmd_buf[i]);
|
||||
fmt::format_to(buf, ", [{}]={:#x}", i, cmd_buf[i]);
|
||||
}
|
||||
w << '}';
|
||||
buf.push_back('}');
|
||||
|
||||
LOG_ERROR(Service, "unknown / unimplemented %s", w.c_str());
|
||||
LOG_ERROR(Service, "unknown / unimplemented %s", fmt::to_string(buf).c_str());
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
@@ -187,6 +188,7 @@ void Init() {
|
||||
Friend::InstallInterfaces(*SM::g_service_manager);
|
||||
HID::InstallInterfaces(*SM::g_service_manager);
|
||||
LM::InstallInterfaces(*SM::g_service_manager);
|
||||
NFP::InstallInterfaces(*SM::g_service_manager);
|
||||
NIFM::InstallInterfaces(*SM::g_service_manager);
|
||||
NS::InstallInterfaces(*SM::g_service_manager);
|
||||
Nvidia::InstallInterfaces(*SM::g_service_manager);
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/sockets/bsd_u.h"
|
||||
#include "core/hle/service/sockets/bsd.h"
|
||||
|
||||
namespace Service {
|
||||
namespace Sockets {
|
||||
|
||||
void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
|
||||
void BSD::RegisterClient(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -17,7 +17,7 @@ void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(0); // bsd errno
|
||||
}
|
||||
|
||||
void BSD_U::StartMonitoring(Kernel::HLERequestContext& ctx) {
|
||||
void BSD::StartMonitoring(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -26,7 +26,7 @@ void BSD_U::StartMonitoring(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(0); // bsd errno
|
||||
}
|
||||
|
||||
void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
|
||||
void BSD::Socket(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
u32 domain = rp.Pop<u32>();
|
||||
@@ -44,7 +44,7 @@ void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(0); // bsd errno
|
||||
}
|
||||
|
||||
void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
|
||||
void BSD::Connect(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -54,7 +54,7 @@ void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(0); // bsd errno
|
||||
}
|
||||
|
||||
void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
|
||||
void BSD::SendTo(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -64,7 +64,7 @@ void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(0); // bsd errno
|
||||
}
|
||||
|
||||
void BSD_U::Close(Kernel::HLERequestContext& ctx) {
|
||||
void BSD::Close(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -74,13 +74,15 @@ void BSD_U::Close(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(0); // bsd errno
|
||||
}
|
||||
|
||||
BSD_U::BSD_U() : ServiceFramework("bsd:u") {
|
||||
static const FunctionInfo functions[] = {{0, &BSD_U::RegisterClient, "RegisterClient"},
|
||||
{1, &BSD_U::StartMonitoring, "StartMonitoring"},
|
||||
{2, &BSD_U::Socket, "Socket"},
|
||||
{11, &BSD_U::SendTo, "SendTo"},
|
||||
{14, &BSD_U::Connect, "Connect"},
|
||||
{26, &BSD_U::Close, "Close"}};
|
||||
BSD::BSD(const char* name) : ServiceFramework(name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &BSD::RegisterClient, "RegisterClient"},
|
||||
{1, &BSD::StartMonitoring, "StartMonitoring"},
|
||||
{2, &BSD::Socket, "Socket"},
|
||||
{11, &BSD::SendTo, "SendTo"},
|
||||
{14, &BSD::Connect, "Connect"},
|
||||
{26, &BSD::Close, "Close"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
namespace Service {
|
||||
namespace Sockets {
|
||||
|
||||
class BSD_U final : public ServiceFramework<BSD_U> {
|
||||
class BSD final : public ServiceFramework<BSD> {
|
||||
public:
|
||||
BSD_U();
|
||||
~BSD_U() = default;
|
||||
explicit BSD(const char* name);
|
||||
~BSD() = default;
|
||||
|
||||
private:
|
||||
void RegisterClient(Kernel::HLERequestContext& ctx);
|
||||
34
src/core/hle/service/sockets/nsd.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/sockets/nsd.h"
|
||||
|
||||
namespace Service {
|
||||
namespace Sockets {
|
||||
|
||||
NSD::NSD(const char* name) : ServiceFramework(name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{10, nullptr, "GetSettingName"},
|
||||
{11, nullptr, "GetEnvironmentIdentifier"},
|
||||
{12, nullptr, "GetDeviceId"},
|
||||
{13, nullptr, "DeleteSettings"},
|
||||
{14, nullptr, "ImportSettings"},
|
||||
{20, nullptr, "Resolve"},
|
||||
{21, nullptr, "ResolveEx"},
|
||||
{30, nullptr, "GetNasServiceSetting"},
|
||||
{31, nullptr, "GetNasServiceSettingEx"},
|
||||
{40, nullptr, "GetNasRequestFqdn"},
|
||||
{41, nullptr, "GetNasRequestFqdnEx"},
|
||||
{42, nullptr, "GetNasApiFqdn"},
|
||||
{43, nullptr, "GetNasApiFqdnEx"},
|
||||
{50, nullptr, "GetCurrentSetting"},
|
||||
{60, nullptr, "ReadSaveDataFromFsForTest"},
|
||||
{61, nullptr, "WriteSaveDataToFsForTest"},
|
||||
{62, nullptr, "DeleteSaveDataOfFsForTest"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
} // namespace Sockets
|
||||
} // namespace Service
|
||||
20
src/core/hle/service/sockets/nsd.h
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service {
|
||||
namespace Sockets {
|
||||
|
||||
class NSD final : public ServiceFramework<NSD> {
|
||||
public:
|
||||
explicit NSD(const char* name);
|
||||
~NSD() = default;
|
||||
};
|
||||
|
||||
} // namespace Sockets
|
||||
} // namespace Service
|
||||
@@ -19,16 +19,18 @@ void SFDNSRES::GetAddrInfo(Kernel::HLERequestContext& ctx) {
|
||||
}
|
||||
|
||||
SFDNSRES::SFDNSRES() : ServiceFramework("sfdnsres") {
|
||||
static const FunctionInfo functions[] = {{0, nullptr, "SetDnsAddressesPrivate"},
|
||||
{1, nullptr, "GetDnsAddressPrivate"},
|
||||
{2, nullptr, "GetHostByName"},
|
||||
{3, nullptr, "GetHostByAddr"},
|
||||
{4, nullptr, "GetHostStringError"},
|
||||
{5, nullptr, "GetGaiStringError"},
|
||||
{6, &SFDNSRES::GetAddrInfo, "GetAddrInfo"},
|
||||
{7, nullptr, "GetNameInfo"},
|
||||
{8, nullptr, "RequestCancelHandle"},
|
||||
{9, nullptr, "CancelSocketCall"}};
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "SetDnsAddressesPrivate"},
|
||||
{1, nullptr, "GetDnsAddressPrivate"},
|
||||
{2, nullptr, "GetHostByName"},
|
||||
{3, nullptr, "GetHostByAddr"},
|
||||
{4, nullptr, "GetHostStringError"},
|
||||
{5, nullptr, "GetGaiStringError"},
|
||||
{6, &SFDNSRES::GetAddrInfo, "GetAddrInfo"},
|
||||
{7, nullptr, "GetNameInfo"},
|
||||
{8, nullptr, "RequestCancelHandle"},
|
||||
{9, nullptr, "CancelSocketCall"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Sockets {
|
||||
|
||||
class SFDNSRES final : public ServiceFramework<SFDNSRES> {
|
||||
public:
|
||||
SFDNSRES();
|
||||
explicit SFDNSRES();
|
||||
~SFDNSRES() = default;
|
||||
|
||||
private:
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/hle/service/sockets/bsd_u.h"
|
||||
#include "core/hle/service/sockets/bsd.h"
|
||||
#include "core/hle/service/sockets/nsd.h"
|
||||
#include "core/hle/service/sockets/sfdnsres.h"
|
||||
#include "core/hle/service/sockets/sockets.h"
|
||||
|
||||
@@ -10,7 +11,10 @@ namespace Service {
|
||||
namespace Sockets {
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
std::make_shared<BSD_U>()->InstallAsService(service_manager);
|
||||
std::make_shared<BSD>("bsd:s")->InstallAsService(service_manager);
|
||||
std::make_shared<BSD>("bsd:u")->InstallAsService(service_manager);
|
||||
std::make_shared<NSD>("nsd:a")->InstallAsService(service_manager);
|
||||
std::make_shared<NSD>("nsd:u")->InstallAsService(service_manager);
|
||||
std::make_shared<SFDNSRES>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ FileType AppLoader_DeconstructedRomDirectory::IdentifyType(FileUtil::IOFile& fil
|
||||
} else if (Common::ToLower(virtual_name) == "sdk") {
|
||||
is_sdk_found = true;
|
||||
} else {
|
||||
// Contrinue searching
|
||||
// Continue searching
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -414,7 +414,7 @@ ResultStatus AppLoader_ELF::Load(Kernel::SharedPtr<Kernel::Process>& process) {
|
||||
process->resource_limit =
|
||||
Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
|
||||
|
||||
process->Run(codeset->entrypoint, 48, Memory::STACK_SIZE);
|
||||
process->Run(codeset->entrypoint, 48, Memory::DEFAULT_STACK_SIZE);
|
||||
|
||||
is_loaded = true;
|
||||
return ResultStatus::Success;
|
||||
|
||||
@@ -137,7 +137,7 @@ ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
|
||||
process->address_mappings = default_address_mappings;
|
||||
process->resource_limit =
|
||||
Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
|
||||
process->Run(base_addr, 48, Memory::STACK_SIZE);
|
||||
process->Run(base_addr, 48, Memory::DEFAULT_STACK_SIZE);
|
||||
|
||||
is_loaded = true;
|
||||
return ResultStatus::Success;
|
||||
|
||||