summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2021-05-29core/memory: Check our memory fallbacks for out-of-bound behavior.Markus Wick
This makes it by far harder to crash yuzu. Also implement the 48bit masking of AARCH64 while touching this code.
2021-05-28common/fs/file: Explicitly delete copy constructorsLioncash
Relocates them to the same place the move equivalents are at for consistent viewing.
2021-05-28common/fs/file: Devirtualize destructorLioncash
IOFile is a final class, so there's no need for a virtual destructor.
2021-05-28common/fs/file: Default initialize IOFile membersLioncash
Prevents a potential uninitialized read vector in the move constructor.
2021-05-25common: fs: Rework the Common Filesystem interface to make use of ↵Morph
std::filesystem (#6270) * common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
2021-05-24Merge pull request #6357 from lioncash/compressionbunnei
common/compression: Make use of std::span
2021-05-24zstd_compression: Make use of std::spanLioncash
Allows for the incoming data stream to be non-allocating.
2021-05-24lz4_compression: Make use of std::spanLioncash
Allows making the incoming data stream non-allocating.
2021-05-20common: tree: Avoid a crash on nullptr dereference.bunnei
2021-05-20Merge pull request #6321 from lat9nq/per-game-cpubunnei
configuration: Add CPU tab to game properties and slight per-game settings rework
2021-05-19Merge pull request #6297 from lioncash/common-convbunnei
parent_of_member: Make sign conversion explicit in OffsetOfImpl()
2021-05-17general: Demote custom_rtc to regular settinglat9nq
2021-05-16configuration: Add CPU tab to game propertieslat9nq
Allows setting CPU accuracy to Accurate or Unsafe per-game, as well as the accuracy options for Unsafe. Debug is not allowed here as a per-game CPU accuracy.
2021-05-15general: Make CPU accuracy and related a Settings::Settinglat9nq
Required to make CPU accuracy and unsafe settings available to use as a per-game setting.
2021-05-11common: tree: Avoid a nullptr dereference.bunnei
2021-05-10parent_of_member: Make sign conversion explicit in OffsetOfImpl()Lioncash
Previously these conversions were implicit and causing quite a few warnings on clang.
2021-05-05fixup! common: bit_util: Add BIT macro.bunnei
2021-05-05common: parent_of_member: Fix build for OffsetOf().bunnei
2021-05-05fixup! common: intrusive_red_black_tree: Disable static_assert that will not ↵bunnei
evaluate as constant on MSVC.
2021-05-05common: Rename NON_COPYABLE/NON_MOVABLE with YUZU_ prefix.bunnei
2021-05-05common: common_funcs: Add Size helper function.bunnei
2021-05-05common: bit_util: Add BIT macro.bunnei
2021-05-05common: intrusive_red_black_tree: Disable static_assert that will not ↵bunnei
evaluate as constant on MSVC.
2021-05-05common: common_funcs: Add helper macros for non-copyable and non-moveable.bunnei
- Useful for scenarios where we do not want to inherit from NonCopyable.
2021-04-20log/backend: Use in-class initializer for FileBackendLioncash
We can also avoid redundant constructions of the same string repeatedly.
2021-04-20log/backend: Make use of erase_ifLioncash
Same behavior, but less verbose.
2021-04-14Merge pull request #6199 from lioncash/log-nsbunnei
common/log: Move Log namespace into the Common namespace
2021-04-14log/backend: Correct order of const in copy constructorLioncash
Follows our predominant coding style. Also explicitly specifies the move constructor/assignment operator as well.
2021-04-14common/log: Move Log namespace into the Common namespaceLioncash
Forgot to move this over when I moved the rest of the source files with lacking namespaces over.
2021-04-14common: Move settings to common from core.bunnei
- Removes a dependency on core and input_common from common.
2021-04-14core: settings: Add setting for debug assertions and disable by default.bunnei
- This is a developer-only setting and no longer needs to be enabled by default. - Also adds "use_auto_stub" setting to SDL frontend while we are here. - Supersedes #1340.
2021-04-12nvidia_flags: Add missing header guardLioncash
Prevents potential inclusion compilation errors.
2021-04-10Merge pull request #6099 from bunnei/derive-membunnei
Kernel Rework: Derive memory regions from board layout.
2021-04-09Merge pull request #6162 from degasus/no_spin_loopsbunnei
video_core: Avoid spin loops.
2021-04-09bgtc: Update to 12.x and implement OpenTaskServiceMorph
2021-04-07common/threadsafe_queue: Provide Wait() method.Markus Wick
It shall block until there is something to consume in the queue. And use it for the GPU emulation instead of the spin loop. This is only in booting the emulator, however in BOTW this is the case for about 1 second.
2021-04-04common: Move assert failure handling into a cpp file.Markus Wick
Advantage: Altering the handler does not need a full recompilation. Disadvantage: noreturn is droped, so the caller is a bit slower. We quite often run yuzu with a YOLO assertion handler. In fact, only very few games run at all with asserts. This patch allows developers to patch the handler without recompiling everything. The overhead of the missing "noreturn" attribute shoul be negletable.
2021-03-23common: common_sizes: Move sizes to the Common namespace.bunnei
2021-03-21common: common_sizes: Move Invalid to Size_* prefix and add missing values.bunnei
2021-03-21hle: kernel: board: k_system_control: Extend to include memory region sizes.bunnei
2021-03-21common: Move common sizes to their own header for code reuse.bunnei
2021-03-10fiber: Double default stack sizeMerryMage
Stack overflow occurs with some guest applications
2021-03-07common: Fiber: use a reference for YieldTo.bunnei
- Fixes another small leak.
2021-03-05common: fiber: Use weak_ptr when yielding.bunnei
- Avoids a memory leak, as taking a strong reference of the fiber here causes a circular reference. - Supersedes #6006 with a more narrow fix.
2021-03-05Revert "core: Switch to unique_ptr for usage of Common::Fiber."bunnei
2021-03-04Merge pull request #6006 from bunnei/fiber-unique-ptrbunnei
core: Switch to unique_ptr for usage of Common::Fiber.
2021-02-28[network] Error handling reformcomex
`network.cpp` has several error paths which either: - report "Unhandled host socket error=n" and return `SUCCESS`, or - switch on a few possible errors, log them, and translate them to Errno; the same switch statement is copied and pasted in multiple places in the code Convert these paths to use a helper function `GetAndLogLastError`, which is roughly the equivalent of one of the switch statements, but: - handling more cases (both ones that were already in `Errno`, and a few more I added), and - using OS functions to convert the error to a string when logging, so it'll describe the error even if it's not one of the ones in the switch statement. - To handle this, refactor the logic in `GetLastErrorMsg` to expose a new function `NativeErrorToString` which takes the error number explicitly as an argument. And improve the Windows version a bit. Also, add a test which exercises two random error paths.
2021-02-27Merge pull request #5984 from jbeich/gcc-freebsdbunnei
common,video-core: unbreak GCC 11 build on FreeBSD 13
2021-02-27core: Switch to unique_ptr for usage of Common::Fiber.bunnei
- With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer.
2021-02-27Merge pull request #5953 from bunnei/memory-refactor-1bunnei
Kernel Rework: Memory updates and refactoring (Part 1)