Commit Graph

838 Commits (fbc67a05637f3acb47f933066fb2e548f9d35d8c)

Author SHA1 Message Date
Weiyi Wang a4595bb939 string_util: remove ShiftJIS/CP1252 conversion function
We always use unicode internally. Any dirty work of conversion with other codec should be handled by frontend framework (Qt). Further more, ShiftJIS/CP1252 are not special (they are not code set used by 3ds, or any guest/host dependencies we have), so there is no reason to specifically include them
7 years ago
fearlessTobi e4daf4bee5 Review comments - part 5 7 years ago
fearlessTobi b4ace6ec6f Address a bunch of review comments 7 years ago
fearlessTobi 4d139943f2 Port web_service from Citra 7 years ago
bunnei 7b81e1e525
Merge pull request #1365 from DarkLordZach/lfs
file_sys: Add support for LayeredFS mods
7 years ago
David 2513e086ab Stubbed IRS (#1349)
* Stubbed IRS

Currently we have no ideal way of implementing IRS. For the time being we should have the functions stubbed until we come up with a way to emulate IRS properly.

* Added IRS to logging backend

* Forward declared shared memory for irs
7 years ago
Weiyi Wang e0ce07aa7d common/thread: remove YieldCPU()
simply use the standard library yield()
7 years ago
Zach Hilman bd8db3f7f8 common_paths: Add Load and Dump dirs 7 years ago
Lioncash ab6dfa4fa5
ring_buffer: Use std::atomic_size_t in a static assert
Avoids the need to repeat "std::" twice
7 years ago
Lioncash c51f8563a6
ring_buffer: Use std::hardware_destructive_interference_size to determine alignment size for avoiding false sharing
MSVC 19.11 (A.K.A. VS 15.3)'s C++ standard library implements P0154R1
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0154r1.html)
which defines two new constants within the <new> header, std::hardware_destructive_interference_size
and std::hardware_constructive_interference_size.

std::hardware_destructive_interference_size defines the minimum
recommended offset between two concurrently-accessed objects to avoid
performance degradation due to contention introduced by the
implementation (with the lower-bound being at least alignof(max_align_t)).
In other words, the minimum offset between objects necessary to avoid
false-sharing.

std::hardware_constructive_interference_size on the other hand defines
the maximum recommended size of contiguous memory occupied by two
objects accessed wth temporal locality by concurrent threads (also
defined to be at least alignof(max_align_t)). In other words the maximum
size to promote true-sharing.

So we can simply use this facility to determine the ideal alignment
size. Unfortunately, only MSVC supports this right now, so we need to
enclose it within an ifdef for the time being.
7 years ago
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 7 years ago
MerryMage 112351d557 common: Implement a ring buffer 7 years ago
CaptV0rt3x e3af341d5b Better Title Bar Display 7 years ago
Lioncash 6ef84f1c4c common/logging: Amend documentation comments
Multi-line doc comments still need the '<' after the ///, otherwise it's
treated as a regular comment and makes the original doc comment broken
in viewers, IDEs, etc. While we're at it, also fix some typos in the
comments.
7 years ago
Lioncash 2949d9552c common/logging/filter: Replace C-style case with C++ static_cast 7 years ago
Lioncash 978f3a3282 common/logging/filter: Make constructor explicit
Implicit conversions aren't desirable here.
7 years ago
bunnei 2562fe4a16
Merge pull request #1170 from lioncash/ret
file_util: Correct return value in early exit of ReadFileToString()
7 years ago
Lioncash c74b7ee204 file_util: Correct return value in early exit of ReadFileToString()
While still essentially being zero, we should be returning a numeric
value here, not a boolean typed value.
7 years ago
Zach Hilman 06487c2c8d hex_util: Replace logic_errors with LOG_CRITICAL
Makes it so malformed hex strings do not crash the entire program.
7 years ago
Lioncash 5a53d75313 logging/text_formatter: Use empty braces for initializing CONSOLE_SCREEN_BUFFER_INFO instance
The previous form of initializing done here is a C-ism, an empty set of
braces is sufficient for initializing (and doesn't potentially cause
missing brace warnings, given the first member of the struct is a COORD
struct).
7 years ago
Lioncash 36090521ce bit_field: Convert ToBool() into explicit operator bool
Gets rid of a TODO that is long overdue.
7 years ago
bunnei b1d238bbb8
Merge pull request #1064 from lioncash/telemetry
common/telemetry: Migrate core-independent info gathering to common
7 years ago
Lioncash b39cd70cd4 common: Namespace hex_util.h/.cpp
It's in the common code, so it should be under the Common namespace like
everything else.
7 years ago
bunnei c594ec3417
Merge pull request #1005 from DarkLordZach/registered-fmt
file_sys: Add support for registration format
7 years ago
bunnei f009ed63f3
Merge pull request #1063 from lioncash/inline
common/xbyak_abi: Mark defined functions in header as inline
7 years ago
bunnei ad7815a28d
Merge pull request #1054 from zhaowenlan1779/misc-fixup
common/misc: use windows.h
7 years ago
Lioncash 60f476cd8f common/telemetry: Migrate core-independent info gathering to common
Previously core itself was the library containing the code to gather
common information (build info, CPU info, and OS info), however all of
this isn't core-dependent and can be moved to the common code and use
the common interfaces. We can then just call those functions from the
core instead.

This will allow replacing our CPU detection with Xbyak's which has
better detection facilities than ours. It also keeps more
architecture-dependent code in common instead of core.
7 years ago
Lioncash 6d549abb4e common/xbyak_abi: Mark defined functions in header as inline
Avoids potential One Definition Rule violations when these are used in
the future.
7 years ago
Lioncash 0ce0905380 common/xbyak: Use nested namespace specifiers where applicable 7 years ago
Lioncash 11895d54af common: Remove unused old breakpoint source files
These currently aren't used and contain commented out source code that
corresponds to Dolphin's JIT. Given our CPU code is organized quite
differently, we shouldn't be keeping this around (at the moment it just
adds to compile times marginally).
7 years ago
Lioncash bc7bfd96f0 logging/backend: Use const reference to refer to log filter
The filter is returned via const reference, so this was making a
pointless copy of the entire filter every time a message was being
pushed into the logger instance.
7 years ago
Zhu PengFei 59d18ef55b
common/misc: use windows.h
linux-mingw does not really like this.
7 years ago
Lioncash 11470f331a thread_queue_list: Make contains() and get_first() const member functions
These don't directly modify the contained data.
7 years ago
Lioncash 55c73e10a7 thread_queue_list: Convert typedef to a type alias 7 years ago
Zach Hilman 167bfddafa file_sys: Comply to style guidelines 7 years ago
Zach Hilman b70a831608 file_util: Add getter for NAND registration directory 7 years ago
Zach Hilman 10aac376d1 common: Move hex string processing to separate file 7 years ago
bunnei a91bb7080d
Merge pull request #989 from lioncash/log
common/logging: Add missing service log categories
7 years ago
bunnei 96ef22d3d0
Merge pull request #897 from DarkLordZach/vfs-accuracy-2
vfs: Add VfsFilesystem and fix RealVfs* implementations
7 years ago
bunnei 5c908c0373
Merge pull request #988 from lioncash/color
common/color: Minor cleanup
7 years ago
Zach Hilman 2b6128fe0b file_util: Use enum instead of bool for specifing path behavior 7 years ago
Zach Hilman 3f82dad1e4 file_util: Add platform-specific slash option to SanitizePath 7 years ago
Lioncash 6e90f0bf6a common/logging: Add missing service log categories
These weren't added when the services were introduced.
7 years ago
Lioncash 5a9c00ea04 common/color: Remove unnecessary const qualifiers on return types
These are just superfluous and not necessesary
7 years ago
Lioncash 76197a4be9 common/color: Get rid of undefined behavior
Gets rid of type punning via reinterpret_cast within functions. Instead,
we use memcpy to transfer the contents across types.
7 years ago
Lioncash cc9d7bbf01 vector_math: Use variable template version of is_signed in Vec classes
Same behavior, less code
7 years ago
bunnei d224eb7c39
Merge pull request #966 from lioncash/modernize
common: Convert type traits templates over to variable template versions where applicable
7 years ago
bunnei 507e6ae100
Merge pull request #968 from lioncash/vec
vector_math: Minor cleanups
7 years ago
Lioncash 766c1a2d50 vector_math: Remove unimplemented function prototypes 7 years ago
Lioncash 5c323d96e0 vector_math: Make functions constexpr where applicable 7 years ago
Lioncash 4e3bc37791 vector_math: Convert typedefs to type aliases 7 years ago
Lioncash a7d6efc520 common: Convert type traits templates over to variable template versions where applicable
Uses the C++17 inline variable variants
7 years ago
Lioncash 0735a0c8a1 file_util: Avoid sign-conversions in WriteArray() and ReadArray()
Prevents compiler warnings.
7 years ago
Lioncash 45bc449ff9 service: Add usb services
Adds basic skeleton for the usb services based off the information provided by Switch Brew.
7 years ago
Lioncash de72956181 service: Add arp services
Adds the basic skeleton of the arp services based off the information
provided by Switch Brew.
7 years ago
bunnei 2b06301dbf
Merge pull request #849 from DarkLordZach/xci
XCI and Encrypted NCA Support
7 years ago
bunnei 40e78b9a89
Merge pull request #898 from lioncash/mig
service: Add migration services
7 years ago
bunnei ef9433411d
Merge pull request #900 from lioncash/init
math_util: Always initialize members of Rectangle
7 years ago
Lioncash f2a03468b1 math_util: Always initialize members of Rectangle
Prevents potentially using the members uninitialized.
7 years ago
Lioncash 7469e26e5e service: Add migration services
Adds the basic skeleton for the mig:usr service based off information
provided by Switch Brew.
7 years ago
Lioncash 42c5171322 logging/log: Remove incorrect description in PCV doc comment
PCV isn't the parental control service.
7 years ago
Lioncash 5233040ab4 service: Add psc services
Adds the basic skeleton for the psc services based off the information
provided by Switch Brew.
7 years ago
bunnei 746d7d4d28
Merge pull request #888 from lioncash/caps
service: Add capture services
7 years ago
Lioncash e39294c267 service: Add capture services
Adds the basic skeleton for the capture services based off information
provided by Switch Brew.
7 years ago
Lioncash d109279543 service: Add bpc and pcv services
Adds the basic skeleton for the remaining pcv-related services based off
information on Switch Brew.
7 years ago
Zach Hilman 150527ec19 Allow key loading from %YUZU_DIR%/keys in addition to ~/.switch 7 years ago
Zach Hilman cc8234fa89 Use SHGetKnownFolderPath instead of SHGetFolderPathA 7 years ago
Zach Hilman 22342487e8 Extract mbedtls to cpp file 7 years ago
Zach Hilman df5b75694f Remove files that are not used 7 years ago
bunnei 0a2b219a31
Merge pull request #864 from FearlessTobi/port-3973
Port #3973 from Citra: "Remove polymorphism issue"
7 years ago
bunnei fd020ad52a
Merge pull request #875 from lioncash/fgm
service: Add fgm services
7 years ago
Lioncash 268eeeb406 service: Add fgm services
Adds the basic skeleton for the fgm services based off the information
provided by Switch Brew.
7 years ago
Lioncash e373027a73 service: Add the pcie service
Adds the basic skeleton of the pcie service based off information on
Switch Brew.
7 years ago
Tobias 420f8fb29e Port #3758 from Citra (#852): Add missing std::string import in text_formatter 7 years ago
bunnei 05ee92a357
Merge pull request #861 from FearlessTobi/port-3972
Port #3972 from Citra: "common/timer: use std::chrono, avoid platform-dependent code"
7 years ago
bunnei e6b08b2209
Merge pull request #862 from FearlessTobi/port-3997
Port #3997 from Citra: "common/string_utils: replace boost::transform with std counterpart"
7 years ago
bunnei f8094c2617
Merge pull request #865 from FearlessTobi/port-3732
Port #3732 from Citra: "common: Fix compilation on ARM"
7 years ago
bunnei c5fa3560a6
Merge pull request #857 from lioncash/wlan
service: Add wlan services
7 years ago
Cameron Cawley 1670c4421f Port #3732 from Citra: "common: Fix compilation on ARM" 7 years ago
B3n30 6e5f83ee24 remove polymorphism issue 7 years ago
zhupengfei ff510157d8 common/string_utils: replace boost::transform with std counterpart
Note: according to cppreference it is necessary to convert char to unsigned char when using std::tolower and std::toupper, otherwise the behaviour would be undefined.
7 years ago
zhupengfei 38a1113674 Port #3972 from Citra: "common/timer: use std::chrono, avoid platform-dependent code" 7 years ago
Lioncash 6ea416091e service: Add wlan services
Adds the basic skeleton for the wlan services based off the information
on Switch Brew.
7 years ago
Lioncash ca7655be3a service: Add btm services
Adds the skeleton for the btm services based off the information on
Switch Brew.
7 years ago
bunnei 458fdda700
Merge pull request #847 from lioncash/ncm
service: Add ncm services
7 years ago
bunnei d00dcdb1be
Merge pull request #846 from lioncash/mii
service: Add mii services
7 years ago
Lioncash 7931cc0ceb service: Add ncm services
Adds the basic skeleton for the ncm services based off information on
Switch Brew.
7 years ago
bunnei 0191a1e526
Merge pull request #845 from lioncash/nfc
service: Add nfc services
7 years ago
Lioncash f46bfdd77d service: Add mii services
Adds the skeleton for the mii services based off information provided by
Switch Brew
7 years ago
Lioncash 04d144aa40 service: Add nfc services
Adds the skeleton of the nfc service based off the information provided
on Switch Brew.
7 years ago
Lioncash ea8dd8b650 service/lbl: Implement EnableVrMode, DisableVrMode and GetVrMode
Implements these functions according to the information available on
Switch Brew.
7 years ago
Lioncash 8781beaf0d service: Add ldn services
Adds ldn services based off information provided by Switch Brew.
7 years ago
Zach Hilman 59cb258409 VFS Regression and Accuracy Fixes (#776)
* Regression and Mode Fixes

* Review Fixes

* string_view correction

* Add operator& for FileSys::Mode

* Return std::string from SanitizePath

* Farming Simulator Fix

* Use != With mode operator&
7 years ago
Lioncash 9d33122197 string_util: Get rid of separate resize() in CPToUTF16(), UTF16ToUTF8(), CodeToUTF8() and UTF8ToUTF16()
There's no need to perform the resize separately here, since the
constructor allows presizing the buffer.

Also move the empty string check before the construction of the string
to make the early out more straightforward.
7 years ago
Lioncash 26a157cd31 string_util: Use emplace_back() in SplitString() instead of push_back()
This is equivalent to doing:

push_back(std::string(""));

which is likely not to cause issues, assuming a decent std::string
implementation with small-string optimizations implemented in its
design, however it's still a little unnecessary to copy that buffer
regardless. Instead, we can use emplace_back() to directly construct the
empty string within the std::vector instance, eliminating any possible
overhead from the copy.
7 years ago
Lioncash cd46b267f5 string_util: Remove unnecessary std::string instance in TabsToSpaces()
We can just use the variant of std::string's replace() function that can
replace an occurrence with N copies of the same character, eliminating
the need to allocate a std::string containing a buffer of spaces.
7 years ago
bunnei 5ee4c49c30
Merge pull request #768 from lioncash/string-view
file_util, vfs: Use std::string_view where applicable
7 years ago
Lioncash 398444e676 file_util, vfs: Use std::string_view where applicable
Avoids unnecessary construction of std::string instances where
applicable.
7 years ago
bunnei 258a5cee84
Merge pull request #765 from lioncash/file
file_util: Remove goto usages from Copy()
7 years ago
Lioncash c5de0a67a8 file_util: Remove goto usages from Copy()
We can just leverage std::unique_ptr to automatically close these for us
in error cases instead of jumping to the end of the function to call
fclose on them.
7 years ago