aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/savedata_factory.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [fs] revert #4319 savedata_factory changes (#4462)xbzk2026-09-201-14/+8
| | | | | | | | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This one reverts part of the PR 4319 which was aimed to allow child titles to inherit bundle settings. The fix seems good so far, but by applying it to save folders caused a trap: Now child's save folders move to bundle folder, hence saves will vanish, and the android/qt save tools are still pointing to old folders. Since the save part was only a compliance fix, instead of fiddle in master i'd rather revert this part now, then only touch this again if any bug show up. No worries. I'll be right here waiting. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4462 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [fs] share parent resources with bundled programs (#4319)xbzk2026-09-181-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Normal games are Applications; Bundled games are Application + Programs; We've been treating both as the same thing, calling both programs, and making programs unable to see settings and saves from application. References: https://switchbrew.org/wiki/Filesystem_services https://switchbrew.org/wiki/NCM_services#ApplicationId https://switchbrew.org/wiki/Super_Mario_3D_All-Stars Ryujinx.HLE/HOS/ApplicationLoader.cs:GetMultiProgramInfo UPDATE: The first version was a big rework to make AppId/ProgId concepts proper, and it was successful in most tests, but it caused a regression with applets, which are programs that breed straight from no application. In order to simplify things i've reverted all the rework, added a helper to identify whether a program has a parent Application and bounded it to it's proper stores. Although this is no big deal coz it doesn't have impact on emulation, it permeates to several routines, so it needs to be tested broadly. Applets, Normal games, Bundled games, Blobbed NSPs/XCIs, Mods, Updates, Saves, DLCs,. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4319 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: lizzie <lizzie@eden-emu.dev>
* [fs] moved temp folder cleanup upstream (per-application level) to avoid ↵xbzk2026-09-101-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | per-program retrigger (#4375) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This issue was observed in MGS Master Collection Volume II, MGS4: Guns of the Patriots, Chapter 4: Shadow Moses That title is a bundle, and that specific chapter is a program (MGS 1st stage), launched by a program (MGS4), launched by an application (main title bundle). Upon decoding guest panic message, it was exposed that an abort was triggered after trying to create a save in nand/temp/gclvar.bak file. Further instrumentation exposed the error on that file's path, caused from a previous deletion of that folder. In the same session that folder had been already cleaned and created successfully, which evidences an undesired re-cleaning of the temp structure. The issue was the fact that the MGS4 to MGS transition also calls EnsureSaveData>...>SaveDataFactory creator, and that was destroying the previous created temp structure. After that stage, the return from MSG to MSG4 was causing the same issue again. By moving the deletion to the guest application level, the factory creation was called only once, as it should be, and the issue is gone. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4375 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: lizzie <lizzie@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [hle,display,overlay,starter,hid] add overlay functions, starter applet ↵Maufeat2025-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | (initially), HID handheld for system applets and fw21 stubs (#3080) Adds fully functional overlay display. - Enable Overlay Applet via "View" -> "Enable Overlay Display Applet" - Open the overlay by pressing the home button for over 1s - Can adjust volume - Can toggle airplane mode (if on WiFi, maybe if overlay is enabled pretend to be on WiFi?) - Future TODO(?): Adjust Brightness implementation for host system - Inputs are properly registered. e.g. if overlay open, application does not register inputs. You can control volume and airplane mode outside of the emulator window Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3080 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
* [hle, kernel] Add support for FW21 and kernel changes (#3004)lizzie2025-11-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Adapts kernel changes from atmosphere for firmware 21.0.0. - Fixes launch error of firmware 21.0.0 applets. - Adds new commands for `prepo` (New `SaveSystemReport` & `SaveSystemReportWithUser`). - Adds new commands for `IReadOnlyApplicationControlDataInterface` (cmd 19; incomplete!) - Adds `{12010, nullptr, "SetButtonConfigLeft"},` undocumented IHidServer. - Adds new commands for `ngc:u` (`Mask2` and `Check2`) - Adds new commands for system settings server (GetHttpAuthConfig) for webapplet - Removes incompatible firmware popup warning. Signed-off-by: lizzie lizzie@eden-emu.dev Co-authored by: maufeat sahyno1996@gmail.com Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: JPikachu <jpikachu.eden@gmail.com> Co-authored-by: Maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3004 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [desktop] fix save data location, orphaned profiles finder (#2678)crueter2025-10-071-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if the user had their NAND in a nonstandard location, profiles.dat would be read from the standard Eden path and thus return effectively garbage data. What this would result in is: - The Qt profile manager would be completely nonfunctional - "Open Save Data Location" would put you into the completely wrong place - Games would read from incorrect locations for their saves To solve this, I made it so that profiles.dat is re-read *after* QtConfig initializes. It's not the perfect solution, but it works. Additionally, this adds an orphaned profiles finder: - walks through the save folders in nand/user/save/000.../ - for each subdirectory, checks to see if profiles.dat contains a corresponding UUID - If not, the profile is "orphaned". It may contain legit save data, so let the user decide how to handle it (famous last words) - Empty profiles are just removed. If they really matter, they're instantly recreated anyways. The orphaned profiles check runs right *after* the decryption keys check, but before the game list ever gets populated Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2678 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [qt] refactor: qt_common lib (#94)crueter2025-09-151-0/+7
| | | | | | | | | | | | | | | | | This is part of a series of PRs made in preparation for the QML rewrite. this PR specifically moves a bunch of utility functions from main.cpp into qt_common, with the biggest benefit being that QML can reuse the exact same code through ctx passthrough. Also, QtCommon::Frontend is an abstraction layer over several previously Widgets-specific stuff like QMessageBox that gets used everywhere. The idea is that once QML is implemented, these functions can have a Quick version implemented for systems that don't work well with Widgets (sun) or for those on Plasma 6+ (reduces memory usage w/o Widgets linkage) although Quick from C++ is actually anal, but whatever. Other than that this should also just kinda reduce the size of main.cpp which is a 6000-line behemoth rn, and clangd straight up gives up with it for me (likely caused by the massive amount of headers, which this DOES reduce). In the future, I probably want to create a common strings lookup table that both Qt and QML can reference--though I'm not sure how much linguist likes that--which should give us a way to keep language consistent (use frozen-map). TODO: Docs for Qt stuff Co-authored-by: MaranBr <maranbr@outlook.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/94 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
* fs: Add and use fs_save_data_types.hFearlessTobi2024-02-191-68/+22
|
* vfs: Move vfs files to their own directoryFearlessTobi2024-01-251-1/+1
|
* fsp-srv: use program registry for SetCurrentProcessLiam2024-01-111-8/+9
|
* android: Re-add global save managert8952024-01-041-0/+9
| | | | Reworked to correctly collect and import/export saves that could exist in either /nand/user/save/000...000/<user id> or /nand/user/save/account/<user id raw string>
* fs: don't enumerate hidden savedata size fileLiam2023-12-091-4/+2
|
* core: remove ResultVal typeLiam2023-08-081-19/+3
|
* fs: adjust future save pathLiam2023-05-111-2/+2
|
* general: rename CurrentProcess to ApplicationProcessLiam2023-02-131-1/+1
|
* savedata_factory: Detect future save data pathsMorph2022-10-161-7/+51
| | | | Enable compatibility for new account/device save paths planned on a future implementation.
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* general: Get the current process program id directly from the systemMorph2021-11-041-2/+1
| | | | This allows us to avoid including KProcess' header file in files that only need to get the current process' program id.
* general: Rename GetTitleID to GetProgramIDMorph2021-11-041-1/+1
|
* general: Remove MakeResult helpersMorph2021-11-021-2/+2
| | | | This is made obsolete by the presence of implicit constructors.
* fspsrv: Implement DisableAutoSaveDataCreation (#6355)Chloe2021-06-021-1/+5
| | | - Used by Mii Edit
* general: Replace RESULT_UNKNOWN with ResultUnknownMorph2021-06-021-2/+2
| | | | Transition to PascalCase for result names.
* hle: kernel: Rename Process to KProcess.bunnei2021-05-051-1/+1
|
* file_sys: Resolve cases of variable shadowingLioncash2021-05-021-7/+11
| | | | Brings us closer to enabling -Wshadow as an error in the core code.
* savedata_factory: Eliminate usage of the global system instanceLioncash2020-11-271-8/+10
| | | | Now there's only two meaningful instances left in core.
* fs: Rename SaveDataDescriptor to SaveDataAttributeMorph2020-07-301-17/+16
|
* file_sys: savefata_factory: Update to support DeviceSaveData.bunnei2020-05-111-3/+6
|
* file_sys: Resolve sign conversion warningsLioncash2019-11-121-2/+2
| | | | Resolves a few trivial sign conversion/mismatch errors.
* savedata_factory: Automatically create certain savedataZach Hilman2019-10-221-0/+12
| | | | | After further hardware investigation, it appears that some games, perhaps those more lazily coded, will not call EnsureSaveData, meaning that they expect the normal (current) save to be automatically made. Additionally, some games do not create a cache or temporary save before use. In these 3 specific instances, the save is created automatically for the game if it doesn't exist.
* core: Remove Core::CurrentProcess()Lioncash2019-10-061-2/+3
| | | | | | This only encourages the use of the global system instance (which will be phased out long-term). Instead, we use the direct system function call directly to remove the appealing but discouraged short-hand.
* filesystem: Add const qualification to various accessorsZach Hilman2019-09-211-3/+4
|
* savedata_factory: Implement savedata creation and don't create dir on openZach Hilman2019-09-211-26/+39
| | | Matches hardware behavior and eliminates some nasty behavior we were doing that wasn't hw-accurate at all.
* service/fsp_srv: Don't pass SaveDataDescriptor instances by value.Lioncash2019-04-051-1/+1
| | | | | Passing around a 64 byte data struct by value is kind of wasteful, instead pass a reference to the struct.
* service/fsp_srv: Update SaveDataInfo and SaveDataDescriptor structsLioncash2019-04-051-2/+4
| | | | | I realized that I updated the documentation on SwitchBrew a while ago, but never actually updated the structs within yuzu.
* am: Implement GetSaveDataSize and ExtendSaveDataZach Hilman2018-12-271-1/+1
| | | These functions come in a pair and are needed by Smash Ultimate, Minecraft, and Skyrim, amongst others.
* savedata_factory: Partially implement IVFC save sizes using filesZach Hilman2018-12-271-0/+30
| | | 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.
* Fixed uninitialized memory due to missing returns in canaryDavid Marcec2018-12-191-0/+1
| | | | Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
* savedata_factory: Add support for CacheStorageZach Hilman2018-12-071-0/+2
|
* savedata_factory: Delete TemporaryStorage on startupZach Hilman2018-12-061-1/+5
| | | | Mimics hardware behavior.
* ns: Implement command 400: GetApplicationControlDataZach Hilman2018-10-291-1/+1
| | | Returns the raw NACP bytes and the raw icon bytes into a title-provided buffer. Pulls from Registration Cache for control data, returning all zeros should it not exist.
* savedata_factory: Expose accessors for SaveDataSpaceZach Hilman2018-10-291-14/+18
|
* savedata_factory: Add TemporaryStorage SaveDataSpaceIdZach Hilman2018-10-161-1/+4
| | | | Required for TemporaryStorage saves (in addition to SaveDataType)
* savedata_factory: Add support for DeviceSaveDataZach Hilman2018-10-161-0/+8
| | | | Uses the same path as SaveData except with UID 0. Adds a warning if UID is not 0.
* kernel/process: Make data member variables privateLioncash2018-09-301-1/+1
| | | | | | | Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
* Merge pull request #1364 from lioncash/contentbunnei2018-09-201-0/+2
|\ | | | | file-sys: Default heavy-weight class destructors in the cpp file
| * file-sys: Default heavy-weight class destructors in the cpp fileLioncash2018-09-191-0/+2
| | | | | | | | | | | | | | | | | | | | Several classes have a lot of non-trivial members within them, or don't but likely should have the destructor defaulted in the cpp file for future-proofing/being more friendly to forward declarations. Leaving the destructor unspecified allows the compiler to inline the destruction code all over the place, which is generally undesirable from a code bloat perspective.
* | savedata_factory: Add TemporaryStorage SaveDataTypeZach Hilman2018-09-191-4/+7
|/ | | Seems to be used by NSO NES Emulator
* file_sys: Replace includes with forward declarations where applicableLioncash2018-09-031-0/+1
| | | | | Cuts down on include dependencies, resulting in less files that need to be rebuilt when certain things are changed.
* core/core: Replace includes with forward declarations where applicableLioncash2018-08-311-0/+1
| | | | | | | | | | | The follow-up to 88597535d629ea9a265f8bf0f00a9ce4dd5dc218, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.