Compare commits
25 Commits
2024-04-28
...
2024-05-14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2184968eb4 | ||
|
|
ffc907460f | ||
|
|
e966068fea | ||
|
|
fad5984210 | ||
|
|
e96b877ee2 | ||
|
|
377c9bc831 | ||
|
|
ef6fc3e26a | ||
|
|
bef55d43a5 | ||
|
|
08f47542e8 | ||
|
|
cdcbfdc837 | ||
|
|
036a7edb2c | ||
|
|
1df1841ad1 | ||
|
|
5097c6a0b9 | ||
|
|
4821698cd8 | ||
|
|
4ebd9dc2b5 | ||
|
|
12ccc468f4 | ||
|
|
82fce02827 | ||
|
|
bddfb77343 | ||
|
|
f7f1114ec1 | ||
|
|
c1449cca64 | ||
|
|
b242ac022c | ||
|
|
37e53d50bb | ||
|
|
b6e8e04533 | ||
|
|
f890dbb064 | ||
|
|
f05ffb6b05 |
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -31,9 +31,6 @@
|
||||
[submodule "vcpkg"]
|
||||
path = externals/vcpkg
|
||||
url = https://github.com/microsoft/vcpkg.git
|
||||
[submodule "cpp-jwt"]
|
||||
path = externals/cpp-jwt
|
||||
url = https://github.com/arun11299/cpp-jwt.git
|
||||
[submodule "libadrenotools"]
|
||||
path = externals/libadrenotools
|
||||
url = https://github.com/bylaws/libadrenotools.git
|
||||
@@ -55,9 +52,6 @@
|
||||
[submodule "externals/SPIRV-Headers"]
|
||||
path = externals/SPIRV-Headers
|
||||
url = https://github.com/KhronosGroup/SPIRV-Headers.git
|
||||
[submodule "externals/boost-headers"]
|
||||
path = externals/boost-headers
|
||||
url = https://github.com/boostorg/headers.git
|
||||
[submodule "externals/SPIRV-Tools"]
|
||||
path = externals/SPIRV-Tools
|
||||
url = https://github.com/KhronosGroup/SPIRV-Tools.git
|
||||
|
||||
@@ -30,8 +30,6 @@ set(QT6_LOCATION "" CACHE PATH "Additional Location to search for Qt6 libraries
|
||||
option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
|
||||
|
||||
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
|
||||
|
||||
option(YUZU_USE_BUNDLED_FFMPEG "Download/Build bundled FFmpeg" "${WIN32}")
|
||||
|
||||
option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON)
|
||||
@@ -143,9 +141,6 @@ if (YUZU_USE_BUNDLED_VCPKG)
|
||||
if (YUZU_TESTS)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "yuzu-tests")
|
||||
endif()
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "web-service")
|
||||
endif()
|
||||
if (ANDROID)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "android")
|
||||
endif()
|
||||
@@ -275,8 +270,17 @@ endif()
|
||||
# Configure C++ standard
|
||||
# ===========================
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
# boost asio's concept usage doesn't play nicely with some compilers yet.
|
||||
add_definitions(-DBOOST_ASIO_DISABLE_CONCEPTS)
|
||||
if (MSVC)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/std:c++20>)
|
||||
|
||||
# boost still makes use of deprecated result_of.
|
||||
add_definitions(-D_HAS_DEPRECATED_RESULT_OF)
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
# Output binaries to bin/
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||
@@ -285,6 +289,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||
# =======================================================================
|
||||
|
||||
# Enforce the search mode of non-required packages for better and shorter failure messages
|
||||
find_package(Boost 1.79.0 REQUIRED context)
|
||||
find_package(enet 1.3 MODULE)
|
||||
find_package(fmt 9 REQUIRED)
|
||||
find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle)
|
||||
@@ -335,15 +340,17 @@ if (USE_DISCORD_PRESENCE)
|
||||
find_package(DiscordRPC MODULE)
|
||||
endif()
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
find_package(cpp-jwt 1.4 CONFIG)
|
||||
find_package(httplib 0.12 MODULE COMPONENTS OpenSSL)
|
||||
endif()
|
||||
find_package(httplib 0.12 MODULE COMPONENTS OpenSSL)
|
||||
|
||||
if (YUZU_TESTS)
|
||||
find_package(Catch2 3.0.1 REQUIRED)
|
||||
endif()
|
||||
|
||||
# boost:asio has functions that require AcceptEx et al
|
||||
if (MINGW)
|
||||
find_library(MSWSOCK_LIBRARY mswsock REQUIRED)
|
||||
endif()
|
||||
|
||||
if(ENABLE_OPENSSL)
|
||||
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||
endif()
|
||||
@@ -669,6 +676,8 @@ function(create_target_directory_groups target_name)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Prevent boost from linking against libs when building
|
||||
target_link_libraries(Boost::headers INTERFACE Boost::disable_autolinking)
|
||||
# Adjustments for MSVC + Ninja
|
||||
if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
add_compile_options(
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# prefix_var: name of a variable which will be set with the path to the extracted contents
|
||||
function(download_bundled_external remote_path lib_name prefix_var)
|
||||
|
||||
set(package_base_url "https://github.com/yuzu-emu/")
|
||||
set(package_base_url "https://github.com/yuzu-mirror/")
|
||||
set(package_repo "no_platform")
|
||||
set(package_extension "no_platform")
|
||||
if (WIN32)
|
||||
|
||||
32
FAQ.md
Normal file
32
FAQ.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# FAQ
|
||||
|
||||
**Q:** Will you fix game X?<br/>
|
||||
**A:** I would love to! Unfortunately my resources are severely limited as I'm a one-man team. I will give it a try, but if you can link me to a commit in any other fork fixing the game I'd be glad to cherry-pick it.
|
||||
|
||||
**Q:** Will you add feature X?<br/>
|
||||
**A:** Most likely, no. I hesitate from adding complex features that may jeopardize stability and introduce bugs. Such features would only be added behind a settings toggle.
|
||||
|
||||
**Q:** You're only doing this for fame/money/...<br/>
|
||||
**A:** At the moment I am not considering to take any donations. I won't need them anyways in the foreseeable future.
|
||||
About the fame thing, I kind of dislike the attention. It distracts me from doing actual work, and it makes me feel pressured. Read this if you'd like to know more: [https://www.reddit.com/r/EmulationOnAndroid/comments/1ckmdh7/comment/l36hru9/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button](https://www.reddit.com/r/EmulationOnAndroid/comments/1ckmdh7/comment/l36hru9/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button)
|
||||
|
||||
**Q:** What happens if Nintendo DMCAs the repo?<br/>
|
||||
**A:** The main repository is on the Tor network. That means Nintendo can do no harm to it unless they manage to deanonymize me and send me a personal letter. I'm doing my best to avoid that.
|
||||
Whenever a mirror repository gets taken down, I'll just move on to another git service. Yes, they are finite but I've got enough to hopefully make them give up before I've depleted my list.
|
||||
|
||||
**Q:** But you're just stealing changes from other forks!<br/>
|
||||
**A:** This is a pretty normal thing to do in the open source world. Yes, a lot of the changes are cherry-picked from other forks. There is no point in duplicating work unnecessarily and keeping good additions out of the project just because they are not mine. Original contributors are always credited as commit author of course.
|
||||
Note however that all changes listed in the README file are my own work and other forks should feel free to cherry-pick them!
|
||||
|
||||
**Q:** Will there ever be an Android version?<br/>
|
||||
**A:** Unfortunately I am pretty inexperienced in the Android world. This whole gradle stuff makes no sense to me and I've given up for now.
|
||||
Let's say, it'd be a nice bonus but it's very low priority. If you'd like to run Yuzu on Android you'd probably be better off with Sudachi.
|
||||
|
||||
**Q:** This fork is going to be abandoned very soon!<br/>
|
||||
**A:** I have committed myself to at the very least keep it updated enough to compile and run on modern systems for the next decade or so. If you don't see commits for a while it doesn't mean I've abandoned it.
|
||||
I have ADHD and need to shift my focus between different projects sometimes to stay motivated. Also, personal life is a thing. ~~Who knows maybe I'll be run over by a car tomorrow? Joking, that's not going to happen. Hopefully.~~
|
||||
|
||||
Enjoy playing your favorite (and legally obtained) Nintendo games on whatever device and emulator you prefer!<br/>
|
||||
Don't let Nintendo pressure you into using their kind of terrible and overpriced hardware... I'm truly sorry if no emulator can currently play the game you want to play.
|
||||
|
||||
Finally, enjoy life, make the most of it, don't be a ~~couch~~ office chair potato like me. Tip, even if you are, a walk around the green city areas can be incredibly refreshing!
|
||||
38
README.md
38
README.md
@@ -5,13 +5,13 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
<h1 align="center">
|
||||
<br>
|
||||
<a href="http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu"><img src="https://raw.githubusercontent.com/litucks/torzu/master/dist/yuzu.svg" alt="torzu" width="200"></a>
|
||||
<a href="http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu"><img src="https://raw.githubusercontent.com/litucks/torzu/master/dist/yuzu.bmp" alt="torzu" width="200"></a>
|
||||
<br>
|
||||
<b>torzu</b>
|
||||
<br>
|
||||
</h1>
|
||||
|
||||
<h4 align="center"><b>torzu</b> is a fork of yuzu, the world's most popular, open-source, Nintendo Switch emulator — started by the creators of <a href="https://citra-emu.org" target="_blank">Citra</a>.
|
||||
<h4 align="center"><b>torzu</b> is a fork of yuzu, the world's most popular, open-source, Nintendo Switch emulator.
|
||||
<br>
|
||||
It is written in C++ with portability in mind, and I plan to actively maintain builds for Linux, Android and Windows.
|
||||
</h4>
|
||||
@@ -30,11 +30,33 @@ The emulator is capable of running most commercial games at full speed, provided
|
||||
|
||||
It runs most Nintendo Switch games released until the date of the Yuzu takedown.
|
||||
|
||||
## Changes
|
||||
|
||||
Following are the changes made since forking from Yuzu:
|
||||
|
||||
- Added option to optimize generated SPIR-V shaders via spirv-opt
|
||||
- Added option to synchronize CPU clock to render speed limit
|
||||
- Added option to launch home menu from Switch firmware
|
||||
- Fixed crash when switching away from null graphics per-game
|
||||
- Fixed controller UI being cut off at the bottom
|
||||
- Removed analytics and authentication as they'd be useless (perhaps even outright dangerous) now
|
||||
- Minor improvements and additions
|
||||
|
||||
## Goals
|
||||
|
||||
The first and foremost goal is long-term maintenance. Even if I stop commiting new features I will always do my best to keep the emulator functional and third party dependencies updated. This also means most of the changes made will eventually be bug fixes.
|
||||
Essentially, the main goal is that you can still use this emulator on modern systems in 20 years.
|
||||
It is very important to me that this project is going to be a good base to fork once grass has grown over the whole legal dilemma and people are willing to do real work on this emulator non-anonymously.
|
||||
|
||||
A secondary goal is the improvement of usability on low-end systems. This includes both improving the performance of the emulator as well as making games more playable below 100% speed whenever possible (the sync CPU to render speed limit option already helps with that in few cases).
|
||||
|
||||
Android support is low priority but would be a nice bonus.
|
||||
|
||||
## Development
|
||||
|
||||
Most of the development happens on [Dark Git](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/). It's also where [our central repository](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu) is hosted.
|
||||
|
||||
Currently, development is limited to external commits as I'm working on implementing a faster recompiler! This will increase emulation speed in CPU-bound scenarios.
|
||||
Currently, development is somewhat limited to external commits as I'm working on improvements in dynarmic! This will increase emulation speed in CPU-bound scenarios.
|
||||
|
||||
If you want to contribute, please take a look at the [Contributor's Guide](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu/wiki/Contributing) and [Developer Information](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu/wiki/Developer-Information).
|
||||
|
||||
@@ -48,22 +70,22 @@ Alternatively, you can clone from the [GitHub mirror repository](https://github.
|
||||
|
||||
git clone https://github.com/litucks/torzu.git --depth 1 --recursive
|
||||
|
||||
Note that above repository may be taken down any time. Do not rely on its existence in production.
|
||||
Note that above repository may be taken down any time. Do not rely on its existence in production. In case the GitHub mirror goes down, a mirror will be set up on Gitlab.
|
||||
|
||||
This project incorporates several commits from the [Suyu](https://suyu.dev) and [Sudachi](https://github.com/sudachi-emu/sudachi) forks (but cleaned up due to the typically mediocre code/commit quality from both projects) as well as some custom changes, including lowered minimum boost library version requirements and faster fibers.
|
||||
This project incorporates several commits from the [Suyu](https://suyu.dev) and [Sudachi](https://github.com/sudachi-emu/sudachi) forks (but cleaned up due to the typically mediocre code/commit quality from both projects) as well as changes listed in **Changes**.
|
||||
|
||||
## Building
|
||||
|
||||
* __Linux__: [Linux Build](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu/wiki/Building-for-Linux)
|
||||
* ~~__Windows__: [Windows Build](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu/wiki/Building-for-Windows)~~
|
||||
* __Windows__: [Windows Build](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu/wiki/Building-for-Windows)
|
||||
* ~~__Android__: [Android Build](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu/wiki/Building-For-Android)~~
|
||||
* ~~__macOS__: [macOS Build](http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu/wiki/Building-for-macOS)~~
|
||||
|
||||
(Only Linux builds are available for now. Next planned are Windows, then Android.)
|
||||
(Only Linux and Windows builds are available for now. Android is planned eventually.)
|
||||
|
||||
## Download
|
||||
|
||||
There are no precompiled releases available (yet).
|
||||
Precompiled build are available **in the releases section**.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
2
dist/yuzu.svg
vendored
2
dist/yuzu.svg
vendored
@@ -1,2 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" version="1.1" viewBox="0 0 152 152" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><circle cx="75.585" cy="75.585" r="75.585" fill="url(#_Radial1)"/><clipPath id="_clip2"><circle cx="75.585" cy="75.585" r="75.585"/></clipPath><g clip-path="url(#_clip2)"><path d="m75.585 17.097c11.94-0 21.635 9.694 21.635 21.635s-9.695 21.635-21.635 21.635c-11.941 0-21.635-9.694-21.635-21.635s9.694-21.635 21.635-21.635zm-0 5.21c-9.066 0-16.425 7.36-16.425 16.425s7.359 16.425 16.425 16.425c9.065-0 16.424-7.36 16.424-16.425s-7.359-16.425-16.424-16.425z"/><path d="m75.585 27.343c6.285 0 11.388 5.103 11.388 11.389s-5.103 11.389-11.388 11.389c-6.286-0-11.389-5.103-11.389-11.389s5.103-11.389 11.389-11.389zm-0 5.21c-3.41 0-6.179 2.769-6.179 6.179s2.769 6.179 6.179 6.179 6.178-2.769 6.178-6.179-2.768-6.179-6.178-6.179z"/><path d="m112.44 53.95c11.941-0 21.635 9.694 21.635 21.635 0 11.94-9.694 21.635-21.635 21.635s-21.635-9.695-21.635-21.635c0-11.941 9.694-21.635 21.635-21.635zm0 5.21c-9.065-0-16.425 7.359-16.425 16.425 0 9.065 7.36 16.424 16.425 16.424s16.425-7.359 16.425-16.424c-0-9.066-7.36-16.425-16.425-16.425z"/><path d="m112.44 64.196c6.286-0 11.389 5.103 11.389 11.389-0 6.285-5.103 11.388-11.389 11.388s-11.389-5.103-11.389-11.388c0-6.286 5.103-11.389 11.389-11.389zm0 5.21c-3.41-0-6.178 2.769-6.178 6.179s2.768 6.178 6.178 6.178 6.179-2.768 6.179-6.178-2.769-6.179-6.179-6.179z"/><path d="m75.585 90.802c11.94 0 21.635 9.694 21.635 21.635s-9.695 21.635-21.635 21.635c-11.941 0-21.635-9.694-21.635-21.635s9.694-21.635 21.635-21.635zm-0 5.21c-9.066 0-16.425 7.36-16.425 16.425s7.359 16.425 16.425 16.425c9.065-0 16.424-7.36 16.424-16.425s-7.359-16.425-16.424-16.425z"/><path d="m75.585 101.05c6.285 0 11.388 5.103 11.388 11.389s-5.103 11.389-11.388 11.389c-6.286-0-11.389-5.103-11.389-11.389s5.103-11.389 11.389-11.389zm-0 5.211c-3.41-0-6.179 2.768-6.179 6.178s2.769 6.179 6.179 6.179 6.178-2.769 6.178-6.179-2.768-6.178-6.178-6.178z"/><path d="m38.732 53.95c11.941-0 21.635 9.694 21.635 21.635 0 11.94-9.694 21.635-21.635 21.635s-21.635-9.695-21.635-21.635c-0-11.941 9.694-21.635 21.635-21.635zm-0 5.21c-9.065-0-16.425 7.359-16.425 16.425 0 9.065 7.36 16.424 16.425 16.424s16.425-7.359 16.425-16.424c-0-9.066-7.36-16.425-16.425-16.425z"/><path d="m38.732 64.196c6.286-0 11.389 5.103 11.389 11.389-0 6.285-5.103 11.388-11.389 11.388s-11.389-5.103-11.389-11.388c0-6.286 5.103-11.389 11.389-11.389zm-0 5.21c-3.41-0-6.179 2.769-6.179 6.179s2.769 6.178 6.179 6.178 6.179-2.768 6.179-6.178-2.769-6.179-6.179-6.179z"/></g><defs><radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientTransform="matrix(-81.196 -81.196 81.196 -81.196 114.32 116.87)" gradientUnits="userSpaceOnUse"><stop stop-color="#ff2088" offset="0"/><stop stop-color="#c24bac" offset=".44"/><stop stop-color="#37aeff" offset="1"/></radialGradient></defs></svg>
|
||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" version="1.1" viewBox="0 0 152 152" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><circle cx="75.585" cy="75.585" r="75.585" fill="url(#_Radial1)"/><clipPath id="_clip2"></clipPath><g clip-path="url(#_clip2)"><path d="m75.585 17.097c11.94-0 21.635 9.694 21.635 21.635s-9.695 21.635-21.635 21.635c-11.941 0-21.635-9.694-21.635-21.635s9.694-21.635 21.635-21.635zm-0 5.21c-9.066 0-16.425 7.36-16.425 16.425s7.359 16.425 16.425 16.425c9.065-0 16.424-7.36 16.424-16.425s-7.359-16.425-16.424-16.425z"/><path d="m75.585 27.343c6.285 0 11.388 5.103 11.388 11.389s-5.103 11.389-11.388 11.389c-6.286-0-11.389-5.103-11.389-11.389s5.103-11.389 11.389-11.389zm-0 5.21c-3.41 0-6.179 2.769-6.179 6.179s2.769 6.179 6.179 6.179 6.178-2.769 6.178-6.179-2.768-6.179-6.178-6.179z"/><path d="m112.44 53.95c11.941-0 21.635 9.694 21.635 21.635 0 11.94-9.694 21.635-21.635 21.635s-21.635-9.695-21.635-21.635c0-11.941 9.694-21.635 21.635-21.635zm0 5.21c-9.065-0-16.425 7.359-16.425 16.425 0 9.065 7.36 16.424 16.425 16.424s16.425-7.359 16.425-16.424c-0-9.066-7.36-16.425-16.425-16.425z"/><path d="m112.44 64.196c6.286-0 11.389 5.103 11.389 11.389-0 6.285-5.103 11.388-11.389 11.388s-11.389-5.103-11.389-11.388c0-6.286 5.103-11.389 11.389-11.389zm0 5.21c-3.41-0-6.178 2.769-6.178 6.179s2.768 6.178 6.178 6.178 6.179-2.768 6.179-6.178-2.769-6.179-6.179-6.179z"/><path d="m75.585 90.802c11.94 0 21.635 9.694 21.635 21.635s-9.695 21.635-21.635 21.635c-11.941 0-21.635-9.694-21.635-21.635s9.694-21.635 21.635-21.635zm-0 5.21c-9.066 0-16.425 7.36-16.425 16.425s7.359 16.425 16.425 16.425c9.065-0 16.424-7.36 16.424-16.425s-7.359-16.425-16.424-16.425z"/><path d="m75.585 101.05c6.285 0 11.388 5.103 11.388 11.389s-5.103 11.389-11.388 11.389c-6.286-0-11.389-5.103-11.389-11.389s5.103-11.389 11.389-11.389zm-0 5.211c-3.41-0-6.179 2.768-6.179 6.178s2.769 6.179 6.179 6.179 6.178-2.769 6.178-6.179-2.768-6.178-6.178-6.178z"/><path d="m38.732 53.95c11.941-0 21.635 9.694 21.635 21.635 0 11.94-9.694 21.635-21.635 21.635s-21.635-9.695-21.635-21.635c-0-11.941 9.694-21.635 21.635-21.635zm-0 5.21c-9.065-0-16.425 7.359-16.425 16.425 0 9.065 7.36 16.424 16.425 16.424s16.425-7.359 16.425-16.424c-0-9.066-7.36-16.425-16.425-16.425z"/><path d="m38.732 64.196c6.286-0 11.389 5.103 11.389 11.389-0 6.285-5.103 11.388-11.389 11.388s-11.389-5.103-11.389-11.388c0-6.286 5.103-11.389 11.389-11.389zm-0 5.21c-3.41-0-6.179 2.769-6.179 6.179s2.769 6.178 6.179 6.178 6.179-2.768 6.179-6.178-2.769-6.179-6.179-6.179z"/></g><defs><radialGradient id="_Radial1" cx="0" cy="0" r="1" gradientTransform="matrix(-81.196 -81.196 81.196 -81.196 114.32 116.87)" gradientUnits="userSpaceOnUse"><stop stop-color="#ff2088" offset="0"/><stop stop-color="#c24bac" offset=".44"/><stop stop-color="#37aeff" offset="1"/></radialGradient></defs></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
14
externals/CMakeLists.txt
vendored
14
externals/CMakeLists.txt
vendored
@@ -125,19 +125,11 @@ endif()
|
||||
add_subdirectory(sirit)
|
||||
|
||||
# httplib
|
||||
if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib)
|
||||
if (NOT TARGET httplib::httplib)
|
||||
set(HTTPLIB_REQUIRE_OPENSSL ON)
|
||||
add_subdirectory(cpp-httplib)
|
||||
endif()
|
||||
|
||||
# cpp-jwt
|
||||
if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt)
|
||||
set(CPP_JWT_BUILD_EXAMPLES OFF)
|
||||
set(CPP_JWT_BUILD_TESTS OFF)
|
||||
set(CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF)
|
||||
add_subdirectory(cpp-jwt)
|
||||
endif()
|
||||
|
||||
# Opus
|
||||
if (NOT TARGET Opus::opus)
|
||||
set(OPUS_BUILD_TESTING OFF)
|
||||
@@ -168,12 +160,10 @@ endif()
|
||||
|
||||
# SPIRV-Tools
|
||||
if (YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||
set(SPIRV_SKIP_EXECUTABLES ON)
|
||||
add_subdirectory(SPIRV-Tools)
|
||||
endif()
|
||||
|
||||
# Boost headers
|
||||
add_subdirectory(boost-headers)
|
||||
|
||||
# TZDB (Time Zone Database)
|
||||
add_subdirectory(nx_tzdb)
|
||||
|
||||
|
||||
1
externals/boost-headers
vendored
1
externals/boost-headers
vendored
Submodule externals/boost-headers deleted from 0456900fad
1
externals/cpp-jwt
vendored
1
externals/cpp-jwt
vendored
Submodule externals/cpp-jwt deleted from 10ef5735d8
@@ -62,12 +62,10 @@ if (MSVC)
|
||||
|
||||
# Warnings
|
||||
/W4
|
||||
/WX
|
||||
|
||||
/we4062 # Enumerator 'identifier' in a switch of enum 'enumeration' is not handled
|
||||
/we4189 # 'identifier': local variable is initialized but not referenced
|
||||
/we4265 # 'class': class has virtual functions, but destructor is not virtual
|
||||
/we4388 # 'expression': signed/unsigned mismatch
|
||||
/we4389 # 'operator': signed/unsigned mismatch
|
||||
/we4456 # Declaration of 'identifier' hides previous local declaration
|
||||
/we4457 # Declaration of 'identifier' hides function parameter
|
||||
@@ -209,10 +207,6 @@ if (ENABLE_QT)
|
||||
add_subdirectory(yuzu)
|
||||
endif()
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
add_subdirectory(web_service)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
add_subdirectory(android/app/src/main/jni)
|
||||
target_include_directories(yuzu-android PRIVATE android/app/src/main)
|
||||
|
||||
@@ -212,8 +212,6 @@ add_library(audio_core STATIC
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(audio_core PRIVATE
|
||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
||||
|
||||
@@ -233,8 +233,6 @@ if (MSVC)
|
||||
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
||||
)
|
||||
target_compile_options(common PRIVATE
|
||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
||||
)
|
||||
else()
|
||||
@@ -261,7 +259,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(common PUBLIC Boost::headers fmt::fmt microprofile stb::headers Threads::Threads)
|
||||
target_link_libraries(common PUBLIC Boost::context Boost::headers fmt::fmt microprofile stb::headers Threads::Threads)
|
||||
target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
|
||||
|
||||
if (ANDROID)
|
||||
|
||||
@@ -5,46 +5,87 @@
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/fiber.h"
|
||||
#define MINICORO_IMPL
|
||||
#include "common/minicoro.h"
|
||||
#include "common/virtual_buffer.h"
|
||||
|
||||
#include <boost/context/detail/fcontext.hpp>
|
||||
|
||||
namespace Common {
|
||||
|
||||
constexpr std::size_t default_stack_size = 512 * 1024;
|
||||
|
||||
struct Fiber::FiberImpl {
|
||||
FiberImpl() {}
|
||||
FiberImpl() : stack{default_stack_size}, rewind_stack{default_stack_size} {}
|
||||
|
||||
VirtualBuffer<u8> stack;
|
||||
VirtualBuffer<u8> rewind_stack;
|
||||
|
||||
std::mutex guard;
|
||||
bool released{};
|
||||
bool is_thread_fiber{};
|
||||
Fiber* next_fiber{};
|
||||
Fiber** next_fiber_ptr;
|
||||
std::function<void()> entry_point;
|
||||
std::function<void()> rewind_point;
|
||||
std::shared_ptr<Fiber> previous_fiber;
|
||||
bool is_thread_fiber{};
|
||||
bool released{};
|
||||
|
||||
mco_coro* context;
|
||||
u8* stack_limit{};
|
||||
u8* rewind_stack_limit{};
|
||||
boost::context::detail::fcontext_t context{};
|
||||
boost::context::detail::fcontext_t rewind_context{};
|
||||
};
|
||||
|
||||
Fiber::Fiber() : impl{std::make_unique<FiberImpl>()} {
|
||||
impl->is_thread_fiber = true;
|
||||
void Fiber::SetRewindPoint(std::function<void()>&& rewind_func) {
|
||||
impl->rewind_point = std::move(rewind_func);
|
||||
}
|
||||
|
||||
void Fiber::Start(boost::context::detail::transfer_t& transfer) {
|
||||
ASSERT(impl->previous_fiber != nullptr);
|
||||
impl->previous_fiber->impl->context = transfer.fctx;
|
||||
impl->previous_fiber->impl->guard.unlock();
|
||||
impl->previous_fiber.reset();
|
||||
impl->entry_point();
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void Fiber::OnRewind([[maybe_unused]] boost::context::detail::transfer_t& transfer) {
|
||||
ASSERT(impl->context != nullptr);
|
||||
impl->context = impl->rewind_context;
|
||||
impl->rewind_context = nullptr;
|
||||
u8* tmp = impl->stack_limit;
|
||||
impl->stack_limit = impl->rewind_stack_limit;
|
||||
impl->rewind_stack_limit = tmp;
|
||||
impl->rewind_point();
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
void Fiber::FiberStartFunc(boost::context::detail::transfer_t transfer) {
|
||||
auto* fiber = static_cast<Fiber*>(transfer.data);
|
||||
fiber->Start(transfer);
|
||||
}
|
||||
|
||||
void Fiber::RewindStartFunc(boost::context::detail::transfer_t transfer) {
|
||||
auto* fiber = static_cast<Fiber*>(transfer.data);
|
||||
fiber->OnRewind(transfer);
|
||||
}
|
||||
|
||||
Fiber::Fiber(std::function<void()>&& entry_point_func) : impl{std::make_unique<FiberImpl>()} {
|
||||
impl->entry_point = std::move(entry_point_func);
|
||||
auto desc = mco_desc_init(
|
||||
[](mco_coro* coro) { reinterpret_cast<Fiber*>(coro->user_data)->impl->entry_point(); }, 0);
|
||||
desc.user_data = this;
|
||||
mco_result res = mco_create(&impl->context, &desc);
|
||||
ASSERT(res == MCO_SUCCESS);
|
||||
impl->stack_limit = impl->stack.data();
|
||||
impl->rewind_stack_limit = impl->rewind_stack.data();
|
||||
u8* stack_base = impl->stack_limit + default_stack_size;
|
||||
impl->context =
|
||||
boost::context::detail::make_fcontext(stack_base, impl->stack.size(), FiberStartFunc);
|
||||
}
|
||||
|
||||
Fiber::Fiber() : impl{std::make_unique<FiberImpl>()} {}
|
||||
|
||||
Fiber::~Fiber() {
|
||||
if (impl->released) {
|
||||
return;
|
||||
}
|
||||
DestroyPre();
|
||||
if (impl->is_thread_fiber) {
|
||||
DestroyThreadFiber();
|
||||
} else {
|
||||
DestroyWorkFiber();
|
||||
// Make sure the Fiber is not being used
|
||||
const bool locked = impl->guard.try_lock();
|
||||
ASSERT_MSG(locked, "Destroying a fiber that's still running");
|
||||
if (locked) {
|
||||
impl->guard.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,66 +94,42 @@ void Fiber::Exit() {
|
||||
if (!impl->is_thread_fiber) {
|
||||
return;
|
||||
}
|
||||
DestroyPre();
|
||||
DestroyThreadFiber();
|
||||
}
|
||||
|
||||
void Fiber::DestroyPre() {
|
||||
// Make sure the Fiber is not being used
|
||||
const bool locked = impl->guard.try_lock();
|
||||
ASSERT_MSG(locked, "Destroying a fiber that's still running");
|
||||
if (locked) {
|
||||
impl->guard.unlock();
|
||||
}
|
||||
impl->guard.unlock();
|
||||
impl->released = true;
|
||||
}
|
||||
|
||||
void Fiber::DestroyWorkFiber() {
|
||||
mco_result res = mco_destroy(impl->context);
|
||||
ASSERT(res == MCO_SUCCESS);
|
||||
}
|
||||
|
||||
void Fiber::DestroyThreadFiber() {
|
||||
if (impl->next_fiber_ptr && *impl->next_fiber_ptr) {
|
||||
*impl->next_fiber_ptr = nullptr;
|
||||
}
|
||||
void Fiber::Rewind() {
|
||||
ASSERT(impl->rewind_point);
|
||||
ASSERT(impl->rewind_context == nullptr);
|
||||
u8* stack_base = impl->rewind_stack_limit + default_stack_size;
|
||||
impl->rewind_context =
|
||||
boost::context::detail::make_fcontext(stack_base, impl->stack.size(), RewindStartFunc);
|
||||
boost::context::detail::jump_fcontext(impl->rewind_context, this);
|
||||
}
|
||||
|
||||
void Fiber::YieldTo(std::weak_ptr<Fiber> weak_from, Fiber& to) {
|
||||
to.impl->guard.lock();
|
||||
to.impl->previous_fiber = weak_from.lock();
|
||||
|
||||
auto transfer = boost::context::detail::jump_fcontext(to.impl->context, &to);
|
||||
|
||||
// "from" might no longer be valid if the thread was killed
|
||||
if (auto from = weak_from.lock()) {
|
||||
if (!from->impl->is_thread_fiber) {
|
||||
// Set next fiber
|
||||
from->impl->next_fiber = &to;
|
||||
// Yield from thread
|
||||
if (!from->impl->released) {
|
||||
from->impl->guard.unlock();
|
||||
mco_yield(from->impl->context);
|
||||
}
|
||||
} else {
|
||||
from->impl->guard.lock();
|
||||
// Keep running next fiber until they've ran out
|
||||
auto& next_fiber_ptr = from->impl->next_fiber_ptr;
|
||||
next_fiber_ptr = &from->impl->next_fiber;
|
||||
*next_fiber_ptr = &to;
|
||||
while (*next_fiber_ptr) {
|
||||
auto next = *next_fiber_ptr;
|
||||
*next_fiber_ptr = nullptr;
|
||||
next_fiber_ptr = &next->impl->next_fiber;
|
||||
// Stop if new thread is thread fiber
|
||||
if (next->impl->is_thread_fiber)
|
||||
break;
|
||||
// Resume new thread
|
||||
next->impl->guard.lock();
|
||||
mco_result res = mco_resume(next->impl->context);
|
||||
ASSERT(res == MCO_SUCCESS);
|
||||
}
|
||||
from->impl->guard.unlock();
|
||||
if (from->impl->previous_fiber == nullptr) {
|
||||
ASSERT_MSG(false, "previous_fiber is nullptr!");
|
||||
return;
|
||||
}
|
||||
from->impl->previous_fiber->impl->context = transfer.fctx;
|
||||
from->impl->previous_fiber->impl->guard.unlock();
|
||||
from->impl->previous_fiber.reset();
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<Fiber> Fiber::ThreadToFiber() {
|
||||
return std::shared_ptr<Fiber>{new Fiber()};
|
||||
std::shared_ptr<Fiber> fiber = std::shared_ptr<Fiber>{new Fiber()};
|
||||
fiber->impl->guard.lock();
|
||||
fiber->impl->is_thread_fiber = true;
|
||||
return fiber;
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include "common/minicoro.h"
|
||||
namespace boost::context::detail {
|
||||
struct transfer_t;
|
||||
}
|
||||
|
||||
namespace Common {
|
||||
|
||||
@@ -36,18 +38,25 @@ public:
|
||||
Fiber(Fiber&&) = default;
|
||||
Fiber& operator=(Fiber&&) = default;
|
||||
|
||||
/// Yields control from Fiber 'from' to Fiber 'to'
|
||||
/// Fiber 'from' must be the currently running fiber.
|
||||
static void YieldTo(std::weak_ptr<Fiber> weak_from, Fiber& to);
|
||||
[[nodiscard]] static std::shared_ptr<Fiber> ThreadToFiber();
|
||||
|
||||
void SetRewindPoint(std::function<void()>&& rewind_func);
|
||||
|
||||
void Rewind();
|
||||
|
||||
/// Only call from main thread's fiber
|
||||
void Exit();
|
||||
|
||||
private:
|
||||
Fiber();
|
||||
|
||||
void DestroyPre();
|
||||
void DestroyWorkFiber();
|
||||
void DestroyThreadFiber();
|
||||
void OnRewind(boost::context::detail::transfer_t& transfer);
|
||||
void Start(boost::context::detail::transfer_t& transfer);
|
||||
static void FiberStartFunc(boost::context::detail::transfer_t transfer);
|
||||
static void RewindStartFunc(boost::context::detail::transfer_t transfer);
|
||||
|
||||
struct FiberImpl;
|
||||
std::unique_ptr<FiberImpl> impl;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -210,7 +210,8 @@ struct Values {
|
||||
true,
|
||||
true,
|
||||
&use_speed_limit};
|
||||
SwitchableSetting<bool> sync_core_speed{linkage, false, "sync_core_speed", Category::Core, Specialization::Default};
|
||||
SwitchableSetting<bool> sync_core_speed{linkage, false, "sync_core_speed", Category::Core,
|
||||
Specialization::Default};
|
||||
|
||||
// Cpu
|
||||
SwitchableSetting<CpuBackend, true> cpu_backend{linkage,
|
||||
|
||||
@@ -1144,8 +1144,6 @@ add_library(core STATIC
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(core PRIVATE
|
||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
||||
@@ -1167,11 +1165,6 @@ if (MINGW)
|
||||
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
||||
endif()
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(core PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(core PRIVATE web_service)
|
||||
endif()
|
||||
|
||||
if (HAS_NCE)
|
||||
enable_language(C ASM)
|
||||
set(CMAKE_ASM_FLAGS "${CFLAGS} -x assembler-with-cpp")
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
#include "common/x64/cpu_wait.h"
|
||||
#endif
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "common/microprofile.h"
|
||||
#include "common/settings.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hardware_properties.h"
|
||||
|
||||
@@ -194,8 +194,9 @@ u64 CoreTiming::GetClockTicks() const {
|
||||
|
||||
if (Settings::values.sync_core_speed.GetValue()) {
|
||||
const double ticks = static_cast<double>(fres);
|
||||
const double speed_limit = static_cast<double>(Settings::values.speed_limit.GetValue())*0.01;
|
||||
return static_cast<u64>(ticks/speed_limit);
|
||||
const double speed_limit =
|
||||
static_cast<double>(Settings::values.speed_limit.GetValue()) * 0.01;
|
||||
return static_cast<u64>(ticks / speed_limit);
|
||||
} else {
|
||||
return fres;
|
||||
}
|
||||
|
||||
@@ -172,6 +172,7 @@ Result KPageTableBase::InitializeForKernel(bool is_64_bit, KVirtualAddress start
|
||||
m_mapped_unsafe_physical_memory = 0;
|
||||
m_mapped_insecure_memory = 0;
|
||||
m_mapped_ipc_server_memory = 0;
|
||||
m_alias_region_extra_size = 0;
|
||||
|
||||
m_memory_block_slab_manager =
|
||||
m_kernel.GetSystemSystemResource().GetMemoryBlockSlabManagerPointer();
|
||||
@@ -269,6 +270,12 @@ Result KPageTableBase::InitializeForProcess(Svc::CreateProcessFlag as_type, bool
|
||||
process_code_end = m_code_region_end;
|
||||
}
|
||||
|
||||
m_alias_region_extra_size = 0;
|
||||
if (as_type == Svc::CreateProcessFlag::EnableReservedRegionExtraSize) {
|
||||
m_alias_region_extra_size = GetAddressSpaceSize() / 8;
|
||||
alias_region_size += m_alias_region_extra_size;
|
||||
}
|
||||
|
||||
// Set other basic fields.
|
||||
m_enable_aslr = enable_aslr;
|
||||
m_enable_device_address_space_merge = enable_das_merge;
|
||||
|
||||
@@ -208,6 +208,7 @@ private:
|
||||
size_t m_mapped_unsafe_physical_memory{};
|
||||
size_t m_mapped_insecure_memory{};
|
||||
size_t m_mapped_ipc_server_memory{};
|
||||
size_t m_alias_region_extra_size{};
|
||||
mutable KLightLock m_general_lock;
|
||||
mutable KLightLock m_map_physical_memory_lock;
|
||||
KLightLock m_device_map_lock;
|
||||
@@ -682,6 +683,9 @@ public:
|
||||
size_t GetAliasRegionSize() const {
|
||||
return m_alias_region_end - m_alias_region_start;
|
||||
}
|
||||
size_t GetReservedRegionExtraSize() const {
|
||||
return m_alias_region_extra_size;
|
||||
}
|
||||
size_t GetStackRegionSize() const {
|
||||
return m_stack_region_end - m_stack_region_start;
|
||||
}
|
||||
|
||||
@@ -410,6 +410,9 @@ public:
|
||||
size_t GetAliasRegionSize() const {
|
||||
return m_page_table.GetAliasRegionSize();
|
||||
}
|
||||
size_t GetReservedRegionExtraSize() const {
|
||||
return m_page_table.GetReservedRegionExtraSize();
|
||||
}
|
||||
size_t GetStackRegionSize() const {
|
||||
return m_page_table.GetStackRegionSize();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
|
||||
case InfoType::TotalNonSystemMemorySize:
|
||||
case InfoType::UsedNonSystemMemorySize:
|
||||
case InfoType::IsApplication:
|
||||
case InfoType::FreeThreadCount: {
|
||||
case InfoType::FreeThreadCount:
|
||||
case InfoType::ReservedRegionExtraSize: {
|
||||
R_UNLESS(info_sub_id == 0, ResultInvalidEnumValue);
|
||||
|
||||
const auto& handle_table = GetCurrentProcess(system.Kernel()).GetHandleTable();
|
||||
@@ -134,6 +135,10 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
|
||||
}
|
||||
R_SUCCEED();
|
||||
|
||||
case InfoType::ReservedRegionExtraSize:
|
||||
*result = process->GetPageTable().GetReservedRegionExtraSize();
|
||||
R_SUCCEED();
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -153,6 +153,7 @@ enum class InfoType : u32 {
|
||||
ThreadTickCount = 25,
|
||||
IsSvcPermitted = 26,
|
||||
IoRegionHint = 27,
|
||||
ReservedRegionExtraSize = 28,
|
||||
|
||||
MesosphereMeta = 65000,
|
||||
MesosphereCurrentProcess = 65001,
|
||||
@@ -642,9 +643,12 @@ enum class CreateProcessFlag : u32 {
|
||||
// 11.x+ DisableDeviceAddressSpaceMerge.
|
||||
DisableDeviceAddressSpaceMerge = (1 << 12),
|
||||
|
||||
EnableReservedRegionExtraSize = (1 << 13),
|
||||
|
||||
// Mask of all flags.
|
||||
All = Is64Bit | AddressSpaceMask | EnableDebug | EnableAslr | IsApplication |
|
||||
PoolPartitionMask | OptimizeMemoryAllocation | DisableDeviceAddressSpaceMerge,
|
||||
PoolPartitionMask | OptimizeMemoryAllocation | DisableDeviceAddressSpaceMerge |
|
||||
EnableReservedRegionExtraSize,
|
||||
};
|
||||
DECLARE_ENUM_FLAG_OPERATORS(CreateProcessFlag);
|
||||
|
||||
|
||||
@@ -324,8 +324,8 @@ public:
|
||||
{10, &IProfileCommon::GetImageSize, "GetImageSize"},
|
||||
{11, &IProfileCommon::LoadImage, "LoadImage"},
|
||||
{20, &IProfileCommon::GetImageSize, "GetLargeImageSize"}, // 18.0.0+
|
||||
{21, &IProfileCommon::LoadImage, "LoadLargeImage"}, // 18.0.0+
|
||||
{30, nullptr, "GetImageId"} // 18.0.0+
|
||||
{21, &IProfileCommon::LoadImage, "LoadLargeImage"}, // 18.0.0+
|
||||
{30, &IProfileCommon::Unknown, "GetImageId"} // 18.0.0+
|
||||
};
|
||||
|
||||
RegisterHandlers(functions);
|
||||
@@ -496,6 +496,13 @@ protected:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Unknown(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(0);
|
||||
}
|
||||
|
||||
ProfileManager& profile_manager;
|
||||
Common::UUID user_id{}; ///< The user id this profile refers to.
|
||||
};
|
||||
@@ -511,7 +518,15 @@ class IProfileEditor final : public IProfileCommon {
|
||||
public:
|
||||
explicit IProfileEditor(Core::System& system_, Common::UUID user_id_,
|
||||
ProfileManager& profile_manager_)
|
||||
: IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {}
|
||||
: IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{30, &IProfileEditor::Unknown, "Unknown"},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
};
|
||||
|
||||
class ISessionObject final : public ServiceFramework<ISessionObject> {
|
||||
|
||||
@@ -8,10 +8,6 @@ add_executable(yuzu-room
|
||||
)
|
||||
|
||||
target_link_libraries(yuzu-room PRIVATE common network)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(yuzu-room PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(yuzu-room PRIVATE web_service)
|
||||
endif()
|
||||
|
||||
target_link_libraries(yuzu-room PRIVATE mbedtls mbedcrypto)
|
||||
if (MSVC)
|
||||
|
||||
@@ -33,10 +33,6 @@
|
||||
#include "network/room.h"
|
||||
#include "network/verify_user.h"
|
||||
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/verify_user_jwt.h"
|
||||
#endif
|
||||
|
||||
#undef _UNICODE
|
||||
#include <getopt.h>
|
||||
#ifndef _MSC_VER
|
||||
@@ -351,14 +347,9 @@ int main(int argc, char** argv) {
|
||||
|
||||
std::unique_ptr<Network::VerifyUser::Backend> verify_backend;
|
||||
if (announce) {
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
verify_backend =
|
||||
std::make_unique<WebService::VerifyUserJWT>(Settings::values.web_api_url.GetValue());
|
||||
#else
|
||||
LOG_INFO(Network,
|
||||
"yuzu Web Services is not available with this build: validation is disabled.");
|
||||
verify_backend = std::make_unique<Network::VerifyUser::NullBackend>();
|
||||
#endif
|
||||
} else {
|
||||
verify_backend = std::make_unique<Network::VerifyUser::NullBackend>();
|
||||
}
|
||||
|
||||
@@ -141,8 +141,6 @@ add_library(hid_core STATIC
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(hid_core PRIVATE
|
||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
||||
|
||||
@@ -37,7 +37,6 @@ add_library(input_common STATIC
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(input_common PRIVATE
|
||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
||||
)
|
||||
|
||||
@@ -20,10 +20,6 @@ add_library(network STATIC
|
||||
create_target_directory_groups(network)
|
||||
|
||||
target_link_libraries(network PRIVATE common enet::enet Boost::headers)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(network PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(network PRIVATE web_service)
|
||||
endif()
|
||||
|
||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||
target_precompile_headers(network PRIVATE precompiled_headers.h)
|
||||
|
||||
@@ -7,13 +7,8 @@
|
||||
#include "announce_multiplayer_session.h"
|
||||
#include "common/announce_multiplayer_room.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/settings.h"
|
||||
#include "network/network.h"
|
||||
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/announce_room_json.h"
|
||||
#endif
|
||||
|
||||
namespace Core {
|
||||
|
||||
// Time between room is announced to web_service
|
||||
@@ -21,13 +16,7 @@ static constexpr std::chrono::seconds announce_time_interval(15);
|
||||
|
||||
AnnounceMultiplayerSession::AnnounceMultiplayerSession(Network::RoomNetwork& room_network_)
|
||||
: room_network{room_network_} {
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
backend = std::make_unique<WebService::RoomJson>(Settings::values.web_api_url.GetValue(),
|
||||
Settings::values.yuzu_username.GetValue(),
|
||||
Settings::values.yuzu_token.GetValue());
|
||||
#else
|
||||
backend = std::make_unique<AnnounceMultiplayerRoom::NullBackend>();
|
||||
#endif
|
||||
}
|
||||
|
||||
WebService::WebResult AnnounceMultiplayerSession::Register() {
|
||||
@@ -153,12 +142,6 @@ bool AnnounceMultiplayerSession::IsRunning() const {
|
||||
|
||||
void AnnounceMultiplayerSession::UpdateCredentials() {
|
||||
ASSERT_MSG(!IsRunning(), "Credentials can only be updated when session is not running");
|
||||
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
backend = std::make_unique<WebService::RoomJson>(Settings::values.web_api_url.GetValue(),
|
||||
Settings::values.yuzu_username.GetValue(),
|
||||
Settings::values.yuzu_token.GetValue());
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
||||
@@ -252,7 +252,6 @@ target_link_libraries(shader_recompiler PUBLIC common fmt::fmt sirit ${SPIRV_TOO
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(shader_recompiler PRIVATE
|
||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
||||
)
|
||||
|
||||
@@ -271,4 +271,43 @@ TEST_CASE("Fibers::StartRace", "[common]") {
|
||||
REQUIRE(test_control.value3 == 1);
|
||||
}
|
||||
|
||||
class TestControl4;
|
||||
|
||||
class TestControl4 {
|
||||
public:
|
||||
TestControl4() {
|
||||
fiber1 = std::make_shared<Fiber>([this] { DoWork(); });
|
||||
goal_reached = false;
|
||||
rewinded = false;
|
||||
}
|
||||
|
||||
void Execute() {
|
||||
thread_fiber = Fiber::ThreadToFiber();
|
||||
Fiber::YieldTo(thread_fiber, *fiber1);
|
||||
thread_fiber->Exit();
|
||||
}
|
||||
|
||||
void DoWork() {
|
||||
fiber1->SetRewindPoint([this] { DoWork(); });
|
||||
if (rewinded) {
|
||||
goal_reached = true;
|
||||
Fiber::YieldTo(fiber1, *thread_fiber);
|
||||
}
|
||||
rewinded = true;
|
||||
fiber1->Rewind();
|
||||
}
|
||||
|
||||
std::shared_ptr<Common::Fiber> fiber1;
|
||||
std::shared_ptr<Common::Fiber> thread_fiber;
|
||||
bool goal_reached;
|
||||
bool rewinded;
|
||||
};
|
||||
|
||||
TEST_CASE("Fibers::Rewind", "[common]") {
|
||||
TestControl4 test_control{};
|
||||
test_control.Execute();
|
||||
REQUIRE(test_control.goal_reached);
|
||||
REQUIRE(test_control.rewinded);
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
||||
@@ -341,12 +341,7 @@ if (ENABLE_NSIGHT_AFTERMATH)
|
||||
target_include_directories(video_core PRIVATE "$ENV{NSIGHT_AFTERMATH_SDK}/include")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(video_core PRIVATE
|
||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
|
||||
)
|
||||
else()
|
||||
if (NOT MSVC)
|
||||
if (APPLE)
|
||||
# error: declaration shadows a typedef in 'interval_base_set<SubType, DomainT, Compare, Interval, Alloc>'
|
||||
# error: implicit conversion loses integer precision: 'int' to 'boost::icl::bound_type' (aka 'unsigned char')
|
||||
|
||||
@@ -382,7 +382,7 @@ elseif(WIN32)
|
||||
endif()
|
||||
|
||||
target_link_libraries(yuzu PRIVATE common core input_common frontend_common network video_core)
|
||||
target_link_libraries(yuzu PRIVATE Boost::headers glad Qt${QT_MAJOR_VERSION}::Widgets)
|
||||
target_link_libraries(yuzu PRIVATE Boost::headers glad Qt${QT_MAJOR_VERSION}::Widgets httplib::httplib)
|
||||
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
||||
|
||||
target_link_libraries(yuzu PRIVATE Vulkan::Headers)
|
||||
@@ -425,10 +425,6 @@ if (USE_DISCORD_PRESENCE)
|
||||
target_compile_definitions(yuzu PRIVATE -DUSE_DISCORD_PRESENCE)
|
||||
endif()
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE)
|
||||
endif()
|
||||
|
||||
if (YUZU_USE_QT_MULTIMEDIA)
|
||||
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::Multimedia)
|
||||
target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_MULTIMEDIA)
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
#include "input_common/drivers/virtual_amiibo.h"
|
||||
#include "input_common/main.h"
|
||||
#include "ui_qt_amiibo_settings.h"
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/web_backend.h"
|
||||
#endif
|
||||
#include "yuzu/applets/qt_amiibo_settings.h"
|
||||
#include "yuzu/main.h"
|
||||
|
||||
@@ -91,55 +88,6 @@ void QtAmiiboSettingsDialog::LoadAmiiboInfo() {
|
||||
ui->amiiboInfoGroup->setVisible(false);
|
||||
}
|
||||
|
||||
void QtAmiiboSettingsDialog::LoadAmiiboApiInfo(std::string_view amiibo_id) {
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
// TODO: Host this data on our website
|
||||
WebService::Client client{"https://amiiboapi.com", {}, {}};
|
||||
WebService::Client image_client{"https://raw.githubusercontent.com", {}, {}};
|
||||
const auto url_path = fmt::format("/api/amiibo/?id={}", amiibo_id);
|
||||
|
||||
const auto amiibo_json = client.GetJson(url_path, true).returned_data;
|
||||
if (amiibo_json.empty()) {
|
||||
ui->amiiboImageLabel->setVisible(false);
|
||||
ui->amiiboInfoGroup->setVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string amiibo_series{};
|
||||
std::string amiibo_name{};
|
||||
std::string amiibo_image_url{};
|
||||
std::string amiibo_type{};
|
||||
|
||||
const auto parsed_amiibo_json_json = nlohmann::json::parse(amiibo_json).at("amiibo");
|
||||
parsed_amiibo_json_json.at("amiiboSeries").get_to(amiibo_series);
|
||||
parsed_amiibo_json_json.at("name").get_to(amiibo_name);
|
||||
parsed_amiibo_json_json.at("image").get_to(amiibo_image_url);
|
||||
parsed_amiibo_json_json.at("type").get_to(amiibo_type);
|
||||
|
||||
ui->amiiboSeriesValue->setText(QString::fromStdString(amiibo_series));
|
||||
ui->amiiboNameValue->setText(QString::fromStdString(amiibo_name));
|
||||
ui->amiiboTypeValue->setText(QString::fromStdString(amiibo_type));
|
||||
|
||||
if (amiibo_image_url.size() < 34) {
|
||||
ui->amiiboImageLabel->setVisible(false);
|
||||
}
|
||||
|
||||
const auto image_url_path = amiibo_image_url.substr(34, amiibo_image_url.size() - 34);
|
||||
const auto image_data = image_client.GetImage(image_url_path, true).returned_data;
|
||||
|
||||
if (image_data.empty()) {
|
||||
ui->amiiboImageLabel->setVisible(false);
|
||||
}
|
||||
|
||||
QPixmap pixmap;
|
||||
pixmap.loadFromData(reinterpret_cast<const u8*>(image_data.data()),
|
||||
static_cast<uint>(image_data.size()));
|
||||
pixmap = pixmap.scaled(250, 350, Qt::AspectRatioMode::KeepAspectRatio,
|
||||
Qt::TransformationMode::SmoothTransformation);
|
||||
ui->amiiboImageLabel->setPixmap(pixmap);
|
||||
#endif
|
||||
}
|
||||
|
||||
void QtAmiiboSettingsDialog::LoadAmiiboData() {
|
||||
Service::NFP::RegisterInfo register_info{};
|
||||
Service::NFP::CommonInfo common_info{};
|
||||
|
||||
@@ -43,7 +43,6 @@ public:
|
||||
private:
|
||||
void LoadInfo();
|
||||
void LoadAmiiboInfo();
|
||||
void LoadAmiiboApiInfo(std::string_view amiibo_id);
|
||||
void LoadAmiiboData();
|
||||
void LoadAmiiboGameInfo();
|
||||
void SetGameDataName(u32 application_area_id);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -71,11 +71,14 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
|
||||
"faster or not.\n200% for a 30 FPS game is 60 FPS, and for a "
|
||||
"60 FPS game it will be 120 FPS.\nDisabling it means unlocking the framerate to the "
|
||||
"maximum your PC can reach."));
|
||||
INSERT(Settings, sync_core_speed, tr("Synchronize core speed"),
|
||||
tr("Synchronizes CPU core speed to game's maximum rendering speed, which can be useful to "
|
||||
"increase FPS without increasing the actual speed of the game (animations, physics, etc.)\n"
|
||||
"It's up to each game if it plays well with this or not. Most games (specially original ones) "
|
||||
"simply ignore this.\nThis can help play the game stutter-free at a lower framerate."));
|
||||
INSERT(
|
||||
Settings, sync_core_speed, tr("Synchronize core speed"),
|
||||
tr("Synchronizes CPU core speed to game's maximum rendering speed, which can be useful to "
|
||||
"increase FPS without increasing the actual speed of the game (animations, physics, "
|
||||
"etc.)\n"
|
||||
"It's up to each game if it plays well with this or not. Most games (specially original "
|
||||
"ones) "
|
||||
"simply ignore this.\nThis can help play the game stutter-free at a lower framerate."));
|
||||
|
||||
// Cpu
|
||||
INSERT(Settings, cpu_accuracy, tr("Accuracy:"),
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/container/flat_set.hpp>
|
||||
#include <httplib.h>
|
||||
|
||||
// VFS includes must be before glad as they will conflict with Windows file api, which uses defines.
|
||||
#include "applets/qt_amiibo_settings.h"
|
||||
@@ -1520,10 +1521,7 @@ void GMainWindow::ConnectMenuEvents() {
|
||||
// Emulation
|
||||
connect_menu(ui->action_Pause, &GMainWindow::OnPauseContinueGame);
|
||||
connect_menu(ui->action_Stop, &GMainWindow::OnStopGame);
|
||||
connect_menu(ui->action_Report_Compatibility, &GMainWindow::OnMenuReportCompatibility);
|
||||
connect_menu(ui->action_Open_Mods_Page, &GMainWindow::OnOpenModsPage);
|
||||
connect_menu(ui->action_Open_Quickstart_Guide, &GMainWindow::OnOpenQuickstartGuide);
|
||||
connect_menu(ui->action_Open_FAQ, &GMainWindow::OnOpenFAQ);
|
||||
connect_menu(ui->action_Open_Mirror_Repo, &GMainWindow::OnOpenMirrorRepo);
|
||||
connect_menu(ui->action_Restart, &GMainWindow::OnRestartGame);
|
||||
connect_menu(ui->action_Configure, &GMainWindow::OnConfigure);
|
||||
connect_menu(ui->action_Configure_Current_Game, &GMainWindow::OnConfigurePerGame);
|
||||
@@ -3513,39 +3511,6 @@ void GMainWindow::ErrorDisplayRequestExit() {
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::OnMenuReportCompatibility() {
|
||||
#if defined(ARCHITECTURE_x86_64) && !defined(__APPLE__)
|
||||
const auto& caps = Common::GetCPUCaps();
|
||||
const bool has_fma = caps.fma || caps.fma4;
|
||||
const auto processor_count = std::thread::hardware_concurrency();
|
||||
const bool has_4threads = processor_count == 0 || processor_count >= 4;
|
||||
const bool has_8gb_ram = Common::GetMemInfo().TotalPhysicalMemory >= 8_GiB;
|
||||
const bool has_broken_vulkan = UISettings::values.has_broken_vulkan;
|
||||
|
||||
if (!has_fma || !has_4threads || !has_8gb_ram || has_broken_vulkan) {
|
||||
QMessageBox::critical(this, tr("Hardware requirements not met"),
|
||||
tr("Your system does not meet the recommended hardware requirements. "
|
||||
"Compatibility reporting has been disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Settings::values.yuzu_token.GetValue().empty() &&
|
||||
!Settings::values.yuzu_username.GetValue().empty()) {
|
||||
} else {
|
||||
QMessageBox::critical(
|
||||
this, tr("Missing yuzu Account"),
|
||||
tr("In order to submit a game compatibility test case, you must link your yuzu "
|
||||
"account.<br><br/>To link your yuzu account, go to Emulation > Configuration "
|
||||
"> "
|
||||
"Web."));
|
||||
}
|
||||
#else
|
||||
QMessageBox::critical(this, tr("Hardware requirements not met"),
|
||||
tr("Your system does not meet the recommended hardware requirements. "
|
||||
"Compatibility reporting has been disabled."));
|
||||
#endif
|
||||
}
|
||||
|
||||
void GMainWindow::OpenURL(const QUrl& url) {
|
||||
const bool open = QDesktopServices::openUrl(url);
|
||||
if (!open) {
|
||||
@@ -3554,16 +3519,25 @@ void GMainWindow::OpenURL(const QUrl& url) {
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::OnOpenModsPage() {
|
||||
OpenURL(QUrl(QStringLiteral("https://github.com/yuzu-emu/yuzu/wiki/Switch-Mods")));
|
||||
}
|
||||
void GMainWindow::OnOpenMirrorRepo() {
|
||||
httplib::Client cli("https://codeberg.org");
|
||||
auto res = cli.Get("/litucks/tz-mu/raw/branch/main/mu.txt");
|
||||
if (!res) {
|
||||
QMessageBox::warning(
|
||||
this, tr("Error locating mirror"),
|
||||
tr("There has been an error finding the current mirror repository.<br/>"
|
||||
"Your version may be too old or your network connectivity may be"
|
||||
"limited.<br/>"
|
||||
"Please either try again later, through a VPN or access the main<br/>"
|
||||
"repository via the Tor Browser:<br/>"
|
||||
"<a "
|
||||
"href='http://y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/"
|
||||
"torzu-emu/torzu'>http://"
|
||||
"y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion/torzu-emu/torzu</"
|
||||
"a>"));
|
||||
}
|
||||
|
||||
void GMainWindow::OnOpenQuickstartGuide() {
|
||||
OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/help/quickstart/")));
|
||||
}
|
||||
|
||||
void GMainWindow::OnOpenFAQ() {
|
||||
OpenURL(QUrl(QStringLiteral("https://yuzu-emu.org/wiki/faq/")));
|
||||
OpenURL(QUrl(QString::fromStdString(res->body)));
|
||||
}
|
||||
|
||||
void GMainWindow::ToggleFullscreen() {
|
||||
|
||||
@@ -333,10 +333,7 @@ private slots:
|
||||
void OnPauseContinueGame();
|
||||
void OnStopGame();
|
||||
void OnPrepareForSleep(bool prepare_sleep);
|
||||
void OnMenuReportCompatibility();
|
||||
void OnOpenModsPage();
|
||||
void OnOpenQuickstartGuide();
|
||||
void OnOpenFAQ();
|
||||
void OnOpenMirrorRepo();
|
||||
/// Called whenever a user selects a game in the game list widget.
|
||||
void OnGameListLoadFile(QString game_path, u64 program_id);
|
||||
void OnGameListOpenFolder(u64 program_id, GameListOpenTarget target,
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1280</width>
|
||||
<height>21</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_File">
|
||||
@@ -183,9 +183,7 @@
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
<addaction name="action_Report_Compatibility"/>
|
||||
<addaction name="action_Open_Mods_Page"/>
|
||||
<addaction name="action_Open_Quickstart_Guide"/>
|
||||
<addaction name="action_Open_FAQ"/>
|
||||
<addaction name="action_Open_Mirror_Repo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_About"/>
|
||||
</widget>
|
||||
@@ -481,6 +479,11 @@
|
||||
<string>Open Home Menu</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Open_Mirror_Repo">
|
||||
<property name="text">
|
||||
<string>Open current Mirror &Repo</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="yuzu.qrc"/>
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
#include "yuzu/game_list_p.h"
|
||||
#include "yuzu/multiplayer/chat_room.h"
|
||||
#include "yuzu/multiplayer/message.h"
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/web_backend.h"
|
||||
#endif
|
||||
|
||||
class ChatMessage {
|
||||
public:
|
||||
@@ -387,38 +384,6 @@ void ChatRoom::SetPlayerList(const Network::RoomMember::MemberList& member_list)
|
||||
QStandardItem* name_item = new PlayerListItem(member.nickname, member.username,
|
||||
member.avatar_url, member.game_info);
|
||||
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
if (!icon_cache.count(member.avatar_url) && !member.avatar_url.empty()) {
|
||||
// Start a request to get the member's avatar
|
||||
const QUrl url(QString::fromStdString(member.avatar_url));
|
||||
QFuture<std::string> future = QtConcurrent::run([url] {
|
||||
WebService::Client client(
|
||||
QStringLiteral("%1://%2").arg(url.scheme(), url.host()).toStdString(), "", "");
|
||||
auto result = client.GetImage(url.path().toStdString(), true);
|
||||
if (result.returned_data.empty()) {
|
||||
LOG_ERROR(WebService, "Failed to get avatar");
|
||||
}
|
||||
return result.returned_data;
|
||||
});
|
||||
auto* future_watcher = new QFutureWatcher<std::string>(this);
|
||||
connect(future_watcher, &QFutureWatcher<std::string>::finished, this,
|
||||
[this, future_watcher, avatar_url = member.avatar_url] {
|
||||
const std::string result = future_watcher->result();
|
||||
if (result.empty())
|
||||
return;
|
||||
QPixmap pixmap;
|
||||
if (!pixmap.loadFromData(reinterpret_cast<const u8*>(result.data()),
|
||||
static_cast<uint>(result.size())))
|
||||
return;
|
||||
icon_cache[avatar_url] =
|
||||
pixmap.scaled(48, 48, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
// Update all the displayed icons with the new icon_cache
|
||||
UpdateIconDisplay();
|
||||
});
|
||||
future_watcher->setFuture(future);
|
||||
}
|
||||
#endif
|
||||
|
||||
player_list->invisibleRootItem()->appendRow(name_item);
|
||||
}
|
||||
UpdateIconDisplay();
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
#include "yuzu/multiplayer/state.h"
|
||||
#include "yuzu/multiplayer/validation.h"
|
||||
#include "yuzu/uisettings.h"
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/verify_user_jwt.h"
|
||||
#endif
|
||||
|
||||
HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
|
||||
std::shared_ptr<Core::AnnounceMultiplayerSession> session,
|
||||
@@ -98,12 +95,7 @@ std::unique_ptr<Network::VerifyUser::Backend> HostRoomWindow::CreateVerifyBacken
|
||||
bool use_validation) const {
|
||||
std::unique_ptr<Network::VerifyUser::Backend> verify_backend;
|
||||
if (use_validation) {
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
verify_backend =
|
||||
std::make_unique<WebService::VerifyUserJWT>(Settings::values.web_api_url.GetValue());
|
||||
#else
|
||||
verify_backend = std::make_unique<Network::VerifyUser::NullBackend>();
|
||||
#endif
|
||||
} else {
|
||||
verify_backend = std::make_unique<Network::VerifyUser::NullBackend>();
|
||||
}
|
||||
@@ -201,21 +193,6 @@ void HostRoomWindow::Host() {
|
||||
}
|
||||
}
|
||||
std::string token;
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
if (is_public) {
|
||||
WebService::Client client(Settings::values.web_api_url.GetValue(),
|
||||
Settings::values.yuzu_username.GetValue(),
|
||||
Settings::values.yuzu_token.GetValue());
|
||||
if (auto room = room_network.GetRoom().lock()) {
|
||||
token = client.GetExternalJWT(room->GetVerifyUID()).returned_data;
|
||||
}
|
||||
if (token.empty()) {
|
||||
LOG_ERROR(WebService, "Could not get external JWT, verification may fail");
|
||||
} else {
|
||||
LOG_INFO(WebService, "Successfully requested external JWT: size={}", token.size());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// TODO: Check what to do with this
|
||||
member->Join(ui->username->text().toStdString(), "127.0.0.1", port, 0,
|
||||
Network::NoPreferredIP, password, token);
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#include "yuzu/multiplayer/state.h"
|
||||
#include "yuzu/multiplayer/validation.h"
|
||||
#include "yuzu/uisettings.h"
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
#include "web_service/web_backend.h"
|
||||
#endif
|
||||
|
||||
Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
|
||||
std::shared_ptr<Core::AnnounceMultiplayerSession> session, Core::System& system_)
|
||||
@@ -186,20 +183,6 @@ void Lobby::OnJoinRoom(const QModelIndex& source) {
|
||||
// attempt to connect in a different thread
|
||||
QFuture<void> f = QtConcurrent::run([nickname, ip, port, password, verify_uid, this] {
|
||||
std::string token;
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
if (!Settings::values.yuzu_username.GetValue().empty() &&
|
||||
!Settings::values.yuzu_token.GetValue().empty()) {
|
||||
WebService::Client client(Settings::values.web_api_url.GetValue(),
|
||||
Settings::values.yuzu_username.GetValue(),
|
||||
Settings::values.yuzu_token.GetValue());
|
||||
token = client.GetExternalJWT(verify_uid).returned_data;
|
||||
if (token.empty()) {
|
||||
LOG_ERROR(WebService, "Could not get external JWT, verification may fail");
|
||||
} else {
|
||||
LOG_INFO(WebService, "Successfully requested external JWT: size={}", token.size());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (auto room_member = room_network.GetRoomMember().lock()) {
|
||||
room_member->Join(nickname, ip.c_str(), port, 0, Network::NoPreferredIP, password,
|
||||
token);
|
||||
|
||||
Reference in New Issue
Block a user