Commit Graph

9097 Commits (86dcf2942b4a2135c00d2d0303fbbb6d46758714)
 

Author SHA1 Message Date
bunnei fe292573de
Merge pull request #1442 from lioncash/format
text_formatter: Avoid unnecessary string temporary creation in PrintMessage()
6 years ago
Zach Hilman 38c2ac95af romfs_factory: Extract packed update setter to new function 6 years ago
Zach Hilman 5acaeb04c4 patch_manager: Add support for NSP packed updates
Reads as Update (NSP) in add-ons
6 years ago
Zach Hilman cf7aba4817 game_list: Add XCI update versioning to game list 6 years ago
Zach Hilman d79d4fd764 patch_manager: Add support for packed updates
Will prefer any installed update over the packed version.
6 years ago
Zach Hilman 5045748829 loader: Add getter for packed update
Reads the update included with the game if it has one and adds the new ErrorNoPackedUpdate status.
6 years ago
Zach Hilman e948fbf5d0 loader: Add ReadRomFSIVFCOffset to NSP, XCI, and NAX loaders
Fixes errors with certain updates
6 years ago
Lioncash 6f16826260 text_formatter: Avoid unnecessary string temporary creation in PrintMessage()
operator+ for std::string creates an entirely new string, which is kind
of unnecessary here if we just want to append a null terminator to the
existing one.

Reduces the total amount of potential allocations that need to be done
in the logging path.
6 years ago
Zach Hilman d0e6b93695 patch_manager: Avoid romfs_ext requirement for patching 6 years ago
Zach Hilman c1e069c066 fsmitm_romfsbuild: Extract stubs and IPS to romfs_ext dir 6 years ago
Zach Hilman bc4bec8a60 fsmitm_romfsbuild: Add support for stubbing and IPS patches in LFS 6 years ago
Zach Hilman 110d578470 ips_layer: Fix inaccuracies with comments and flags
Specifically bugs/crashes that arise when putting them in positions that are legal but not typical, such as midline, between patch data, or between patch records.
6 years ago
Zach Hilman 70bd2bb1d3 ips_layer: Deduplicate resource usage 6 years ago
Zach Hilman 9669cdb710 ips_layer: Add support for escape sequences and midline comments
More accurately follows IPSwitch specification.
6 years ago
Zach Hilman 8886f2e55e patch_manager: Add support for IPSwitch format patches 6 years ago
Zach Hilman 306739c2c4 ips_layer: Add IPSwitchCompiler to process IPSwitch format 6 years ago
Zach Hilman f62227aa95 hex_util: Add HexVectorToString and HexStringToVector
Converts between bytes and strings when the size is not known at compile time.
6 years ago
Lioncash 30dfd89126 ui_settings: Place definition of the theme array within the cpp file
Placing the array wholesale into the header places a copy of the whole
array into every translation unit that uses the data, which is wasteful.
Particularly given that this array is referenced from three different
translation units.

This also changes the array to contain pairs of const char*, rather than
QString instances. This way, the string data is able to be fixed into
the read-only segment of the program, as well as eliminate static
constructors/heap allocation immediately on program start.
6 years ago
bunnei f85f2b3728
Merge pull request #1415 from DarkLordZach/ips
file_sys: Add support for loading IPS patches
6 years ago
Lioncash baed7e1fba kernel/thread: Make all instance variables private
Many of the member variables of the thread class aren't even used
outside of the class itself, so there's no need to make those variables
public. This change follows in the steps of the previous changes that
made other kernel types' members private.

The main motivation behind this is that the Thread class will likely
change in the future as emulation becomes more accurate, and letting
random bits of the emulator access data members of the Thread class
directly makes it a pain to shuffle around and/or modify internals.
Having all data members public like this also makes it difficult to
reason about certain bits of behavior without first verifying what parts
of the core actually use them.

Everything being public also generally follows the tendency for changes
to be introduced in completely different translation units that would
otherwise be better introduced as an addition to the Thread class'
public interface.
6 years ago
ReinUsesLisp 3e2380327a gl_rasterizer: Implement quads topology 6 years ago
bunnei cf3a6dd4a1
Merge pull request #1434 from DarkLordZach/dlc-edge-case
aoc_u: Fix edge case with DLC that causes breaks
6 years ago
bunnei af672d8abf
Merge pull request #1428 from lioncash/qt
configure_graphics: Make functions internally linked where applicable
6 years ago
bunnei 839dbd9710
Merge pull request #1431 from lioncash/audio
configure_audio: Minor cleanup-related changes
6 years ago
bunnei 39f08e551d
Merge pull request #1433 from lioncash/fs
services/fsp_srv: Amend service function table
6 years ago
bunnei 5ae5610c13
Merge pull request #1429 from lioncash/translate
configure_input: Make analog mapping strings translatable
6 years ago
bunnei 15b2e2ec13
Merge pull request #1436 from lioncash/view
submission_package: Cleanup and bug fixes
6 years ago
bunnei e7e347a828
Merge pull request #1432 from lioncash/lbl
service/lbl: Update service function table
6 years ago
bunnei 137d43fa2f
Merge pull request #1426 from FearlessTobi/port-4253
Port citra-emu/citra#4253: "common/string_util cleanup"
6 years ago
bunnei 8679934693
Merge pull request #1435 from lioncash/xci
card_image: Ensure program_nca_status is always initialized
6 years ago
FernandoS27 f664437ae8 Implemented Texture Processing Modes in TEXS and TLDS 6 years ago
Lioncash 024eec02a5 submission_package: Avoid dangling std::string_view within SetTicketKeys()
GetName() returns a std::string by value, not by reference, so after the
std::string_view is constructed, it's not well defined to actually
execute any member functions of std::string_view that attempt to access
the data, as the std::string has already been destroyed. Instead, we can
just use a std::string and erase the last four characters.
6 years ago
Lioncash dade709f63 submission_package: Correct location of null check within SetTicketKeys()
If a ticket file was ever a null pointer, we'd cause a null pointer
dereference, as we were calling GetExtension() on the pointer instance.
6 years ago
Lioncash 02841052aa submission_package: Use std::string's rfind() when looking for the extension in InitializeExeFSAndRomFS()
When searching for a file extension, it's generally preferable to begin
the search at the end of the string rather than the beginning, as the
whole string isn't going to be walked just to check for something at the
end of it.
6 years ago
Lioncash 37ee05f7c0 submission_package: Ensure the 'extracted' member variable is always initialized
If an error occurs when constructing the PartitionFilesystem instance,
the constructor would be exited early, which wouldn't initialize the
extracted data member, making it possible for other code to perform an
uninitialized read by calling the public IsExtractedType() member
function. This prevents that.
6 years ago
Lioncash ccf0a9cb38 submission_package: Move ExeFS and RomFS initialization to its own function
Like the other two bits of factored out code, this can also be put
within its own function. We can also modify the code so that it accepts
a const reference to a std::vector of files, this way, we can
deduplicate the file retrieval.

Now the constructor for NSP isn't a combination of multiple behaviors in
one spot. It's nice and separate.
6 years ago
Lioncash fd312abedd submission_package: Move NCA reading code to its own function
This too, is completely separate behavior from what is in the
constructor, so we can move this to its own isolated function to keep
everything self-contained.
6 years ago
Lioncash 4f18d35888 submission_package: Move ticket key setting to its own function
This behavior is entirely independent of the surrounding code, so it can
be put in its own function to keep the behavior separate.
6 years ago
Lioncash 0d83f8f255 submission_package: Invert conditionals within NSP's constructor to reduce nesting
We can use early continues here to reduce the amount of nesting.
6 years ago
Lioncash cf463a9b67 card_image: Ensure program_nca_status is always initialized
If any of the error paths before the NCA retrieval are taken, it'll
result in program_nca_status being left in an inconsistent state. So we
initialize it by default with a value indicating an error.
6 years ago
Zach Hilman 9aaf1c0df8 aoc_u: Fix edge case with DLC that causes breaks
In some games (Splatoon 2 and Splatoon 2 Splatfest World Premiere, notably), pass offset=0 and count=2047 into the ListAddOnContent method which should return all DLCs for the current title. The (presumably) intended behavior is to successfully return a empty array but because of a < v. <= in an if statement, a failure error code was returned causing these games to svcBreak. This fixes that if statement.
6 years ago
Lioncash cba78dc70a services/fsp_srv: Amend service function table
Adds new functions that have been given names to the table. Information
is based off what is provided on Switchbrew.
6 years ago
Lioncash d80dd2b812 service/lbl: Update service function table
Amends the lbl service table to include new names of functions that were
added to Switchbrew.
6 years ago
Lioncash 61b144bbf3 configure_input: Make analog mapping strings translatable
These strings are user-facing, so they should be specified as
translatable with tr().
6 years ago
Lioncash 1c7c798e9e configure_audio: Move combo box index setting to their own functions
Keeps the individual behaviors in their own functions, and cleanly
separate. We can also do a little better by converting the relevant IDs
within the core to a QString only once, instead of converting every
string into a std::string.
6 years ago
Lioncash 57e47bae32 configure_audio: Use QString::fromStdString() for converting audio device names
This ensures that the proper codec will always be used no matter what.
It also avoids relying on ASCII conversions.
6 years ago
Lioncash 226dc914b3 configure_audio: Add disambiguation comment for the volume percentage string
Disambiguates what the string represents to help translators more easily
understand what it is that they're translating. While we're at it, we
can move the code to its own function, so that we don't need to specify
the same string twice.
6 years ago
Lioncash 8f5e2a2b83 configure_graphics: Make functions internally linked where applicable
These aren't used outside of this translation unit, so they can be
internally linked.
6 years ago
Zach Hilman 215b65fe75 nso: Optimize loading of IPS patches
Avoid resource-heavy classes and remove quasi-duplicated code.
6 years ago
Weiyi Wang fdb35760a7 string_util: unify UTF8<->UTF16 conversion to codecvt 6 years ago