Commit Graph

7184 Commits (40c9c5a55c7c9e00d96f55b1cd898a51120451fe)
 

Author SHA1 Message Date
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
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
bunnei 130a02f330
Merge pull request #708 from lioncash/xbyak
externals: Update Xbyak to 5.65
7 years ago
bunnei 8176ab3a07
Merge pull request #707 from lioncash/catch
externals: Update catch to v2.2.3
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