Commit Graph

6283 Commits (99b5aa273cedd32751d3faaabb442e4453b1c32c)

Author SHA1 Message Date
Lioncash 964154ce44 file_util: std::move FST entries in ScanDirectoryTree()
Avoids unnecessary copies when building up the FST entries.
7 years ago
bunnei 63fbf9a7d3 gl_rasterizer_cache: Blit surfaces on recreation instead of flush and load. 7 years ago
bunnei 4301f0b539 gl_rasterizer_cache: Use GPUVAddr as cache key, not parameter set. 7 years ago
bunnei cd47391c2d gl_rasterizer_cache: Use zeta_width and zeta_height registers for depth buffer. 7 years ago
bunnei d8c60029d6 gl_rasterizer: Use zeta_enable register to enable depth buffer. 7 years ago
bunnei 5287991a36 maxwell_3d: Add depth buffer enable, width, and height registers. 7 years ago
bunnei 53a219f163
Merge pull request #759 from lioncash/redundant
file_util: Remove redundant duplicate return in GetPathWithoutTop()
7 years ago
bunnei 3ac736c003
Merge pull request #748 from lioncash/namespace
video_core: Use nested namespaces where applicable
7 years ago
bunnei f5e87f4ce1
Merge pull request #758 from lioncash/sync
common: Remove synchronized_wrapper.h
7 years ago
bunnei 9533875eeb
Merge pull request #760 from lioncash/path
file_util: Use an enum class for GetUserPath()
7 years ago
Subv 5c49e56d41 GPU: Implement the NVGPU_IOCTL_CHANNEL_KICKOFF_PB ioctl2 command.
This behaves quite similarly to the SubmitGPFIFO command. Referenced from Ryujinx.
Many thanks to @gdkchan for investigating this!
7 years ago
Lioncash d66b43dadf file_util: Use an enum class for GetUserPath()
Instead of using an unsigned int as a parameter and expecting a user to
always pass in the correct values, we can just convert the enum into an
enum class and use that type as the parameter type instead, which makes
the interface more type safe.

We also get rid of the bookkeeping "NUM_" element in the enum by just
using an unordered map. This function is generally low-frequency in
terms of calls (and I'd hope so, considering otherwise would mean we're
slamming the disk with IO all the time) so I'd consider this acceptable
in this case.
7 years ago
Lioncash 34d6a1349c file_util: Remove explicit type from std::min() in GetPathWithoutTop()
Given both operands are the same type, there won't be an issue with
overload selection that requires making this explicit.
7 years ago
Lioncash 41660c8923 file_util: Remove redundant duplicate return in GetPathWithoutTop() 7 years ago
Lioncash 973fdce79b common: Remove synchronized_wrapper.h
This is entirely unused in the codebase.
7 years ago
bunnei 0f20fa5a1e
Merge pull request #754 from lioncash/part
partition_filesystem, vfs_real: Minor changes
7 years ago
bunnei de7cb91995
Merge pull request #750 from lioncash/ctx
arm_interface: Remove unused tls_address member of ThreadContext
7 years ago
bunnei 1c7c1347d8
Merge pull request #746 from lioncash/tests
tests/arm_test_common: Minor changes
7 years ago
bunnei ff8754f921
Merge pull request #747 from lioncash/unimplemented
gl_shader_manager: Remove unimplemented function prototype
7 years ago
bunnei 89cc8c1617
Merge pull request #755 from lioncash/ctor
file_sys/errors: Remove redundant object constructor calls
7 years ago
bunnei 552aac7e6c
Merge pull request #749 from lioncash/consistency
gpu: Rename Get3DEngine() to Maxwell3D()
7 years ago
bunnei fe2498a650
Merge pull request #751 from Subv/tpidr_el0
CPU: Save and restore the TPIDR_EL0 system register on every context switch
7 years ago
bunnei 3d938b8c60
Merge pull request #753 from lioncash/const
vfs: Minor changes
7 years ago
bunnei d85cfc94e2
Merge pull request #752 from Subv/vfs_load
Loader: Only print the module names and addresses if they actually exist.
7 years ago
Lioncash 459e158340 file_sys/errors: Remove redundant object constructor calls
Given we're already constructing the error code, we don't need to call
the constructor inside of it.
7 years ago
Lioncash b46c0ed1fa vfs_real: Remove redundant copying of std::vector instances in GetFiles() and GetSubdirectories()
We already return by value, so we don't explicitly need to make the
copy.
7 years ago
Lioncash ec71915ede partition_filesystem, vfs_real: Add missing standard includes 7 years ago
Lioncash d36e327ba6 partition_filesystem, vfs_real: Use std::move in ReplaceFileWithSubdirectory() where applicable
Avoids unnecessary atomic increment and decrement operations.
7 years ago
Lioncash 2b91386e15 partition_filesystem, vfs_real: Use std::distance() instead of subtraction
This is a little bit more self-documenting on what is being done here.
7 years ago
Lioncash 3e0727df1b vfs_offset: Simplify TrimToFit()
We can simply use std::clamp() here, instead of using an equivalent
with std::max() and std::min().
7 years ago
Lioncash 894b0de0f2 vfs: Make WriteBytes() overload taking a std::vector pass the std::vector by const reference
Given the data is intended to be directly written, there's no need to
take the std::vector by value and copy the data.
7 years ago
Lioncash dd09439fee vfs: Use variable template variants of std::is_trivially_copyable
Provides the same behavior, but with less writing
7 years ago
Lioncash 05231d8b08 vfs: Amend constness on pointers in WriteBytes() and WriteArrays() member functions to be const qualified
These functions don't modify the data being pointed to, so these can be
pointers to const data
7 years ago
Subv 966874e357 Loader: Only print the module names and addresses if they actually exist. 7 years ago
Subv d84eb9dac6 CPU: Save and restore the TPIDR_EL0 system register on every context switch.
Note that there's currently a dynarmic bug preventing this register from being written.
7 years ago
bunnei 8afc21f175
Merge pull request #743 from lioncash/view
logging: Use std::string_view where applicable
7 years ago
bunnei d4104c72aa
Merge pull request #745 from lioncash/package
param_package: Minor changes
7 years ago
Lioncash ae09adfcb3 arm_interface: Remove unused tls_address member of ThreadContext
Currently, the TLS address is set within the scheduler, making this
member unused.
7 years ago
Lioncash d5bc9aef4e gl_shader_manager: Replace unimplemented function prototype
This was just a linker error waiting to happen.
7 years ago
Lioncash 863579736c gpu: Rename Get3DEngine() to Maxwell3D()
This makes it match its const qualified equivalent.
7 years ago
Lioncash bb960c8cb4 video_core: Use nested namespaces where applicable
Compresses a few namespace specifiers to be more compact.
7 years ago
bunnei 2b7d862366
Merge pull request #742 from bunnei/misc-apm
apm: Improve stub for GetPerformanceConfiguration.
7 years ago
Lioncash 48733744bb arm_test_common: Get rid of truncation warnings
Explicitly cast the value to a u8 to show that this is intentional.
7 years ago
Lioncash a8bb1eb39f arm_test_common: Make file static variable a member variable of the testing environment
Gets rid of file-static behavior.
7 years ago
Lioncash a44475207c arm_test_common: Add missing header guard 7 years ago
Lioncash 3268321f4b param_package: Take std::string by value in string-based Set() function
Allows avoiding string copies by letting the strings be moved into the
function calls.
7 years ago
Lioncash 6279c2dcf4 param_package: Use std::unordered_map's insert_or_assign instead of map indexing
This avoids a redundant std::string construction if a key doesn't exist
in the map already.

e.g.

data[key] requires constructing a new default instance of the value in
the map (but this is wasteful, since we're already setting something
into the map over top of it).
7 years ago
Lioncash 474ec2ee5f param_package: Get rid of file-static std::string construction
Avoids potential dynamic allocation occuring during program launch
7 years ago
Lioncash f63ccbd936 logging/filter: Use std::string_view in ParseFilterString()
Allows avoiding constructing std::string instances, since this only
reads an arbitrary sequence of characters.

We can also make ParseFilterRule() internal, since it doesn't depend on
any private instance state of Filter
7 years ago
Lioncash 7a1a860abe logging/backend: Add missing standard includes
A few inclusions were being satisfied indirectly. To prevent breakages
in the future, include these directly.
7 years ago
Lioncash 457d1b4490 logging/backend: Use std::string_view in RemoveBackend() and GetBackend()
These can just use a view to a string since its only comparing against
two names in both cases for matches. This avoids constructing
std::string instances where they aren't necessary.
7 years ago
bunnei dffd154d6d apm: Improve stub for GetPerformanceConfiguration. 7 years ago
Lioncash 0a0b3c4b9f ipc_helpers: Add PushEnum() member function to ResponseBuilder
Allows pushing strongly-typed enum members without the need to always
cast them at the call sites.

Note that we *only* allow strongly-typed enums in this case. The reason
for this is that strongly typed enums have a guaranteed defined size, so
the size of the data being pushed is always deterministic. With regular
enums this can be a little more error-prone, so we disallow them.

This function simply uses the underlying type of the enum to determine
the size of the data. For example, if an enum is defined as:

enum class SomeEnum : u16 {
  SomeEntry
};

if PushEnum(SomeEnum::SomeEntry); is called, then it will push a
u16-size amount of data.
7 years ago
bunnei c1c9ab31e8
Merge pull request #740 from Subv/acc_crash
HLE/ACC: Stub IManagerForApplication::GetAccountId to return an error.
7 years ago
bunnei 29f49bd3c1
Merge pull request #738 from lioncash/sign
gl_state: Get rid of mismatched sign conversions in Apply()
7 years ago
bunnei ffbd51e207
Merge pull request #737 from lioncash/move
filesys/loader: std::move VirtualFile instances in constructors where applicable
7 years ago
bunnei 701c7cb85c
Merge pull request #736 from lioncash/null
audout_u/audren_u: Ensure null terminators are written out in ListAudioOutsImpl(), ListAudioDeviceName(), and GetActiveAudioDeviceName()
7 years ago
bunnei fbc2bcd4a9
Merge pull request #735 from lioncash/video-unused
maxwell_3d: Remove unused variable within GetStageTextures()
7 years ago
bunnei 741cae1e1d
Merge pull request #734 from lioncash/thread
thread: Convert ThreadStatus into an enum class
7 years ago
bunnei a1805ceb0b
Merge pull request #733 from lioncash/dirs
partition_filesystem: Return pfs_dirs member variable within GetSubdirectories()
7 years ago
bunnei 86d1649b32
Merge pull request #732 from lioncash/unused
nso: Minor changes
7 years ago
bunnei 204d707ce7
Merge pull request #731 from lioncash/shadow
gl_shader_decompiler: Eliminate variable and declaration shadowing
7 years ago
Subv 9c7321fe6d HLE/ACC: Stub IManagerForApplication::GetAccountId to return an error.
And make IManagerForApplication::CheckAvailability always return false.
Returning a bogus id from GetAccountId causes games to crash on boot.
We should investigate this with a hwtest and either stub it properly or implement it.
7 years ago
Lioncash 0faa13baeb gl_state: Make references const where applicable in Apply() 7 years ago
Lioncash e6b3d3a9ea gl_state: Get rid of mismatched sign conversions
While we're at it, amend the loop variable type to be the same width as
that returned by the .size() call.
7 years ago
Lioncash 8874d0e657 loader/{nca, nro}: std::move VirtualFile in the constructors where applicable
This avoids unnecessary atomic reference count increments and decrements
7 years ago
Lioncash 0e9d58e82a vfs_offset: std::move file and name parameters of OffsetVfsFile
Avoids potentially unnecessary atomic reference count incrementing and
decrementing, as well as string copying.
7 years ago
bunnei f36affdbe3
Merge pull request #730 from lioncash/string
gl_shader_decompiler: Remove unnecessary const from return values
7 years ago
Lioncash 40c9c5a55c audren_u: Use a std::array instead of std::string for holding the audio interface/device name
std::string doesn't include the null-terminator in its data() + size()
range. This ensures that the null-terminator will also be written to the buffer
7 years ago
Lioncash c20cea118b audout_u: Use a std::array instead of std::string for holding the audio interface name
Uses a type that doesn't potentially dynamically allocate, and ensures
that the name of the interface is properly null-terminated when writing
it to the buffer.
7 years ago
Lioncash 8b08f82dc7 maxwell_3d: Remove unused variable within GetStageTextures() 7 years ago
Lioncash dbfe82773d thread: Convert ThreadStatus into an enum class
Makes the thread status strongly typed, so implicit conversions can't
happen. It also makes it easier to catch mistakes at compile time.
7 years ago
Lioncash bbd6429ecb partition_filesystem: Return pfs_dirs member variable within GetSubdirectories()
This should be returned here, otherwise pfs_dirs is effectively only
ever added to, but never read.
7 years ago
Lioncash 364b950515 nso: Silence implicit sign conversion warnings 7 years ago
Lioncash a25c5b982a nso: Remove unused function ReadSegment() 7 years ago
Lioncash f26866ff6a gl_shader_decompiler: Eliminate variable and declaration shadowing
Ensures that no identifiers are being hidden, which also reduces
compiler warnings.
7 years ago
Lioncash c2121cb059 gl_shader_decompiler: Remove unnecessary const from return values
This adds nothing from a behavioral point of view, and can inhibit the
move constructor/RVO
7 years ago
Lioncash 1bdb67440b pl_u: Simplify WriteBuffer() calls in GetSharedFontInOrderOfPriority()
With the new overload, we can simply pass the container directly.
7 years ago
bunnei d3cfaf95c8
Merge pull request #726 from lioncash/overload
hle_ipc: Introduce generic WriteBuffer overload for multiple container types
7 years ago
bunnei 0b13ce1435
Merge pull request #725 from lioncash/bytes
pl_u: Specify correct size for buffers in GetSharedFontInOrderOfPriority()
7 years ago
bunnei af08034c71
Merge pull request #728 from Subv/acc_profile
HLE/ACC: Change the default user id and small improvements to the way we handle profiles
7 years ago
bunnei 2aeb3355e4
Merge pull request #727 from Subv/acc_users
HLE/ACC: Write a single whole user id in ListAllUsers and ListOpenUsers.
7 years ago
bunnei c6352ffc58
Merge pull request #724 from lioncash/printf
pl_u: Remove printf specifier in log call in a log call in GetSharedFontInOrderOfPriority()
7 years ago
bunnei ec468c990d
Merge pull request #723 from lioncash/gdb
gdbstub: Get rid of a few signed/unsigned comparisons
7 years ago
bunnei f43d8ea523
Merge pull request #722 from lioncash/signed
hid: Resolve a signed/unsigned comparison warning
7 years ago
bunnei 2194308245
Merge pull request #721 from lioncash/svc
svc: Correct always true assertion case in SetThreadCoreMask
7 years ago
bunnei b5c77313de
Merge pull request #719 from lioncash/docs
loader: Amend Doxygen comments
7 years ago
bunnei dd0446ff43
Merge pull request #718 from lioncash/read
loader/nso: Check if read succeeded in IdentifyFile() before checking magic value
7 years ago
bunnei 31413f0d2f
Merge pull request #717 from lioncash/explicit
hle/service: Make constructors explicit where applicable
7 years ago
Subv 05549e45c5 HLE/ACC: Return an IProfile that is consistent with what was requested.
The default username for now is "yuzu".
We should eventually allow the creation of users in the emulator and have the ability to modify their parameters.
7 years ago
Subv 50e2777724 HLE/ACC: Change the default user id to be consistent with what we tell games on startup.
In IApplicationFunctions::PopLaunchParameter we tell the games that they were launched as user id 1.
7 years ago
Subv b102815f1f HLE/ACC: Write a single whole user id in ListAllUsers and ListOpenUsers.
We only emulate a single user id for now.
7 years ago
bunnei 7244671137
Merge pull request #716 from lioncash/construct
nvflinger: Emplace Display instances directly
7 years ago
Lioncash ff500a7b68 hle_ipc: Introduce generic WriteBuffer overload for multiple container types
This introduces a slightly more generic variant of WriteBuffer().
Notably, this variant doesn't constrain the arguments to only accepting
std::vector instances. It accepts whatever adheres to the
ContiguousContainer concept in the C++ standard library.

This essentially means, std::array, std::string, and std::vector can be
used directly with this interface. The interface no longer forces you to
solely use containers that dynamically allocate.

To ensure our overloads play nice with one another, we only enable the
container-based WriteBuffer if the argument is not a pointer, otherwise
we fall back to the pointer-based one.
7 years ago
bunnei eb9b55eafe
Merge pull request #715 from lioncash/const-ref
nvdrv: Take std::string by const reference in GetDevice()
7 years ago
Sebastian Valle 78dd1cd441
Merge pull request #720 from Subv/getentrytype_root
Filesystem: Return EntryType::Directory for the root directory.
7 years ago
Lioncash df001e83b1 pl_u: Specify correct size for buffers in GetSharedFontInOrderOfPriority()
This WriteBuffer overload expects its size argument to be in bytes, not
elements.
7 years ago
Lioncash b879fb84a2 svc: Correct always true assertion case in SetThreadCoreMask
The reason this would never be true is that ideal_processor is a u8 and
THREADPROCESSORID_DEFAULT is an s32. In this case, it boils down to how
arithmetic conversions are performed before performing the comparison.

If an unsigned value has a lesser conversion rank (aka smaller size)
than the signed type being compared, then the unsigned value is promoted
to the signed value (i.e. u8 -> s32 happens before the comparison). No
sign-extension occurs here either.

An alternative phrasing:

Say we have a variable named core and it's given a value of -2.

u8 core = -2;

This becomes 254 due to the lack of sign. During integral promotion to
the signed type, this still remains as 254, and therefore the condition
will always be true, because no matter what value the u8 is given it
will never be -2 in terms of 32 bits.

Now, if one type was a s32 and one was a u32, this would be entirely
different, since they have the same bit width (and the signed type would
be converted to unsigned instead of the other way around) but would
still have its representation preserved in terms of bits, allowing the
comparison to be false in some cases, as opposed to being true all the
time.

---

We also get rid of two signed/unsigned comparison warnings while we're
at it.
7 years ago
Lioncash 68c1ffdd1c pl_u: Remove printf specifier in log call in a log call in GetSharedFontInOrderOfPriority()
This can just use the fmt specifiers and be type-agnostic.
7 years ago
Sebastian Valle 7eace8f512
Merge pull request #714 from lioncash/index
hle_ipc: Amend usage of buffer_index within one of HLERequestContext's WriteBuffer() overloads
7 years ago
bunnei 38b35e752b
Merge pull request #712 from lioncash/fsp
fsp_srv: Misc individual changes
7 years ago
Lioncash c945226973 gdbstub: Get rid of a few signed/unsigned comparisons
Ensures both operands in comparisons are the same signedness.
7 years ago
Lioncash a37a47448d hid: Use a ranged-for loops in UpdatePadCallback
Modernizes the loops themselves while also getting rid of a signed/unsigned
comparison in a loop condition.
7 years ago
Lioncash 95103a1b7b hid: Use HID_NUM_LAYOUTS constant for indicating size of the layouts array
Gets rid of the use of a magic constant
7 years ago
bunnei 427fc4ac6b
Merge pull request #713 from lioncash/filesys
filesystem: Minor changes
7 years ago
bunnei e91ba6c057
Merge pull request #711 from lioncash/swap
common/swap: Minor changes
7 years ago
bunnei d6c7a05239
Merge pull request #710 from lioncash/unused
common/common_funcs: Remove unused rotation functions
7 years ago
bunnei 1034bcc742
Merge pull request #694 from lioncash/warn
loader/{nro, nso}: Resolve compilation warnings
7 years ago
Subv e5c916a27c Filesystem: Return EntryType::Directory for the root directory.
It is unknown if this is correct behavior, but it makes sense and fixes a regression with Stardew Valley.
7 years ago
Lioncash 50d08beed2 loader: Amend Doxygen comments
These weren't adjusted when VFS was introduced
7 years ago
bunnei bbc31ba6af
Merge pull request #709 from lioncash/thread-local
common/misc: Deduplicate code in GetLastErrorMsg()
7 years ago
Lioncash 9b22f856c2 loader/nso: Check if read succeeded in IdentifyFile() before checking magic value
We should always assume the filesystem is volatile and check each IO
operation. While we're at it reorganize checks so that early-out errors
are near one another.
7 years ago
Lioncash c061c2bf3c hle/service: Make constructors explicit where applicable
Prevents implicit construction and makes these lingering non-explicit
constructors consistent with the rest of the other classes in services.
7 years ago
Lioncash f3daecafeb nvflinger: Emplace Display instances directly
We can use emplace_back to construct the Display instances directly,
instead of constructing them separately and copying them, avoiding the
need to copy std::string and std::vector instances that are part of the
Display struct.
7 years ago
bunnei 04f7a7036a
Merge pull request #705 from lioncash/string-ref
file_util: return string by const reference for GetExeDirectory()
7 years ago
bunnei cbf43225a9
Merge pull request #704 from lioncash/string
string_util: Remove AsciiToHex()
7 years ago
bunnei f1d7486eac
Merge pull request #703 from lioncash/const
savedata_factory: Make SaveDataDescriptor's DebugInfo() function a const member function
7 years ago
bunnei b0334af05b
Merge pull request #702 from lioncash/initialize
partition_filesystem: Ensure all class members of PartitionFilesystem are initialized
7 years ago
bunnei 1bf7ae79c8
Merge pull request #701 from lioncash/moving
content_archive: Minor changes
7 years ago
Lioncash dc35c3f9d7 nvdrv: Take std::string by const reference in GetDevice()
This is only ever used as a lookup into the device map, so we don't need to
take the std::string instance by value here.
7 years ago
Lioncash af2698dcea hle_ipc: Amend usage of buffer_index within one of HLERequestContext's WriteBuffer() overloads
Previously, the buffer_index parameter was unused, causing all writes to
use the buffer index of zero, which is not necessarily what is wanted
all the time.

Thankfully, all current usages don't use a buffer index other than zero,
so this just prevents a bug before it has a chance to spring.
7 years ago
Lioncash 6c1ba02e0c fsp_srv: Remove unnecessary vector construction in IFile's Write() function
We can avoid constructing a std::vector here by simply passing a pointer
to the original data and the size of the copy we wish to perform to the
backend's Write() function instead, avoiding copying the data where it's
otherwise not needed.
7 years ago
Lioncash 3e9b79e088 fsp_srv: Remove unnecessary std::vector construction in IDirectory's Read() function
We were using a second std::vector as a buffer to convert another
std::vector's data into a byte sequence, however we can just use
pointers to the original data and use them directly with WriteBuffer,
which avoids copying the data at all into a separate std::vector.

We simply cast the pointers to u8* (which is allowed by the standard,
given std::uint8_t is an alias for unsigned char on platforms that we
support).
7 years ago
bunnei 758c357868
Merge pull request #699 from lioncash/vfs
vfs: Deduplicate accumulation code in VfsDirectory's GetSize()
7 years ago
bunnei 87053fb3b8
Merge pull request #697 from bunnei/disable-depth-cull
gl_state: Temporarily disable culling and depth test.
7 years ago
Lioncash 5da4c78c6a filesystem: std::move VirtualDir instance in VfsDirectoryServiceWrapper's constructor
Avoids unnecessary atomic reference count incrementing and decrementing
7 years ago
Lioncash abbf038191 filesystem: Use std::string's empty() function instead of comparing against a literal
This is simply a basic value check as opposed to potentially doing
string based operations (unlikely, but still, avoiding it is free).
7 years ago
Lioncash 2cc0ef83cf filesystem: Remove pragma disabling global optimizations
This was just an artifact missed during PR review.
7 years ago
Lioncash f317080f40 fsp_srv: Make IStorage constructor explicit
Prevents implicit conversions.
7 years ago
Lioncash 910ad2e110 fsp_srv: Add missing includes
Gets rid of relying on indirect inclusions.
7 years ago
Lioncash 6be342118a fsp_srv: Resolve sign-mismatch warnings in assertion comparisons 7 years ago
Lioncash d6e9b96e2f fsp_srv: Respect write length in Write()
Previously we were just copying the data whole-sale, even if the length
was less than the total data size. This effectively makes the
actual_data vector useless, which is likely not intended.

Instead, amend this to only copy the given length amount of data.

At the same time, we can avoid zeroing out the data before using it by
passing iterators to the constructor instead of a size.
7 years ago
Lioncash 5c47ea1a4e common/swap: Remove unnecessary const on return value of swap() 7 years ago
Lioncash 0a868641fa common/swap: Use static_cast where applicable 7 years ago
Lioncash 1edf4dd7ef common/swap: Use using aliases where applicable 7 years ago
Lioncash 9128271292 common/common_funcs: Remove unused rotation functions
These are unused and essentially don't provide much benefit either. If
we ever need rotation functions, these can be introduced in a way that
they don't sit in a common_* header and require a bunch of ifdefing to
simply be available
7 years ago
Lioncash e0b8a35937 common/misc: Deduplicate code in GetLastErrorMsg()
Android and macOS have supported thread_local for quite a while, but
most importantly is that we don't even really need it. Instead of using
a thread-local buffer, we can just return a non-static buffer as a
std::string, avoiding the need for that quality entirely.
7 years ago
Lioncash 63e64f0131 file_util: return string by const reference for GetExeDirectory()
This disallows modifying the internal string buffer (which shouldn't be
modified anyhow).
7 years ago
Lioncash 33fbcb45a7 string_util: Remove AsciiToHex()
Easy TODO
7 years ago
bunnei 368e1d25be
Merge pull request #692 from lioncash/assign
address_arbiter: Correct assignment within an assertion statement in WakeThreads()
7 years ago
bunnei 85421f3406
Merge pull request #690 from lioncash/move
core/memory, core/hle/kernel: Use std::move where applicable
7 years ago
Lioncash 88ba94e8a2 savedata_factory: Make SaveDataDescriptor's DebugInfo() function a const member function
This function doesn't alter class state.
7 years ago
Lioncash 9abc5763b6 partition_filesystem: Ensure all class members of PartitionFilesystem are initialized
Previously is_hfs and pfs_header members wouldn't be initialized in the
constructor, as they were stored in locals instead. This would result in
things like GetName() and PrintDebugInfo() behaving incorrectly.

While we're at it, initialize the members to deterministic values as
well, in case loading ever fails.
7 years ago
bunnei cf30c4be22 gl_state: Temporarily disable culling and depth test. 7 years ago
Lioncash 4790bb907d content_archive: Make IsDirectoryExeFS() take a shared_ptr as a const reference
There's no need to take this by value when it's possible to avoid
unnecessary copies entirely like this.
7 years ago
Lioncash 87a9bb392b content_archive: Add missing standard includes 7 years ago
Lioncash 0b566f43a1 content_archive: std::move VirtualFile in NCA's constructor
Gets rid of unnecessary atomic reference count incrementing and
decrementing.
7 years ago
Lioncash 5e626c774f vfs: Deduplicate accumulation code in VfsDirectory's GetSize()
We can just use a generic lambda to avoid writing the same thing twice.
7 years ago
bunnei 1371e2fb6a
Merge pull request #691 from lioncash/guard
service/prepo: Add missing header guard
7 years ago
bunnei b10905c8ae
Merge pull request #686 from lioncash/fmt
externals: update fmt to version 5.1.0
7 years ago
Lioncash 55ab369043
loader/nro: Resolve sign mismatch warnings 7 years ago
Lioncash 1831b5ef62
loader/nso: Remove unnecessary vector resizes
We can just initialize these vectors directly via their constructor.
7 years ago
Lioncash e3a30ccc7c
loader/nso: Resolve sign mismatch warnings 7 years ago
bunnei 90ce935f3d
Merge pull request #688 from lioncash/comma
vm_manager: Add missing commas to string literal array elements in GetMemoryStateName()
7 years ago
bunnei 3f93279047
Merge pull request #693 from lioncash/unused
core/memory: Remove unused function GetSpecialHandlers() and an unused variable in ZeroBlock()
7 years ago
bunnei 49b0966003
Merge pull request #687 from lioncash/instance
core: Don't construct instance of Core::System, just to access its live instance
7 years ago
bunnei 89f0acfd36
Merge pull request #680 from bunnei/fix-swizz
decoders: Fix calc of swizzle image_width_in_gobs.
7 years ago
bunnei 2975f7820e
Merge pull request #684 from lioncash/nonmember
game_list: Make ContainsAllWords an internally linked non-member function
7 years ago
bunnei b496a9eefe decoders: Fix calc of swizzle image_width_in_gobs. 7 years ago
Zach Hilman 29aff8d5ab Virtual Filesystem 2: Electric Boogaloo (#676)
* Virtual Filesystem

* Fix delete bug and documentate

* Review fixes + other stuff

* Fix puyo regression
7 years ago
Lioncash 72207577b2 core/memory: Remove unused function GetSpecialHandlers() and an unused variable in ZeroBlock() 7 years ago
Lioncash 2cd3141c30 address_arbiter: Correct assignment within an assertion statement in WakeThreads()
This was introduced within 4f81bc4e1b, and
considering there's no comment indicating that this is intentional, this
is very likely a bug.
7 years ago
Lioncash 296e68fd43 service/prepo: Add missing header guard 7 years ago
Lioncash 93cba6f699 vm_manager: Add missing commas to string literal array elements in GetMemoryStateName()
Without these, this would perform concatenation, which is definitely not
what we want here.
7 years ago
Lioncash 46458e7284 core/memory, core/hle/kernel: Use std::move where applicable
Avoids pointless copies
7 years ago
Lioncash 10d2ab8098 core: Make System's default constructor private
This makes it a compilation error to construct additional instances of
the System class directly, preventing accidental wasteful constructions
over and over.
7 years ago
Lioncash 3a4841e403 core: Don't construct instance of Core::System, just to access its live instance
This would result in a lot of allocations and related object
construction, just to toss it all away immediately after the call.

These are definitely not intentional, and it was intended that all of
these should have been accessing the static function GetInstance()
through the name itself, not constructed instances.
7 years ago
Lioncash f5d7706ca1 externals: update fmt to version 5.1.0
Previously, we were on 4.1.0, which was a major version behind.
7 years ago
Lioncash d17e172d92 game_list: Make ContainsAllWords an internally linked non-member function
This function actually depends on no internal class state, so it doesn't
even need to be a part of the class interface.
7 years ago
Zach Hilman c337272ca9 Fill in more fields in TouchScreenEntryTouch 7 years ago
Zach Hilman f2f368014e Single touch support 7 years ago
bunnei 3d1e8f750c
Merge pull request #681 from lioncash/const
game_list: Make containsAllWords a const member function
7 years ago
bunnei e3da9fc367
Merge pull request #682 from lioncash/telemetry
Telemetry: Minor changes
7 years ago
bunnei 24a55bba42
Merge pull request #679 from lioncash/ctor
game_list: Remove unnecessary QString initialization in KeyReleaseEater
7 years ago
bunnei b87a71b3fe
Merge pull request #678 from lioncash/astc
astc: Minor changes
7 years ago
Lioncash c65a8fafa0 telemetry: Remove unnecessary Field constructor
We can just take the value parameter by value which allows both moving
into it, and copies at the same time, depending on the calling code.
7 years ago
Lioncash 0aebe6b3d5 telemetry: Make operator== and operator!= const member functions of Field
These operators don't modify internal class state, so they can be made
const member functions. While we're at it, drop the unnecessary inline
keywords. Member functions that are defined in the class declaration are
already inline by default.
7 years ago
Lioncash 3575d367a4 telemetry: Default copy/move constructors and assignment operators
This provides the equivalent behavior, but without as much boilerplate.
While we're at it, explicitly default the move constructor, since we
have a move-assignment operator defined.
7 years ago
Lioncash f4b98a857b game_list: Upper-case containsAllWords to ContainsAllWords()
This makes it consistent with most of the other private utility
functions.
7 years ago
Lioncash c8f3fc9a4b game_list: Make containsAllWords a const member function
This doesn't actually modify the internal class state, so it can be a
const member function. While we're at it, amend the function to take
its arguments by const reference.
7 years ago
Lioncash f4c69149f9 game_list: Remove unnecessary QString initialization in KeyReleaseEater
QString initializes to an empty string by default, so this does nothing
meaningful. While we're at it, use a constructor initializer list for
initializing the gamelist member variable.
7 years ago
Lioncash 6a03badcbc astc: Initialize vector size directly in Decompress
There's no need to perform a separate resize.
7 years ago
Lioncash 0f148548f3 astc: Mark functions as internally linked where applicable 7 years ago
Lioncash c5803e30d3 astc: const-correctness changes where applicable
A few member functions didn't actually modify class state, so these can
be amended as necessary.
7 years ago
Lioncash e3fadb9616 astc: Delete Bits' copy contstructor and assignment operator
This also potentially avoids warnings, considering the copy assignment
operator is supposed to have a return value.
7 years ago
Lioncash 4cd52a34b9 astc: In-class initialize member variables where appropriate 7 years ago
bunnei 03c2d049d4 settings: Turn docked mode off by default. 7 years ago
bunnei 49e5de9f03 vi: Change TransactionId::CancelBuffer to LOG_CRITICAL. 7 years ago
bunnei 0d1a99edf6 vi: Fix size for ListDisplays default display. 7 years ago
bunnei c3dd456d51 vi: Partially implement buffer crop parameters. 7 years ago
bunnei 8e28af6f89
Merge pull request #675 from Subv/stencil
GPU: Added register definitions for the stencil parameters.
7 years ago
Subv 3d3b10adc7 GPU: Added register definitions for the stencil parameters. 7 years ago
Zach Hilman 69bfe075b5 General Filesystem and Save Data Fixes (#670) 7 years ago
bunnei 88a3140c9b
Merge pull request #671 from MerryMage/clear-exclusive-state
scheduler: Clear exclusive state when switching contexts
7 years ago
bunnei 519035db3d
Merge pull request #672 from SciresM/to_address_fix
svc:: Fix bug in svcWaitForAddress
7 years ago
bunnei 170e19d4ea nvflinger: Fix for BufferQueue event handling. 7 years ago
Michael Scire 3b885691a1 Kernel/Arbiter: Fix bug in WaitIfLessThan 7 years ago
MerryMage 56cc1c11ec scheduler: Clear exclusive state when switching contexts 7 years ago
bunnei 068668780c
Merge pull request #668 from jroweboy/controller-lag
HID: Update controllers less often
7 years ago
bunnei 04b9cde4f5
Merge pull request #664 from jroweboy/logging-stuff
Minor logging improvements
7 years ago
James Rowe 7d209b3c9f HID: Update controllers less often 7 years ago
James Rowe 497b81558e Logging: Dump all logs in the queue on close in debug mode 7 years ago
bunnei 3a96670f2d gl_rasterizer_cache: Implement texture format G8R8. 7 years ago
bunnei aaec0b7e70
Merge pull request #665 from bunnei/fix-z24-s8
gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8.
7 years ago
bunnei 3145114190 gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8. 7 years ago
bunnei e21190f47f gl_rasterizer_cache: Implement depth format Z16_UNORM. 7 years ago
bunnei 2cb3fdca86
Merge pull request #598 from bunnei/makedonecurrent
OpenGL: Use MakeCurrent/DoneCurrent for multithreaded rendering.
7 years ago
bunnei c324a378ac
Merge pull request #663 from Subv/bsd
Services/BSD: Corrected the return for StartMonitoring according to SwIPC
7 years ago
bunnei fd1f5c5414
Merge pull request #662 from Subv/delete_file
FileSys: Append the requested path to the filesystem base path in DeleteFile
7 years ago
James Rowe 6daebaaa57 Logging: Don't lock the queue for the duration of the write 7 years ago
Subv b07f4d6afb Services/BSD: Corrected the return for StartMonitoring according to SwIPC. 7 years ago
Subv 7e5e4f8d7a FileSys: Append the requested path to the filesystem base path in DeleteFile.
We were trying to delete things in the current directory instead of the actual filesystem directory. This may fix some savedata issues in some games.
7 years ago
David Marcec a7d6c0d6ea No need to use ASSERT_MSG with an empty message 7 years ago
bunnei 05cb10530f OpenGL: Use MakeCurrent/DoneCurrent for multithreaded rendering. 7 years ago
Subv b37354cca8 GPU: Always enable the depth write when clearing the depth buffer.
The GPU ignores that register when clearing, but OpenGL obeys the glDepthMask parameter, so we set the depth mask to GL_TRUE when clearing the depth buffer. It will be restored to the correct value automatically on the next draw call.
7 years ago
bunnei 9fc0d1d701
Merge pull request #657 from bunnei/dual-vs
gl_shader_gen: Implement dual vertex shader mode.
7 years ago
Hedges e066bc75b9 More improvements to GDBStub (#653)
* More improvements to GDBStub
- Debugging of threads should work correctly with source and assembly level stepping and modifying registers and memory, meaning threads and callstacks are fully clickable in VS.
- List of modules is available to the client, with assumption that .nro and .nso are backed up by an .elf with symbols, while deconstructed ROMs keep N names.
- Initial support for floating point registers.

* Tidy up as requested in PR feedback

* Tidy up as requested in PR feedback
7 years ago
bunnei 8aeff9cf8e gl_rasterizer: Fix check for if a shader stage is enabled. 7 years ago
bunnei c4015cd93a gl_shader_gen: Implement dual vertex shader mode.
- When VertexA shader stage is enabled, we combine with VertexB program to make a single Vertex Shader stage.
7 years ago
bunnei ce23ae3ede
Merge pull request #656 from ogniK5377/audren-mem-init
Initialized memory for RequestUpdateAudioRenderer and fixed MemoryPoolSection to be more accurate
7 years ago
bunnei 64b5e5d5d9
Merge pull request #655 from bunnei/pred-lt-nan
gl_shader_decompiler: Implement PredCondition::LessThanWithNan.
7 years ago
David Marcec 8bd8d1e3da We only need to alert for memory pool changes 7 years ago
David Marcec 6642011706 initialized voice status and unused sizes in the update data header 7 years ago
bunnei 49c0c081c4 gl_shader_decompiler: Implement PredCondition::LessThanWithNan. 7 years ago
bunnei 4757ffdcce gl_shader_decompiler: Use FlowCondition field in EXIT instruction. 7 years ago
Sebastian Valle 274d1fb0fc
Merge pull request #652 from Subv/fadd32i
GPU: Implement the FADD32I shader instruction.
7 years ago
bunnei 3ff21345b4
Merge pull request #651 from Subv/ffma_decode
GPU: Corrected the decoding of FFMA for immediate operands.
7 years ago
Subv c1ae841f47 GPU: Implement the FADD32I shader instruction. 7 years ago
Tobias 316b933a31 Port #3335 and #3373 from Citra: "Small SDL fixes" and "Print the actual error preventing SDL from working" (#637)
* Port #3335 and #3373 from Citra

* Fixup: Use the new logging placeholders
7 years ago
Subv 0cad310e12 GPU: Corrected the decoding of FFMA for immediate operands. 7 years ago
bunnei 4f41ffdd41
Merge pull request #648 from ogniK5377/no-net
Let games/application know that we're offline
7 years ago
bunnei 7c7b2b8285
Merge pull request #649 from ogniK5377/audout-auto
Audout "Auto" functions
7 years ago
James Rowe b30c5370b1 yuzu - Fix duplicate logs 7 years ago
James Rowe 020d005d8c yuzu-cmd Apply the filter string from settings 7 years ago
David Marcec 706892de7d Audout "Auto" functions
Audout autos are identical to their counterpart except for the buffer type which yuzu already handles for us.
7 years ago
David Marcec 3d68f6ba6c Added IsWirelessCommunicationEnabled, IsEthernetCommunicationEnabled, IsAnyInternetRequestAccepted
Since we have no socket implementation we should be returning 0 to indicate we're currently offline.
7 years ago
bunnei 7230ceb584
Merge pull request #559 from Subv/mount_savedata
Services/FS: Return the correct error code when trying to mount a nonexistent savedata.
7 years ago
bunnei 12a6996262 hid: Fix timestamps and controller type.
- This fixes user input in SMO.
7 years ago
bunnei 379a935016
Merge pull request #644 from ogniK5377/getconfig-err
NvOsGetConfigU32 production impl
7 years ago
bunnei 04524e76c2
Merge pull request #633 from FearlessTobi/port-defines
Port #3579 from Citra: Clean up architecture-specific defines
7 years ago
bunnei 3e966be6fc
Merge pull request #642 from bunnei/create-save-dir
savedata_factory: Always create a save directory for games.
7 years ago
David Marcec 0944bfe3cb NvOsGetConfigU32 production impl
Settings are only  used when RMOS_SET_PRODUCTION_MODE is set to 0.
If production mode is set, the error code 0x30006 is returned instead
7 years ago
bunnei ef2c955db5
Merge pull request #635 from FearlessTobi/port-crashfix
Port #3474 from Citra: Do not crash on unimplemented code in debug build
7 years ago
bunnei dacc89b38b
Merge pull request #634 from FearlessTobi/port-viewport-fix
Port #3505 from Citra: Fix QGLWidget viewport resize on macOS
7 years ago
bunnei 51a3e93f8e
Merge pull request #640 from bunnei/flip-tris-viewport
gl_rasterizer: Flip triangles when regs.viewport_transform[0].scale_y is negative.
7 years ago
bunnei eb6cbfdbd8 savedata_factory: Always create a save directory for games. 7 years ago
bunnei 1b3dd30ba8 nvhost_ctrl: Fix NvOsGetConfigU32 for Snipper Clips. 7 years ago
bunnei 854f474f52 gl_rasterizer: Flip triangles when regs.viewport_transform[0].scale_y is negative.
- Fixes a regression with Binding of Isaac.
7 years ago
bunnei 639346bcfb
Merge pull request #625 from Subv/imnmx
GPU: Implemented the IMNMX shader instruction.
7 years ago
bunnei d990f2355b
Merge pull request #627 from Subv/bc7u
GPU: Implemented the BC7U texture format.
7 years ago