summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/ns (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: support offline web appletLiam2024-01-302-3/+79
|
* vfs: Move vfs files to their own directoryFearlessTobi2024-01-251-1/+1
|
* Rework time service to fix time passing offline.Kelebek12024-01-242-5/+2
|
* service: set: Rename filesgerman772024-01-072-2/+2
|
* service: caps: Partially implement IAlbumAccessorServiceNarr the Reg2023-10-022-2/+29
|
* service: ns: Implement GetSharedFontInOrderOfPriorityForSystemgerman772023-09-241-4/+13
|
* core: remove ResultVal typeLiam2023-08-082-20/+26
|
* configure_system: Implement with for looplat9nq2023-07-211-1/+1
|
* general: fix spelling mistakesLiam2023-03-121-1/+1
|
* hle: rename legacy errors to ResultsLiam2023-03-072-6/+7
|
* service: move hle_ipc from kernelLiam2023-03-016-31/+30
|
* Merge pull request #9832 from liamwhite/hle-mpliamwhite2023-03-012-19/+22
|\ | | | | service: HLE multiprocess
| * service: refactor server architectureLiam2023-02-212-19/+22
| | | | | | | | Converts services to have their own processes
* | core: Update service function tables to 16.0.0+Narr the Reg2023-02-251-2/+10
|/
* service: Make use of buffer element count helpersLioncash2022-11-231-7/+4
|
* general: preliminary support for hblLiam2022-10-122-1/+32
|
* core: ns: Implement pl:s serviceNarr the Reg2022-09-033-22/+23
|
* core: Replace all instances of ResultCode with Resultgerman772022-06-271-1/+1
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-239-27/+18
| | | | | 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.
* core: Reduce unused includesameerj2022-03-191-1/+0
|
* general: Rename NewUUID to UUID, and remove the previous UUID implMorph2022-02-051-2/+2
| | | | This completes the removal of the old UUID implementation.
* service: Migrate to the new UUID implementationMorph2022-02-051-3/+3
|
* service/ns: Update function tablesLioncash2022-01-211-0/+6
|
* core/ns: Implement GetReadOnlyApplicationControlDataInterfaceNarr the Reg2021-11-282-1/+26
| | | | Used in checkpoint homebrew
* core/pdm: Stub QueryPlayStatisticsByApplicationIdAndUserAccountIdNarr the Reg2021-11-283-0/+105
| | | | Used in checkpoint homebrew
* core: Remove unused includesameerj2021-11-041-2/+1
|
* general: Remove MakeResult helpersMorph2021-11-021-2/+2
| | | | This is made obsolete by the presence of implicit constructors.
* ns: language: Add BrazilianPortuguese to ApplicationLanguageMorph2021-10-292-1/+26
| | | | It seems that Nintendo finally filled that last empty spot in ApplicationLanguage for a total of 16 supported languages.
* service: Reduce header include overheadMorph2021-10-071-1/+0
|
* service: ns, set: Add PT_BR (Brazilian Portuguese)Morph2021-07-301-0/+1
|
* service: ns: Remove unused ns_language headerMorph2021-07-271-42/+0
|
* service: ns: Map ZH_TW and ZH_CN to Traditional/Simplified ChineseMorph2021-07-271-0/+2
|
* hle: kernel: Refactor to allocate a ServiceThread per service handler.bunnei2021-06-051-2/+0
| | | | | | - Previously, we would allocate a thread per session, which adds new threads on CloneCurrentObject. - This results in race conditions with N sessions queuing requests to the same service interface. - Fixes Pokken Tournament DX crashes/softlocks, which were regressed by #6347.
* general: Replace RESULT_UNKNOWN with ResultUnknownMorph2021-06-021-2/+2
| | | | Transition to PascalCase for result names.
* general: Replace RESULT_SUCCESS with ResultSuccessMorph2021-06-023-13/+13
| | | | Transition to PascalCase for result names.
* common: fs: Rework the Common Filesystem interface to make use of std::filesystem (#6270)Morph2021-05-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
* fixup! hle: kernel: Migrate KSharedMemory to KAutoObject.bunnei2021-05-061-2/+2
|
* hle: kernel: Migrate KSharedMemory to KAutoObject.bunnei2021-05-061-6/+2
|
* hle: kernel: Refactor IPC interfaces to not use std::shared_ptr.bunnei2021-05-061-1/+1
|
* common: Move settings to common from core.bunnei2021-04-151-1/+1
| | | | - Removes a dependency on core and input_common from common.
* Merge pull request #6171 from german77/servicesbunnei2021-04-101-0/+4
|\ | | | | service: Update service function tables and use proper names
| * pl_u: Update to 12.xgerman772021-04-091-0/+4
| |
* | ns: Update to 12.xMorph2021-04-091-3/+38
|/
* hle: kernel: Rename SharedMemory to KSharedMemory.bunnei2021-02-191-2/+2
|
* pl_u: Fix read out of boundsAlessandro Astone2021-02-061-2/+7
|
* pl_u, applets/web: Decrypt shared fonts to TTF filesMorph2020-12-182-18/+31
|
* ns_vm: Stub NeedsUpdateVulnerabilityMorph2020-12-181-1/+10
| | | | This is used to force system updates on launching the web browser. We do not care about system updates so this can be set to false.
* core: Remove unnecessary enum casts in log callsLioncash2020-12-081-6/+3
| | | | | Follows the video core PR. fmt doesn't require casts for enum classes anymore, so we can remove quite a few casts.
* service: Eliminate usages of the global system instanceLioncash2020-11-274-36/+36
| | | | | Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
* patch_manager: Remove usages of the global system instanceLioncash2020-11-182-17/+35
| | | | | | | With this, only 19 usages of the global system instance remain within the core library. We're almost there.
* core: Fix clang build pt.3Lioncash2020-10-221-11/+1
| | | | Should finally resolve building with clang.
* Revert "core: Fix clang build"bunnei2020-10-212-2/+12
|
* core: Fix clang buildLioncash2020-10-182-12/+2
| | | | | | | Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
* file_sys: Replace inclusions with forward declarations where applicableLioncash2020-08-231-0/+1
| | | | Same behavior, minus unnecessary inclusions where not necessary.
* Merge pull request #4203 from VolcaEM/servicesbunnei2020-07-113-13/+17
|\ | | | | service: Update function tables
| * Rename two functions in NSVolcaEM2020-07-021-2/+2
| | | | | | | | - Rename "GetShellEvent" to "GetShellEventHandle" - Rename "LaunchApplicationFromHost" to "LaunchApplication"
| * service: Update function tablesVolcaEM2020-06-293-15/+19
| |
* | configuration: implement per-game configurations (#4098)lat9nq2020-07-101-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Switch game settings to use a pointer In order to add full per-game settings, we need to be able to tell yuzu to switch to using either the global or game configuration. Using a pointer makes it easier to switch. * configuration: add new UI without changing existing funcitonality The new UI also adds General, System, Graphics, Advanced Graphics, and Audio tabs, but as yet they do nothing. This commit keeps yuzu to the same functionality as originally branched. * configuration: Rename files These weren't included in the last commit. Now they are. * configuration: setup global configuration checkbox Global config checkbox now enables/disables the appropriate tabs in the game properties dialog. The use global configuration setting is now saved to the config, defaulting to true. This also addresses some changes requested in the PR. * configuration: swap to per-game config memory for properties dialog Does not set memory going in-game. Swaps to game values when opening the properties dialog, then swaps back when closing it. Uses a `memcpy` to swap. Also implements saving config files, limited to certain groups of configurations so as to not risk setting unsafe configurations. * configuration: change config interfaces to use config-specific pointers When a game is booted, we need to be able to open the configuration dialogs without changing the settings pointer in the game's emualtion. A new pointer specific to just the configuration dialogs can be used to separate changes to just those config dialogs without affecting the emulation. * configuration: boot a game using per-game settings Swaps values where needed to boot a game. * configuration: user correct config during emulation Creates a new pointer specifically for modifying the configuration while emulation is in progress. Both the regular configuration dialog and the game properties dialog now use the pointer Settings::config_values to focus edits to the correct struct. * settings: split Settings::values into two different structs By splitting the settings into two mutually exclusive structs, it becomes easier, as a developer, to determine how to use the Settings structs after per-game configurations is merged. Other benefits include only duplicating the required settings in memory. * settings: move use_docked_mode to Controls group `use_docked_mode` is set in the input settings and cannot be accessed from the system settings. Grouping it with system settings causes it to be saved with per-game settings, which may make transferring configs more difficult later on, especially since docked mode cannot be set from within the game properties dialog. * configuration: Fix the other yuzu executables and a regression In main.cpp, we have to get the title ID before the ROM is loaded, else the renderer will reflect only the global settings and now the user's game specific settings. * settings: use a template to duplicate memory for each setting Replaces the type of each variable in the Settings::Values struct with a new class that allows basic data reading and writing. The new struct Settings::Setting duplicates the data in memory and can manage global overrides per each setting. * configuration: correct add-ons config and swap settings when apropriate Any add-ons interaction happens directly through the global values struct. Swapping bewteen structs now also includes copying the necessary global configs that cannot be changed nor saved in per-game settings. General and System config menus now update based on whether it is viewing the global or per-game settings. * settings: restore old values struct No longer needed with the Settings::Setting class template. * configuration: implement hierarchical game properties dialog This sets the apropriate global or local data in each setting. * clang format * clang format take 2 can the docker container save this? * address comments and style issues * config: read and write settings with global awareness Adds new functions to read and write settings while keeping the global state in focus. Files now generated per-game are much smaller since often they only need address the global state. * settings: restore global state when necessary Upon closing a game or the game properties dialog, we need to restore all global settings to the original global state so that we can properly open the configuration dialog or boot a different game. * configuration: guard setting values incorrectly This disables setting values while a game is running if the setting is overwritten by a per game setting. * config: don't write local settings in the global config Simple guards to prevent writing the wrong settings in the wrong files. * configuration: add comments, assume less, and clang format No longer assumes that a disabled UI element means the global state is turned off, instead opting to directly answer that question. Still however assumes a game is running if it is in that state. * configuration: fix a logic error Should not be negated * restore settings' global state regardless of accept/cancel Fixes loading a properties dialog and causing the global config dialog to show local settings. * fix more logic errors Fixed the frame limit would set the global setting from the game properties dialog. Also strengthened the Settings::Setting member variables and simplified the logic in config reading (ReadSettingGlobal). * fix another logic error In my efforts to guard RestoreGlobalState, I accidentally negated the IsPowered condition. * configure_audio: set toggle_stretched_audio to tristate * fixed custom rtc and rng seed overwriting the global value * clang format * rebased * clang format take 4 * address my own review Basically revert unintended changes * settings: literal instead of casting "No need to cast, use 1U instead" Thanks, Morph! Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> * Revert "settings: literal instead of casting " This reverts commit 95e992a87c898f3e882ffdb415bb0ef9f80f613f. * main: fix status buttons reporting wrong settings after stop emulation * settings: Log UseDockedMode in the Controls group This should have happened when use_docked_mode was moved over to the controls group internally. This just reflects this in the log. * main: load settings if the file has a title id In other words, don't exit if the loader has trouble getting a title id. * use a zero * settings: initalize resolution factor with constructor instead of casting * Revert "settings: initalize resolution factor with constructor instead of casting" This reverts commit 54c35ecb46a29953842614620f9b7de1aa9d5dc8. * configure_graphics: guard device selector when Vulkan is global Prevents the user from editing the device selector if Vulkan is the global renderer backend. Also resets the vulkan_device variable when the users switches back-and-forth between global and Vulkan. * address reviewer concerns Changes function variables to const wherever they don't need to be changed. Sets Settings::Setting to final as it should not be inherited from. Sets ConfigurationShared::use_global_text to static. Co-Authored-By: VolcaEM <volcaem@users.noreply.github.com> * main: load per-game settings after LoadROM This prevents `Restart Emulation` from restoring the global settings *after* the per-game settings were applied. Thanks to BSoDGamingYT for finding this bug. * Revert "main: load per-game settings after LoadROM" This reverts commit 9d0d48c52d2dcf3bfb1806cc8fa7d5a271a8a804. * main: only restore global settings when necessary Loading the per-game settings cannot happen after the ROM is loaded, so we have to specify when to restore the global state. Again thanks to BSoD for finding the bug. * configuration_shared: address reviewer concerns except operator overrides Dropping operator override usage in next commit. Co-Authored-By: LC <lioncash@users.noreply.github.com> * settings: Drop operator overrides from Setting template Requires using GetValue and SetValue explicitly. Also reverts a change that broke title ID formatting in the game properties dialog. * complete rebase * configuration_shared: translate "Use global configuration" Uses ConfigurePerGame to do so, since its usage, at least as of now, corresponds with ConfigurationShared. * configure_per_game: address reviewer concern As far as I understand, it prevents the program from unnecessarily copying strings. Co-Authored-By: LC <lioncash@users.noreply.github.com> Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com> Co-authored-by: VolcaEM <volcaem@users.noreply.github.com> Co-authored-by: LC <lioncash@users.noreply.github.com>
* Don't fail silently for vi, sm, set and ns servicesDavid Marcec2020-04-291-0/+8
|
* service: Update function tablesLioncash2020-04-202-2/+21
| | | | | | Keeps the service function tables up to date. Updated based off information on SwitchBrew.
* service: pl_u: Update for new shared memory layout.bunnei2020-04-171-7/+5
|
* Merge pull request #3094 from lioncash/tablesbunnei2019-11-252-1/+34
|\ | | | | service: Update function tables
| * service: Update function tablesLioncash2019-11-122-1/+34
| | | | | | | | | | | | Keeps the function tables up to date. Updated based off information from Switchbrew.
* | kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)bunnei2019-11-251-1/+1
| | | | | | | | | | | | * kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. - See https://github.com/citra-emu/citra/pull/4710 for details.
* | service: Resolve sign conversion errorsLioncash2019-11-122-3/+3
|/ | | | | These are fairly trivial to resolve and most of the changes entail using RESULT_UNKNOWN over ResultCode(-1).
* pl_u: Fix mismatched rebase size error in font encryptionZach Hilman2019-10-132-11/+11
|
* pl_u: Use kernel physical memoryZach Hilman2019-10-131-0/+1
|
* pl_u: Remove excess static qualifierZach Hilman2019-10-131-1/+1
|
* pl_u: Use OSS system archives if real archives don't existZach Hilman2019-10-131-110/+47
|
* hle/service: Replace global system instance calls with instance-based onesLioncash2019-10-061-4/+4
| | | | | | | | | | Migrates the HLE service code off the use of directly accessing the global system instance where trivially able to do so. This removes all usages of Core::CurrentProcess from the service code, only 8 occurrences of this function exist elsewhere. There's still quite a bit of "System::GetInstance()" being used, however this was able to replace a few instances.
* Merge pull request #2884 from ogniK5377/deglobal-sys-servicesFernando Sahmkow2019-09-224-8/+13
|\ | | | | Remove usage of System::CurrentInterface() from most services
| * RebaseDavid Marcec2019-09-221-1/+1
| |
| * RebaseDavid Marcec2019-09-224-7/+8
| |
| * RebaseDavid Marcec2019-09-224-8/+12
| |
* | Revert "Merge pull request #2709 from DarkLordZach/oss-ext-fonts-1"David Marcec2019-09-222-50/+117
|/ | | | | This reverts commit fa1c60c33ef88c6cd0b72da46842dc9098db712d, reversing changes made to e34899067b60a69bca02761bd1290c6824bb559a.
* Merge pull request #2709 from DarkLordZach/oss-ext-fonts-1David2019-09-222-117/+50
|\ | | | | system_archive: Move shared font data to system_archive and fix extended font data
| * pl_u: Use kernel physical memoryZach Hilman2019-09-221-0/+1
| |
| * pl_u: Remove excess static qualifierZach Hilman2019-09-221-1/+1
| |
| * pl_u: Use OSS system archives if real archives don't existZach Hilman2019-09-222-109/+41
| |
| * pl_u: Expose method to encrypt TTF to BFTTFZach Hilman2019-09-222-14/+14
| |
* | services: Pass FileSystemController as reference to services that need itZach Hilman2019-09-214-10/+27
|/
* VM_Manager: Align allocated memory to 256bytesFernando Sahmkow2019-07-191-6/+6
| | | | | | This commit ensures that all backing memory allocated for the Guest CPU is aligned to 256 bytes. This due to how gpu memory works and the heavy constraints it has in the alignment of physical memory.
* service/ns: Add missing override specifiersLioncash2019-06-051-9/+9
|
* Fix bitmask logic inversionMichael Scire2019-05-231-2/+1
|
* fix introduced clang-format errorsMichael Scire2019-05-231-3/+2
|
* Address review commentsMichael Scire2019-05-235-45/+118
|
* clang-format fixesMichael Scire2019-05-234-31/+32
|
* Implement IApplicationFunctions::GetDesiredLanguageMichael Scire2019-05-235-401/+964
|
* service/ns: Update function tablesLioncash2019-01-301-14/+20
| | | | Updates function tables based off information provided by SwitchBrew
* Changed logging to be "Log before execution", Added more error logging, all services should now log on some levelDavid Marcec2018-11-262-8/+10
|
* pl_u: Resize buffers in shared font data getter to what game requestsZach Hilman2018-11-151-0/+8
| | | | Fixes unmapped spam in SMP and buffer size errors in some other games
* ns: Implement command 400: GetApplicationControlDataZach Hilman2018-10-291-1/+63
| | | 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.
* ns: Update service function tableLioncash2018-10-191-6/+49
| | | | Updated based off information provided by Switchbrew.
* file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicableLioncash2018-10-161-1/+1
| | | | | | | | | | | | | | | The data retrieved in these cases are ultimately chiefly owned by either the RegisteredCache instance itself, or the filesystem factories. Both these should live throughout the use of their contained data. If they don't, it should be considered an interface/design issue, and using shared_ptr instances here would mask that, as the data would always be prolonged after the main owner's lifetime ended. This makes the lifetime of the data explicit and makes it harder to accidentally create cyclic references. It also makes the interface slightly more flexible than the previous API, as a shared_ptr can be created from a unique_ptr, but not the other way around, so this allows for that use-case if it ever becomes necessary in some form.
* kernel/process: Make data member variables privateLioncash2018-09-301-3/+3
| | | | | | | 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.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-6/+6
|
* services/pl_u: Add missing Korean font to the fallback case for shared fontsLioncash2018-09-131-2/+4
| | | | Previously this wasn't using the Korean font at all.
* pl_u: Eliminate mutable file-scope stateLioncash2018-09-122-66/+88
| | | | | Converts the PL_U internals to use the PImpl idiom and makes the state part of the Impl struct, eliminating mutable global/file state.
* Merge pull request #1291 from lioncash/defaultbunnei2018-09-112-1/+3
|\ | | | | hle/service: Default constructors and destructors in the cpp file where applicable
| * hle/service: Default constructors and destructors in the cpp file where applicableLioncash2018-09-112-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a destructor isn't defaulted into a cpp file, it can cause the use of forward declarations to seemingly fail to compile for non-obvious reasons. It also allows inlining of the construction/destruction logic all over the place where a constructor or destructor is invoked, which can lead to code bloat. This isn't so much a worry here, given the services won't be created and destroyed frequently. The cause of the above mentioned non-obvious errors can be demonstrated as follows: ------- Demonstrative example, if you know how the described error happens, skip forwards ------- Assume we have the following in the header, which we'll call "thing.h": \#include <memory> // Forward declaration. For example purposes, assume the definition // of Object is in some header named "object.h" class Object; class Thing { public: // assume no constructors or destructors are specified here, // or the constructors/destructors are defined as: // // Thing() = default; // ~Thing() = default; // // ... Some interface member functions would be defined here private: std::shared_ptr<Object> obj; }; If this header is included in a cpp file, (which we'll call "main.cpp"), this will result in a compilation error, because even though no destructor is specified, the destructor will still need to be generated by the compiler because std::shared_ptr's destructor is *not* trivial (in other words, it does something other than nothing), as std::shared_ptr's destructor needs to do two things: 1. Decrement the shared reference count of the object being pointed to, and if the reference count decrements to zero, 2. Free the Object instance's memory (aka deallocate the memory it's pointing to). And so the compiler generates the code for the destructor doing this inside main.cpp. Now, keep in mind, the Object forward declaration is not a complete type. All it does is tell the compiler "a type named Object exists" and allows us to use the name in certain situations to avoid a header dependency. So the compiler needs to generate destruction code for Object, but the compiler doesn't know *how* to destruct it. A forward declaration doesn't tell the compiler anything about Object's constructor or destructor. So, the compiler will issue an error in this case because it's undefined behavior to try and deallocate (or construct) an incomplete type and std::shared_ptr and std::unique_ptr make sure this isn't the case internally. Now, if we had defaulted the destructor in "thing.cpp", where we also include "object.h", this would never be an issue, as the destructor would only have its code generated in one place, and it would be in a place where the full class definition of Object would be visible to the compiler. ---------------------- End example ---------------------------- Given these service classes are more than certainly going to change in the future, this defaults the constructors and destructors into the relevant cpp files to make the construction and destruction of all of the services consistent and unlikely to run into cases where forward declarations are indirectly causing compilation errors. It also has the plus of avoiding the need to rebuild several services if destruction logic changes, since it would only be necessary to recompile the single cpp file.
* | externals: Place font data within cpp filesLioncash2018-09-111-6/+6
|/ | | | | | | | | | | | | | | This places the font data within cpp files, which mitigates the possibility of the font data being duplicated within the binary if it's referred to in more than one translation unit in the future. It also stores the data within a std::array, which is more flexible when it comes to operating with the standard library. Furthermore, it makes the data arrays const. This is what we want, as it allows the compiler to store the data within the read-only segment. As it is, having several large sections of mutable data like this just leaves spots in memory that we can accidentally write to (via accidental overruns, what have you) and actually have it work. This ensures the font data remains the same no matter what.
* Use open-source shared fonts if no dumped file is available (#1269)Tobias2018-09-111-1/+25
| | | | | | * Add open-source shared fonts * Address review comments
* file_sys: Replace includes with forward declarations where applicableLioncash2018-09-041-1/+3
| | | | | Cuts down on include dependencies, resulting in less files that need to be rebuilt when certain things are changed.
* kernel: Eliminate kernel global stateLioncash2018-08-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
* Addressed plu TTF changesDavid Marcec2018-08-231-6/+7
|
* Added SharedFonts loading via TTFDavid Marcec2018-08-231-5/+50
| | | | | | | | | | | By having the following TTF files in your yuzu sysdata directory. You can load sharedfonts via TTF files. FontStandard.ttf FontChineseSimplified.ttf FontExtendedChineseSimplified.ttf FontChineseTraditional.ttf FontKorean.ttf FontNintendoExtended.ttf FontNintendoExtended2.ttf
* Added missing include for pl:uDavid Marcec2018-08-221-0/+1
| | | | Should fix any compile errors
* PL:U Added BFTTF loading(Loading from System NAND dumps) (#1088)David2018-08-221-25/+140
| | | | | | | | | | | | * Added bfttf loading We can now load system bfttf fonts from system archives AND shared memory dumps. This allows people who have installed their system nand dumps to yuzu to automatically get shared font support. We also now don't hard code the offsets or the sizes of the shared fonts and it's all calculated for us now. * Addressed plu fixups * Style changes for plu * Fixed logic error for plu and added more error checks.
* service/ns: Add missing ns servicesLioncash2018-08-021-0/+447
| | | | | | Implements the basic skeleton of ns:am2, ns:ec, ns:rid, ns:rt, ns:su, ns:vm, and ns:web based off the information provided by Switch Brew and SwIPC.
* file_util: Use an enum class for GetUserPath()Lioncash2018-07-211-1/+1
| | | | | | | | | | | | | 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.
* pl_u: Simplify WriteBuffer() calls in GetSharedFontInOrderOfPriority()Lioncash2018-07-201-3/+3
| | | | With the new overload, we can simply pass the container directly.
* Merge pull request #725 from lioncash/bytesbunnei2018-07-201-3/+3
|\ | | | | pl_u: Specify correct size for buffers in GetSharedFontInOrderOfPriority()
| * pl_u: Specify correct size for buffers in GetSharedFontInOrderOfPriority()Lioncash2018-07-191-3/+3
| | | | | | | | | | This WriteBuffer overload expects its size argument to be in bytes, not elements.
* | pl_u: Remove printf specifier in log call in a log call in GetSharedFontInOrderOfPriority()Lioncash2018-07-191-1/+1
|/ | | | This can just use the fmt specifiers and be type-agnostic.
* Rename logging macro back to LOG_*James Rowe2018-07-031-7/+7
|
* GetSharedFontInOrderOfPriority (#381)David2018-05-012-1/+27
| | | | | | | | | | | | | | | | | | | | * GetSharedFontInOrderOfPriority * Update pl_u.cpp * Ability to use ReadBuffer and WriteBuffer with different buffer indexes, fixed up GetSharedFontInOrderOfPriority * switched to NGLOG * Update pl_u.cpp * Update pl_u.cpp * language_code is actually language code and not index * u32->u64 * final cleanups
* ns: Move logging macros over to new fmt-compatible onesLioncash2018-04-241-6/+6
|
* service: Use nested namespace specifiers where applicableLioncash2018-04-204-16/+8
| | | | Tidies up namespace declarations
* pl_u: Use empty shared font if none is available.bunnei2018-04-151-17/+14
| | | | - Makes games work in lieu of shared_font.bin.
* Updated pl:u with more service names.Hexagon122018-04-101-1/+3
|
* pl_u: Add RequestLoad.bunnei2018-03-252-0/+11
|
* core: Move process creation out of global state.bunnei2018-03-141-4/+5
|
* pl_u: Implement basic shared font loading from RAM dump.bunnei2018-02-154-0/+176
|
* Remove lots more 3DS-specific code.bunnei2017-10-134-87/+0
|
* Services/NS: Port ns:s to the new service framework.Subv2017-09-164-0/+87