Compare commits
9 Commits
2024-07-02
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff8ac03129 | ||
|
|
47d0fa312b | ||
|
|
db2f9edd53 | ||
|
|
c8937268ea | ||
|
|
06b39ecfd9 | ||
|
|
72675e3886 | ||
|
|
63f808b365 | ||
|
|
e40391eedd | ||
|
|
6210feba12 |
@@ -1,328 +0,0 @@
|
||||
sudo bwrap --bind . / --ro-bind / /host --dev-bind /run /run --dev-bind /dev /dev --proc /proc --dev-bind /sys /sys --ro-bind /etc/resolv.conf /etc/resolv.conf --setenv PATH '/sbin:/bin:/usr/sbin:/usr/bin' --setenv HOME /root /bin/ash
|
||||
|
||||
apk add git gcc g++ yasm glslang cmake samurai make patch openssl-dev autoconf automake libtool libudev-zero-dev qt5-qtbase-dev qt5-qtmultimedia-dev glslang glslang-static libintl pulseaudio-dev alsa-lib-dev sndio-dev libxkbcommon-dev libunwind-dev ffmpeg-dev
|
||||
|
||||
ln -s /usr/lib /usr/lib64
|
||||
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DYUZU_USE_CPM=ON -DYUZU_TESTS=OFF -DENABLE_QT_TRANSLATION=OFF -DTZ_LINK_INTL=ON -GNinja
|
||||
|
||||
|
||||
|
||||
|
||||
apk add linux-headers git gcc g++ cmake meson samurai make patch autoconf automake libtool pkgconf python3 gettext bison flex xrandr-dev xtrans util-macros gperf gettext-dev elfutils-dev
|
||||
|
||||
mkdir /static
|
||||
mkdir /static/lib
|
||||
ln -s /static/lib /static/lib64
|
||||
mkdir /static/share
|
||||
mkdir /static/lib/pkgconfig
|
||||
ln -s /static/lib/pkgconfig /static/share/pkgconfig
|
||||
|
||||
python3 -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install mako packaging PyYAML
|
||||
|
||||
export PREFIX=/static
|
||||
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
|
||||
export PATH="$PREFIX/bin:$PATH"
|
||||
|
||||
git clone https://git.tukaani.org/xz.git --depth 1 --recursive
|
||||
cd xz
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/madler/zlib.git -b v1.3.1
|
||||
cd zlib
|
||||
prefix="$PREFIX" ./configure
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/facebook/zstd.git --depth 1 --recursive -b v1.5.7
|
||||
cd zstd
|
||||
mkdir cmakebuild
|
||||
cd cmakebuild
|
||||
cmake ../build/cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=OFF -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_TESTS=OFF -G Ninja
|
||||
ninja install
|
||||
cd ..
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/openssl/openssl.git --depth 1 --recursive -b openssl-3.5.0
|
||||
cd openssl
|
||||
./Configure --prefix="$PREFIX" --openssldir="$PREFIX/ssl" --static -static
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/illiliti/libudev-zero.git --depth 1 --recursive -b 1.0.3
|
||||
cd libudev-zero
|
||||
make -j$(nproc) PREFIX="$PREFIX" install
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/llvm/llvm-project.git --depth 1 --recursive -b llvmorg-20.1.7
|
||||
cd llvm-project
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=OFF -DLLVM_ENABLE_PROJECTS="clang;lld;libclc" -DLLVM_TARGETS_TO_BUILD=all -DLLVM_ENABLE_RUNTIMES="" -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_OPTIMIZED_TABLEGEN=ON -DBUILD_SHARED_LIBS=OFF -DCLANG_ENABLE_HLSL=ON -DCLANG_ENABLE_ARCMT=OFF -DCLANG_ENABLE_STATIC_ANALYZER=OFF -G Ninja
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libpciaccess.git --depth 1 --recursive -b libpciaccess-0.18.1
|
||||
cd libpciaccess
|
||||
meson setup build --prefix "$PREFIX" -Ddefault_library=static
|
||||
cd build
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/mesa/libdrm.git --depth 1 --recursive -b libdrm-2.4.125
|
||||
cd libdrm
|
||||
meson setup build --prefix "$PREFIX" -Ddefault_library=static
|
||||
cd build
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
git clone https://github.com/KhronosGroup/SPIRV-Headers.git --depth 1 --recursive -b vulkan-sdk-1.4.313.0
|
||||
cd SPIRV-Headers
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=OFF -DSPIRV_HEADERS_ENABLE_TESTS=OFF -DSPIRV_HEADERS_ENABLE_INSTALL=ON -G Ninja
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.git --depth 1 --recursive -b v20.1.3
|
||||
cd SPIRV-LLVM-Translator
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=OFF -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=$PREFIX/include/spirv/ -G Ninja
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
git clone https://github.com/KhronosGroup/SPIRV-Tools.git --depth 1 --recursive -b v2025.1
|
||||
cd SPIRV-Tools
|
||||
ln -s /root/SPIRV-Headers external/spirv-headers
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PREFIX" -DBUILD_SHARED_LIBS=OFF -DENABLE_SPIRV_TOOLS_INSTALL=ON -G Ninja
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
wget https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-1.17.0.tar.gz
|
||||
tar xfv xcb-proto-*.tar.gz
|
||||
cd xcb-proto-*/
|
||||
./configure --prefix="$PREFIX"
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/util/macros.git --depth 1 --recursive -b util-macros-1.20.2
|
||||
cd macros
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX"
|
||||
make install
|
||||
cd ..
|
||||
|
||||
wget https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2024.1.tar.xz
|
||||
tar xfv xorgproto-*.tar.xz
|
||||
cd xorgproto-*/
|
||||
./configure --prefix="$PREFIX"
|
||||
make install
|
||||
cd ..
|
||||
|
||||
wget https://www.x.org/pub/individual/lib/libXau-1.0.12.tar.xz
|
||||
tar xfv libXau-*.tar.xz
|
||||
cd libXau-*/
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
wget https://xorg.freedesktop.org/archive/individual/lib/libxcb-1.17.0.tar.gz
|
||||
tar xfv libxcb-*.tar.gz
|
||||
cd libxcb-*/
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes --enable-dri3
|
||||
make $(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libx11.git --depth 1 --recursive -b libX11-1.8.12
|
||||
cd libx11
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxrender.git --depth 1 --recursive -b libXrender-0.9.12
|
||||
cd libxrender
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxcb-util.git --depth 1 --recursive -b xcb-util-0.4.1-gitlab
|
||||
cd libxcb-util
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms.git --depth 1 --recursive -b xcb-util-keysyms-0.4.1
|
||||
cd libxcb-keysyms
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxcb-image.git --depth 1 --recursive -b xcb-util-image-0.4.1-gitlab
|
||||
cd libxcb-image
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/alanc/libxcb-render-util.git --depth 1 --recursive -b xcb-util-renderutil-0.3.10
|
||||
cd libxcb-render-util
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxext.git --depth 1 --recursive -b libXext-1.3.6
|
||||
cd libxext
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxfixes.git --depth 1 --recursive -b libXfixes-6.0.1
|
||||
cd libxfixes
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxshmfence.git --depth 1 --recursive -b libxshmfence-1.3.3
|
||||
cd libxshmfence
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxrandr.git --depth 1 --recursive -b libXrandr-1.5.4
|
||||
cd libxrandr
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxxf86vm.git --depth 1 --recursive -b libXxf86vm-1.1.6
|
||||
cd libxxf86vm
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libxcb-wm.git --depth 1 --recursive -b xcb-util-wm-0.4.2
|
||||
cd libxcb-wm
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/freetype/freetype.git --depth 1 --recursive -b VER-2-13-3
|
||||
cd freetype
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libice.git --depth 1 --recursive -b libICE-1.1.2
|
||||
cd libice
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/lib/libsm.git --depth 1 --recursive -b libSM-1.2.6
|
||||
cd libsm
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/fontconfig/fontconfig.git --depth 1 --recursive -b 2.16.2
|
||||
cd fontconfig
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/xkbcommon/libxkbcommon.git --depth 1 --recursive -b xkbcommon-1.10.0
|
||||
cd libxkbcommon
|
||||
meson setup build --prefix "$PREFIX" -Ddefault_library=static -Denable-xkbregistry=false -Denable-wayland=false -Denable-tools=false -Dc_link_args="$PREFIX/lib/libXau.a"
|
||||
cd build
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/mesa/mesa.git --depth 1 --recursive -b mesa-25.1.3
|
||||
cd mesa
|
||||
meson setup build -Dvulkan-drivers= -Dgallium-drivers=nouveau,r300,r600,radeonsi,zink -Dplatforms=x11 -Degl-native-platform=x11 -Dstatic-libclc=all -Dcpp_rtti=false
|
||||
cd build
|
||||
ninja install
|
||||
cd ../..
|
||||
|
||||
git clone https://git.ffmpeg.org/ffmpeg.git --depth 1 --recursive -b n7.1.1
|
||||
cd ffmpeg
|
||||
./configure --prefix="$PREFIX" --enable-gpl --disable-programs --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/libusb/libusb.git --depth 1 --recursive
|
||||
cd libusb
|
||||
./autogen.sh
|
||||
./configure --prefix="$PREFIX" --enable-shared=no --enable-static=yes
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
wget https://download.qt.io/official_releases/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz
|
||||
tar xfv qt-everywhere-src-*.tar.xz
|
||||
cd qt-everywhere-src-*/
|
||||
./configure -prefix "$PREFIX" -static -release -opensource -confirm-license -qt-zlib -qt-libpng -qt-webp -qt-libjpeg -qt-freetype -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtsensors -skip qtspeech -skip qtwayland -skip qtwebglplugin -skip qtwebview -skip webengine -make libs -nomake examples -nomake tests
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
|
||||
find /static -name \*.so -exec rm -vf {} \;
|
||||
|
||||
cd torzu
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DYUZU_USE_CPM=ON -DYUZU_TESTS=OFF -DENABLE_QT=OFF -DTZ_LINK_INTL=ON -G Ninja
|
||||
ninja yuzu
|
||||
cd ../..
|
||||
|
||||
# /root/llvm-project/llvm/tools/llvm-config/llvm-config.cpp
|
||||
# : replace all LinkMode = LinkModeShared with LinkMode = LinkModeStatic
|
||||
|
||||
# /root/qt-everywhere-src-5.15.2/qtbase/include/QtCore/../../src/corelib/global/qfloat16.h
|
||||
# /root/qt-everywhere-src-5.15.2/qtbase/src/corelib/text/qbytearraymatcher.h
|
||||
# : add <limits> #include
|
||||
23
README.md
23
README.md
@@ -21,16 +21,6 @@ It is written in C++ with portability in mind and runs on Linux, Windows and And
|
||||
A lot of fake Torzu websites have popped up. These are not mine. **This project will not have a clearnet website for the foreseeable future!**
|
||||
I highly advice against downloading anything from these websites, specially if their intention is clearly to make money through advertisements.
|
||||
|
||||
## Infrastructure back up online
|
||||
|
||||
There have been issues with the infrastructure running the main repository while I've been away from home. It should be all back and functional now!
|
||||
Sorry for that!
|
||||
|
||||
## IRC chat
|
||||
|
||||
There's an IRC! Connect to `mao7u6s7jwxeof2fax2kwwqeabyevy5b2icbl24lhgnmkebbtmh37had.onion` port `6667` using your favorite client and join `#torzu`. Connecting via Tor might require a bit of setup but that shouldn't take much more than a quick web search to figure out.
|
||||
Please **register your nicks**!
|
||||
|
||||
## Compatibility
|
||||
|
||||
The emulator is capable of running most commercial games at full speed, provided you meet the [necessary hardware requirements](http://web.archive.org/web/20240130133811/https://yuzu-emu.org/help/quickstart/#hardware-requirements).
|
||||
@@ -39,11 +29,12 @@ It runs most Nintendo Switch games released until the date of the Yuzu takedown.
|
||||
|
||||
## 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.
|
||||
**Consider this project in feature freeze!** This means no new features are going to be added. All further updates are going to be focused on maintaining compatibility with modern systems.
|
||||
|
||||
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).
|
||||
I think this project has done a really good job with keeping regressions from Yuzu to the minimum. If a game runs on Yuzu, and on the current version of Torzu, it's extremely likely that it works just as well on all future versions of Torzu.
|
||||
|
||||
Regardless, I am very happy with how things are right now.
|
||||
If you're looking for a Yuzu fork that definitely runs the games the original Yuzu emulator did well without any regressions, Torzu is probably your best bet for now.
|
||||
|
||||
## Development
|
||||
|
||||
@@ -69,10 +60,6 @@ Note that above repository may be taken down any time. Do not rely on its existe
|
||||
|
||||
This project incorporates several commits from the [Suyu](https://suyu.dev), [Sudachi](https://github.com/sudachi-emu/sudachi) and [Citron](https://github.com/ong19th/Citron) forks, as well as changes listed in **Changes**.
|
||||
|
||||
## Move away from Codeberg
|
||||
|
||||
As requested by Codeberg staff, **I have removed the Codeberg mirror repository**. [The new mirror repository is on NotABug](https://notabug.org/litucks/torzu).
|
||||
|
||||
## Building
|
||||
<!-- -->
|
||||
* [Android Build](http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/src/branch/master/build-for-android.md) (NotABug [alt](https://notabug.org/litucks/torzu/src/master/build-for-android.md))
|
||||
|
||||
2
externals/CMakeLists.txt
vendored
2
externals/CMakeLists.txt
vendored
@@ -158,7 +158,7 @@ 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()
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -148,7 +151,7 @@ Result OpusDecoder::DecodeInterleavedForMultiStream(u32* out_data_size, u64* out
|
||||
auto* header_p{reinterpret_cast<const OpusPacketHeader*>(input_data.data())};
|
||||
OpusPacketHeader header{ReverseHeader(*header_p)};
|
||||
|
||||
LOG_TRACE(Service_Audio, "header size 0x{:X} input data size 0x{:X} in_data size 0x{:X}",
|
||||
LOG_TRACE(Service_Audio, "header size {:#X} input data size 0x{:X} in_data size 0x{:X}",
|
||||
header.size, input_data.size_bytes(), in_data.size_bytes());
|
||||
|
||||
R_UNLESS(in_data.size_bytes() >= header.size &&
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
void InterpreterFallback(u32 pc, std::size_t num_instructions) override {
|
||||
m_parent.LogBacktrace(m_process);
|
||||
LOG_ERROR(Core_ARM,
|
||||
"Unimplemented instruction @ 0x{:X} for {} instructions (instr = {:08X})", pc,
|
||||
"Unimplemented instruction @ {:#X} for {} instructions (instr = {:08X})", pc,
|
||||
num_instructions, m_memory.Read32(pc));
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
void InterpreterFallback(u64 pc, std::size_t num_instructions) override {
|
||||
m_parent.LogBacktrace(m_process);
|
||||
LOG_ERROR(Core_ARM,
|
||||
"Unimplemented instruction @ 0x{:X} for {} instructions (instr = {:08X})", pc,
|
||||
"Unimplemented instruction @ {:#X} for {} instructions (instr = {:08X})", pc,
|
||||
num_instructions, m_memory.Read32(pc));
|
||||
ReturnException(pc, PrefetchAbort);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -180,7 +183,7 @@ void ProgramMetadata::Print() const {
|
||||
LOG_DEBUG(Service_FS, "Magic: {:.4}", npdm_header.magic.data());
|
||||
LOG_DEBUG(Service_FS, "Main thread priority: 0x{:02X}", npdm_header.main_thread_priority);
|
||||
LOG_DEBUG(Service_FS, "Main thread core: {}", npdm_header.main_thread_cpu);
|
||||
LOG_DEBUG(Service_FS, "Main thread stack size: 0x{:X} bytes", npdm_header.main_stack_size);
|
||||
LOG_DEBUG(Service_FS, "Main thread stack size: {:#X} bytes", npdm_header.main_stack_size);
|
||||
LOG_DEBUG(Service_FS, "Process category: {}", npdm_header.process_category);
|
||||
LOG_DEBUG(Service_FS, "Flags: 0x{:02X}", npdm_header.flags);
|
||||
LOG_DEBUG(Service_FS, " > 64-bit instructions: {}",
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -40,7 +43,7 @@ constexpr bool IsValidArbitrationType(Svc::ArbitrationType type) {
|
||||
// Wait for an address (via Address Arbiter)
|
||||
Result WaitForAddress(Core::System& system, u64 address, ArbitrationType arb_type, s32 value,
|
||||
s64 timeout_ns) {
|
||||
LOG_TRACE(Kernel_SVC, "called, address=0x{:X}, arb_type=0x{:X}, value=0x{:X}, timeout_ns={}",
|
||||
LOG_TRACE(Kernel_SVC, "called, address={:#X}, arb_type=0x{:X}, value=0x{:X}, timeout_ns={}",
|
||||
address, arb_type, value, timeout_ns);
|
||||
|
||||
// Validate input.
|
||||
@@ -71,7 +74,7 @@ Result WaitForAddress(Core::System& system, u64 address, ArbitrationType arb_typ
|
||||
// Signals to an address (via Address Arbiter)
|
||||
Result SignalToAddress(Core::System& system, u64 address, SignalType signal_type, s32 value,
|
||||
s32 count) {
|
||||
LOG_TRACE(Kernel_SVC, "called, address=0x{:X}, signal_type=0x{:X}, value=0x{:X}, count=0x{:X}",
|
||||
LOG_TRACE(Kernel_SVC, "called, address={:#X}, signal_type=0x{:X}, value=0x{:X}, count=0x{:X}",
|
||||
address, signal_type, value, count);
|
||||
|
||||
// Validate input.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -30,7 +33,7 @@ constexpr bool IsValidUnmapFromOwnerCodeMemoryPermission(MemoryPermission perm)
|
||||
} // namespace
|
||||
|
||||
Result CreateCodeMemory(Core::System& system, Handle* out, u64 address, uint64_t size) {
|
||||
LOG_TRACE(Kernel_SVC, "called, address=0x{:X}, size=0x{:X}", address, size);
|
||||
LOG_TRACE(Kernel_SVC, "called, address={:#X}, size=0x{:X}", address, size);
|
||||
|
||||
// Get kernel instance.
|
||||
auto& kernel = system.Kernel();
|
||||
@@ -70,8 +73,8 @@ Result ControlCodeMemory(Core::System& system, Handle code_memory_handle,
|
||||
MemoryPermission perm) {
|
||||
|
||||
LOG_TRACE(Kernel_SVC,
|
||||
"called, code_memory_handle=0x{:X}, operation=0x{:X}, address=0x{:X}, size=0x{:X}, "
|
||||
"permission=0x{:X}",
|
||||
"called, code_memory_handle={:#X}, operation=0x{:X}, address=0x{:X}, size=0x{:X}, "
|
||||
"permission={:#X}",
|
||||
code_memory_handle, operation, address, size, perm);
|
||||
|
||||
// Validate the address / size.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -45,7 +48,7 @@ Result WaitProcessWideKeyAtomic(Core::System& system, u64 address, u64 cv_key, u
|
||||
|
||||
/// Signal process wide key
|
||||
void SignalProcessWideKey(Core::System& system, u64 cv_key, s32 count) {
|
||||
LOG_TRACE(Kernel_SVC, "called, cv_key=0x{:X}, count=0x{:08X}", cv_key, count);
|
||||
LOG_TRACE(Kernel_SVC, "called, cv_key={:#X}, count=0x{:08X}", cv_key, count);
|
||||
|
||||
// Signal the condition variable.
|
||||
return GetCurrentProcess(system.Kernel())
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Kernel::Svc {
|
||||
/// Gets system/memory information for the current process
|
||||
Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle handle,
|
||||
u64 info_sub_id) {
|
||||
LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}",
|
||||
LOG_TRACE(Kernel_SVC, "called info_id={:#X}, info_sub_id=0x{:X}, handle=0x{:08X}",
|
||||
info_id_type, info_sub_id, handle);
|
||||
|
||||
u32 info_id = static_cast<u32>(info_id_type);
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -10,7 +13,7 @@ namespace Kernel::Svc {
|
||||
|
||||
/// Attempts to locks a mutex
|
||||
Result ArbitrateLock(Core::System& system, Handle thread_handle, u64 address, u32 tag) {
|
||||
LOG_TRACE(Kernel_SVC, "called thread_handle=0x{:08X}, address=0x{:X}, tag=0x{:08X}",
|
||||
LOG_TRACE(Kernel_SVC, "called thread_handle=0x{:08X}, address={:#X}, tag=0x{:08X}",
|
||||
thread_handle, address, tag);
|
||||
|
||||
// Validate the input address.
|
||||
@@ -22,7 +25,7 @@ Result ArbitrateLock(Core::System& system, Handle thread_handle, u64 address, u3
|
||||
|
||||
/// Unlock a mutex
|
||||
Result ArbitrateUnlock(Core::System& system, u64 address) {
|
||||
LOG_TRACE(Kernel_SVC, "called address=0x{:X}", address);
|
||||
LOG_TRACE(Kernel_SVC, "called address={:#X}", address);
|
||||
|
||||
// Validate the input address.
|
||||
R_UNLESS(!IsKernelAddress(address), ResultInvalidCurrentMemory);
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -77,7 +80,7 @@ Result MapUnmapMemorySanityChecks(const KProcessPageTable& manager, u64 dst_addr
|
||||
} // namespace
|
||||
|
||||
Result SetMemoryPermission(Core::System& system, u64 address, u64 size, MemoryPermission perm) {
|
||||
LOG_DEBUG(Kernel_SVC, "called, address=0x{:016X}, size=0x{:X}, perm=0x{:08X}", address, size,
|
||||
LOG_DEBUG(Kernel_SVC, "called, address=0x{:016X}, size={:#X}, perm=0x{:08X}", address, size,
|
||||
perm);
|
||||
|
||||
// Validate address / size.
|
||||
@@ -99,7 +102,7 @@ Result SetMemoryPermission(Core::System& system, u64 address, u64 size, MemoryPe
|
||||
|
||||
Result SetMemoryAttribute(Core::System& system, u64 address, u64 size, u32 mask, u32 attr) {
|
||||
LOG_DEBUG(Kernel_SVC,
|
||||
"called, address=0x{:016X}, size=0x{:X}, mask=0x{:08X}, attribute=0x{:08X}", address,
|
||||
"called, address=0x{:016X}, size={:#X}, mask=0x{:08X}, attribute=0x{:08X}", address,
|
||||
size, mask, attr);
|
||||
|
||||
// Validate address / size.
|
||||
@@ -130,7 +133,7 @@ Result SetMemoryAttribute(Core::System& system, u64 address, u64 size, u32 mask,
|
||||
|
||||
/// Maps a memory range into a different range.
|
||||
Result MapMemory(Core::System& system, u64 dst_addr, u64 src_addr, u64 size) {
|
||||
LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
|
||||
LOG_TRACE(Kernel_SVC, "called, dst_addr={:#X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
|
||||
src_addr, size);
|
||||
|
||||
auto& page_table{GetCurrentProcess(system.Kernel()).GetPageTable()};
|
||||
@@ -145,7 +148,7 @@ Result MapMemory(Core::System& system, u64 dst_addr, u64 src_addr, u64 size) {
|
||||
|
||||
/// Unmaps a region that was previously mapped with svcMapMemory
|
||||
Result UnmapMemory(Core::System& system, u64 dst_addr, u64 src_addr, u64 size) {
|
||||
LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
|
||||
LOG_TRACE(Kernel_SVC, "called, dst_addr={:#X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
|
||||
src_addr, size);
|
||||
|
||||
auto& page_table{GetCurrentProcess(system.Kernel()).GetPageTable()};
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -9,7 +12,7 @@ namespace Kernel::Svc {
|
||||
|
||||
/// Set the process heap to a given Size. It can both extend and shrink the heap.
|
||||
Result SetHeapSize(Core::System& system, u64* out_address, u64 size) {
|
||||
LOG_TRACE(Kernel_SVC, "called, heap_size=0x{:X}", size);
|
||||
LOG_TRACE(Kernel_SVC, "called, heap_size={:#X}", size);
|
||||
|
||||
// Validate size.
|
||||
R_UNLESS(Common::IsAligned(size, HeapSizeAlignment), ResultInvalidSize);
|
||||
@@ -28,7 +31,7 @@ Result SetHeapSize(Core::System& system, u64* out_address, u64 size) {
|
||||
|
||||
/// Maps memory at a desired address
|
||||
Result MapPhysicalMemory(Core::System& system, u64 addr, u64 size) {
|
||||
LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size=0x{:X}", addr, size);
|
||||
LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size={:#X}", addr, size);
|
||||
|
||||
if (!Common::Is4KBAligned(addr)) {
|
||||
LOG_ERROR(Kernel_SVC, "Address is not aligned to 4KB, 0x{:016X}", addr);
|
||||
@@ -36,7 +39,7 @@ Result MapPhysicalMemory(Core::System& system, u64 addr, u64 size) {
|
||||
}
|
||||
|
||||
if (!Common::Is4KBAligned(size)) {
|
||||
LOG_ERROR(Kernel_SVC, "Size is not aligned to 4KB, 0x{:X}", size);
|
||||
LOG_ERROR(Kernel_SVC, "Size is not aligned to 4KB, {:#X}", size);
|
||||
R_THROW(ResultInvalidSize);
|
||||
}
|
||||
|
||||
@@ -77,7 +80,7 @@ Result MapPhysicalMemory(Core::System& system, u64 addr, u64 size) {
|
||||
|
||||
/// Unmaps memory previously mapped via MapPhysicalMemory
|
||||
Result UnmapPhysicalMemory(Core::System& system, u64 addr, u64 size) {
|
||||
LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size=0x{:X}", addr, size);
|
||||
LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size={:#X}", addr, size);
|
||||
|
||||
if (!Common::Is4KBAligned(addr)) {
|
||||
LOG_ERROR(Kernel_SVC, "Address is not aligned to 4KB, 0x{:016X}", addr);
|
||||
@@ -85,7 +88,7 @@ Result UnmapPhysicalMemory(Core::System& system, u64 addr, u64 size) {
|
||||
}
|
||||
|
||||
if (!Common::Is4KBAligned(size)) {
|
||||
LOG_ERROR(Kernel_SVC, "Size is not aligned to 4KB, 0x{:X}", size);
|
||||
LOG_ERROR(Kernel_SVC, "Size is not aligned to 4KB, {:#X}", size);
|
||||
R_THROW(ResultInvalidSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -92,7 +95,7 @@ Result GetProcessList(Core::System& system, s32* out_num_processes, u64 out_proc
|
||||
|
||||
Result GetProcessInfo(Core::System& system, s64* out, Handle process_handle,
|
||||
ProcessInfoType info_type) {
|
||||
LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, type=0x{:X}", process_handle, info_type);
|
||||
LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, type={:#X}", process_handle, info_type);
|
||||
|
||||
const auto& handle_table = GetCurrentProcess(system.Kernel()).GetHandleTable();
|
||||
KScopedAutoObject process = handle_table.GetObject<KProcess>(process_handle);
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -29,7 +32,7 @@ constexpr bool IsValidProcessMemoryPermission(Svc::MemoryPermission perm) {
|
||||
Result SetProcessMemoryPermission(Core::System& system, Handle process_handle, u64 address,
|
||||
u64 size, Svc::MemoryPermission perm) {
|
||||
LOG_TRACE(Kernel_SVC,
|
||||
"called, process_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}",
|
||||
"called, process_handle={:#X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}",
|
||||
process_handle, address, size, perm);
|
||||
|
||||
// Validate the address/size.
|
||||
@@ -59,7 +62,7 @@ Result SetProcessMemoryPermission(Core::System& system, Handle process_handle, u
|
||||
Result MapProcessMemory(Core::System& system, u64 dst_address, Handle process_handle,
|
||||
u64 src_address, u64 size) {
|
||||
LOG_TRACE(Kernel_SVC,
|
||||
"called, dst_address=0x{:X}, process_handle=0x{:X}, src_address=0x{:X}, size=0x{:X}",
|
||||
"called, dst_address={:#X}, process_handle=0x{:X}, src_address=0x{:X}, size=0x{:X}",
|
||||
dst_address, process_handle, src_address, size);
|
||||
|
||||
// Validate the address/size.
|
||||
@@ -100,7 +103,7 @@ Result MapProcessMemory(Core::System& system, u64 dst_address, Handle process_ha
|
||||
Result UnmapProcessMemory(Core::System& system, u64 dst_address, Handle process_handle,
|
||||
u64 src_address, u64 size) {
|
||||
LOG_TRACE(Kernel_SVC,
|
||||
"called, dst_address=0x{:X}, process_handle=0x{:X}, src_address=0x{:X}, size=0x{:X}",
|
||||
"called, dst_address={:#X}, process_handle=0x{:X}, src_address=0x{:X}, size=0x{:X}",
|
||||
dst_address, process_handle, src_address, size);
|
||||
|
||||
// Validate the address/size.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -29,7 +32,7 @@ constexpr bool IsValidSharedMemoryPermission(MemoryPermission perm) {
|
||||
Result MapSharedMemory(Core::System& system, Handle shmem_handle, u64 address, u64 size,
|
||||
Svc::MemoryPermission map_perm) {
|
||||
LOG_TRACE(Kernel_SVC,
|
||||
"called, shared_memory_handle=0x{:X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}",
|
||||
"called, shared_memory_handle={:#X}, addr=0x{:X}, size=0x{:X}, permissions=0x{:08X}",
|
||||
shmem_handle, address, size, map_perm);
|
||||
|
||||
// Validate the address/size.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -105,7 +108,7 @@ Result WaitSynchronization(Core::System& system, int32_t* out_index, u64 user_ha
|
||||
|
||||
/// Resumes a thread waiting on WaitSynchronization
|
||||
Result CancelSynchronization(Core::System& system, Handle handle) {
|
||||
LOG_TRACE(Kernel_SVC, "called handle=0x{:X}", handle);
|
||||
LOG_TRACE(Kernel_SVC, "called handle={:#X}", handle);
|
||||
|
||||
// Get the thread from its handle.
|
||||
KScopedAutoObject thread =
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -136,7 +139,7 @@ void SleepThread(Core::System& system, s64 ns) {
|
||||
|
||||
/// Gets the thread context
|
||||
Result GetThreadContext3(Core::System& system, u64 out_context, Handle thread_handle) {
|
||||
LOG_DEBUG(Kernel_SVC, "called, out_context=0x{:08X}, thread_handle=0x{:X}", out_context,
|
||||
LOG_DEBUG(Kernel_SVC, "called, out_context=0x{:08X}, thread_handle={:#X}", out_context,
|
||||
thread_handle);
|
||||
|
||||
auto& kernel = system.Kernel();
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -68,7 +71,7 @@ static void GenerateErrorReport(Core::System& system, Result error_code, const F
|
||||
std::string crash_report = fmt::format(
|
||||
"Yuzu {}-{} crash report\n"
|
||||
"Title ID: {:016x}\n"
|
||||
"Result: 0x{:X} ({:04}-{:04d})\n"
|
||||
"Result: {:#X} ({:04}-{:04d})\n"
|
||||
"Set flags: 0x{:16X}\n"
|
||||
"Program entry point: 0x{:16X}\n"
|
||||
"\n",
|
||||
@@ -108,7 +111,7 @@ static void GenerateErrorReport(Core::System& system, Result error_code, const F
|
||||
|
||||
static void ThrowFatalError(Core::System& system, Result error_code, FatalType fatal_type,
|
||||
const FatalInfo& info) {
|
||||
LOG_ERROR(Service_Fatal, "Threw fatal error type {} with error code 0x{:X}", fatal_type,
|
||||
LOG_ERROR(Service_Fatal, "Threw fatal error type {} with error code {:#X}", fatal_type,
|
||||
error_code.raw);
|
||||
|
||||
switch (fatal_type) {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -27,7 +30,7 @@ Result IFile::Read(
|
||||
FileSys::ReadOption option, Out<s64> out_size, s64 offset,
|
||||
const OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_buffer,
|
||||
s64 size) {
|
||||
LOG_DEBUG(Service_FS, "called, option={}, offset=0x{:X}, length={}", option.value, offset,
|
||||
LOG_DEBUG(Service_FS, "called, option={}, offset={:#X}, length={}", option.value, offset,
|
||||
size);
|
||||
|
||||
// Read the data from the Storage backend
|
||||
@@ -38,7 +41,7 @@ Result IFile::Read(
|
||||
Result IFile::Write(
|
||||
const InBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> buffer,
|
||||
FileSys::WriteOption option, s64 offset, s64 size) {
|
||||
LOG_DEBUG(Service_FS, "called, option={}, offset=0x{:X}, length={}", option.value, offset,
|
||||
LOG_DEBUG(Service_FS, "called, option={}, offset={:#X}, length={}", option.value, offset,
|
||||
size);
|
||||
|
||||
R_RETURN(backend->Write(offset, buffer.data(), size, option));
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -38,7 +41,7 @@ IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGe
|
||||
|
||||
Result IFileSystem::CreateFile(const InLargeData<FileSys::Sf::Path, BufferAttr_HipcPointer> path,
|
||||
s32 option, s64 size) {
|
||||
LOG_DEBUG(Service_FS, "called. file={}, option=0x{:X}, size=0x{:08X}", path->str, option, size);
|
||||
LOG_DEBUG(Service_FS, "called. file={}, option={:#X}, size=0x{:08X}", path->str, option, size);
|
||||
|
||||
R_RETURN(backend->CreateFile(FileSys::Path(path->str), size));
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -23,7 +26,7 @@ IStorage::IStorage(Core::System& system_, FileSys::VirtualFile backend_)
|
||||
Result IStorage::Read(
|
||||
OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_bytes,
|
||||
s64 offset, s64 length) {
|
||||
LOG_DEBUG(Service_FS, "called, offset=0x{:X}, length={}", offset, length);
|
||||
LOG_DEBUG(Service_FS, "called, offset={:#X}, length={}", offset, length);
|
||||
|
||||
R_UNLESS(length >= 0, FileSys::ResultInvalidSize);
|
||||
R_UNLESS(offset >= 0, FileSys::ResultInvalidOffset);
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
@@ -27,7 +30,7 @@ Result IAppletResource::GetSharedMemoryHandle(
|
||||
OutCopyHandle<Kernel::KSharedMemory> out_shared_memory_handle) {
|
||||
const auto result = resource_manager->GetSharedMemoryHandle(out_shared_memory_handle, aruid);
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, result=0x{:X}", aruid, result.raw);
|
||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, result={:#X}", aruid, result.raw);
|
||||
R_RETURN(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ Result IHidServer::CreateAppletResource(OutInterface<IAppletResource> out_applet
|
||||
ClientAppletResourceUserId aruid) {
|
||||
const auto result = GetResourceManager()->CreateAppletResource(aruid.pid);
|
||||
|
||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, result=0x{:X}", aruid.pid,
|
||||
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}, result={:#X}", aruid.pid,
|
||||
result.raw);
|
||||
|
||||
*out_applet_resource = std::make_shared<IAppletResource>(system, resource_manager, aruid.pid);
|
||||
|
||||
@@ -90,7 +90,7 @@ void nvhost_as_gpu::OnOpen(NvCore::SessionId session_id, DeviceFD fd) {}
|
||||
void nvhost_as_gpu::OnClose(DeviceFD fd) {}
|
||||
|
||||
NvResult nvhost_as_gpu::AllocAsEx(IoctlAllocAsEx& params) {
|
||||
LOG_DEBUG(Service_NVDRV, "called, big_page_size=0x{:X}", params.big_page_size);
|
||||
LOG_DEBUG(Service_NVDRV, "called, big_page_size={:#X}", params.big_page_size);
|
||||
|
||||
std::scoped_lock lock(mutex);
|
||||
|
||||
@@ -101,12 +101,12 @@ NvResult nvhost_as_gpu::AllocAsEx(IoctlAllocAsEx& params) {
|
||||
|
||||
if (params.big_page_size) {
|
||||
if (!std::has_single_bit(params.big_page_size)) {
|
||||
LOG_ERROR(Service_NVDRV, "Non power-of-2 big page size: 0x{:X}!", params.big_page_size);
|
||||
LOG_ERROR(Service_NVDRV, "Non power-of-2 big page size: {:#X}!", params.big_page_size);
|
||||
return NvResult::BadValue;
|
||||
}
|
||||
|
||||
if ((params.big_page_size & VM::SUPPORTED_BIG_PAGE_SIZES) == 0) {
|
||||
LOG_ERROR(Service_NVDRV, "Unsupported big page size: 0x{:X}!", params.big_page_size);
|
||||
LOG_ERROR(Service_NVDRV, "Unsupported big page size: {:#X}!", params.big_page_size);
|
||||
return NvResult::BadValue;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ NvResult nvhost_as_gpu::FreeSpace(IoctlFreeSpace& params) {
|
||||
}
|
||||
|
||||
NvResult nvhost_as_gpu::Remap(std::span<IoctlRemapEntry> entries) {
|
||||
LOG_DEBUG(Service_NVDRV, "called, num_entries=0x{:X}", entries.size());
|
||||
LOG_DEBUG(Service_NVDRV, "called, num_entries={:#X}", entries.size());
|
||||
|
||||
if (!vm.initialised) {
|
||||
return NvResult::BadValue;
|
||||
@@ -312,7 +312,7 @@ NvResult nvhost_as_gpu::Remap(std::span<IoctlRemapEntry> entries) {
|
||||
NvResult nvhost_as_gpu::MapBufferEx(IoctlMapBufferEx& params) {
|
||||
LOG_DEBUG(Service_NVDRV,
|
||||
"called, flags={:X}, nvmap_handle={:X}, buffer_offset={}, mapping_size={}"
|
||||
", offset={}",
|
||||
", offset={:#X}",
|
||||
params.flags, params.handle, params.buffer_offset, params.mapping_size,
|
||||
params.offset);
|
||||
|
||||
@@ -329,7 +329,7 @@ NvResult nvhost_as_gpu::MapBufferEx(IoctlMapBufferEx& params) {
|
||||
|
||||
if (mapping->size < params.mapping_size) {
|
||||
LOG_WARNING(Service_NVDRV,
|
||||
"Cannot remap a partially mapped GPU address space region: 0x{:X}",
|
||||
"Cannot remap a partially mapped GPU address space region: {:#X}",
|
||||
params.offset);
|
||||
return NvResult::BadValue;
|
||||
}
|
||||
@@ -342,7 +342,7 @@ NvResult nvhost_as_gpu::MapBufferEx(IoctlMapBufferEx& params) {
|
||||
|
||||
return NvResult::Success;
|
||||
} catch (const std::out_of_range&) {
|
||||
LOG_WARNING(Service_NVDRV, "Cannot remap an unmapped GPU address space region: 0x{:X}",
|
||||
LOG_WARNING(Service_NVDRV, "Cannot remap an unmapped GPU address space region: {:#X}",
|
||||
params.offset);
|
||||
return NvResult::BadValue;
|
||||
}
|
||||
@@ -410,7 +410,7 @@ NvResult nvhost_as_gpu::MapBufferEx(IoctlMapBufferEx& params) {
|
||||
}
|
||||
|
||||
NvResult nvhost_as_gpu::UnmapBuffer(IoctlUnmapBuffer& params) {
|
||||
LOG_DEBUG(Service_NVDRV, "called, offset=0x{:X}", params.offset);
|
||||
LOG_DEBUG(Service_NVDRV, "called, offset={:#X}", params.offset);
|
||||
|
||||
std::scoped_lock lock(mutex);
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -175,7 +178,7 @@ NvResult nvhost_ctrl_gpu::GetCharacteristics3(
|
||||
}
|
||||
|
||||
NvResult nvhost_ctrl_gpu::GetTPCMasks1(IoctlGpuGetTpcMasksArgs& params) {
|
||||
LOG_DEBUG(Service_NVDRV, "called, mask_buffer_size=0x{:X}", params.mask_buffer_size);
|
||||
LOG_DEBUG(Service_NVDRV, "called, mask_buffer_size={:#X}", params.mask_buffer_size);
|
||||
if (params.mask_buffer_size != 0) {
|
||||
params.tcp_mask = 3;
|
||||
}
|
||||
@@ -183,7 +186,7 @@ NvResult nvhost_ctrl_gpu::GetTPCMasks1(IoctlGpuGetTpcMasksArgs& params) {
|
||||
}
|
||||
|
||||
NvResult nvhost_ctrl_gpu::GetTPCMasks3(IoctlGpuGetTpcMasksArgs& params, std::span<u32> tpc_mask) {
|
||||
LOG_DEBUG(Service_NVDRV, "called, mask_buffer_size=0x{:X}", params.mask_buffer_size);
|
||||
LOG_DEBUG(Service_NVDRV, "called, mask_buffer_size={:#X}", params.mask_buffer_size);
|
||||
if (params.mask_buffer_size != 0) {
|
||||
params.tcp_mask = 3;
|
||||
}
|
||||
|
||||
@@ -316,20 +316,20 @@ NvResult nvhost_gpu::SubmitGPFIFOBase2(IoctlSubmitGpfifo& params,
|
||||
}
|
||||
|
||||
NvResult nvhost_gpu::GetWaitbase(IoctlGetWaitbase& params) {
|
||||
LOG_INFO(Service_NVDRV, "called, unknown=0x{:X}", params.unknown);
|
||||
LOG_INFO(Service_NVDRV, "called, unknown={:#X}", params.unknown);
|
||||
|
||||
params.value = 0; // Seems to be hard coded at 0
|
||||
return NvResult::Success;
|
||||
}
|
||||
|
||||
NvResult nvhost_gpu::ChannelSetTimeout(IoctlChannelSetTimeout& params) {
|
||||
LOG_INFO(Service_NVDRV, "called, timeout=0x{:X}", params.timeout);
|
||||
LOG_INFO(Service_NVDRV, "called, timeout={:#X}", params.timeout);
|
||||
|
||||
return NvResult::Success;
|
||||
}
|
||||
|
||||
NvResult nvhost_gpu::ChannelSetTimeslice(IoctlSetTimeslice& params) {
|
||||
LOG_INFO(Service_NVDRV, "called, timeslice=0x{:X}", params.timeslice);
|
||||
LOG_INFO(Service_NVDRV, "called, timeslice={:#X}", params.timeslice);
|
||||
|
||||
channel_timeslice = params.timeslice;
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -89,7 +92,7 @@ NvResult nvmap::IocCreate(IocCreateParams& params) {
|
||||
}
|
||||
handle_description->orig_size = params.size; // Orig size is the unaligned size
|
||||
params.handle = handle_description->id;
|
||||
LOG_DEBUG(Service_NVDRV, "handle: {}, size: 0x{:X}", handle_description->id, params.size);
|
||||
LOG_DEBUG(Service_NVDRV, "handle: {}, size: {:#X}", handle_description->id, params.size);
|
||||
|
||||
return NvResult::Success;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: 2021 Skyline Team and Contributors
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
@@ -209,7 +212,7 @@ void NVDRV::QueryEvent(HLERequestContext& ctx) {
|
||||
void NVDRV::SetAruid(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
pid = rp.Pop<u64>();
|
||||
LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid);
|
||||
LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid={:#X}", pid);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -87,7 +90,7 @@ Result SteadyClock::IsRtcResetDetected(Out<bool> out_is_detected) {
|
||||
|
||||
Result SteadyClock::GetSetupResultValue(Out<Result> out_result) {
|
||||
SCOPE_EXIT {
|
||||
LOG_DEBUG(Service_Time, "called. out_result=0x{:X}", out_result->raw);
|
||||
LOG_DEBUG(Service_Time, "called. out_result={:#X}", out_result->raw);
|
||||
};
|
||||
|
||||
R_UNLESS(m_can_write_uninitialized_clock || m_clock_core.IsInitialized(),
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Service {
|
||||
|
||||
std::string function_string = fmt::format("function '{}': port={}", name, port_name);
|
||||
for (int i = 1; i <= num_params; ++i) {
|
||||
function_string += fmt::format(", cmd_buff[{}]=0x{:X}", i, cmd_buff[i]);
|
||||
function_string += fmt::format(", cmd_buff[{}]={:#X}", i, cmd_buff[i]);
|
||||
}
|
||||
return function_string;
|
||||
}
|
||||
@@ -66,10 +66,10 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx,
|
||||
std::string function_name = info == nullptr ? "<unknown>" : info->name;
|
||||
|
||||
fmt::memory_buffer buf;
|
||||
fmt::format_to(std::back_inserter(buf), "function '{}({})': port='{}' cmd_buf={{[0]=0x{:X}",
|
||||
fmt::format_to(std::back_inserter(buf), "function '{}({})': port='{}' cmd_buf={{[0]={:#X}",
|
||||
ctx.GetCommand(), function_name, service_name, cmd_buf[0]);
|
||||
for (int i = 1; i <= 8; ++i) {
|
||||
fmt::format_to(std::back_inserter(buf), ", [{}]=0x{:X}", i, cmd_buf[i]);
|
||||
fmt::format_to(std::back_inserter(buf), ", [{}]={:#X}", i, cmd_buf[i]);
|
||||
}
|
||||
buf.push_back('}');
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -101,7 +104,7 @@ AppLoader::LoadResult AppLoader_KIP::Load(Kernel::KProcess& process,
|
||||
const VAddr base_address = GetInteger(process.GetEntryPoint());
|
||||
process.LoadModule(std::move(codeset), base_address);
|
||||
|
||||
LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", kip->GetName(), base_address);
|
||||
LOG_DEBUG(Loader, "loaded module {} @ {:#X}", kip->GetName(), base_address);
|
||||
|
||||
is_loaded = true;
|
||||
return {ResultStatus::Success,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -220,7 +223,7 @@ AppLoader_NSO::LoadResult AppLoader_NSO::Load(Kernel::KProcess& process, Core::S
|
||||
}
|
||||
|
||||
modules.insert_or_assign(base_address, file->GetName());
|
||||
LOG_DEBUG(Loader, "loaded module {} @ 0x{:X}", file->GetName(), base_address);
|
||||
LOG_DEBUG(Loader, "loaded module {} @ {:#X}", file->GetName(), base_address);
|
||||
|
||||
is_loaded = true;
|
||||
return {ResultStatus::Success, LoadParameters{Kernel::KThread::DefaultThreadPriority,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -19,7 +22,15 @@ namespace Shader::Backend::SPIRV {
|
||||
namespace {
|
||||
template <class Func>
|
||||
struct FuncTraits {};
|
||||
thread_local std::unique_ptr<spvtools::Optimizer> thread_optimizer;
|
||||
|
||||
spvtools::Optimizer& GetThreadOptimizer() {
|
||||
if (!thread_optimizer) {
|
||||
thread_optimizer = std::make_unique<spvtools::Optimizer>(SPV_ENV_VULKAN_1_3);
|
||||
thread_optimizer->RegisterPerformancePasses();
|
||||
}
|
||||
return *thread_optimizer;
|
||||
}
|
||||
template <class ReturnType_, class... Args>
|
||||
struct FuncTraits<ReturnType_ (*)(Args...)> {
|
||||
using ReturnType = ReturnType_;
|
||||
@@ -463,22 +474,31 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
|
||||
}
|
||||
|
||||
void PatchPhiNodes(IR::Program& program, EmitContext& ctx) {
|
||||
auto inst{program.blocks.front()->begin()};
|
||||
size_t block_index{0};
|
||||
ctx.PatchDeferredPhi([&](size_t phi_arg) {
|
||||
if (phi_arg == 0) {
|
||||
++inst;
|
||||
if (inst == program.blocks[block_index]->end() ||
|
||||
inst->GetOpcode() != IR::Opcode::Phi) {
|
||||
do {
|
||||
++block_index;
|
||||
inst = program.blocks[block_index]->begin();
|
||||
} while (inst->GetOpcode() != IR::Opcode::Phi);
|
||||
// Flatten all leading PHIs from each block into a vector
|
||||
std::vector<IR::Inst*> phi_instructions;
|
||||
for (IR::Block* block : program.blocks) {
|
||||
for (auto it = block->begin(); it != block->end(); ++it) {
|
||||
if (it->GetOpcode() != IR::Opcode::Phi)
|
||||
break;
|
||||
phi_instructions.push_back(&*it);
|
||||
}
|
||||
}
|
||||
|
||||
if (phi_instructions.empty()) {
|
||||
return; // nothing to patch
|
||||
}
|
||||
|
||||
// Start "before" first PHI; advance on phi_arg == 0
|
||||
size_t phi_index = static_cast<size_t>(-1);
|
||||
|
||||
ctx.PatchDeferredPhi([&](size_t phi_arg) -> Id {
|
||||
if (phi_arg == 0) {
|
||||
++phi_index;
|
||||
}
|
||||
IR::Inst* phi = phi_instructions[phi_index];
|
||||
return ctx.Def(phi->Arg(phi_arg));
|
||||
});
|
||||
}
|
||||
return ctx.Def(inst->Arg(phi_arg));
|
||||
});
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_info,
|
||||
@@ -500,10 +520,11 @@ std::vector<u32> EmitSPIRV(const Profile& profile, const RuntimeInfo& runtime_in
|
||||
} else {
|
||||
std::vector<u32> spirv = ctx.Assemble();
|
||||
|
||||
spvtools::Optimizer spv_opt(SPV_ENV_VULKAN_1_3);
|
||||
spv_opt.SetMessageConsumer([](spv_message_level_t, const char*, const spv_position_t&,
|
||||
const char* m) { LOG_ERROR(HW_GPU, "spirv-opt: {}", m); });
|
||||
spv_opt.RegisterPerformancePasses();
|
||||
// Use thread-local optimizer instead of creating a new one
|
||||
auto& spv_opt = GetThreadOptimizer();
|
||||
spv_opt.SetMessageConsumer([](spv_message_level_t, const char*, const spv_position_t&, const char* m) {
|
||||
LOG_ERROR(HW_GPU, "spirv-opt: {}", m);
|
||||
});
|
||||
|
||||
spvtools::OptimizerOptions opt_options;
|
||||
opt_options.set_run_validator(false);
|
||||
|
||||
@@ -87,7 +87,7 @@ void CDmaPusher::ProcessEntries(std::stop_token stop_token) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
LOG_ERROR(HW_GPU, "Bad command at index {} (bytes 0x{:X}), buffer size {}", i - 1,
|
||||
LOG_ERROR(HW_GPU, "Bad command at index {} (bytes {:#X}), buffer size {}", i - 1,
|
||||
(i - 1) * sizeof(u32), command_list.size());
|
||||
UNIMPLEMENTED_MSG("ChSubmission mode {} is not implemented!",
|
||||
static_cast<u32>(mode));
|
||||
@@ -100,7 +100,7 @@ void CDmaPusher::ProcessEntries(std::stop_token stop_token) {
|
||||
void CDmaPusher::ExecuteCommand(u32 method, u32 arg) {
|
||||
switch (current_class) {
|
||||
case ChClassId::Control:
|
||||
LOG_TRACE(Service_NVDRV, "Class {} method 0x{:X} arg 0x{:X}",
|
||||
LOG_TRACE(Service_NVDRV, "Class {} method {:#X} arg 0x{:X}",
|
||||
static_cast<u32>(current_class), method, arg);
|
||||
host_processor->ProcessMethod(static_cast<Host1x::Control::Method>(method), arg);
|
||||
break;
|
||||
@@ -118,7 +118,7 @@ void CDmaPusher::ExecuteCommand(u32 method, u32 arg) {
|
||||
break;
|
||||
}
|
||||
case ThiMethod::SetMethod1:
|
||||
LOG_TRACE(Service_NVDRV, "Class {} method 0x{:X} arg 0x{:X}",
|
||||
LOG_TRACE(Service_NVDRV, "Class {} method {:#X} arg 0x{:X}",
|
||||
static_cast<u32>(current_class), static_cast<u32>(thi_regs.method_0), arg);
|
||||
ProcessMethod(thi_regs.method_0, arg);
|
||||
break;
|
||||
|
||||
@@ -41,7 +41,7 @@ void Decoder::Decode() {
|
||||
|
||||
if (!frame.get()) {
|
||||
LOG_ERROR(HW_GPU,
|
||||
"Nvdec {} dailed to decode interlaced frame for top 0x{:X} bottom 0x{:X}", id,
|
||||
"Nvdec {} failed to decode interlaced frame for top {:#X} bottom 0x{:X}", id,
|
||||
luma_top, luma_bottom);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ void Decoder::Decode() {
|
||||
auto [luma_offset, chroma_offset] = GetProgressiveOffsets();
|
||||
|
||||
if (!frame.get()) {
|
||||
LOG_ERROR(HW_GPU, "Nvdec {} failed to decode progressive frame for luma 0x{:X}", id,
|
||||
LOG_ERROR(HW_GPU, "Nvdec {} failed to decode progressive frame for luma {:#X}", id,
|
||||
luma_offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
@@ -21,7 +24,7 @@ void Control::ProcessMethod(Method method, u32 argument) {
|
||||
Execute(argument);
|
||||
break;
|
||||
default:
|
||||
UNIMPLEMENTED_MSG("Control method 0x{:X}", static_cast<u32>(method));
|
||||
UNIMPLEMENTED_MSG("Control method {:#X}", static_cast<u32>(method));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -105,7 +108,7 @@ Vic::~Vic() {
|
||||
}
|
||||
|
||||
void Vic::ProcessMethod(u32 method, u32 arg) {
|
||||
LOG_TRACE(HW_GPU, "Vic {} method 0x{:X}", id, static_cast<u32>(method));
|
||||
LOG_TRACE(HW_GPU, "Vic {} method {:#X}", id, static_cast<u32>(method));
|
||||
regs.reg_array[method] = arg;
|
||||
|
||||
switch (static_cast<Method>(method * sizeof(u32))) {
|
||||
@@ -142,7 +145,7 @@ void Vic::Execute() {
|
||||
|
||||
auto frame = frame_queue.GetFrame(nvdec_id, luma_offset);
|
||||
if (!frame.get()) {
|
||||
LOG_ERROR(HW_GPU, "Vic {} failed to get frame with offset 0x{:X}", id, luma_offset);
|
||||
LOG_ERROR(HW_GPU, "Vic {} failed to get frame with offset {:#X}", id, luma_offset);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -999,9 +1002,9 @@ void Vic::WriteY8__V8U8_N420(const OutputSurfaceConfig& output_surface_config) {
|
||||
LOG_TRACE(
|
||||
HW_GPU,
|
||||
"Writing Y8__V8U8_N420 swizzled frame\n"
|
||||
"\tinput surface {}x{} stride {} size 0x{:X}\n"
|
||||
"\toutput luma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}\n",
|
||||
"\toutput chroma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}",
|
||||
"\tinput surface {}x{} stride {} size {:#X}\n"
|
||||
"\toutput luma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}\n",
|
||||
"\toutput chroma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}",
|
||||
surface_width, surface_height, surface_stride * BytesPerPixel,
|
||||
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
|
||||
out_luma_stride, out_luma_size, block_height, out_luma_swizzle_size, out_chroma_width,
|
||||
@@ -1041,9 +1044,9 @@ void Vic::WriteY8__V8U8_N420(const OutputSurfaceConfig& output_surface_config) {
|
||||
LOG_TRACE(
|
||||
HW_GPU,
|
||||
"Writing Y8__V8U8_N420 swizzled frame\n"
|
||||
"\tinput surface {}x{} stride {} size 0x{:X}\n"
|
||||
"\toutput luma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}\n",
|
||||
"\toutput chroma {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}",
|
||||
"\tinput surface {}x{} stride {} size {:#X}\n"
|
||||
"\toutput luma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}\n",
|
||||
"\toutput chroma {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}",
|
||||
surface_width, surface_height, surface_stride * BytesPerPixel,
|
||||
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
|
||||
out_luma_stride, out_luma_size, out_chroma_width, out_chroma_height, out_chroma_stride,
|
||||
@@ -1212,8 +1215,8 @@ void Vic::WriteABGR(const OutputSurfaceConfig& output_surface_config) {
|
||||
LOG_TRACE(
|
||||
HW_GPU,
|
||||
"Writing ABGR swizzled frame\n"
|
||||
"\tinput surface {}x{} stride {} size 0x{:X}\n"
|
||||
"\toutput surface {}x{} stride {} size 0x{:X} block height {} swizzled size 0x{:X}",
|
||||
"\tinput surface {}x{} stride {} size {:#X}\n"
|
||||
"\toutput surface {}x{} stride {} size {:#X} block height {} swizzled size 0x{:X}",
|
||||
surface_width, surface_height, surface_stride * BytesPerPixel,
|
||||
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
|
||||
out_luma_stride, out_luma_size, block_height, out_swizzle_size);
|
||||
@@ -1237,8 +1240,8 @@ void Vic::WriteABGR(const OutputSurfaceConfig& output_surface_config) {
|
||||
case BLK_KIND::PITCH: {
|
||||
LOG_TRACE(HW_GPU,
|
||||
"Writing ABGR pitch frame\n"
|
||||
"\tinput surface {}x{} stride {} size 0x{:X}"
|
||||
"\toutput surface {}x{} stride {} size 0x{:X}",
|
||||
"\tinput surface {}x{} stride {} size {:#X}"
|
||||
"\toutput surface {}x{} stride {} size {:#X}",
|
||||
surface_width, surface_height, surface_stride,
|
||||
surface_stride * surface_height * BytesPerPixel, out_luma_width, out_luma_height,
|
||||
out_luma_stride, out_luma_size);
|
||||
|
||||
@@ -28,7 +28,7 @@ struct DescriptorBank {
|
||||
bool DescriptorBankInfo::IsSuperset(const DescriptorBankInfo& subset) const noexcept {
|
||||
return uniform_buffers >= subset.uniform_buffers && storage_buffers >= subset.storage_buffers &&
|
||||
texture_buffers >= subset.texture_buffers && image_buffers >= subset.image_buffers &&
|
||||
textures >= subset.textures && images >= subset.image_buffers;
|
||||
textures >= subset.textures && images >= subset.images;
|
||||
}
|
||||
|
||||
template <typename Descriptors>
|
||||
|
||||
@@ -90,7 +90,7 @@ bool IsLine(VkPrimitiveTopology topology) {
|
||||
VK_PRIMITIVE_TOPOLOGY_LINE_LIST, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP,
|
||||
// VK_PRIMITIVE_TOPOLOGY_LINE_LOOP_EXT,
|
||||
};
|
||||
return std::ranges::find(line_topologies, topology) == line_topologies.end();
|
||||
return std::ranges::find(line_topologies, topology) != line_topologies.end();
|
||||
}
|
||||
|
||||
VkViewportSwizzleNV UnpackViewportSwizzle(u16 swizzle) {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -60,25 +63,25 @@ std::string Name(const ImageViewBase& image_view, GPUVAddr addr) {
|
||||
const std::string level = num_levels > 1 ? fmt::format(":{}", num_levels) : "";
|
||||
switch (image_view.type) {
|
||||
case ImageViewType::e1D:
|
||||
return fmt::format("ImageView 1D 0x{:X} {}{}", addr, width, level);
|
||||
return fmt::format("ImageView 1D {:#X} {}{}", addr, width, level);
|
||||
case ImageViewType::e2D:
|
||||
return fmt::format("ImageView 2D 0x{:X} {}x{}{}", addr, width, height, level);
|
||||
return fmt::format("ImageView 2D {:#X} {}x{}{}", addr, width, height, level);
|
||||
case ImageViewType::Cube:
|
||||
return fmt::format("ImageView Cube 0x{:X} {}x{}{}", addr, width, height, level);
|
||||
return fmt::format("ImageView Cube {:#X} {}x{}{}", addr, width, height, level);
|
||||
case ImageViewType::e3D:
|
||||
return fmt::format("ImageView 3D 0x{:X} {}x{}x{}{}", addr, width, height, depth, level);
|
||||
return fmt::format("ImageView 3D {:#X} {}x{}x{}{}", addr, width, height, depth, level);
|
||||
case ImageViewType::e1DArray:
|
||||
return fmt::format("ImageView 1DArray 0x{:X} {}{}|{}", addr, width, level, num_layers);
|
||||
return fmt::format("ImageView 1DArray {:#X} {}{}|{}", addr, width, level, num_layers);
|
||||
case ImageViewType::e2DArray:
|
||||
return fmt::format("ImageView 2DArray 0x{:X} {}x{}{}|{}", addr, width, height, level,
|
||||
return fmt::format("ImageView 2DArray {:#X} {}x{}{}|{}", addr, width, height, level,
|
||||
num_layers);
|
||||
case ImageViewType::CubeArray:
|
||||
return fmt::format("ImageView CubeArray 0x{:X} {}x{}{}|{}", addr, width, height, level,
|
||||
return fmt::format("ImageView CubeArray {:#X} {}x{}{}|{}", addr, width, height, level,
|
||||
num_layers);
|
||||
case ImageViewType::Rect:
|
||||
return fmt::format("ImageView Rect 0x{:X} {}x{}{}", addr, width, height, level);
|
||||
return fmt::format("ImageView Rect {:#X} {}x{}{}", addr, width, height, level);
|
||||
case ImageViewType::Buffer:
|
||||
return fmt::format("BufferView 0x{:X} {}", addr, width);
|
||||
return fmt::format("BufferView {:#X} {}", addr, width);
|
||||
}
|
||||
return "Invalid";
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -49,19 +51,23 @@ InputCommon::MouseButton EmuWindow_SDL2::SDLButtonToMouseButton(u32 button) cons
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<float, float> EmuWindow_SDL2::MouseToTouchPos(s32 touch_x, s32 touch_y) const {
|
||||
int w, h;
|
||||
/// @brief Translates pixel position to float position
|
||||
EmuWindow_SDL2::FloatPairNonHFA EmuWindow_SDL2::MouseToTouchPos(s32 touch_x, s32 touch_y) const {
|
||||
int w = 0, h = 0;
|
||||
SDL_GetWindowSize(render_window, &w, &h);
|
||||
const float fx = static_cast<float>(touch_x) / w;
|
||||
const float fy = static_cast<float>(touch_y) / h;
|
||||
|
||||
return {std::clamp<float>(fx, 0.0f, 1.0f), std::clamp<float>(fy, 0.0f, 1.0f)};
|
||||
const float fx = float(touch_x) / w;
|
||||
const float fy = float(touch_y) / h;
|
||||
return {
|
||||
std::clamp<float>(fx, 0.0f, 1.0f),
|
||||
std::clamp<float>(fy, 0.0f, 1.0f),
|
||||
0
|
||||
};
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) {
|
||||
const auto mouse_button = SDLButtonToMouseButton(button);
|
||||
if (state == SDL_PRESSED) {
|
||||
const auto [touch_x, touch_y] = MouseToTouchPos(x, y);
|
||||
auto const [touch_x, touch_y, _] = MouseToTouchPos(x, y);
|
||||
input_subsystem->GetMouse()->PressButton(x, y, mouse_button);
|
||||
input_subsystem->GetMouse()->PressMouseButton(mouse_button);
|
||||
input_subsystem->GetMouse()->PressTouchButton(touch_x, touch_y, mouse_button);
|
||||
@@ -71,7 +77,7 @@ void EmuWindow_SDL2::OnMouseButton(u32 button, u8 state, s32 x, s32 y) {
|
||||
}
|
||||
|
||||
void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) {
|
||||
const auto [touch_x, touch_y] = MouseToTouchPos(x, y);
|
||||
auto const [touch_x, touch_y, _] = MouseToTouchPos(x, y);
|
||||
input_subsystem->GetMouse()->Move(x, y, 0, 0);
|
||||
input_subsystem->GetMouse()->MouseMove(touch_x, touch_y);
|
||||
input_subsystem->GetMouse()->TouchMove(touch_x, touch_y);
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "core/frontend/emu_window.h"
|
||||
@@ -43,8 +46,11 @@ protected:
|
||||
/// Converts a SDL mouse button into MouseInput mouse button
|
||||
InputCommon::MouseButton SDLButtonToMouseButton(u32 button) const;
|
||||
|
||||
/// Translates pixel position to float position
|
||||
std::pair<float, float> MouseToTouchPos(s32 touch_x, s32 touch_y) const;
|
||||
// Using std::pair<float,float> will invoke HFA miscompilation bug on g++10
|
||||
// on newer versions it emits an annoying warning, so just not use an HFA
|
||||
// https://stackoverflow.com/questions/77729813/parameter-passing-for-argument-when-c17-is-enabled-changed-to-match-c14
|
||||
using FloatPairNonHFA = std::tuple<float, float, char>;
|
||||
FloatPairNonHFA MouseToTouchPos(s32 touch_x, s32 touch_y) const;
|
||||
|
||||
/// Called by WaitEvent when a mouse button is pressed or released
|
||||
void OnMouseButton(u32 button, u8 state, s32 x, s32 y);
|
||||
|
||||
Reference in New Issue
Block a user