Commit graph

1704 commits

Author SHA1 Message Date
Lioncash
d28572d4b8 fixed_point: Mark default constructor as constexpr
Ensures that a fixed-point value is always initialized

This likely also fixes several cases of uninitialized values being
operated on, since we have multiple areas in the codebase where the
default constructor is being used like:

Common::FixedPoint<50, 14> current_sample{};

and is then followed up with an arithmetic operation like += or
something else, which operates directly on FixedPoint's internal data
member, which would previously be uninitialized.
2022-10-18 16:06:50 -04:00
Lioncash
9cc6234265 fixed_point: Mark copy/move assignment operators and constructors as constexpr
Given these are just moving a raw value around, these can sensibly be
made constexpr to make the interface more useful.
2022-10-18 16:06:50 -04:00
Lioncash
278826ce5b fixed_point: Mark std::swap and move constructor as noexcept
These shouldn't throw and can influence how some standard algorithms
will work.
2022-10-18 16:06:50 -04:00
Lioncash
3ba285f09e fixed_point: Mark relevant member function [[nodiscard]]
Marks member functions as discard, where ignoring the return value would
be indicative of a bug or dead code.
2022-10-18 16:06:50 -04:00
Lioncash
62d3f2021b fixed_point: Make to_uint() non-const
This calls round_up(), which is a non-const member function, so if a
fixed-point instantiation ever calls to_uint(), it'll result in a
compiler error.

This allows the member function to work.

While we're at it, we can actually mark to_long_floor() as const, since
it's not modifying any member state.
2022-10-18 16:06:50 -04:00
Lioncash
801b7a6652 fixed_point: Use defaulted comparisons
Collapses all of the comparison functions down to a single line.
2022-10-18 16:06:50 -04:00
Lioncash
3b07fadfe3 fixed_point: Use variable templates and concepts where applicable
Makes a few things a little less noisy and removes the need for SFINAE
in quite a few functions.
2022-10-18 16:06:46 -04:00
bunnei
74bc4a549a Merge pull request #9054 from Docteh/just_lz4
CMake: Try add_library "lz4" if "lz4::lz4" is unavailable
2022-10-17 22:51:26 -07:00
Morph
4b35f9e78e fixed_point: Replace CONSTEXPR14 with constexpr
As we require the latest C++ standards to compile yuzu, checking for C++14 constexpr is not needed.
2022-10-17 03:16:54 -04:00
Morph
6a22ed905b general: Add missing pragma once 2022-10-17 03:14:31 -04:00
Kyle Kienapfel
c16b8f5f59 CMake: Try add library "LZ4::lz4_shared" if "lz4::lz4" is unavailable
Right now this looks like a distro specific problem, but we'll have to see.

Over on Gentoo: with lz4 1.9.3 there is a lz4::lz4 library target, with 1.9.4 it's no longer
mentioned in the cmake files provided by the  package. (/usr/lib64/cmake/lz4)

arch and openSUSE have lz4 1.9.4 available so I checked there,
they only have .pc files for pkg-config, so asking for "lz4::lz4" works as usual

MSVC does require "lz4::lz4" to be asked for
2022-10-13 17:23:47 -07:00
Morph
98c792dbf4 settings: Update aspect_ratio range
Since 16:10 was added, the maximum value is now 4.
2022-10-13 12:24:04 -04:00
german77
36d02d1fc3 input_common: have an unique vector in callback status 2022-10-09 12:49:18 -05:00
Fernando Sahmkow
1595e77913 General: address feedback 2022-10-06 21:00:54 +02:00
Liam
d8009fb2d1 general: rework usages of UNREACHABLE macro 2022-10-06 21:00:54 +02:00
Morph
6a6b22b67d address_space: Rename va_start to virt_start
Avoids conflicting with the va_start macro
2022-10-06 21:00:54 +02:00
Morph
f8733d9da6 address_space: Address feedback 2022-10-06 21:00:54 +02:00
Morph
5ee9e5e84b general: Format licenses as per SPDX guidelines 2022-10-06 21:00:54 +02:00
Fernando Sahmkow
2f61540d44 General: Fix clang format. 2022-10-06 21:00:53 +02:00
Fernando Sahmkow
7ed9c68b89 Common: Fix variable shadowing. 2022-10-06 21:00:53 +02:00
Liam White
6df0663a57 General: Fix compilation for GCC 2022-10-06 21:00:53 +02:00
bunnei
616e83dd94 DMA & InlineToMemory Engines Rework. 2022-10-06 21:00:53 +02:00
Fernando Sahmkow
67bb131e37 MemoryManager: initial multi paging system implementation. 2022-10-06 21:00:52 +02:00
Fernando Sahmkow
0925f2386a Refactor VideoCore to use AS sepparate from Channel. 2022-10-06 21:00:52 +02:00
Fernando Sahmkow
19d8ea6bd6 NVDRV: Remake ASGPU 2022-10-06 21:00:52 +02:00
Fernando Sahmkow
a4346d16ed VideoCore: Update MemoryManager 2022-10-06 21:00:51 +02:00
Fernando Sahmkow
68f5643159 Common: implement MultiLevelPageTable. 2022-10-06 21:00:51 +02:00
Fernando Sahmkow
3991518f74 NVDRV: Refactor and add new NvMap. 2022-10-06 21:00:51 +02:00
Liam
47fc168030 common: remove "yuzu:" prefix from thread names 2022-10-03 18:43:56 -04:00
german77
d389a05005 service: nfp: address comments 2022-10-02 12:32:26 -05:00
german77
56b1301938 input_common: Create virtual amiibo driver 2022-10-02 12:32:26 -05:00
bunnei
a8091a7823 Merge pull request #8920 from abouvier/cmake-git
cmake: fix git detection
2022-09-24 23:11:45 -07:00
lat9nq
e5392df1a5 yuzu qt: Add option to disable startup Vulkan check
The startup check apparently confuses other programs when yuzu launches
2 processes and then quickly closes one of them. Though this isn't
really our issues it's also not a big deal for me to add an option to
work around that issue.
2022-09-19 14:46:12 -04:00
Alexandre Bouvier
8a1d99e72d cmake: fix git detection 2022-09-18 00:04:35 +02:00
bunnei
58975829b7 Merge pull request #8650 from Kelebek1/vsync
[Coretiming/NVNFlinger] Improve multi-core vsync timing, and core timing accuracy
2022-09-17 11:10:54 -07:00
Morph
f013dea5aa Merge pull request #8649 from lat9nq/common-position-independent
common: Use PROJECT_SOURCE_DIR to find CMakeModules
2022-09-16 12:48:53 -04:00
Morph
8c3b3247ea Merge pull request #8682 from lat9nq/dumpy
yuzu qt: Add option to create Windows crash dumps
2022-09-16 12:47:51 -04:00
liushuyu
49e1d6f43c common: do not link to xbyak on non-amd64 architectures 2022-09-13 17:19:37 -06:00
bunnei
7dc3d49135 Merge pull request #8864 from german77/toggle_analog
input_common: Add support for analog toggle
2022-09-09 20:54:01 -07:00
lat9nq
c48259ca81 Merge pull request #8819 from liamwhite/cash-money
video_core: add option for pessimistic flushing
2022-09-08 22:46:58 -04:00
Narr the Reg
d4fb46d8f9 input_common: Add support for analog toggle 2022-09-06 11:21:28 -05:00
lat9nq
554b7e220b yuzu: Use a debugger to generate minidumps
yuzu: Move mini_dump out of core

startup_checks: Better exception handling
2022-09-04 21:36:04 -04:00
bunnei
3210654f5a Merge pull request #8822 from FearlessTobi/multiplayer-fixes
network: Fixes and improvements to the room feature
2022-09-02 10:24:32 -07:00
Kelebek1
a0732144ba Silence std::aligned_storage warnings as it's deprecated in C++23,
replace it with alignas() and a C array
2022-09-01 16:50:41 +01:00
FearlessTobi
31c4475420 yuzu: Display current game version in multiplayer room
Makes it easier for users to recognize connection errors caused by different game versions.
2022-08-27 03:31:17 +02:00
Liam
39c3184237 video_core: add option for pessimistic flushing 2022-08-25 12:32:14 -04:00
liamwhite
eaf4777e58 Merge pull request #8784 from Docteh/nosnek
code: dodge PAGE_SIZE #define
2022-08-21 12:59:01 -04:00
Kyle Kienapfel
ea00332a67 code: dodge PAGE_SIZE #define
Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number
This is great except in yuzu we're using PAGE_SIZE as a variable

Specific example
`static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;`

PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables.
Simply deleted the underscores, and then added YUZU_ prefix

Might be worth noting that there are multiple uses in different classes/namespaces
This list may not be exhaustive

Core::Memory   12 bits (4096)
QueryCacheBase 12 bits
ShaderCache    14 bits (16384)
TextureCache   20 bits (1048576, or 1MB)

Fixes #8779
2022-08-19 16:08:40 -07:00
liushuyu
1702caebbb common: remove unneeded x86-specific header 2022-08-16 15:19:57 -06:00
FearlessTobi
ce2eefb57c Make copyright headers SPDX-compliant 2022-08-15 20:25:42 +02:00