aboutsummaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2018-09-11pl_u: Eliminate mutable file-scope stateLioncash
Converts the PL_U internals to use the PImpl idiom and makes the state part of the Impl struct, eliminating mutable global/file state.
2018-09-11Merge pull request #1291 from lioncash/defaultbunnei
hle/service: Default constructors and destructors in the cpp file where applicable
2018-09-11externals: Place font data within cpp filesLioncash
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.
2018-09-10hle/service: Default constructors and destructors in the cpp file where ↵Lioncash
applicable 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.
2018-09-10Use open-source shared fonts if no dumped file is available (#1269)Tobias
* Add open-source shared fonts * Address review comments
2018-09-10video_core: Move command buffer loop.Markus Wick
This moves the hot loop into video_core. This refactoring shall reduce the CPU overhead of calling ProcessCommandList.
2018-09-09Merge pull request #1276 from FearlessTobi/fix-stupid-stubbunnei
hid: Implement ReloadInputDevices
2018-09-09service: Remove unused g_kernel_named_ports variableLioncash
With the named port functionality all migrated over to the kernel, there's no need to keep this around anymore.
2018-09-09hid: Implement ReloadInputDevicesfearlessTobi
2018-09-06core: Migrate current_process pointer to the kernelLioncash
Given we now have the kernel as a class, it doesn't make sense to keep the current process pointer within the System class, as processes are related to the kernel. This also gets rid of a subtle case where memory wouldn't be freed on core shutdown, as the current_process pointer would never be reset, causing the pointed to contents to continue to live.
2018-09-06Merge pull request #1250 from lioncash/file-sysbunnei
file_sys/{nca_patch, patch_manager}: Amend unnecessary/missing includes.
2018-09-06core/core: Remove unnecessary sm/controller includeLioncash
The only reason this include was necessary, was because the constructor wasn't defaulted in the cpp file and the compiler would inline it wherever it was used. However, given Controller is forward declared, all those inlined constructors would see an incomplete type, causing a compilation failure. So, we just place the constructor in the cpp file, where it can see the complete type definition, allowing us to remove this include.
2018-09-06file_sys/nca_patch: Amend constructor initializer list orderLioncash
Orders the elements in the initializer list in the order they're specified in the class. This prevents compiler warnings about initialization order.
2018-09-06file_sys/nca_patch: Remove unnecessary includesLioncash
romfs.h doesn't need to be included in the header, the only real dependency here is common's swap.h that needs to be included.
2018-09-06file_sys/patch_manager: Add missing includesLioncash
These includes were previously being satisfied indirectly.
2018-09-05Merge pull request #1242 from lioncash/file-sysbunnei
file_sys/submission_package: Replace includes with forward declarations where applicable
2018-09-05file_sys/submission_package: Correct constructor initialization list orderLioncash
Orders the elements in the sequence to match the order in which they'll actually be initialized in.
2018-09-05file_sys/submission_package: Replace includes with forward declarations ↵Lioncash
where applicable
2018-09-04bktr: Fix bucket overlap errorZach Hilman
2018-09-04drd: Parse title ID from program metadataZach Hilman
2018-09-04patch_manager: Centralize Control-type NCA parsingZach Hilman
2018-09-04nsp: Fix error masking issue with XCI filesZach Hilman
Now display correct error instead of catch-all MissingProgramNCA
2018-09-04game_list: Fix version display on non-NAND titlesZach Hilman
2018-09-04bktr: Add logging on successful patchZach Hilman
2018-09-04bktr: Implement IVFC offset shiftingZach Hilman
Fixes base game read errors
2018-09-04bktr: Fix missing includes and optimize styleZach Hilman
2018-09-04loader: Add BKTR-specific error messages and codesZach Hilman
2018-09-04loader: Ignore patches on NRO and DRDZach Hilman
2018-09-04patch_manager: Add usages of patches to ExeFSZach Hilman
2018-09-04file_sys: Add class to manage game patchesZach Hilman
Right now only includes Updates, but should eventually contain all of the other patches we need.
2018-09-04file_sys: Add BKTR patching mechanismZach Hilman
2018-09-04content_archive: Add BKTR header parsing to NCAZach Hilman
2018-09-04registration: Add RegisteredCacheUnionZach Hilman
Aggregates multiple caches into one interface
2018-09-04game_list: Use RegisteredCacheUnion for installedZach Hilman
Reduces code
2018-09-04aes_util: Fix error involving reads of less than 0x10Zach Hilman
Issues with block size are fixed by making all reads minimum length of 0x10
2018-09-04main: Only show DRD deprecation warning onceZach Hilman
2018-09-04control_metadata: Use alternate language names if AmericanEnglish isn't ↵Zach Hilman
available
2018-09-04card_image: Add program title ID getterZach Hilman
2018-09-04nsp: Comply with style and performance guidelinesZach Hilman
2018-09-04qt: Add UI support for NSP filesZach Hilman
2018-09-04registration: Add support for installing NSP filesZach Hilman
2018-09-04loader: Add AppLoader for NSP filesZach Hilman
2018-09-04card_image: Parse XCI secure partition with NSPZach Hilman
Eliminated duplicate code and adds support for Rev1+ carts
2018-09-04file_sys: Add Nintendo Submission Package (NSP)Zach Hilman
2018-09-04drd: Load title ID from program metadataZach Hilman
Previously only loaded from control metadata
2018-09-04loader: Add NSP file type and NSP-specific errorsZach Hilman
2018-09-04key_manager: Avoid autogeneration if key existsZach Hilman
2018-09-04Merge pull request #1237 from degasus/optimizationsbunnei
Optimizations
2018-09-04Merge pull request #1223 from DarkLordZach/custom-nand-sd-dirsbunnei
file_sys: Allow for custom NAND/SD directories
2018-09-04Merge pull request #1235 from lioncash/forward-declbunnei
file_sys: Replace includes with forward declarations where applicable