Commit graph

647 commits

Author SHA1 Message Date
Zach Hilman
77f9ecd32b card_image: Add functions to query gamecard update partition
Includes version and meta title ID, used by fsp-srv/IDeviceOperator
2019-09-21 16:43:10 -04:00
Zach Hilman
e018a48460 content_archive: Add accessors for Rights ID and SDK Version 2019-09-21 16:43:10 -04:00
Zach Hilman
721a92775d sdmc_factory: Add SD Card size getters 2019-09-21 16:43:10 -04:00
Zach Hilman
e47b57a90f bis_factory: Add getters for NAND partition sizes 2019-09-21 16:43:10 -04:00
Zach Hilman
0a8e540681 submisson_package: Fix edge case with improperly sized filenames
Prevents a crash if the filename is less than 9 characters long.
2019-09-21 16:43:10 -04:00
Zach Hilman
08c0783d34 sdmc_factory: Add accessor for SDMC Album directory 2019-09-21 16:43:10 -04:00
Zach Hilman
0084cceb20 sdmc_factory: Add accessor for SDMC PlaceholderCache 2019-09-21 16:43:10 -04:00
Zach Hilman
02b36b0eb5 sdmc_factory: Add accessor for content directory 2019-09-21 16:43:10 -04:00
Zach Hilman
49c44e3fae savedata_factory: Implement savedata creation and don't create dir on open
Matches hardware behavior and eliminates some nasty behavior we were doing that wasn't hw-accurate at all.
2019-09-21 16:43:10 -04:00
Zach Hilman
62d772eaed patch_manager: Add short-circuit edge-case to GetPatchVersionNames
If title ID is 0, there are no add ons, prevents wasting time looking for them.
2019-09-21 16:43:10 -04:00
Zach Hilman
06db4d94fd patch_manager: Add error checking to load dir to prevent crashes
Prevents a crash if the load dir would be nullptr, instead logs an error and returns appropriately.
2019-09-21 16:43:10 -04:00
Zach Hilman
9d9fc8a675 registered_cache: Process *.cnmt.nca files
Needed to use the RegisteredCache/PlaceholderCache on gamecards.
2019-09-21 16:43:10 -04:00
Zach Hilman
8500ca797f registered_cache: Implement PlaceholderCache to manage placeholder and installing content 2019-09-21 16:43:10 -04:00
Zach Hilman
256a50ad15 bis_factory: Fix mod loader edge-case with homebrew title IDs
Fixes a bug where homebrew that has a title ID with the update bit set can cause issues with the PatchManager
2019-09-21 16:43:10 -04:00
Zach Hilman
b71bda45ae bis_factory: Add accessors for BIS placeholder caches 2019-09-21 16:43:10 -04:00
Zach Hilman
9bee885282 bis_factory: Add accessor for NAND Image Directory 2019-09-21 16:43:10 -04:00
Zach Hilman
4dae5a52a8 bis_factory: Add accessors for BIS content directories 2019-09-21 16:43:10 -04:00
Zach Hilman
3a1899d143 bis_factory: Add accessors for BIS partitions 2019-09-21 16:43:10 -04:00
David
25383b9ff2
Merge pull request #2576 from DarkLordZach/nsp-fix-1
nsp: Fix various errors with loading and processing of extracted NSPs
2019-09-21 20:05:24 +10:00
David
8795645d97
Merge pull request #2707 from DarkLordZach/oss-miimodel
system_archive: Add open-source reimplementation of MiiModel data
2019-09-05 10:56:32 +10:00
Zach Hilman
adab188c2b system_archive: Add open-source reimplementation of MiiModel data 2019-07-10 07:21:36 -04:00
Michael Scire
13a8fde3ad Implement MapPhysicalMemory/UnmapPhysicalMemory
This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu,
which can be used to map memory at a desired address by games since
3.0.0.

It also properly parses SystemResourceSize from NPDM, and makes
information available via svcGetInfo.

This is needed for games like Super Smash Bros. and Diablo 3 -- this
PR's implementation does not run into the "ASCII reads" issue mentioned
in the comments of #2626, which was caused by the following bugs in
Yuzu's memory management that this PR also addresses:
* Yuzu's memory coalescing does not properly merge blocks. This results
  in a polluted address space/svcQueryMemory results that would be
  impossible to replicate on hardware, which can lead to game code making
  the wrong assumptions about memory layout.
  * This implements better merging for AllocatedMemoryBlocks.
* Yuzu's implementation of svcMirrorMemory unprotected the entire
  virtual memory range containing the range being mirrored. This could
  lead to games attempting to map data at that unprotected
  range/attempting to access that range after yuzu improperly unmapped
  it.
  * This PR fixes it by simply calling ReprotectRange instead of
    Reprotect.
2019-07-07 11:45:53 -07:00
Bakugo
b50557d1f0 file_sys: Rename other ContentRecordType members 2019-07-02 00:57:23 +01:00
Bakugo
c72ef5f405 file_sys/registered_cache: Improve missing metadata error
This can happen when installing NSPs too, not just XCIs.
2019-07-01 07:31:32 +01:00
Bakugo
9968c0883a file_sys/submission_package: Don't warn about missing DeltaFragment NCAs
DeltaFragments are not useful to us and are often not included in patch NSPs.
2019-07-01 06:46:05 +01:00
Bakugo
79163fca80 file_sys/registered_cache: Ignore DeltaFragment NCAs during installation
DeltaFragments are only used to download and apply partial patches on a real console, and are not useful to us at all. Most patch NSPs do not include them, and when they do, it's a waste of space to install them.
2019-07-01 06:37:22 +01:00
Bakugo
306a24aad7 file_sys: Rename ContentRecordType::Patch to DeltaFragment
Avoids potential confusion, since patches and DeltaFragments are not the same thing. Actual full patches are listed under the Program type.
2019-07-01 06:32:13 +01:00
Zach Hilman
d10fc2d727 glue: Correct missing bytes in ApplicationLaunchParameter 2019-06-25 22:25:10 -04:00
Zach Hilman
db2e5e5fa6 registered_cache: Add getter to determine source slot in content provider union
Used to determine StorageId source for application data.
2019-06-24 19:10:17 -04:00
Zach Hilman
a468273221 patch_manager: Add getter for title version 2019-06-24 19:05:50 -04:00
bunnei
e2f7933b3f
Merge pull request #2546 from DarkLordZach/kips
loader, file_sys: Add support for parsing and loading KIP (Kernel Internal Process) files
2019-06-21 14:28:18 -04:00
jonsn0w
e78d069a81
Update content_archive.cpp
log clutter in debug logs when theres really no need
2019-06-19 22:01:41 -04:00
David Marcec
6ca20ad7ba Addressed issues 2019-06-17 08:17:26 +10:00
David Marcec
335127af69 Impl'd IsUserAccountSwitchLocked, SetAudioOutVolume, GetAudioOutVolume & Partial impl of GetAccumulatedSuspendedTickChangedEvent
IPC-100 was changed to InitializeApplicationInfoOld instead of InitializeApplicationInfo. IPC-150 makes an indentical call to IPC-100 however does extra processing. They should not have the same name as it's quite confusing to debug.
2019-06-16 19:06:33 +10:00
Zach Hilman
c140b6ae2c
Merge pull request #2581 from lioncash/hex
common/hex_util: Combine HexVectorToString() and HexArrayToString()
2019-06-15 16:47:13 -04:00
bunnei
0360c40e90
Merge pull request #2582 from lioncash/reserved
file_sys/ips_layer: Remove unnecessary reserve() call
2019-06-14 11:24:18 -04:00
Zach Hilman
0f08f2d562
Merge pull request #2577 from lioncash/fs
file_sys/card_image: Minor cleanup
2019-06-12 19:23:33 -04:00
Lioncash
18c1d91920
file_sys/ips_layer: Remove unnecessary reserve() call
Given 'replace' is assigned to on the following line, this isn't
necessary, given the underlying data is going to be overwritten
entirely.
2019-06-12 18:12:45 -04:00
Lioncash
a62088539e
common/hex_util: Combine HexVectorToString() and HexArrayToString()
These can be generified together by using a concept type to designate
them. This also has the benefit of not making copies of potentially very
large arrays.
2019-06-12 17:54:05 -04:00
Lioncash
c7daddb715
file_sys/card_image: Remove obsolete TODO
We already support Rev 1+.
2019-06-12 16:52:19 -04:00
Lioncash
a602bcaaf8
file_sys/nca_metadata: Update CNMT structures
Names a few more entries in relevant structures. Information based off
SwitchBrew and my own RE.
2019-06-10 23:51:06 -04:00
Lioncash
7bdef6106e
file_sys/card_image: Deduplicate casts within AddNCAFromPartition()
Makes for nicer reading.
2019-06-10 23:27:14 -04:00
Lioncash
81d361d9f8
file_sys/card_image: Make bracing consistent
Makes for more consistent reading.
2019-06-10 23:27:13 -04:00
Lioncash
e34368249f
file_sys/card_image: Assign collapsed NCA contents directly to ncas member
Same thing, significantly less noisy.
2019-06-10 23:27:13 -04:00
Lioncash
288d027e89
file_sys/card_image: Deduplicate type cast
Same thing, less duplication. We can also std::move raw into the
PartitionFilesystem constructor.
2019-06-10 23:27:05 -04:00
Lioncash
825ffd7b1f
file_sys/card_image: Get rid of a magic number
We can just use the size of the array to dehardcode it.
2019-06-10 22:58:08 -04:00
Lioncash
bf35138d1d
file_sys/card_image: Use std::array deduction guides
Same thing, less code.
2019-06-10 22:57:53 -04:00
Zach Hilman
b957a4862f nsp: Correct status codes for extracted NSPs
Avoids all extracted NSPs being marked as error file type because they don't have program NCAs.
2019-06-10 00:21:41 -04:00
Zach Hilman
1c75945dc4 nsp: Use title ID from NPDM metadata for extracted type NSPs
Avoids 0 being used as title ID for all extracted NSPs.
2019-06-10 00:19:23 -04:00
Zach Hilman
9db119f8a2 kernel_executable: Optimize BLZ decompression 2019-06-06 19:20:15 -04:00
Zach Hilman
c417b4fe28 game_list: Accept *.kip as a file extension of executables 2019-06-05 00:33:05 -04:00
Zach Hilman
b550a01f74 program_metadata: Add function to load meta from raw parameters
Needed for KIP loading as KIPs do not have an NPDM but do have the essential parts of the data within.
2019-06-05 00:20:26 -04:00
Zach Hilman
421c3e831a file_sys: Add classes to parse KIP1 and INI1 files 2019-06-05 00:18:25 -04:00
Michael Scire
7dbf4c1ae5 Implement IApplicationFunctions::GetDesiredLanguage 2019-05-23 00:55:56 -07:00
bunnei
61f63bb994
Merge pull request #1957 from DarkLordZach/title-provider
file_sys: Provide generic interface for accessing game data
2019-04-09 19:16:37 -04:00
bunnei
00207cc965
Merge pull request #2340 from lioncash/view
file_sys/fsmitm_romfsbuild: Utilize a string_view in romfs_calc_path_hash
2019-04-05 23:40:16 -04:00
bunnei
23d3cd7604
Merge pull request #2341 from lioncash/compare
file_sys/nca_metadata: Remove unnecessary comparison operators for TitleType
2019-04-05 23:38:37 -04:00
bunnei
d6cddffb78
Merge pull request #2339 from lioncash/rank
service/fsp_srv: Update SaveDataInfo and SaveDataDescriptor structs
2019-04-05 23:36:46 -04:00
Lioncash
37b23efece file_sys/program_metadata: Remove obsolete TODOs
BitField has been trivially copyable since
e99a148628, so we can eliminate these
TODO comments and use ReadObject() directly instead of memcpying the
data.
2019-04-05 15:57:47 -04:00
Lioncash
a1868286b0 file_sys/nca_metadata: Remove unnecessary comparison operators for TitleType
enum class elements from the same enum can already be compared against
one another without the need for explicitly defined comparison
operators.
2019-04-05 15:20:07 -04:00
Lioncash
28e36de56f file_sys/fsmitm_romfsbuild: Utilize a string_view in romfs_calc_path_hash()
The given string instance doesn't need to be copied entirely, we can
just use a view instead.
2019-04-05 15:12:20 -04:00
Lioncash
c05c8a7a06 service/fsp_srv: Don't pass SaveDataDescriptor instances by value.
Passing around a 64 byte data struct by value is kind of wasteful,
instead pass a reference to the struct.
2019-04-05 11:04:01 -04:00
Lioncash
d9ee58a3b5 service/fsp_srv: Update SaveDataInfo and SaveDataDescriptor structs
I realized that I updated the documentation on SwitchBrew a while ago,
but never actually updated the structs within yuzu.
2019-04-05 11:03:53 -04:00
Lioncash
a973271b8c file_sys/control_metadata: Amend naming of members
Quite a bit of these were out of sync with Switchbrew (and in some cases
entirely wrong). While we're at it, also expand the section of named
members. A segment within the control metadata is used to specify
maximum values for the user, device, and cache storage max sizes and
journal sizes.

These appear to be generally used by the am service (e.g. in
CreateCacheStorage, etc).
2019-04-03 21:18:12 -04:00
Zach Hilman
552d5071fa patch_manager: Dump NSO name with build ID 2019-03-27 20:09:01 -04:00
Zach Hilman
60f39060c6 core: Port current uses of RegisteredCache to ContentProvider 2019-03-26 22:05:37 -04:00
Zach Hilman
a6c7ae6fe8 file_sys: Create ContentProvider interface and default implementations 2019-03-26 22:03:26 -04:00
Lioncash
b26481c94b core/cheat_engine: Make MemoryReadImpl and MemoryWriteImpl internally linked
These don't need to be visible outside of the translation unit, so they
can be enclosed within an anonymous namespace.
2019-03-24 18:34:42 -04:00
bunnei
1665b70cc6
Merge pull request #2221 from DarkLordZach/firmware-version
set_sys: Implement GetFirmwareVersion(2) for libnx hosversion
2019-03-23 13:48:29 -04:00
bunnei
6af322a347
Merge pull request #2280 from lioncash/nso
loader/nso: Minor refactoring
2019-03-23 13:46:09 -04:00
Lioncash
733cf179b8 file_sys/cheat_engine: Silence truncation and sign-conversion warnings 2019-03-22 14:43:41 -04:00
Lioncash
540235bb05 file_sys/cheat_engine: Remove use of global system accessors
Instead, pass in the core timing instance and make the dependency
explicit in the interface.
2019-03-22 14:43:37 -04:00
Lioncash
1cf90f4570 file_sys/patch_manager: Deduplicate NSO header
This source file was utilizing its own version of the NSO header.
Instead of keeping this around, we can have the patch manager also use
the version of the header that we have defined in loader/nso.h
2019-03-22 14:39:10 -04:00
Lioncash
ee49e1fcb6 file_sys/patch_manager: Remove two magic values
These correspond to the NSOBuildHeader.
2019-03-22 14:17:50 -04:00
bunnei
639f0c524d
Merge pull request #1933 from DarkLordZach/cheat-engine
file_sys: Implement parser and interpreter for game memory cheats
2019-03-21 21:41:59 -04:00
Lioncash
b8c7072206 file_sys/content_archive: Amend name of Data_Unknown5 enum entry
While we're at it, give each entry some documentation.
2019-03-19 15:58:38 -04:00
Zach Hilman
debc7442f2 set_sys: Use official nintendo version string 2019-03-10 19:54:13 -04:00
Zach Hilman
73f2ee5484 system_version: Correct sizes on VectorVfsFile construction 2019-03-10 19:16:17 -04:00
Zach Hilman
ed82bb968a set_sys: Implement GetFirmwareVersion(2) for libnx hosversion
Uses the synthesized system archive 9 (SystemVersion) and reports v5.1.0-0.0
2019-03-10 16:51:42 -04:00
Zach Hilman
52ac6419da vm_manager: Remove cheat-specific ranges from VMManager 2019-03-05 10:09:36 -05:00
Zach Hilman
769b346682 cheat_engine: Add parser and interpreter for game cheats 2019-03-04 18:39:58 -05:00
Zach Hilman
4495bf5706 patch_manager: Display cheats in game list add-ons 2019-03-04 18:39:57 -05:00
Zach Hilman
c5091bfe00 patch_manager: Add support for loading cheats lists
Uses load/<title_id>/<mod_name>/cheats as root dir, file name is all upper or lower hex first 8 bytes build ID.
2019-03-04 18:39:57 -05:00
Frederic L
517933adcb
file_sys/vfs_vector: Fix ignored offset on Write 2019-02-25 00:27:49 +01:00
bunnei
f9e69faf4a
Merge pull request #2025 from DarkLordZach/loader-banner-logo
loader: Add getters for application banner and logo
2019-01-20 13:26:27 -05:00
Lioncash
96644385ca file_sys/directory: Remove unused DirectoryBackend class
This isn't used at all, so we can just get rid of it.
2019-01-18 14:33:50 -05:00
Zach Hilman
318bf7c8e3 content_archive: Add getter for logo section of NCA 2019-01-15 16:00:29 -05:00
Zach Hilman
abbcc8e61e romfs: Add SingleDiscard extraction type
Needed for manual RomFS extraction, as Full generates an extra directory and Truncated generates variable results.
2018-12-28 15:30:36 -05:00
Lioncash
9aa68212d9 file_sys/program_metadata: Print out more descriptive address space descriptions
Provides extra information that makes it easier to tell if an executable
being run is using a 36-bit address space or a 39-bit address space.
While we don't support AArch32 executables yet, this also puts in
distinguishing information for the 32-bit address space types as well.
2018-12-27 19:16:45 -05:00
bunnei
795335af0f
Merge pull request #1928 from lioncash/caps
kernel: Handle kernel capability descriptors
2018-12-27 11:15:34 -05:00
Zach Hilman
c643f364b4 am: Implement GetSaveDataSize and ExtendSaveData
These functions come in a pair and are needed by Smash Ultimate, Minecraft, and Skyrim, amongst others.
2018-12-27 00:18:00 -05:00
Zach Hilman
4082c4eda6 savedata_factory: Partially implement IVFC save sizes using files
This stores a file in the save directory called '.yuzu_save_size' which stores the two save sizes (normal area and journaled area) sequentially as u64s.
2018-12-27 00:18:00 -05:00
Zach Hilman
417e1ef09c control_metadata: Update NACP fields with latest Switchbrew data 2018-12-27 00:16:55 -05:00
Zach Hilman
5c4259ec1a control_metadata: Use value member instead of unique_ptr to store struct
Serves no actual purpose in this instance besides making NACP's copy assignment deleted, which is not intended behavior.
2018-12-27 00:16:55 -05:00
Zach Hilman
4a6ba58073 vfs: Add reinterpret_casts to WriteArray and Object
Allows these functions to compile when T is not u8.
2018-12-27 00:16:55 -05:00
Lioncash
002ae08bbd kernel/process: Hook up the process capability parser to the process itself
While we're at it, we can also toss out the leftover capability parsing
from Citra.
2018-12-21 07:05:34 -05:00
David Marcec
fdd649e2ef Fixed uninitialized memory due to missing returns in canary
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
2018-12-19 12:52:32 +11:00
Lioncash
5c72aa7c4c patch_manager: Prevent use of a dangling pointer within PatchRomFS
fmt::format() returns a std::string instance by value, so calling
.c_str() on it here is equivalent to doing:

auto* ptr = std::string{}.c_str();

The data being pointed to isn't guaranteed to actually be valid anymore
after that expression ends. Instead, we can just take the string as is,
and provide the necessary formatting parameters.
2018-12-11 10:08:13 -05:00
bunnei
3b1043c58a
Merge pull request #1846 from lioncash/dir
file_sys/directory: Amend path buffer size for directory entries
2018-12-10 21:54:03 -05:00
bunnei
2c45c6d234
Merge pull request #1819 from DarkLordZach/disable-addons
patch_manager: Add support for disabling patches
2018-12-10 21:52:19 -05:00