diff options
70 files changed, 275 insertions, 636 deletions
diff --git a/.ci/templates/merge-private.yml b/.ci/templates/merge-private.yml index f15a74355..c74561c46 100644 --- a/.ci/templates/merge-private.yml +++ b/.ci/templates/merge-private.yml | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | jobs: | 1 | jobs: |
| 2 | - job: merge | 2 | - job: merge |
| 3 | displayName: 'pull requests' | 3 | displayName: 'pull requests' |
| 4 | pool: | ||
| 5 | vmImage: 'ubuntu-latest' | ||
| 4 | steps: | 6 | steps: |
| 5 | - checkout: self | 7 | - checkout: self |
| 6 | submodules: recursive | 8 | submodules: recursive |
| @@ -24,6 +26,8 @@ jobs: | |||
| 24 | - job: upload_source | 26 | - job: upload_source |
| 25 | displayName: 'upload' | 27 | displayName: 'upload' |
| 26 | dependsOn: merge | 28 | dependsOn: merge |
| 29 | pool: | ||
| 30 | vmImage: 'ubuntu-latest' | ||
| 27 | steps: | 31 | steps: |
| 28 | - template: ./sync-source.yml | 32 | - template: ./sync-source.yml |
| 29 | parameters: | 33 | parameters: |
diff --git a/.ci/templates/merge.yml b/.ci/templates/merge.yml index 460dfa1c1..27c36e162 100644 --- a/.ci/templates/merge.yml +++ b/.ci/templates/merge.yml | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | jobs: | 1 | jobs: |
| 2 | - job: merge | 2 | - job: merge |
| 3 | displayName: 'pull requests' | 3 | displayName: 'pull requests' |
| 4 | pool: | ||
| 5 | vmImage: 'ubuntu-latest' | ||
| 4 | steps: | 6 | steps: |
| 5 | - checkout: self | 7 | - checkout: self |
| 6 | submodules: recursive | 8 | submodules: recursive |
| @@ -23,6 +25,8 @@ jobs: | |||
| 23 | - job: upload_source | 25 | - job: upload_source |
| 24 | displayName: 'upload' | 26 | displayName: 'upload' |
| 25 | dependsOn: merge | 27 | dependsOn: merge |
| 28 | pool: | ||
| 29 | vmImage: 'ubuntu-latest' | ||
| 26 | steps: | 30 | steps: |
| 27 | - template: ./sync-source.yml | 31 | - template: ./sync-source.yml |
| 28 | parameters: | 32 | parameters: |
diff --git a/.ci/yuzu-mainline-step2.yml b/.ci/yuzu-mainline-step2.yml index 3159ce3ed..91e21a126 100644 --- a/.ci/yuzu-mainline-step2.yml +++ b/.ci/yuzu-mainline-step2.yml | |||
| @@ -66,5 +66,7 @@ stages: | |||
| 66 | jobs: | 66 | jobs: |
| 67 | - job: github | 67 | - job: github |
| 68 | displayName: 'github' | 68 | displayName: 'github' |
| 69 | pool: | ||
| 70 | vmImage: ubuntu-latest | ||
| 69 | steps: | 71 | steps: |
| 70 | - template: ./templates/release-github.yml | 72 | - template: ./templates/release-github.yml |
diff --git a/.ci/yuzu-patreon-step2.yml b/.ci/yuzu-patreon-step2.yml index 3f338e2a0..ad61ac74e 100644 --- a/.ci/yuzu-patreon-step2.yml +++ b/.ci/yuzu-patreon-step2.yml | |||
| @@ -29,5 +29,7 @@ stages: | |||
| 29 | jobs: | 29 | jobs: |
| 30 | - job: release | 30 | - job: release |
| 31 | displayName: 'source' | 31 | displayName: 'source' |
| 32 | pool: | ||
| 33 | vmImage: 'ubuntu-latest' | ||
| 32 | steps: | 34 | steps: |
| 33 | - template: ./templates/release-private-tag.yml | 35 | - template: ./templates/release-private-tag.yml |
diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 93fda1dfa..000000000 --- a/.travis.yml +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | language: cpp | ||
| 2 | matrix: | ||
| 3 | include: | ||
| 4 | - os: linux | ||
| 5 | env: NAME="clang-format" | ||
| 6 | sudo: required | ||
| 7 | dist: trusty | ||
| 8 | services: docker | ||
| 9 | install: "./.travis/clang-format/deps.sh" | ||
| 10 | script: "./.travis/clang-format/build.sh" | ||
| 11 | - os: linux | ||
| 12 | env: NAME="linux build" | ||
| 13 | sudo: required | ||
| 14 | dist: trusty | ||
| 15 | services: docker | ||
| 16 | addons: | ||
| 17 | apt: | ||
| 18 | packages: | ||
| 19 | - p7zip-full | ||
| 20 | install: "./.travis/linux/deps.sh" | ||
| 21 | script: "./.travis/linux/build.sh" | ||
| 22 | after_success: "./.travis/linux/upload.sh" | ||
| 23 | cache: ccache | ||
| 24 | - os: osx | ||
| 25 | env: NAME="macos build" | ||
| 26 | sudo: false | ||
| 27 | osx_image: xcode10.2 | ||
| 28 | install: "./.travis/macos/deps.sh" | ||
| 29 | script: "./.travis/macos/build.sh" | ||
| 30 | after_success: "./.travis/macos/upload.sh" | ||
| 31 | cache: ccache | ||
| 32 | - os: linux | ||
| 33 | env: NAME="MinGW build" | ||
| 34 | sudo: required | ||
| 35 | dist: trusty | ||
| 36 | services: docker | ||
| 37 | addons: | ||
| 38 | apt: | ||
| 39 | packages: | ||
| 40 | - p7zip-full | ||
| 41 | install: "./.travis/linux-mingw/deps.sh" | ||
| 42 | script: "./.travis/linux-mingw/build.sh" | ||
| 43 | after_success: "./.travis/linux-mingw/upload.sh" | ||
| 44 | cache: ccache | ||
| 45 | |||
| 46 | deploy: | ||
| 47 | provider: releases | ||
| 48 | api_key: | ||
| 49 | secure: ElsIAlbvVXBNKsP31nVPysh+mf0GQA4DiL/y5iJeQxKQYR6iRoNo+RfzOBmdswdo0bE/PGeBAlfzCkp15gjhWf6Je0N6dRpczmcmLq6SSQFn1Mpq00xMJB2AgQIlaHs6KFgoUA173EBKbPwgU/NubTFpJFm/Wa+NcSWAHQXKL9KT2M3qKpxNkPl3mKEVsbch4REP+T/46vsa+ikw0VE0kIs6V93LqUQZpI2F0Dhihx8Cxr5iedkE1QsNK+QSX9iItMHbfek9OH980gP7L3lkZltyAA1Pk0c37OAgz2PwczwNKwCT8jg9PMzdcKmWouvLyAkZFuA806ElzwHY3oEd91Zm6+Bk5n24yBKZ9027AZzw38NK2Z2m9Akb8+ar8PdsKU6N5pDutX9qSLayr0oMgJ0s7/xnGBGdL3gfkPCFc50xO/2DxlsOR+zAhPNM9Y76hhGy6A7/40+9uzrJvd4nAuDvIXRzi2Yl2L7mKBE4suMKbFLtk2LlgM0qY5JMVTQ8NliaEtqopfPur2KWFVJUpWDNLtNX8xGqhfwg7cLjIiGmnxSaJBTDuZI6dpEjkWkU0n1xYhGqEqit8DbehYzazozMJ+Vsr8hku7jGlUtlw+U6HG1e19O2y4aGeSwYPROcCNz+BLwmVM8oZE3Roy3qoaa2yiFf+sy6rUHznrhsfEM= | ||
| 50 | file_glob: true | ||
| 51 | file: "artifacts/*" | ||
| 52 | skip_cleanup: true | ||
| 53 | on: | ||
| 54 | tags: true | ||
| 55 | |||
| 56 | notifications: | ||
| 57 | webhooks: | ||
| 58 | urls: | ||
| 59 | - https://api.yuzu-emu.org/code/travis/notify | ||
diff --git a/.travis/clang-format/build.sh b/.travis/clang-format/build.sh deleted file mode 100755 index 36c276c43..000000000 --- a/.travis/clang-format/build.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | docker run --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.travis/clang-format/docker.sh | ||
diff --git a/.travis/clang-format/deps.sh b/.travis/clang-format/deps.sh deleted file mode 100755 index a15d164c7..000000000 --- a/.travis/clang-format/deps.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | docker pull citraemu/build-environments:linux-clang-format | ||
diff --git a/.travis/clang-format/docker.sh b/.travis/clang-format/docker.sh deleted file mode 100755 index b519ab40e..000000000 --- a/.travis/clang-format/docker.sh +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | # Run clang-format | ||
| 4 | cd /yuzu | ||
| 5 | ./.travis/clang-format/script.sh | ||
diff --git a/.travis/clang-format/script.sh b/.travis/clang-format/script.sh deleted file mode 100755 index 56a785fe0..000000000 --- a/.travis/clang-format/script.sh +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis* dist/*.desktop \ | ||
| 4 | dist/*.svg dist/*.xml; then | ||
| 5 | echo Trailing whitespace found, aborting | ||
| 6 | exit 1 | ||
| 7 | fi | ||
| 8 | |||
| 9 | # Default clang-format points to default 3.5 version one | ||
| 10 | CLANG_FORMAT=clang-format-10.0 | ||
| 11 | $CLANG_FORMAT --version | ||
| 12 | |||
| 13 | if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then | ||
| 14 | # Get list of every file modified in this pull request | ||
| 15 | files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)" | ||
| 16 | else | ||
| 17 | # Check everything for branch pushes | ||
| 18 | files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" | ||
| 19 | fi | ||
| 20 | |||
| 21 | # Turn off tracing for this because it's too verbose | ||
| 22 | set +x | ||
| 23 | |||
| 24 | for f in $files_to_lint; do | ||
| 25 | d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true) | ||
| 26 | if ! [ -z "$d" ]; then | ||
| 27 | echo "!!! $f not compliant to coding style, here is the fix:" | ||
| 28 | echo "$d" | ||
| 29 | fail=1 | ||
| 30 | fi | ||
| 31 | done | ||
| 32 | |||
| 33 | set -x | ||
| 34 | |||
| 35 | if [ "$fail" = 1 ]; then | ||
| 36 | exit 1 | ||
| 37 | fi | ||
diff --git a/.travis/common/post-upload.sh b/.travis/common/post-upload.sh deleted file mode 100755 index 28735a9cf..000000000 --- a/.travis/common/post-upload.sh +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | # Copy documentation | ||
| 4 | cp license.txt "$REV_NAME" | ||
| 5 | cp README.md "$REV_NAME" | ||
| 6 | |||
| 7 | tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME" | ||
| 8 | |||
| 9 | # Find out what release we are building | ||
| 10 | if [ -z $TRAVIS_TAG ]; then | ||
| 11 | RELEASE_NAME=head | ||
| 12 | else | ||
| 13 | RELEASE_NAME=$(echo $TRAVIS_TAG | cut -d- -f1) | ||
| 14 | if [ "$NAME" = "MinGW build" ]; then | ||
| 15 | RELEASE_NAME="${RELEASE_NAME}-mingw" | ||
| 16 | fi | ||
| 17 | fi | ||
| 18 | |||
| 19 | mv "$REV_NAME" $RELEASE_NAME | ||
| 20 | |||
| 21 | 7z a "$REV_NAME.7z" $RELEASE_NAME | ||
| 22 | |||
| 23 | # move the compiled archive into the artifacts directory to be uploaded by travis releases | ||
| 24 | mv "$ARCHIVE_NAME" artifacts/ | ||
| 25 | mv "$REV_NAME.7z" artifacts/ | ||
diff --git a/.travis/common/pre-upload.sh b/.travis/common/pre-upload.sh deleted file mode 100755 index 3c2fc79a2..000000000 --- a/.travis/common/pre-upload.sh +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" | ||
| 4 | GITREV="`git show -s --format='%h'`" | ||
| 5 | |||
| 6 | mkdir -p artifacts | ||
diff --git a/.travis/common/travis-ci.env b/.travis/common/travis-ci.env deleted file mode 100644 index cffeb2e2b..000000000 --- a/.travis/common/travis-ci.env +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | # List of environment variables to be shared with Docker containers | ||
| 2 | CI | ||
| 3 | TRAVIS | ||
| 4 | CONTINUOUS_INTEGRATION | ||
| 5 | TRAVIS_BRANCH | ||
| 6 | TRAVIS_BUILD_ID | ||
| 7 | TRAVIS_BUILD_NUMBER | ||
| 8 | TRAVIS_COMMIT | ||
| 9 | TRAVIS_COMMIT_RANGE | ||
| 10 | TRAVIS_EVENT_TYPE | ||
| 11 | TRAVIS_JOB_ID | ||
| 12 | TRAVIS_JOB_NUMBER | ||
| 13 | TRAVIS_REPO_SLUG | ||
| 14 | TRAVIS_TAG | ||
| 15 | |||
| 16 | # yuzu specific flags | ||
| 17 | ENABLE_COMPATIBILITY_REPORTING | ||
| 18 | USE_DISCORD_PRESENCE | ||
diff --git a/.travis/linux-mingw/build.sh b/.travis/linux-mingw/build.sh deleted file mode 100755 index b12d70b12..000000000 --- a/.travis/linux-mingw/build.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | mkdir "$HOME/.ccache" || true | ||
| 3 | docker run --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.travis/linux-mingw/docker.sh | ||
diff --git a/.travis/linux-mingw/deps.sh b/.travis/linux-mingw/deps.sh deleted file mode 100755 index 55b5d6006..000000000 --- a/.travis/linux-mingw/deps.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | docker pull yuzuemu/build-environments:linux-mingw | ||
diff --git a/.travis/linux-mingw/docker.sh b/.travis/linux-mingw/docker.sh deleted file mode 100755 index 80d7dfe9b..000000000 --- a/.travis/linux-mingw/docker.sh +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | cd /yuzu | ||
| 4 | # override Travis CI unreasonable ccache size | ||
| 5 | echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf" | ||
| 6 | |||
| 7 | mkdir build && cd build | ||
| 8 | cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release | ||
| 9 | ninja | ||
| 10 | |||
| 11 | # Clean up the dirty hacks | ||
| 12 | rm /bin/uname && mv /bin/uname1 /bin/uname | ||
| 13 | rm /bin/cmd | ||
| 14 | |||
| 15 | ccache -s | ||
| 16 | |||
| 17 | echo "Tests skipped" | ||
| 18 | #ctest -VV -C Release | ||
| 19 | |||
| 20 | echo 'Prepare binaries...' | ||
| 21 | cd .. | ||
| 22 | mkdir package | ||
| 23 | |||
| 24 | QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/' | ||
| 25 | find build/ -name "yuzu*.exe" -exec cp {} 'package' \; | ||
| 26 | |||
| 27 | # copy Qt plugins | ||
| 28 | mkdir package/platforms | ||
| 29 | cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/ | ||
| 30 | cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/ | ||
| 31 | cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/ | ||
| 32 | rm -f package/mediaservice/*d.dll | ||
| 33 | |||
| 34 | for i in package/*.exe; do | ||
| 35 | # we need to process pdb here, however, cv2pdb | ||
| 36 | # does not work here, so we just simply strip all the debug symbols | ||
| 37 | x86_64-w64-mingw32-strip "${i}" | ||
| 38 | done | ||
| 39 | |||
| 40 | pip3 install pefile | ||
| 41 | python3 .travis/linux-mingw/scan_dll.py package/*.exe "package/" | ||
| 42 | python3 .travis/linux-mingw/scan_dll.py package/imageformats/*.dll "package/" | ||
diff --git a/.travis/linux-mingw/scan_dll.py b/.travis/linux-mingw/scan_dll.py deleted file mode 100644 index 163183f2e..000000000 --- a/.travis/linux-mingw/scan_dll.py +++ /dev/null | |||
| @@ -1,106 +0,0 @@ | |||
| 1 | import pefile | ||
| 2 | import sys | ||
| 3 | import re | ||
| 4 | import os | ||
| 5 | import queue | ||
| 6 | import shutil | ||
| 7 | |||
| 8 | # constant definitions | ||
| 9 | KNOWN_SYS_DLLS = ['WINMM.DLL', 'MSVCRT.DLL', 'VERSION.DLL', 'MPR.DLL', | ||
| 10 | 'DWMAPI.DLL', 'UXTHEME.DLL', 'DNSAPI.DLL', 'IPHLPAPI.DLL'] | ||
| 11 | # below is for Ubuntu 18.04 with specified PPA enabled, if you are using | ||
| 12 | # other distro or different repositories, change the following accordingly | ||
| 13 | DLL_PATH = [ | ||
| 14 | '/usr/x86_64-w64-mingw32/bin/', | ||
| 15 | '/usr/x86_64-w64-mingw32/lib/', | ||
| 16 | '/usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/' | ||
| 17 | ] | ||
| 18 | |||
| 19 | missing = [] | ||
| 20 | |||
| 21 | |||
| 22 | def parse_imports(file_name): | ||
| 23 | results = [] | ||
| 24 | pe = pefile.PE(file_name, fast_load=True) | ||
| 25 | pe.parse_data_directories() | ||
| 26 | |||
| 27 | for entry in pe.DIRECTORY_ENTRY_IMPORT: | ||
| 28 | current = entry.dll.decode() | ||
| 29 | current_u = current.upper() # b/c Windows is often case insensitive | ||
| 30 | # here we filter out system dlls | ||
| 31 | # dll w/ names like *32.dll are likely to be system dlls | ||
| 32 | if current_u.upper() not in KNOWN_SYS_DLLS and not re.match(string=current_u, pattern=r'.*32\.DLL'): | ||
| 33 | results.append(current) | ||
| 34 | |||
| 35 | return results | ||
| 36 | |||
| 37 | |||
| 38 | def parse_imports_recursive(file_name, path_list=[]): | ||
| 39 | q = queue.Queue() # create a FIFO queue | ||
| 40 | # file_name can be a string or a list for the convience | ||
| 41 | if isinstance(file_name, str): | ||
| 42 | q.put(file_name) | ||
| 43 | elif isinstance(file_name, list): | ||
| 44 | for i in file_name: | ||
| 45 | q.put(i) | ||
| 46 | full_list = [] | ||
| 47 | while q.qsize(): | ||
| 48 | current = q.get_nowait() | ||
| 49 | print('> %s' % current) | ||
| 50 | deps = parse_imports(current) | ||
| 51 | # if this dll does not have any import, ignore it | ||
| 52 | if not deps: | ||
| 53 | continue | ||
| 54 | for dep in deps: | ||
| 55 | # the dependency already included in the list, skip | ||
| 56 | if dep in full_list: | ||
| 57 | continue | ||
| 58 | # find the requested dll in the provided paths | ||
| 59 | full_path = find_dll(dep) | ||
| 60 | if not full_path: | ||
| 61 | missing.append(dep) | ||
| 62 | continue | ||
| 63 | full_list.append(dep) | ||
| 64 | q.put(full_path) | ||
| 65 | path_list.append(full_path) | ||
| 66 | return full_list | ||
| 67 | |||
| 68 | |||
| 69 | def find_dll(name): | ||
| 70 | for path in DLL_PATH: | ||
| 71 | for root, _, files in os.walk(path): | ||
| 72 | for f in files: | ||
| 73 | if name.lower() == f.lower(): | ||
| 74 | return os.path.join(root, f) | ||
| 75 | |||
| 76 | |||
| 77 | def deploy(name, dst, dry_run=False): | ||
| 78 | dlls_path = [] | ||
| 79 | parse_imports_recursive(name, dlls_path) | ||
| 80 | for dll_entry in dlls_path: | ||
| 81 | if not dry_run: | ||
| 82 | shutil.copy(dll_entry, dst) | ||
| 83 | else: | ||
| 84 | print('[Dry-Run] Copy %s to %s' % (dll_entry, dst)) | ||
| 85 | print('Deploy completed.') | ||
| 86 | return dlls_path | ||
| 87 | |||
| 88 | |||
| 89 | def main(): | ||
| 90 | if len(sys.argv) < 3: | ||
| 91 | print('Usage: %s [files to examine ...] [target deploy directory]') | ||
| 92 | return 1 | ||
| 93 | to_deploy = sys.argv[1:-1] | ||
| 94 | tgt_dir = sys.argv[-1] | ||
| 95 | if not os.path.isdir(tgt_dir): | ||
| 96 | print('%s is not a directory.' % tgt_dir) | ||
| 97 | return 1 | ||
| 98 | print('Scanning dependencies...') | ||
| 99 | deploy(to_deploy, tgt_dir) | ||
| 100 | if missing: | ||
| 101 | print('Following DLLs are not found: %s' % ('\n'.join(missing))) | ||
| 102 | return 0 | ||
| 103 | |||
| 104 | |||
| 105 | if __name__ == '__main__': | ||
| 106 | main() | ||
diff --git a/.travis/linux-mingw/upload.sh b/.travis/linux-mingw/upload.sh deleted file mode 100755 index 66e896bc4..000000000 --- a/.travis/linux-mingw/upload.sh +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | . .travis/common/pre-upload.sh | ||
| 4 | |||
| 5 | REV_NAME="yuzu-windows-mingw-${GITDATE}-${GITREV}" | ||
| 6 | ARCHIVE_NAME="${REV_NAME}.tar.gz" | ||
| 7 | COMPRESSION_FLAGS="-czvf" | ||
| 8 | |||
| 9 | mkdir "$REV_NAME" | ||
| 10 | # get around the permission issues | ||
| 11 | cp -r package/* "$REV_NAME" | ||
| 12 | |||
| 13 | . .travis/common/post-upload.sh | ||
diff --git a/.travis/linux/build.sh b/.travis/linux/build.sh deleted file mode 100755 index 0c7fb8c9d..000000000 --- a/.travis/linux/build.sh +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | mkdir -p "$HOME/.ccache" | ||
| 4 | docker run -e ENABLE_COMPATIBILITY_REPORTING --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/home/yuzu/.ccache yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.travis/linux/docker.sh | ||
diff --git a/.travis/linux/deps.sh b/.travis/linux/deps.sh deleted file mode 100755 index 8d23c517d..000000000 --- a/.travis/linux/deps.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | docker pull yuzuemu/build-environments:linux-fresh | ||
diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh deleted file mode 100755 index 166fb6d4c..000000000 --- a/.travis/linux/docker.sh +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | cd /yuzu | ||
| 4 | |||
| 5 | mkdir build && cd build | ||
| 6 | cmake .. -G Ninja -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON | ||
| 7 | ninja | ||
| 8 | |||
| 9 | ccache -s | ||
| 10 | |||
| 11 | ctest -VV -C Release | ||
diff --git a/.travis/linux/upload.sh b/.travis/linux/upload.sh deleted file mode 100755 index 61842be12..000000000 --- a/.travis/linux/upload.sh +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | . .travis/common/pre-upload.sh | ||
| 4 | |||
| 5 | REV_NAME="yuzu-linux-${GITDATE}-${GITREV}" | ||
| 6 | ARCHIVE_NAME="${REV_NAME}.tar.xz" | ||
| 7 | COMPRESSION_FLAGS="-cJvf" | ||
| 8 | |||
| 9 | mkdir "$REV_NAME" | ||
| 10 | |||
| 11 | cp build/bin/yuzu-cmd "$REV_NAME" | ||
| 12 | cp build/bin/yuzu "$REV_NAME" | ||
| 13 | |||
| 14 | . .travis/common/post-upload.sh | ||
diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh deleted file mode 100755 index db1c7cae7..000000000 --- a/.travis/macos/build.sh +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | set -o pipefail | ||
| 4 | |||
| 5 | export MACOSX_DEPLOYMENT_TARGET=10.14 | ||
| 6 | export Qt5_DIR=$(brew --prefix)/opt/qt5 | ||
| 7 | export PATH="/usr/local/opt/ccache/libexec:$PATH" | ||
| 8 | |||
| 9 | # TODO: Build using ninja instead of make | ||
| 10 | mkdir build && cd build | ||
| 11 | cmake --version | ||
| 12 | cmake .. -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DUSE_DISCORD_PRESENCE=ON | ||
| 13 | make -j4 | ||
| 14 | |||
| 15 | ccache -s | ||
| 16 | |||
| 17 | ctest -VV -C Release | ||
diff --git a/.travis/macos/deps.sh b/.travis/macos/deps.sh deleted file mode 100755 index faeafa216..000000000 --- a/.travis/macos/deps.sh +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | brew update | ||
| 4 | brew install p7zip qt5 sdl2 ccache | ||
| 5 | brew outdated cmake || brew upgrade cmake | ||
| 6 | pip3 install macpack | ||
diff --git a/.travis/macos/upload.sh b/.travis/macos/upload.sh deleted file mode 100755 index c2f43a906..000000000 --- a/.travis/macos/upload.sh +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | . .travis/common/pre-upload.sh | ||
| 4 | |||
| 5 | REV_NAME="yuzu-osx-${GITDATE}-${GITREV}" | ||
| 6 | ARCHIVE_NAME="${REV_NAME}.tar.gz" | ||
| 7 | COMPRESSION_FLAGS="-czvf" | ||
| 8 | |||
| 9 | mkdir "$REV_NAME" | ||
| 10 | |||
| 11 | cp build/bin/yuzu-cmd "$REV_NAME" | ||
| 12 | cp -r build/bin/yuzu.app "$REV_NAME" | ||
| 13 | |||
| 14 | # move libs into folder for deployment | ||
| 15 | macpack "${REV_NAME}/yuzu.app/Contents/MacOS/yuzu" -d "../Frameworks" | ||
| 16 | # move qt frameworks into app bundle for deployment | ||
| 17 | $(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/yuzu.app" -executable="${REV_NAME}/yuzu.app/Contents/MacOS/yuzu" | ||
| 18 | |||
| 19 | # move libs into folder for deployment | ||
| 20 | macpack "${REV_NAME}/yuzu-cmd" -d "libs" | ||
| 21 | |||
| 22 | # Make the launching script executable | ||
| 23 | chmod +x ${REV_NAME}/yuzu.app/Contents/MacOS/yuzu | ||
| 24 | |||
| 25 | # Verify loader instructions | ||
| 26 | find "$REV_NAME" -exec otool -L {} \; | ||
| 27 | |||
| 28 | . .travis/common/post-upload.sh | ||
diff --git a/externals/dynarmic b/externals/dynarmic | |||
| Subproject 517e35f845e010788b6febe42fd6ddb187b8c23 | Subproject cce7e4ee5d7b07a4609c73c053fbf57dc8c7845 | ||
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 43b79bd6d..1bcb897b5 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp | |||
| @@ -82,32 +82,35 @@ public: | |||
| 82 | 82 | ||
| 83 | private: | 83 | private: |
| 84 | PathManagerImpl() { | 84 | PathManagerImpl() { |
| 85 | fs::path yuzu_path; | ||
| 86 | fs::path yuzu_path_cache; | ||
| 87 | fs::path yuzu_path_config; | ||
| 88 | |||
| 85 | #ifdef _WIN32 | 89 | #ifdef _WIN32 |
| 86 | auto yuzu_path = GetExeDirectory() / PORTABLE_DIR; | 90 | yuzu_path = GetExeDirectory() / PORTABLE_DIR; |
| 87 | 91 | ||
| 88 | if (!IsDir(yuzu_path)) { | 92 | if (!IsDir(yuzu_path)) { |
| 89 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; | 93 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; |
| 90 | } | 94 | } |
| 91 | 95 | ||
| 92 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 96 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 93 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); | 97 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 94 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR); | ||
| 95 | #else | 98 | #else |
| 96 | auto yuzu_path = GetCurrentDir() / PORTABLE_DIR; | 99 | yuzu_path = GetCurrentDir() / PORTABLE_DIR; |
| 97 | 100 | ||
| 98 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { | 101 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { |
| 99 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 102 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 100 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); | 103 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 101 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR); | ||
| 102 | } else { | 104 | } else { |
| 103 | yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; | 105 | yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; |
| 104 | 106 | yuzu_path_cache = GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR; | |
| 105 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 107 | yuzu_path_config = GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR; |
| 106 | GenerateYuzuPath(YuzuPath::CacheDir, GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR); | ||
| 107 | GenerateYuzuPath(YuzuPath::ConfigDir, GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR); | ||
| 108 | } | 108 | } |
| 109 | #endif | 109 | #endif |
| 110 | 110 | ||
| 111 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | ||
| 112 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache); | ||
| 113 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config); | ||
| 111 | GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); | 114 | GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); |
| 112 | GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); | 115 | GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); |
| 113 | GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); | 116 | GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); |
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index ceff2532d..cf204f570 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h | |||
| @@ -4,17 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 8 | #include <cstring> | 7 | #include <cstring> |
| 9 | #include <memory> | 8 | #include <memory> |
| 10 | #include <tuple> | ||
| 11 | #include <type_traits> | 9 | #include <type_traits> |
| 12 | #include <utility> | 10 | #include <utility> |
| 13 | #include "common/assert.h" | 11 | #include "common/assert.h" |
| 14 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 15 | #include "core/hle/ipc.h" | 13 | #include "core/hle/ipc.h" |
| 16 | #include "core/hle/kernel/hle_ipc.h" | 14 | #include "core/hle/kernel/hle_ipc.h" |
| 17 | #include "core/hle/kernel/k_client_port.h" | ||
| 18 | #include "core/hle/kernel/k_process.h" | 15 | #include "core/hle/kernel/k_process.h" |
| 19 | #include "core/hle/kernel/k_resource_limit.h" | 16 | #include "core/hle/kernel/k_resource_limit.h" |
| 20 | #include "core/hle/kernel/k_session.h" | 17 | #include "core/hle/kernel/k_session.h" |
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index ca68fc325..cee96dd9b 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include "common/logging/log.h" | 15 | #include "common/logging/log.h" |
| 16 | #include "core/hle/ipc_helpers.h" | 16 | #include "core/hle/ipc_helpers.h" |
| 17 | #include "core/hle/kernel/hle_ipc.h" | 17 | #include "core/hle/kernel/hle_ipc.h" |
| 18 | #include "core/hle/kernel/k_auto_object.h" | ||
| 18 | #include "core/hle/kernel/k_handle_table.h" | 19 | #include "core/hle/kernel/k_handle_table.h" |
| 19 | #include "core/hle/kernel/k_process.h" | 20 | #include "core/hle/kernel/k_process.h" |
| 20 | #include "core/hle/kernel/k_readable_event.h" | 21 | #include "core/hle/kernel/k_readable_event.h" |
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index a61870f8b..55e6fb9f7 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include "common/concepts.h" | 17 | #include "common/concepts.h" |
| 18 | #include "common/swap.h" | 18 | #include "common/swap.h" |
| 19 | #include "core/hle/ipc.h" | 19 | #include "core/hle/ipc.h" |
| 20 | #include "core/hle/kernel/k_auto_object.h" | ||
| 21 | #include "core/hle/kernel/svc_common.h" | 20 | #include "core/hle/kernel/svc_common.h" |
| 22 | 21 | ||
| 23 | union ResultCode; | 22 | union ResultCode; |
| @@ -38,6 +37,7 @@ namespace Kernel { | |||
| 38 | 37 | ||
| 39 | class Domain; | 38 | class Domain; |
| 40 | class HLERequestContext; | 39 | class HLERequestContext; |
| 40 | class KAutoObject; | ||
| 41 | class KernelCore; | 41 | class KernelCore; |
| 42 | class KHandleTable; | 42 | class KHandleTable; |
| 43 | class KProcess; | 43 | class KProcess; |
diff --git a/src/core/hle/service/am/applet_ae.h b/src/core/hle/service/am/applet_ae.h index adb207349..f89f65649 100644 --- a/src/core/hle/service/am/applet_ae.h +++ b/src/core/hle/service/am/applet_ae.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include "core/hle/kernel/hle_ipc.h" | 8 | |
| 9 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
| 10 | 10 | ||
| 11 | namespace Service { | 11 | namespace Service { |
diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h index 6c1aa255a..64b874ead 100644 --- a/src/core/hle/service/am/applet_oe.h +++ b/src/core/hle/service/am/applet_oe.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include "core/hle/kernel/hle_ipc.h" | 8 | |
| 9 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
| 10 | 10 | ||
| 11 | namespace Service { | 11 | namespace Service { |
diff --git a/src/core/hle/service/am/applets/applet_web_browser.cpp b/src/core/hle/service/am/applets/applet_web_browser.cpp index 35f194961..927eeefff 100644 --- a/src/core/hle/service/am/applets/applet_web_browser.cpp +++ b/src/core/hle/service/am/applets/applet_web_browser.cpp | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include "core/hle/service/am/applets/applet_web_browser.h" | 24 | #include "core/hle/service/am/applets/applet_web_browser.h" |
| 25 | #include "core/hle/service/filesystem/filesystem.h" | 25 | #include "core/hle/service/filesystem/filesystem.h" |
| 26 | #include "core/hle/service/ns/pl_u.h" | 26 | #include "core/hle/service/ns/pl_u.h" |
| 27 | #include "core/loader/loader.h" | ||
| 27 | 28 | ||
| 28 | namespace Service::AM::Applets { | 29 | namespace Service::AM::Applets { |
| 29 | 30 | ||
| @@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id, | |||
| 122 | const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); | 123 | const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); |
| 123 | 124 | ||
| 124 | if (nca == nullptr) { | 125 | if (nca == nullptr) { |
| 126 | if (nca_type == FileSys::ContentRecordType::HtmlDocument) { | ||
| 127 | LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS."); | ||
| 128 | FileSys::VirtualFile romfs; | ||
| 129 | system.GetAppLoader().ReadManualRomFS(romfs); | ||
| 130 | if (romfs != nullptr) { | ||
| 131 | return romfs; | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 125 | LOG_ERROR(Service_AM, | 135 | LOG_ERROR(Service_AM, |
| 126 | "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", | 136 | "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", |
| 127 | nca_type, title_id); | 137 | nca_type, title_id); |
diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp index 840d1d883..34cc659ed 100644 --- a/src/core/hle/service/audio/audin_u.cpp +++ b/src/core/hle/service/audio/audin_u.cpp | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #include "common/logging/log.h" | 5 | #include "common/logging/log.h" |
| 6 | #include "core/core.h" | 6 | #include "core/core.h" |
| 7 | #include "core/hle/ipc_helpers.h" | 7 | #include "core/hle/ipc_helpers.h" |
| 8 | #include "core/hle/kernel/hle_ipc.h" | ||
| 9 | #include "core/hle/kernel/k_event.h" | 8 | #include "core/hle/kernel/k_event.h" |
| 10 | #include "core/hle/service/audio/audin_u.h" | 9 | #include "core/hle/service/audio/audin_u.h" |
| 11 | 10 | ||
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index beb387745..81adbfe09 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include "common/swap.h" | 13 | #include "common/swap.h" |
| 14 | #include "core/core.h" | 14 | #include "core/core.h" |
| 15 | #include "core/hle/ipc_helpers.h" | 15 | #include "core/hle/ipc_helpers.h" |
| 16 | #include "core/hle/kernel/hle_ipc.h" | ||
| 17 | #include "core/hle/kernel/k_event.h" | 16 | #include "core/hle/kernel/k_event.h" |
| 18 | #include "core/hle/kernel/kernel.h" | 17 | #include "core/hle/kernel/kernel.h" |
| 19 | #include "core/hle/service/audio/audout_u.h" | 18 | #include "core/hle/service/audio/audout_u.h" |
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 1f69d39cc..cdb2a9521 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include "common/string_util.h" | 15 | #include "common/string_util.h" |
| 16 | #include "core/core.h" | 16 | #include "core/core.h" |
| 17 | #include "core/hle/ipc_helpers.h" | 17 | #include "core/hle/ipc_helpers.h" |
| 18 | #include "core/hle/kernel/hle_ipc.h" | ||
| 19 | #include "core/hle/kernel/k_event.h" | 18 | #include "core/hle/kernel/k_event.h" |
| 20 | #include "core/hle/kernel/kernel.h" | 19 | #include "core/hle/kernel/kernel.h" |
| 21 | #include "core/hle/service/audio/audren_u.h" | 20 | #include "core/hle/service/audio/audren_u.h" |
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index 33a6dbbb6..7da1f2969 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include "common/assert.h" | 13 | #include "common/assert.h" |
| 14 | #include "common/logging/log.h" | 14 | #include "common/logging/log.h" |
| 15 | #include "core/hle/ipc_helpers.h" | 15 | #include "core/hle/ipc_helpers.h" |
| 16 | #include "core/hle/kernel/hle_ipc.h" | ||
| 17 | #include "core/hle/service/audio/hwopus.h" | 16 | #include "core/hle/service/audio/hwopus.h" |
| 18 | 17 | ||
| 19 | namespace Service::Audio { | 18 | namespace Service::Audio { |
diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp index ecd3bd22a..088a1a18a 100644 --- a/src/core/hle/service/btdrv/btdrv.cpp +++ b/src/core/hle/service/btdrv/btdrv.cpp | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #include "common/logging/log.h" | 5 | #include "common/logging/log.h" |
| 6 | #include "core/core.h" | 6 | #include "core/core.h" |
| 7 | #include "core/hle/ipc_helpers.h" | 7 | #include "core/hle/ipc_helpers.h" |
| 8 | #include "core/hle/kernel/hle_ipc.h" | ||
| 9 | #include "core/hle/kernel/k_event.h" | 8 | #include "core/hle/kernel/k_event.h" |
| 10 | #include "core/hle/kernel/kernel.h" | 9 | #include "core/hle/kernel/kernel.h" |
| 11 | #include "core/hle/service/btdrv/btdrv.h" | 10 | #include "core/hle/service/btdrv/btdrv.h" |
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index 780a99c2d..7aabacc19 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 10 | #include "core/hle/kernel/hle_ipc.h" | ||
| 11 | #include "core/hle/kernel/k_event.h" | 10 | #include "core/hle/kernel/k_event.h" |
| 12 | #include "core/hle/kernel/kernel.h" | 11 | #include "core/hle/kernel/kernel.h" |
| 13 | #include "core/hle/service/btm/btm.h" | 12 | #include "core/hle/service/btm/btm.h" |
diff --git a/src/core/hle/service/caps/caps.h b/src/core/hle/service/caps/caps.h index 3c4290c88..b18adcb9d 100644 --- a/src/core/hle/service/caps/caps.h +++ b/src/core/hle/service/caps/caps.h | |||
| @@ -4,7 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/service/service.h" | 7 | #include "common/common_funcs.h" |
| 8 | #include "common/common_types.h" | ||
| 8 | 9 | ||
| 9 | namespace Core { | 10 | namespace Core { |
| 10 | class System; | 11 | class System; |
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp index 25c6c0194..d7a638f96 100644 --- a/src/core/hle/service/fgm/fgm.cpp +++ b/src/core/hle/service/fgm/fgm.cpp | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #include <memory> | 5 | #include <memory> |
| 6 | 6 | ||
| 7 | #include "core/hle/ipc_helpers.h" | 7 | #include "core/hle/ipc_helpers.h" |
| 8 | #include "core/hle/kernel/hle_ipc.h" | ||
| 9 | #include "core/hle/service/fgm/fgm.h" | 8 | #include "core/hle/service/fgm/fgm.h" |
| 10 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
| 11 | #include "core/hle/service/sm/sm.h" | 10 | #include "core/hle/service/sm/sm.h" |
diff --git a/src/core/hle/service/filesystem/fsp_ldr.cpp b/src/core/hle/service/filesystem/fsp_ldr.cpp index 1f6c17ba5..f112ae9d0 100644 --- a/src/core/hle/service/filesystem/fsp_ldr.cpp +++ b/src/core/hle/service/filesystem/fsp_ldr.cpp | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/service/filesystem/fsp_ldr.h" | 5 | #include "core/hle/service/filesystem/fsp_ldr.h" |
| 6 | #include "core/hle/service/service.h" | ||
| 7 | 6 | ||
| 8 | namespace Service::FileSystem { | 7 | namespace Service::FileSystem { |
| 9 | 8 | ||
diff --git a/src/core/hle/service/filesystem/fsp_pr.cpp b/src/core/hle/service/filesystem/fsp_pr.cpp index 00e4d1662..9b7f7d861 100644 --- a/src/core/hle/service/filesystem/fsp_pr.cpp +++ b/src/core/hle/service/filesystem/fsp_pr.cpp | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/service/filesystem/fsp_pr.h" | 5 | #include "core/hle/service/filesystem/fsp_pr.h" |
| 6 | #include "core/hle/service/service.h" | ||
| 7 | 6 | ||
| 8 | namespace Service::FileSystem { | 7 | namespace Service::FileSystem { |
| 9 | 8 | ||
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp index 5a3b54cc1..70cd63c6b 100644 --- a/src/core/hle/service/glue/arp.cpp +++ b/src/core/hle/service/glue/arp.cpp | |||
| @@ -8,13 +8,11 @@ | |||
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/file_sys/control_metadata.h" | 9 | #include "core/file_sys/control_metadata.h" |
| 10 | #include "core/hle/ipc_helpers.h" | 10 | #include "core/hle/ipc_helpers.h" |
| 11 | #include "core/hle/kernel/hle_ipc.h" | ||
| 12 | #include "core/hle/kernel/k_process.h" | 11 | #include "core/hle/kernel/k_process.h" |
| 13 | #include "core/hle/kernel/kernel.h" | 12 | #include "core/hle/kernel/kernel.h" |
| 14 | #include "core/hle/service/glue/arp.h" | 13 | #include "core/hle/service/glue/arp.h" |
| 15 | #include "core/hle/service/glue/errors.h" | 14 | #include "core/hle/service/glue/errors.h" |
| 16 | #include "core/hle/service/glue/glue_manager.h" | 15 | #include "core/hle/service/glue/glue_manager.h" |
| 17 | #include "core/hle/service/service.h" | ||
| 18 | 16 | ||
| 19 | namespace Service::Glue { | 17 | namespace Service::Glue { |
| 20 | 18 | ||
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 8c363142c..043320d50 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -8,12 +8,9 @@ | |||
| 8 | #include "common/settings.h" | 8 | #include "common/settings.h" |
| 9 | #include "core/core.h" | 9 | #include "core/core.h" |
| 10 | #include "core/core_timing.h" | 10 | #include "core/core_timing.h" |
| 11 | #include "core/core_timing_util.h" | ||
| 12 | #include "core/frontend/emu_window.h" | 11 | #include "core/frontend/emu_window.h" |
| 13 | #include "core/frontend/input.h" | 12 | #include "core/frontend/input.h" |
| 14 | #include "core/hardware_properties.h" | ||
| 15 | #include "core/hle/ipc_helpers.h" | 13 | #include "core/hle/ipc_helpers.h" |
| 16 | #include "core/hle/kernel/k_client_port.h" | ||
| 17 | #include "core/hle/kernel/k_readable_event.h" | 14 | #include "core/hle/kernel/k_readable_event.h" |
| 18 | #include "core/hle/kernel/k_shared_memory.h" | 15 | #include "core/hle/kernel/k_shared_memory.h" |
| 19 | #include "core/hle/kernel/k_transfer_memory.h" | 16 | #include "core/hle/kernel/k_transfer_memory.h" |
| @@ -23,7 +20,6 @@ | |||
| 23 | #include "core/hle/service/hid/hid.h" | 20 | #include "core/hle/service/hid/hid.h" |
| 24 | #include "core/hle/service/hid/irs.h" | 21 | #include "core/hle/service/hid/irs.h" |
| 25 | #include "core/hle/service/hid/xcd.h" | 22 | #include "core/hle/service/hid/xcd.h" |
| 26 | #include "core/hle/service/service.h" | ||
| 27 | #include "core/memory.h" | 23 | #include "core/memory.h" |
| 28 | 24 | ||
| 29 | #include "core/hle/service/hid/controllers/console_sixaxis.h" | 25 | #include "core/hle/service/hid/controllers/console_sixaxis.h" |
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index 37ff37277..5c8ae029c 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | 7 | ||
| 8 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 9 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 10 | #include "core/hle/kernel/hle_ipc.h" | ||
| 11 | #include "core/hle/service/lbl/lbl.h" | 10 | #include "core/hle/service/lbl/lbl.h" |
| 12 | #include "core/hle/service/service.h" | 11 | #include "core/hle/service/service.h" |
| 13 | #include "core/hle/service/sm/sm.h" | 12 | #include "core/hle/service/sm/sm.h" |
diff --git a/src/core/hle/service/mii/mii.cpp b/src/core/hle/service/mii/mii.cpp index 9d863486a..0b907824d 100644 --- a/src/core/hle/service/mii/mii.cpp +++ b/src/core/hle/service/mii/mii.cpp | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "core/hle/ipc_helpers.h" | 8 | #include "core/hle/ipc_helpers.h" |
| 9 | #include "core/hle/kernel/hle_ipc.h" | ||
| 10 | #include "core/hle/service/mii/mii.h" | 9 | #include "core/hle/service/mii/mii.h" |
| 11 | #include "core/hle/service/mii/mii_manager.h" | 10 | #include "core/hle/service/mii/mii_manager.h" |
| 12 | #include "core/hle/service/service.h" | 11 | #include "core/hle/service/service.h" |
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp index b014ea826..f77037842 100644 --- a/src/core/hle/service/nfc/nfc.cpp +++ b/src/core/hle/service/nfc/nfc.cpp | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "common/settings.h" | 8 | #include "common/settings.h" |
| 9 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 10 | #include "core/hle/kernel/hle_ipc.h" | ||
| 11 | #include "core/hle/service/nfc/nfc.h" | 10 | #include "core/hle/service/nfc/nfc.h" |
| 12 | #include "core/hle/service/service.h" | 11 | #include "core/hle/service/service.h" |
| 13 | #include "core/hle/service/sm/sm.h" | 12 | #include "core/hle/service/sm/sm.h" |
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 8ce1f3296..931b48f72 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include "core/file_sys/patch_manager.h" | 9 | #include "core/file_sys/patch_manager.h" |
| 10 | #include "core/file_sys/vfs.h" | 10 | #include "core/file_sys/vfs.h" |
| 11 | #include "core/hle/ipc_helpers.h" | 11 | #include "core/hle/ipc_helpers.h" |
| 12 | #include "core/hle/kernel/hle_ipc.h" | ||
| 13 | #include "core/hle/service/ns/errors.h" | 12 | #include "core/hle/service/ns/errors.h" |
| 14 | #include "core/hle/service/ns/language.h" | 13 | #include "core/hle/service/ns/language.h" |
| 15 | #include "core/hle/service/ns/ns.h" | 14 | #include "core/hle/service/ns/ns.h" |
diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 3bbe1bfe2..39a8031a5 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/ipc_helpers.h" | 5 | #include "core/hle/ipc_helpers.h" |
| 6 | #include "core/hle/kernel/hle_ipc.h" | ||
| 7 | #include "core/hle/service/olsc/olsc.h" | 6 | #include "core/hle/service/olsc/olsc.h" |
| 8 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 9 | #include "core/hle/service/sm/sm.h" | 8 | #include "core/hle/service/sm/sm.h" |
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp index 8299c6b68..286578b17 100644 --- a/src/core/hle/service/set/set_sys.cpp +++ b/src/core/hle/service/set/set_sys.cpp | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include "core/file_sys/errors.h" | 7 | #include "core/file_sys/errors.h" |
| 8 | #include "core/file_sys/system_archive/system_version.h" | 8 | #include "core/file_sys/system_archive/system_version.h" |
| 9 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 10 | #include "core/hle/kernel/k_client_port.h" | ||
| 11 | #include "core/hle/service/filesystem/filesystem.h" | 10 | #include "core/hle/service/filesystem/filesystem.h" |
| 12 | #include "core/hle/service/set/set_sys.h" | 11 | #include "core/hle/service/set/set_sys.h" |
| 13 | 12 | ||
diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index d68beef5c..a387e50df 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h | |||
| @@ -5,11 +5,9 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <string_view> | ||
| 9 | #include <vector> | 8 | #include <vector> |
| 10 | 9 | ||
| 11 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 12 | #include "core/hle/kernel/hle_ipc.h" | ||
| 13 | #include "core/hle/service/service.h" | 11 | #include "core/hle/service/service.h" |
| 14 | #include "core/hle/service/sockets/sockets.h" | 12 | #include "core/hle/service/sockets/sockets.h" |
| 15 | 13 | ||
diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h index faa6b7d0d..5d3b4dc2d 100644 --- a/src/core/hle/service/sockets/sfdnsres.h +++ b/src/core/hle/service/sockets/sfdnsres.h | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/kernel/hle_ipc.h" | ||
| 8 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 9 | 8 | ||
| 10 | namespace Core { | 9 | namespace Core { |
diff --git a/src/core/hle/service/sockets/sockets.h b/src/core/hle/service/sockets/sockets.h index 5a65ed2a9..02dbbae40 100644 --- a/src/core/hle/service/sockets/sockets.h +++ b/src/core/hle/service/sockets/sockets.h | |||
| @@ -4,13 +4,17 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "common/common_funcs.h" | ||
| 7 | #include "common/common_types.h" | 8 | #include "common/common_types.h" |
| 8 | #include "core/hle/service/service.h" | ||
| 9 | 9 | ||
| 10 | namespace Core { | 10 | namespace Core { |
| 11 | class System; | 11 | class System; |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | namespace Service::SM { | ||
| 15 | class ServiceManager; | ||
| 16 | } | ||
| 17 | |||
| 14 | namespace Service::Sockets { | 18 | namespace Service::Sockets { |
| 15 | 19 | ||
| 16 | enum class Errno : u32 { | 20 | enum class Errno : u32 { |
diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp index 918633af5..ed4c06260 100644 --- a/src/core/hle/service/spl/spl_module.cpp +++ b/src/core/hle/service/spl/spl_module.cpp | |||
| @@ -3,10 +3,8 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <chrono> | ||
| 7 | #include <cstdlib> | 6 | #include <cstdlib> |
| 8 | #include <ctime> | 7 | #include <ctime> |
| 9 | #include <functional> | ||
| 10 | #include <vector> | 8 | #include <vector> |
| 11 | #include "common/logging/log.h" | 9 | #include "common/logging/log.h" |
| 12 | #include "common/settings.h" | 10 | #include "common/settings.h" |
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 921f4d776..a81a595ea 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/ipc_helpers.h" | 5 | #include "core/hle/ipc_helpers.h" |
| 6 | #include "core/hle/kernel/hle_ipc.h" | ||
| 7 | #include "core/hle/service/service.h" | 6 | #include "core/hle/service/service.h" |
| 8 | #include "core/hle/service/sm/sm.h" | 7 | #include "core/hle/service/sm/sm.h" |
| 9 | #include "core/hle/service/ssl/ssl.h" | 8 | #include "core/hle/service/ssl/ssl.h" |
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 8fdd5076f..d84a111c2 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp | |||
| @@ -8,11 +8,11 @@ | |||
| 8 | #include "core/core_timing_util.h" | 8 | #include "core/core_timing_util.h" |
| 9 | #include "core/hardware_properties.h" | 9 | #include "core/hardware_properties.h" |
| 10 | #include "core/hle/ipc_helpers.h" | 10 | #include "core/hle/ipc_helpers.h" |
| 11 | #include "core/hle/kernel/k_client_port.h" | ||
| 12 | #include "core/hle/kernel/k_scheduler.h" | 11 | #include "core/hle/kernel/k_scheduler.h" |
| 13 | #include "core/hle/kernel/kernel.h" | 12 | #include "core/hle/kernel/kernel.h" |
| 14 | #include "core/hle/service/time/time.h" | 13 | #include "core/hle/service/time/time.h" |
| 15 | #include "core/hle/service/time/time_interface.h" | 14 | #include "core/hle/service/time/time_interface.h" |
| 15 | #include "core/hle/service/time/time_manager.h" | ||
| 16 | #include "core/hle/service/time/time_sharedmemory.h" | 16 | #include "core/hle/service/time/time_sharedmemory.h" |
| 17 | #include "core/hle/service/time/time_zone_service.h" | 17 | #include "core/hle/service/time/time_zone_service.h" |
| 18 | 18 | ||
diff --git a/src/core/hle/service/time/time.h b/src/core/hle/service/time/time.h index ce9c479c6..30e2cd369 100644 --- a/src/core/hle/service/time/time.h +++ b/src/core/hle/service/time/time.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 8 | #include "core/hle/service/time/clock_types.h" | 8 | #include "core/hle/service/time/clock_types.h" |
| 9 | #include "core/hle/service/time/time_manager.h" | ||
| 10 | 9 | ||
| 11 | namespace Core { | 10 | namespace Core { |
| 12 | class System; | 11 | class System; |
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp index 2ee103b37..502dfbb4a 100644 --- a/src/core/hle/service/usb/usb.cpp +++ b/src/core/hle/service/usb/usb.cpp | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 8 | #include "core/hle/ipc_helpers.h" | 8 | #include "core/hle/ipc_helpers.h" |
| 9 | #include "core/hle/kernel/hle_ipc.h" | ||
| 10 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
| 11 | #include "core/hle/service/sm/sm.h" | 10 | #include "core/hle/service/sm/sm.h" |
| 12 | #include "core/hle/service/usb/usb.h" | 11 | #include "core/hle/service/usb/usb.h" |
diff --git a/src/core/hle/service/vi/vi.h b/src/core/hle/service/vi/vi.h index eec531d54..2fd7f8e61 100644 --- a/src/core/hle/service/vi/vi.h +++ b/src/core/hle/service/vi/vi.h | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | ||
| 8 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 9 | 8 | ||
| 10 | namespace Core { | 9 | namespace Core { |
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp index 51ee14c13..5519c4705 100644 --- a/src/video_core/command_classes/codecs/h264.cpp +++ b/src/video_core/command_classes/codecs/h264.cpp | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | 20 | ||
| 21 | #include <array> | 21 | #include <array> |
| 22 | #include <bit> | 22 | #include <bit> |
| 23 | |||
| 24 | #include "common/settings.h" | ||
| 23 | #include "video_core/command_classes/codecs/h264.h" | 25 | #include "video_core/command_classes/codecs/h264.h" |
| 24 | #include "video_core/gpu.h" | 26 | #include "video_core/gpu.h" |
| 25 | #include "video_core/memory_manager.h" | 27 | #include "video_core/memory_manager.h" |
| @@ -96,7 +98,10 @@ const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegister | |||
| 96 | (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); | 98 | (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); |
| 97 | 99 | ||
| 98 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream | 100 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream |
| 99 | writer.WriteUe(6); // Max number of reference frames | 101 | const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue(); |
| 102 | const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU; | ||
| 103 | const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u; | ||
| 104 | writer.WriteUe(max_num_ref_frames); | ||
| 100 | writer.WriteBit(false); | 105 | writer.WriteBit(false); |
| 101 | writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); | 106 | writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); |
| 102 | writer.WriteUe(pic_height - 1); | 107 | writer.WriteUe(pic_height - 1); |
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp index 0ee07f398..dc768b952 100644 --- a/src/video_core/command_classes/vic.cpp +++ b/src/video_core/command_classes/vic.cpp | |||
| @@ -16,6 +16,7 @@ extern "C" { | |||
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #include "common/assert.h" | 18 | #include "common/assert.h" |
| 19 | #include "common/bit_field.h" | ||
| 19 | #include "common/logging/log.h" | 20 | #include "common/logging/log.h" |
| 20 | 21 | ||
| 21 | #include "video_core/command_classes/nvdec.h" | 22 | #include "video_core/command_classes/nvdec.h" |
| @@ -26,6 +27,25 @@ extern "C" { | |||
| 26 | #include "video_core/textures/decoders.h" | 27 | #include "video_core/textures/decoders.h" |
| 27 | 28 | ||
| 28 | namespace Tegra { | 29 | namespace Tegra { |
| 30 | namespace { | ||
| 31 | enum class VideoPixelFormat : u64_le { | ||
| 32 | RGBA8 = 0x1f, | ||
| 33 | BGRA8 = 0x20, | ||
| 34 | RGBX8 = 0x23, | ||
| 35 | Yuv420 = 0x44, | ||
| 36 | }; | ||
| 37 | } // Anonymous namespace | ||
| 38 | |||
| 39 | union VicConfig { | ||
| 40 | u64_le raw{}; | ||
| 41 | BitField<0, 7, VideoPixelFormat> pixel_format; | ||
| 42 | BitField<7, 2, u64_le> chroma_loc_horiz; | ||
| 43 | BitField<9, 2, u64_le> chroma_loc_vert; | ||
| 44 | BitField<11, 4, u64_le> block_linear_kind; | ||
| 45 | BitField<15, 4, u64_le> block_linear_height_log2; | ||
| 46 | BitField<32, 14, u64_le> surface_width_minus1; | ||
| 47 | BitField<46, 14, u64_le> surface_height_minus1; | ||
| 48 | }; | ||
| 29 | 49 | ||
| 30 | Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_) | 50 | Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_) |
| 31 | : gpu(gpu_), | 51 | : gpu(gpu_), |
| @@ -65,134 +85,156 @@ void Vic::Execute() { | |||
| 65 | if (!frame) { | 85 | if (!frame) { |
| 66 | return; | 86 | return; |
| 67 | } | 87 | } |
| 68 | const auto pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value()); | 88 | const u64 surface_width = config.surface_width_minus1 + 1; |
| 69 | switch (pixel_format) { | 89 | const u64 surface_height = config.surface_height_minus1 + 1; |
| 90 | if (static_cast<u64>(frame->width) != surface_width || | ||
| 91 | static_cast<u64>(frame->height) > surface_height) { | ||
| 92 | // TODO: Properly support multiple video streams with differing frame dimensions | ||
| 93 | LOG_WARNING(Debug, | ||
| 94 | "Frame dimensions {}x{} can't be safely decoded into surface dimensions {}x{}", | ||
| 95 | frame->width, frame->height, surface_width, surface_height); | ||
| 96 | return; | ||
| 97 | } | ||
| 98 | switch (config.pixel_format) { | ||
| 99 | case VideoPixelFormat::RGBA8: | ||
| 70 | case VideoPixelFormat::BGRA8: | 100 | case VideoPixelFormat::BGRA8: |
| 71 | case VideoPixelFormat::RGBA8: { | 101 | case VideoPixelFormat::RGBX8: |
| 72 | LOG_TRACE(Service_NVDRV, "Writing RGB Frame"); | 102 | WriteRGBFrame(frame, config); |
| 103 | break; | ||
| 104 | case VideoPixelFormat::Yuv420: | ||
| 105 | WriteYUVFrame(frame, config); | ||
| 106 | break; | ||
| 107 | default: | ||
| 108 | UNIMPLEMENTED_MSG("Unknown video pixel format {:X}", config.pixel_format.Value()); | ||
| 109 | break; | ||
| 110 | } | ||
| 111 | } | ||
| 73 | 112 | ||
| 74 | if (scaler_ctx == nullptr || frame->width != scaler_width || | 113 | void Vic::WriteRGBFrame(const AVFrame* frame, const VicConfig& config) { |
| 75 | frame->height != scaler_height) { | 114 | LOG_TRACE(Service_NVDRV, "Writing RGB Frame"); |
| 76 | const AVPixelFormat target_format = | 115 | |
| 77 | (pixel_format == VideoPixelFormat::RGBA8) ? AV_PIX_FMT_RGBA : AV_PIX_FMT_BGRA; | 116 | if (!scaler_ctx || frame->width != scaler_width || frame->height != scaler_height) { |
| 117 | const AVPixelFormat target_format = [pixel_format = config.pixel_format]() { | ||
| 118 | switch (pixel_format) { | ||
| 119 | case VideoPixelFormat::RGBA8: | ||
| 120 | return AV_PIX_FMT_RGBA; | ||
| 121 | case VideoPixelFormat::BGRA8: | ||
| 122 | return AV_PIX_FMT_BGRA; | ||
| 123 | case VideoPixelFormat::RGBX8: | ||
| 124 | return AV_PIX_FMT_RGB0; | ||
| 125 | default: | ||
| 126 | return AV_PIX_FMT_RGBA; | ||
| 127 | } | ||
| 128 | }(); | ||
| 129 | |||
| 130 | sws_freeContext(scaler_ctx); | ||
| 131 | // Frames are decoded into either YUV420 or NV12 formats. Convert to desired RGB format | ||
| 132 | scaler_ctx = sws_getContext(frame->width, frame->height, | ||
| 133 | static_cast<AVPixelFormat>(frame->format), frame->width, | ||
| 134 | frame->height, target_format, 0, nullptr, nullptr, nullptr); | ||
| 135 | scaler_width = frame->width; | ||
| 136 | scaler_height = frame->height; | ||
| 137 | converted_frame_buffer.reset(); | ||
| 138 | } | ||
| 139 | // Get Converted frame | ||
| 140 | const u32 width = static_cast<u32>(frame->width); | ||
| 141 | const u32 height = static_cast<u32>(frame->height); | ||
| 142 | const std::size_t linear_size = width * height * 4; | ||
| 143 | |||
| 144 | // Only allocate frame_buffer once per stream, as the size is not expected to change | ||
| 145 | if (!converted_frame_buffer) { | ||
| 146 | converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free}; | ||
| 147 | } | ||
| 148 | const std::array<int, 4> converted_stride{frame->width * 4, frame->height * 4, 0, 0}; | ||
| 149 | u8* const converted_frame_buf_addr{converted_frame_buffer.get()}; | ||
| 150 | |||
| 151 | sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height, &converted_frame_buf_addr, | ||
| 152 | converted_stride.data()); | ||
| 153 | |||
| 154 | const u32 blk_kind = static_cast<u32>(config.block_linear_kind); | ||
| 155 | if (blk_kind != 0) { | ||
| 156 | // swizzle pitch linear to block linear | ||
| 157 | const u32 block_height = static_cast<u32>(config.block_linear_height_log2); | ||
| 158 | const auto size = Texture::CalculateSize(true, 4, width, height, 1, block_height, 0); | ||
| 159 | luma_buffer.resize(size); | ||
| 160 | Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(), | ||
| 161 | converted_frame_buffer.get(), block_height, 0, 0); | ||
| 162 | |||
| 163 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size); | ||
| 164 | } else { | ||
| 165 | // send pitch linear frame | ||
| 166 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr, | ||
| 167 | linear_size); | ||
| 168 | } | ||
| 169 | } | ||
| 78 | 170 | ||
| 79 | sws_freeContext(scaler_ctx); | 171 | void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) { |
| 80 | scaler_ctx = nullptr; | 172 | LOG_TRACE(Service_NVDRV, "Writing YUV420 Frame"); |
| 81 | 173 | ||
| 82 | // Frames are decoded into either YUV420 or NV12 formats. Convert to desired format | 174 | const std::size_t surface_width = config.surface_width_minus1 + 1; |
| 83 | scaler_ctx = sws_getContext(frame->width, frame->height, | 175 | const std::size_t surface_height = config.surface_height_minus1 + 1; |
| 84 | static_cast<AVPixelFormat>(frame->format), frame->width, | 176 | const auto frame_width = std::min(surface_width, static_cast<size_t>(frame->width)); |
| 85 | frame->height, target_format, 0, nullptr, nullptr, nullptr); | 177 | const auto frame_height = std::min(surface_height, static_cast<size_t>(frame->height)); |
| 178 | const std::size_t aligned_width = (surface_width + 0xff) & ~0xffUL; | ||
| 86 | 179 | ||
| 87 | scaler_width = frame->width; | 180 | const auto stride = static_cast<size_t>(frame->linesize[0]); |
| 88 | scaler_height = frame->height; | 181 | |
| 89 | } | 182 | luma_buffer.resize(aligned_width * surface_height); |
| 90 | // Get Converted frame | 183 | chroma_buffer.resize(aligned_width * surface_height / 2); |
| 91 | const u32 width = static_cast<u32>(frame->width); | 184 | |
| 92 | const u32 height = static_cast<u32>(frame->height); | 185 | // Populate luma buffer |
| 93 | const std::size_t linear_size = width * height * 4; | 186 | const u8* luma_src = frame->data[0]; |
| 94 | 187 | for (std::size_t y = 0; y < frame_height; ++y) { | |
| 95 | // Only allocate frame_buffer once per stream, as the size is not expected to change | 188 | const std::size_t src = y * stride; |
| 96 | if (!converted_frame_buffer) { | 189 | const std::size_t dst = y * aligned_width; |
| 97 | converted_frame_buffer = AVMallocPtr{static_cast<u8*>(av_malloc(linear_size)), av_free}; | 190 | for (std::size_t x = 0; x < frame_width; ++x) { |
| 191 | luma_buffer[dst + x] = luma_src[src + x]; | ||
| 98 | } | 192 | } |
| 99 | const std::array<int, 4> converted_stride{frame->width * 4, frame->height * 4, 0, 0}; | 193 | } |
| 100 | u8* const converted_frame_buf_addr{converted_frame_buffer.get()}; | 194 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), |
| 101 | 195 | luma_buffer.size()); | |
| 102 | sws_scale(scaler_ctx, frame->data, frame->linesize, 0, frame->height, | 196 | |
| 103 | &converted_frame_buf_addr, converted_stride.data()); | 197 | // Chroma |
| 104 | 198 | const std::size_t half_height = frame_height / 2; | |
| 105 | const u32 blk_kind = static_cast<u32>(config.block_linear_kind); | 199 | const auto half_stride = static_cast<size_t>(frame->linesize[1]); |
| 106 | if (blk_kind != 0) { | 200 | |
| 107 | // swizzle pitch linear to block linear | 201 | switch (frame->format) { |
| 108 | const u32 block_height = static_cast<u32>(config.block_linear_height_log2); | 202 | case AV_PIX_FMT_YUV420P: { |
| 109 | const auto size = | 203 | // Frame from FFmpeg software |
| 110 | Tegra::Texture::CalculateSize(true, 4, width, height, 1, block_height, 0); | 204 | // Populate chroma buffer from both channels with interleaving. |
| 111 | luma_buffer.resize(size); | 205 | const std::size_t half_width = frame_width / 2; |
| 112 | Tegra::Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(), | 206 | const u8* chroma_b_src = frame->data[1]; |
| 113 | converted_frame_buffer.get(), block_height, 0, 0); | 207 | const u8* chroma_r_src = frame->data[2]; |
| 114 | 208 | for (std::size_t y = 0; y < half_height; ++y) { | |
| 115 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size); | 209 | const std::size_t src = y * half_stride; |
| 116 | } else { | 210 | const std::size_t dst = y * aligned_width; |
| 117 | // send pitch linear frame | 211 | |
| 118 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr, | 212 | for (std::size_t x = 0; x < half_width; ++x) { |
| 119 | linear_size); | 213 | chroma_buffer[dst + x * 2] = chroma_b_src[src + x]; |
| 214 | chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x]; | ||
| 215 | } | ||
| 120 | } | 216 | } |
| 121 | break; | 217 | break; |
| 122 | } | 218 | } |
| 123 | case VideoPixelFormat::Yuv420: { | 219 | case AV_PIX_FMT_NV12: { |
| 124 | LOG_TRACE(Service_NVDRV, "Writing YUV420 Frame"); | 220 | // Frame from VA-API hardware |
| 125 | 221 | // This is already interleaved so just copy | |
| 126 | const std::size_t surface_width = config.surface_width_minus1 + 1; | 222 | const u8* chroma_src = frame->data[1]; |
| 127 | const std::size_t surface_height = config.surface_height_minus1 + 1; | 223 | for (std::size_t y = 0; y < half_height; ++y) { |
| 128 | const auto frame_width = std::min(surface_width, static_cast<size_t>(frame->width)); | ||
| 129 | const auto frame_height = std::min(surface_height, static_cast<size_t>(frame->height)); | ||
| 130 | const std::size_t aligned_width = (surface_width + 0xff) & ~0xffUL; | ||
| 131 | |||
| 132 | const auto stride = static_cast<size_t>(frame->linesize[0]); | ||
| 133 | |||
| 134 | luma_buffer.resize(aligned_width * surface_height); | ||
| 135 | chroma_buffer.resize(aligned_width * surface_height / 2); | ||
| 136 | |||
| 137 | // Populate luma buffer | ||
| 138 | const u8* luma_src = frame->data[0]; | ||
| 139 | for (std::size_t y = 0; y < frame_height; ++y) { | ||
| 140 | const std::size_t src = y * stride; | 224 | const std::size_t src = y * stride; |
| 141 | const std::size_t dst = y * aligned_width; | 225 | const std::size_t dst = y * aligned_width; |
| 142 | for (std::size_t x = 0; x < frame_width; ++x) { | 226 | for (std::size_t x = 0; x < frame_width; ++x) { |
| 143 | luma_buffer[dst + x] = luma_src[src + x]; | 227 | chroma_buffer[dst + x] = chroma_src[src + x]; |
| 144 | } | ||
| 145 | } | ||
| 146 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), | ||
| 147 | luma_buffer.size()); | ||
| 148 | |||
| 149 | // Chroma | ||
| 150 | const std::size_t half_height = frame_height / 2; | ||
| 151 | const auto half_stride = static_cast<size_t>(frame->linesize[1]); | ||
| 152 | |||
| 153 | switch (frame->format) { | ||
| 154 | case AV_PIX_FMT_YUV420P: { | ||
| 155 | // Frame from FFmpeg software | ||
| 156 | // Populate chroma buffer from both channels with interleaving. | ||
| 157 | const std::size_t half_width = frame_width / 2; | ||
| 158 | const u8* chroma_b_src = frame->data[1]; | ||
| 159 | const u8* chroma_r_src = frame->data[2]; | ||
| 160 | for (std::size_t y = 0; y < half_height; ++y) { | ||
| 161 | const std::size_t src = y * half_stride; | ||
| 162 | const std::size_t dst = y * aligned_width; | ||
| 163 | |||
| 164 | for (std::size_t x = 0; x < half_width; ++x) { | ||
| 165 | chroma_buffer[dst + x * 2] = chroma_b_src[src + x]; | ||
| 166 | chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x]; | ||
| 167 | } | ||
| 168 | } | 228 | } |
| 169 | break; | ||
| 170 | } | ||
| 171 | case AV_PIX_FMT_NV12: { | ||
| 172 | // Frame from VA-API hardware | ||
| 173 | // This is already interleaved so just copy | ||
| 174 | const u8* chroma_src = frame->data[1]; | ||
| 175 | for (std::size_t y = 0; y < half_height; ++y) { | ||
| 176 | const std::size_t src = y * stride; | ||
| 177 | const std::size_t dst = y * aligned_width; | ||
| 178 | for (std::size_t x = 0; x < frame_width; ++x) { | ||
| 179 | chroma_buffer[dst + x] = chroma_src[src + x]; | ||
| 180 | } | ||
| 181 | } | ||
| 182 | break; | ||
| 183 | } | ||
| 184 | default: | ||
| 185 | UNREACHABLE(); | ||
| 186 | break; | ||
| 187 | } | 229 | } |
| 188 | gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(), | ||
| 189 | chroma_buffer.size()); | ||
| 190 | break; | 230 | break; |
| 191 | } | 231 | } |
| 192 | default: | 232 | default: |
| 193 | UNIMPLEMENTED_MSG("Unknown video pixel format {}", config.pixel_format.Value()); | 233 | UNREACHABLE(); |
| 194 | break; | 234 | break; |
| 195 | } | 235 | } |
| 236 | gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(), | ||
| 237 | chroma_buffer.size()); | ||
| 196 | } | 238 | } |
| 197 | 239 | ||
| 198 | } // namespace Tegra | 240 | } // namespace Tegra |
diff --git a/src/video_core/command_classes/vic.h b/src/video_core/command_classes/vic.h index 74246e08c..6d4cdfd57 100644 --- a/src/video_core/command_classes/vic.h +++ b/src/video_core/command_classes/vic.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <vector> | 8 | #include <vector> |
| 9 | #include "common/bit_field.h" | ||
| 10 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 11 | 10 | ||
| 12 | struct SwsContext; | 11 | struct SwsContext; |
| @@ -14,6 +13,7 @@ struct SwsContext; | |||
| 14 | namespace Tegra { | 13 | namespace Tegra { |
| 15 | class GPU; | 14 | class GPU; |
| 16 | class Nvdec; | 15 | class Nvdec; |
| 16 | union VicConfig; | ||
| 17 | 17 | ||
| 18 | class Vic { | 18 | class Vic { |
| 19 | public: | 19 | public: |
| @@ -27,6 +27,7 @@ public: | |||
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | explicit Vic(GPU& gpu, std::shared_ptr<Nvdec> nvdec_processor); | 29 | explicit Vic(GPU& gpu, std::shared_ptr<Nvdec> nvdec_processor); |
| 30 | |||
| 30 | ~Vic(); | 31 | ~Vic(); |
| 31 | 32 | ||
| 32 | /// Write to the device state. | 33 | /// Write to the device state. |
| @@ -35,22 +36,9 @@ public: | |||
| 35 | private: | 36 | private: |
| 36 | void Execute(); | 37 | void Execute(); |
| 37 | 38 | ||
| 38 | enum class VideoPixelFormat : u64_le { | 39 | void WriteRGBFrame(const AVFrame* frame, const VicConfig& config); |
| 39 | RGBA8 = 0x1f, | ||
| 40 | BGRA8 = 0x20, | ||
| 41 | Yuv420 = 0x44, | ||
| 42 | }; | ||
| 43 | 40 | ||
| 44 | union VicConfig { | 41 | void WriteYUVFrame(const AVFrame* frame, const VicConfig& config); |
| 45 | u64_le raw{}; | ||
| 46 | BitField<0, 7, u64_le> pixel_format; | ||
| 47 | BitField<7, 2, u64_le> chroma_loc_horiz; | ||
| 48 | BitField<9, 2, u64_le> chroma_loc_vert; | ||
| 49 | BitField<11, 4, u64_le> block_linear_kind; | ||
| 50 | BitField<15, 4, u64_le> block_linear_height_log2; | ||
| 51 | BitField<32, 14, u64_le> surface_width_minus1; | ||
| 52 | BitField<46, 14, u64_le> surface_height_minus1; | ||
| 53 | }; | ||
| 54 | 42 | ||
| 55 | GPU& gpu; | 43 | GPU& gpu; |
| 56 | std::shared_ptr<Tegra::Nvdec> nvdec_processor; | 44 | std::shared_ptr<Tegra::Nvdec> nvdec_processor; |
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index da328d904..f31f86339 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -1837,7 +1837,7 @@ void PlayerControlPreview::DrawLeftBody(QPainter& p, const QPointF center) { | |||
| 1837 | const float led_size = 5.0f; | 1837 | const float led_size = 5.0f; |
| 1838 | const QPointF led_position = sideview_center + QPointF(0, -36); | 1838 | const QPointF led_position = sideview_center + QPointF(0, -36); |
| 1839 | int led_count = 0; | 1839 | int led_count = 0; |
| 1840 | for (const auto color : led_color) { | 1840 | for (const auto& color : led_color) { |
| 1841 | p.setBrush(color); | 1841 | p.setBrush(color); |
| 1842 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); | 1842 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); |
| 1843 | } | 1843 | } |
| @@ -1933,7 +1933,7 @@ void PlayerControlPreview::DrawRightBody(QPainter& p, const QPointF center) { | |||
| 1933 | const float led_size = 5.0f; | 1933 | const float led_size = 5.0f; |
| 1934 | const QPointF led_position = sideview_center + QPointF(0, -36); | 1934 | const QPointF led_position = sideview_center + QPointF(0, -36); |
| 1935 | int led_count = 0; | 1935 | int led_count = 0; |
| 1936 | for (const auto color : led_color) { | 1936 | for (const auto& color : led_color) { |
| 1937 | p.setBrush(color); | 1937 | p.setBrush(color); |
| 1938 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); | 1938 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); |
| 1939 | } | 1939 | } |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 99a5df241..24a67ad46 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include "common/assert.h" | 12 | #include "common/assert.h" |
| 13 | #include "common/settings.h" | 13 | #include "common/settings.h" |
| 14 | #include "core/core.h" | 14 | #include "core/core.h" |
| 15 | #include "core/hle/service/time/time.h" | 15 | #include "core/hle/service/time/time_manager.h" |
| 16 | #include "ui_configure_system.h" | 16 | #include "ui_configure_system.h" |
| 17 | #include "yuzu/configuration/configuration_shared.h" | 17 | #include "yuzu/configuration/configuration_shared.h" |
| 18 | #include "yuzu/configuration/configure_system.h" | 18 | #include "yuzu/configuration/configure_system.h" |
diff --git a/src/yuzu/configuration/configure_tas.ui b/src/yuzu/configuration/configure_tas.ui index 3972f9083..6caa19031 100644 --- a/src/yuzu/configuration/configure_tas.ui +++ b/src/yuzu/configuration/configure_tas.ui | |||
| @@ -2,14 +2,6 @@ | |||
| 2 | <ui version="4.0"> | 2 | <ui version="4.0"> |
| 3 | <class>ConfigureTas</class> | 3 | <class>ConfigureTas</class> |
| 4 | <widget class="QDialog" name="ConfigureTas"> | 4 | <widget class="QDialog" name="ConfigureTas"> |
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>337</width> | ||
| 10 | <height>316</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <layout class="QVBoxLayout" name="verticalLayout_1"> | 5 | <layout class="QVBoxLayout" name="verticalLayout_1"> |
| 14 | <item> | 6 | <item> |
| 15 | <layout class="QHBoxLayout" name="horizontalLayout_1"> | 7 | <layout class="QHBoxLayout" name="horizontalLayout_1"> |
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp index 7a6f84d96..33110685a 100644 --- a/src/yuzu/debugger/profiler.cpp +++ b/src/yuzu/debugger/profiler.cpp | |||
| @@ -143,24 +143,28 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) { | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { | 145 | void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { |
| 146 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 146 | const auto mouse_position = ev->pos(); |
| 147 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 147 | ev->accept(); | 148 | ev->accept(); |
| 148 | } | 149 | } |
| 149 | 150 | ||
| 150 | void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { | 151 | void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { |
| 151 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 152 | const auto mouse_position = ev->pos(); |
| 153 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 152 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); | 154 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); |
| 153 | ev->accept(); | 155 | ev->accept(); |
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { | 158 | void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { |
| 157 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 159 | const auto mouse_position = ev->pos(); |
| 160 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 158 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); | 161 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); |
| 159 | ev->accept(); | 162 | ev->accept(); |
| 160 | } | 163 | } |
| 161 | 164 | ||
| 162 | void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { | 165 | void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { |
| 163 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, | 166 | const auto wheel_position = ev->position().toPoint(); |
| 167 | MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale, | ||
| 164 | ev->angleDelta().y() / 120); | 168 | ev->angleDelta().y() / 120); |
| 165 | ev->accept(); | 169 | ev->accept(); |
| 166 | } | 170 | } |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index f9d949e75..ba54423ff 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -159,8 +159,7 @@ GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} { | |||
| 159 | * @return true if the haystack contains all words of userinput | 159 | * @return true if the haystack contains all words of userinput |
| 160 | */ | 160 | */ |
| 161 | static bool ContainsAllWords(const QString& haystack, const QString& userinput) { | 161 | static bool ContainsAllWords(const QString& haystack, const QString& userinput) { |
| 162 | const QStringList userinput_split = | 162 | const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts); |
| 163 | userinput.split(QLatin1Char{' '}, QString::SplitBehavior::SkipEmptyParts); | ||
| 164 | 163 | ||
| 165 | return std::all_of(userinput_split.begin(), userinput_split.end(), | 164 | return std::all_of(userinput_split.begin(), userinput_split.end(), |
| 166 | [&haystack](const QString& s) { return haystack.contains(s); }); | 165 | [&haystack](const QString& s) { return haystack.contains(s); }); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 552c2cc63..3eea61354 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1172,10 +1172,16 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 1172 | &GMainWindow::OnDisplayTitleBars); | 1172 | &GMainWindow::OnDisplayTitleBars); |
| 1173 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); | 1173 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); |
| 1174 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); | 1174 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); |
| 1175 | |||
| 1175 | connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this, | 1176 | connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this, |
| 1176 | &GMainWindow::ResetWindowSize720); | 1177 | &GMainWindow::ResetWindowSize720); |
| 1178 | connect(ui.action_Reset_Window_Size_900, &QAction::triggered, this, | ||
| 1179 | &GMainWindow::ResetWindowSize900); | ||
| 1177 | connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this, | 1180 | connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this, |
| 1178 | &GMainWindow::ResetWindowSize1080); | 1181 | &GMainWindow::ResetWindowSize1080); |
| 1182 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_720); | ||
| 1183 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_900); | ||
| 1184 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_1080); | ||
| 1179 | 1185 | ||
| 1180 | // Fullscreen | 1186 | // Fullscreen |
| 1181 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); | 1187 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); |
| @@ -2621,32 +2627,29 @@ void GMainWindow::ToggleWindowMode() { | |||
| 2621 | } | 2627 | } |
| 2622 | } | 2628 | } |
| 2623 | 2629 | ||
| 2624 | void GMainWindow::ResetWindowSize720() { | 2630 | void GMainWindow::ResetWindowSize(u32 width, u32 height) { |
| 2625 | const auto aspect_ratio = Layout::EmulationAspectRatio( | 2631 | const auto aspect_ratio = Layout::EmulationAspectRatio( |
| 2626 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), | 2632 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), |
| 2627 | static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width); | 2633 | static_cast<float>(height) / width); |
| 2628 | if (!ui.action_Single_Window_Mode->isChecked()) { | 2634 | if (!ui.action_Single_Window_Mode->isChecked()) { |
| 2629 | render_window->resize(Layout::ScreenUndocked::Height / aspect_ratio, | 2635 | render_window->resize(height / aspect_ratio, height); |
| 2630 | Layout::ScreenUndocked::Height); | ||
| 2631 | } else { | 2636 | } else { |
| 2632 | resize(Layout::ScreenUndocked::Height / aspect_ratio, | 2637 | const bool show_status_bar = ui.action_Show_Status_Bar->isChecked(); |
| 2633 | Layout::ScreenUndocked::Height + menuBar()->height() + | 2638 | const auto status_bar_height = show_status_bar ? statusBar()->height() : 0; |
| 2634 | (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); | 2639 | resize(height / aspect_ratio, height + menuBar()->height() + status_bar_height); |
| 2635 | } | 2640 | } |
| 2636 | } | 2641 | } |
| 2637 | 2642 | ||
| 2643 | void GMainWindow::ResetWindowSize720() { | ||
| 2644 | ResetWindowSize(Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height); | ||
| 2645 | } | ||
| 2646 | |||
| 2647 | void GMainWindow::ResetWindowSize900() { | ||
| 2648 | ResetWindowSize(1600U, 900U); | ||
| 2649 | } | ||
| 2650 | |||
| 2638 | void GMainWindow::ResetWindowSize1080() { | 2651 | void GMainWindow::ResetWindowSize1080() { |
| 2639 | const auto aspect_ratio = Layout::EmulationAspectRatio( | 2652 | ResetWindowSize(Layout::ScreenDocked::Width, Layout::ScreenDocked::Height); |
| 2640 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), | ||
| 2641 | static_cast<float>(Layout::ScreenDocked::Height) / Layout::ScreenDocked::Width); | ||
| 2642 | if (!ui.action_Single_Window_Mode->isChecked()) { | ||
| 2643 | render_window->resize(Layout::ScreenDocked::Height / aspect_ratio, | ||
| 2644 | Layout::ScreenDocked::Height); | ||
| 2645 | } else { | ||
| 2646 | resize(Layout::ScreenDocked::Height / aspect_ratio, | ||
| 2647 | Layout::ScreenDocked::Height + menuBar()->height() + | ||
| 2648 | (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); | ||
| 2649 | } | ||
| 2650 | } | 2653 | } |
| 2651 | 2654 | ||
| 2652 | void GMainWindow::OnConfigure() { | 2655 | void GMainWindow::OnConfigure() { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 60ce01471..5df2c9422 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -272,7 +272,9 @@ private slots: | |||
| 272 | void ShowFullscreen(); | 272 | void ShowFullscreen(); |
| 273 | void HideFullscreen(); | 273 | void HideFullscreen(); |
| 274 | void ToggleWindowMode(); | 274 | void ToggleWindowMode(); |
| 275 | void ResetWindowSize(u32 width, u32 height); | ||
| 275 | void ResetWindowSize720(); | 276 | void ResetWindowSize720(); |
| 277 | void ResetWindowSize900(); | ||
| 276 | void ResetWindowSize1080(); | 278 | void ResetWindowSize1080(); |
| 277 | void OnCaptureScreenshot(); | 279 | void OnCaptureScreenshot(); |
| 278 | void OnCoreError(Core::System::ResultStatus, std::string); | 280 | void OnCoreError(Core::System::ResultStatus, std::string); |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 653c010d8..a62e39a06 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -78,6 +78,35 @@ | |||
| 78 | <property name="title"> | 78 | <property name="title"> |
| 79 | <string>&View</string> | 79 | <string>&View</string> |
| 80 | </property> | 80 | </property> |
| 81 | <widget class="QMenu" name="menu_Reset_Window_Size"> | ||
| 82 | <property name="title"> | ||
| 83 | <string>&Reset Window Size</string> | ||
| 84 | </property> | ||
| 85 | </widget> | ||
| 86 | <action name="action_Reset_Window_Size_720"> | ||
| 87 | <property name="text"> | ||
| 88 | <string>Reset Window Size to &720p</string> | ||
| 89 | </property> | ||
| 90 | <property name="iconText"> | ||
| 91 | <string>Reset Window Size to 720p</string> | ||
| 92 | </property> | ||
| 93 | </action> | ||
| 94 | <action name="action_Reset_Window_Size_900"> | ||
| 95 | <property name="text"> | ||
| 96 | <string>Reset Window Size to &900p</string> | ||
| 97 | </property> | ||
| 98 | <property name="iconText"> | ||
| 99 | <string>Reset Window Size to 900p</string> | ||
| 100 | </property> | ||
| 101 | </action> | ||
| 102 | <action name="action_Reset_Window_Size_1080"> | ||
| 103 | <property name="text"> | ||
| 104 | <string>Reset Window Size to &1080p</string> | ||
| 105 | </property> | ||
| 106 | <property name="iconText"> | ||
| 107 | <string>Reset Window Size to 1080p</string> | ||
| 108 | </property> | ||
| 109 | </action> | ||
| 81 | <widget class="QMenu" name="menu_View_Debugging"> | 110 | <widget class="QMenu" name="menu_View_Debugging"> |
| 82 | <property name="title"> | 111 | <property name="title"> |
| 83 | <string>&Debugging</string> | 112 | <string>&Debugging</string> |
| @@ -88,9 +117,8 @@ | |||
| 88 | <addaction name="action_Display_Dock_Widget_Headers"/> | 117 | <addaction name="action_Display_Dock_Widget_Headers"/> |
| 89 | <addaction name="action_Show_Filter_Bar"/> | 118 | <addaction name="action_Show_Filter_Bar"/> |
| 90 | <addaction name="action_Show_Status_Bar"/> | 119 | <addaction name="action_Show_Status_Bar"/> |
| 91 | <addaction name="action_Reset_Window_Size_720"/> | ||
| 92 | <addaction name="action_Reset_Window_Size_1080"/> | ||
| 93 | <addaction name="separator"/> | 120 | <addaction name="separator"/> |
| 121 | <addaction name="menu_Reset_Window_Size"/> | ||
| 94 | <addaction name="menu_View_Debugging"/> | 122 | <addaction name="menu_View_Debugging"/> |
| 95 | </widget> | 123 | </widget> |
| 96 | <widget class="QMenu" name="menu_Tools"> | 124 | <widget class="QMenu" name="menu_Tools"> |
| @@ -216,22 +244,6 @@ | |||
| 216 | <string>Show Status Bar</string> | 244 | <string>Show Status Bar</string> |
| 217 | </property> | 245 | </property> |
| 218 | </action> | 246 | </action> |
| 219 | <action name="action_Reset_Window_Size_720"> | ||
| 220 | <property name="text"> | ||
| 221 | <string>Reset Window Size to &720p</string> | ||
| 222 | </property> | ||
| 223 | <property name="iconText"> | ||
| 224 | <string>Reset Window Size to 720p</string> | ||
| 225 | </property> | ||
| 226 | </action> | ||
| 227 | <action name="action_Reset_Window_Size_1080"> | ||
| 228 | <property name="text"> | ||
| 229 | <string>Reset Window Size to &1080p</string> | ||
| 230 | </property> | ||
| 231 | <property name="iconText"> | ||
| 232 | <string>Reset Window Size to 1080p</string> | ||
| 233 | </property> | ||
| 234 | </action> | ||
| 235 | <action name="action_Fullscreen"> | 247 | <action name="action_Fullscreen"> |
| 236 | <property name="checkable"> | 248 | <property name="checkable"> |
| 237 | <bool>true</bool> | 249 | <bool>true</bool> |