Commit graph

1274 commits

Author SHA1 Message Date
Morph
74790e4f33 common: fs: file: Remove redundant call to WriteStringToFile
The Append open mode will create a new file if said file does not exist at a given path, making this call redundant.
2021-06-16 00:06:02 -04:00
Morph
0f48292de1 fsp_srv: Fix filesystem access logging
This introduces a new setting Enable FS Access Log which saves the filesystem access log to sdmc:/FsAccessLog.txt

If this setting is not enabled, this will indicate to FS to not call OutputAccessLogToSdCard.

Fixes softlocks during loading in Xenoblade Chronicles 2 when certain DLC is enabled.
2021-06-16 00:06:02 -04:00
Fernando Sahmkow
8d4dfc98ec
Merge pull request #6448 from Morph1984/recursive-dir-iterator
common: fs: Use the normal directory iterator in *Recursively functions
2021-06-14 15:47:04 +02:00
Morph
391e823c79 common: logging: Restructure backend code 2021-06-13 11:05:58 -04:00
Morph
8150c65c07 common: logging: backend: Wrap IOFile in a unique_ptr
Allows us to forward declare Common::FS::IOFile.
2021-06-13 11:05:58 -04:00
Morph
c978f3144c common: fs: Use the normal directory iterator in *Recursively functions
MSVC's implementation of recursive_directory_iterator throws an exception on an error despite a std::error_code being passed into its constructor. This is most likely a bug in MSVC's implementation since directory_iterator does not throw an exception on an error.

We can replace the usage of recursive_directory_iterator for now until MSVC fixes their implementation of it.
2021-06-12 01:39:07 -04:00
Markus Wick
7f85abb281 common/host_memory: Implement a fallback if fastmem fails.
This falls back to the old approach of using a virtual buffer.

Windows is untested, but this build should fix support for Windows < 10 v1803. However without fastmem support at all.
2021-06-11 17:27:17 +02:00
ReinUsesLisp
f332d4a9b5 common/host_shader: Load Windows 10 functions dynamically
Workaround old headers and libraries shipped on MinGW.
2021-06-11 17:27:17 +02:00
ReinUsesLisp
ee67460ff0 host_memory: Support staged VirtualProtect calls 2021-06-11 17:27:17 +02:00
FernandoS27
5ba28325b2 General: Add settings for fastmem and disabling adress space check. 2021-06-11 17:27:17 +02:00
Markus Wick
c4609c92ee common/host_memory: Optimize for huge tables.
In theory, if we have 2 MB continously mapped, this should save one layer of TLB.
Let's make it at least more likely by aligning the memory.
2021-06-11 17:27:06 +02:00
Markus Wick
621f3f5f47 core: Make use of fastmem 2021-06-11 17:27:06 +02:00
Markus Wick
5105318bbc common/host_memory: Add Linux implementation 2021-06-11 17:27:06 +02:00
ReinUsesLisp
a7837a3791 common/host_memory: Add interface and Windows implementation 2021-06-11 17:27:06 +02:00
liushuyu
eb9deffab6
src/common/CMakeLists.txt: fix variable escaping 2021-06-09 02:20:55 -06:00
Lioncash
dd8577e91d common/fs/path_util: Remove [[nodiscard]] from function with void return
We can't make use of the return value here, since we don't a return
value to work with.
2021-06-08 19:36:09 -04:00
Morph
377cd301b3
Merge pull request #6395 from lioncash/result-move
common_funcs: Move R_ macros to result.h
2021-06-02 00:34:48 -04:00
Morph
dba7bcd489 common: fs: fs_util: Move PathToUTF8String to fs_util 2021-06-02 00:26:26 -04:00
Morph
a1eeb9908d common: fs: fs_util: Add more string conversion functions 2021-06-02 00:26:26 -04:00
Lioncash
3aed797466 common_funcs: Move R_ macros to result.h
These macros all interact with the result code type, so they should
ideally be within this file as well, so all the common_funcs machinery
doesn't need to be pulled in just to use them.
2021-05-31 16:41:00 -04:00
bunnei
f34176996e
Merge pull request #6385 from degasus/save_memory_access
core/memory: Check our memory fallbacks for out-of-bound behavior.
2021-05-30 23:21:39 -07:00
Markus Wick
42a7c5d017 core/memory: Check our memory fallbacks for out-of-bound behavior.
This makes it by far harder to crash yuzu.

Also implement the 48bit masking of AARCH64 while touching this code.
2021-05-29 09:28:26 +02:00
Lioncash
8171ad65cd common: Extract point into a common struct
This is generic enough that it can be moved into the Common class for
reuse.
2021-05-28 08:12:49 -04:00
Lioncash
210c2c9a56 common/fs/file: Explicitly delete copy constructors
Relocates them to the same place the move equivalents are at for
consistent viewing.
2021-05-28 01:49:40 -04:00
Lioncash
6806a893bd common/fs/file: Devirtualize destructor
IOFile is a final class, so there's no need for a virtual destructor.
2021-05-28 01:47:52 -04:00
Lioncash
019bc9f6b2 common/fs/file: Default initialize IOFile members
Prevents a potential uninitialized read vector in the move constructor.
2021-05-28 01:46:30 -04:00
Morph
065867e2c2
common: fs: Rework the Common Filesystem interface to make use of 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-25 19:32:56 -04:00
bunnei
d84a93c987
Merge pull request #6357 from lioncash/compression
common/compression: Make use of std::span
2021-05-24 18:50:26 -07:00
Lioncash
49bfd0c461 zstd_compression: Make use of std::span
Allows for the incoming data stream to be non-allocating.
2021-05-24 15:01:04 -04:00
Lioncash
00213377b1 lz4_compression: Make use of std::span
Allows making the incoming data stream non-allocating.
2021-05-24 15:00:59 -04:00
bunnei
342170fcd3 common: tree: Avoid a crash on nullptr dereference. 2021-05-20 21:41:51 -07:00
bunnei
7626ca3343
Merge pull request #6321 from lat9nq/per-game-cpu
configuration: Add CPU tab to game properties and slight per-game settings rework
2021-05-20 20:10:56 -07:00
bunnei
b5d21cc1b1
Merge pull request #6297 from lioncash/common-conv
parent_of_member: Make sign conversion explicit in OffsetOfImpl()
2021-05-19 18:43:47 -07:00
lat9nq
339dc4f806 general: Demote custom_rtc to regular setting 2021-05-17 15:54:30 -04:00
lat9nq
ab2677f0a1 configuration: Add CPU tab to game properties
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-16 01:31:42 -04:00
lat9nq
e169fdad4f general: Make CPU accuracy and related a Settings::Setting
Required to make CPU accuracy and unsafe settings available to use as a
per-game setting.
2021-05-15 20:46:48 -04:00
bunnei
eee302b9b9 common: tree: Avoid a nullptr dereference. 2021-05-11 15:40:20 -07:00
Lioncash
0aff3ba2ff parent_of_member: Make sign conversion explicit in OffsetOfImpl()
Previously these conversions were implicit and causing quite a few
warnings on clang.
2021-05-10 08:07:33 -04:00
bunnei
a488b86e97 fixup! common: bit_util: Add BIT macro. 2021-05-05 16:40:54 -07:00
bunnei
e02785be83 common: parent_of_member: Fix build for OffsetOf(). 2021-05-05 16:40:54 -07:00
bunnei
27a6ef64fd fixup! common: intrusive_red_black_tree: Disable static_assert that will not evaluate as constant on MSVC. 2021-05-05 16:40:54 -07:00
bunnei
d3c166d4d5 common: Rename NON_COPYABLE/NON_MOVABLE with YUZU_ prefix. 2021-05-05 16:40:53 -07:00
bunnei
02c2b28cd0 common: common_funcs: Add Size helper function. 2021-05-05 16:40:49 -07:00
bunnei
74120c5e3a common: bit_util: Add BIT macro. 2021-05-05 16:40:49 -07:00
bunnei
d9205f82b3 common: intrusive_red_black_tree: Disable static_assert that will not evaluate as constant on MSVC. 2021-05-05 16:40:49 -07:00
bunnei
b99fc70191 common: common_funcs: Add helper macros for non-copyable and non-moveable.
- Useful for scenarios where we do not want to inherit from NonCopyable.
2021-05-05 16:40:49 -07:00
Lioncash
6125590a7b log/backend: Use in-class initializer for FileBackend
We can also avoid redundant constructions of the same string repeatedly.
2021-04-20 12:57:49 -04:00
Lioncash
aaaca1cd6d log/backend: Make use of erase_if
Same behavior, but less verbose.
2021-04-20 12:53:05 -04:00
bunnei
60511976bb
Merge pull request #6199 from lioncash/log-ns
common/log: Move Log namespace into the Common namespace
2021-04-14 21:29:44 -07:00
Lioncash
2a341c9969 log/backend: Correct order of const in copy constructor
Follows our predominant coding style. Also explicitly specifies the move
constructor/assignment operator as well.
2021-04-14 23:11:01 -04:00