aboutsummaryrefslogtreecommitdiff
path: root/src/core/core.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2228 from DarkLordZach/applet-manager-p1bunnei2019-04-241-33/+17
|\ | | | | applets: Add AppletManager and implement PhotoViewer and Error applets
| * core: Remove specific applets in favor of AppletManagerZach Hilman2019-04-171-33/+17
| |
* | core/core: Move process execution start to System's Load()Lioncash2019-04-111-1/+5
| | | | | | | | | | | | | | | | | | This gives us significantly more control over where in the initialization process we start execution of the main process. Previously we were running the main process before the CPU or GPU threads were initialized (not good). This amends execution to start after all of our threads are properly set up.
* | core/core: Move main process creation into Load()Lioncash2019-04-111-4/+3
| | | | | | | | | | | | | | | | | | Now that we have dependencies on the initialization order, we can move the creation of the main process to a more sensible area: where we actually load in the executable data. This allows localizing the creation and loading of the process in one location, making the initialization of the process much nicer to trace.
* | video_core/gpu: Create threads separately from initializationLioncash2019-04-111-11/+4
| | | | | | | | | | | | | | | | | | Like with CPU emulation, we generally don't want to fire off the threads immediately after the relevant classes are initialized, we want to do this after all necessary data is done loading first. This splits the thread creation into its own interface member function to allow controlling when these threads in particular get created.
* | core/cpu_core_manager: Create threads separately from initialization.Lioncash2019-04-111-3/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our initialization process is a little wonky than one would expect when it comes to code flow. We initialize the CPU last, as opposed to hardware, where the CPU obviously needs to be first, otherwise nothing else would work, and we have code that adds checks to get around this. For example, in the page table setting code, we check to see if the system is turned on before we even notify the CPU instances of a page table switch. This results in dead code (at the moment), because the only time a page table switch will occur is when the system is *not* running, preventing the emulated CPU instances from being notified of a page table switch in a convenient manner (technically the code path could be taken, but we don't emulate the process creation svc handlers yet). This moves the threads creation into its own member function of the core manager and restores a little order (and predictability) to our initialization process. Previously, in the multi-threaded cases, we'd kick off several threads before even the main kernel process was created and ready to execute (gross!). Now the initialization process is like so: Initialization: 1. Timers 2. CPU 3. Kernel 4. Filesystem stuff (kind of gross, but can be amended trivially) 5. Applet stuff (ditto in terms of being kind of gross) 6. Main process (will be moved into the loading step in a following change) 7. Telemetry (this should be initialized last in the future). 8. Services (4 and 5 should ideally be alongside this). 9. GDB (gross. Uses namespace scope state. Needs to be refactored into a class or booted altogether). 10. Renderer 11. GPU (will also have its threads created in a separate step in a following change). Which... isn't *ideal* per-se, however getting rid of the wonky intertwining of CPU state initialization out of this mix gets rid of most of the footguns when it comes to our initialization process.
* core: Store system-wide ContentProvider for the emulatorZach Hilman2019-03-261-0/+26
|
* file_sys/cheat_engine: Remove use of global system accessorsLioncash2019-03-221-2/+2
| | | | | Instead, pass in the core timing instance and make the dependency explicit in the interface.
* Merge pull request #1933 from DarkLordZach/cheat-enginebunnei2019-03-211-0/+11
|\ | | | | file_sys: Implement parser and interpreter for game memory cheats
| * vm_manager: Remove cheat-specific ranges from VMManagerZach Hilman2019-03-051-2/+4
| |
| * core: Add support for registering and controlling ownership of CheatEngineZach Hilman2019-03-041-0/+9
| |
* | kernel: Make the address arbiter instance per-processLioncash2019-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | Now that we have the address arbiter extracted to its own class, we can fix an innaccuracy with the kernel. Said inaccuracy being that there isn't only one address arbiter. Each process instance contains its own AddressArbiter instance in the actual kernel. This fixes that and gets rid of another long-standing issue that could arise when attempting to create more than one process.
* | Merge pull request #2055 from bunnei/gpu-threadbunnei2019-03-071-3/+10
|\ \ | | | | | | Asynchronous GPU command processing
| * | gpu: Refactor a/synchronous implementations into their own classes.bunnei2019-03-061-2/+7
| | |
| * | gpu: Refactor to take RendererBase instead of RasterizerInterface.bunnei2019-03-061-1/+1
| | |
| * | core: Set is_powered_on before GPU is initialized.bunnei2019-03-061-1/+3
| | |
* | | Merge pull request #2190 from lioncash/ogl-globalbunnei2019-03-061-7/+7
|\ \ \ | |/ / |/| | core: Remove the global telemetry accessor function
| * | core/core: Replace direct usage of the global system telemetry accessor from ↵Lioncash2019-03-041-7/+7
| |/ | | | | | | | | | | | | Shutdown() The telemetry instance is actually a member of the class itself, so we can access it directly instead of going through the global accessor.
* / kernel/address_arbiter: Pass in system instance to constructorLioncash2019-03-051-2/+3
|/ | | | | Allows getting rid of reliance on the global accessor functions and instead operating on the provided system instance.
* video_core: Remove usages of System::GetInstance() within the enginesLioncash2019-02-151-1/+1
| | | | | Avoids the use of the global accessor in favor of explicitly making the system a dependency within the interface.
* core_timing: Convert core timing into a classLioncash2019-02-151-5/+14
| | | | | | | | | | | Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
* core_timing: Rename CoreTiming namespace to Core::TimingLioncash2019-02-121-3/+3
| | | | | | Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
* gl_shader_cache: Link loading screen with disk shader cache loadReinUsesLisp2019-02-061-2/+0
|
* gl_shader_disk_cache: Pass core system as argument and guard against games ↵ReinUsesLisp2019-02-061-1/+1
| | | | without title ids
* rasterizer_interface: Add disk cache entry for the rasterizerReinUsesLisp2019-02-061-0/+3
|
* core/frontend/applets/web_browser: Make OpenPage() non-constLioncash2019-01-171-6/+10
| | | | | | | | This is a function that definitely doesn't always have a non-modifying behavior across all implementations, so this should be made non-const. This gets rid of the need to mark data members as mutable to work around the fact mutating data members needs to occur.
* Merge pull request #1959 from DarkLordZach/custom-rtcbunnei2019-01-101-0/+6
|\ | | | | settings: Add support for setting the RTC manually
| * settings: Use std::chrono::seconds instead of s64 for RTCZach Hilman2019-01-071-2/+1
| |
| * core: Set custom RTC differential on game bootZach Hilman2019-01-071-0/+7
| |
* | web_browser: Add bounds checking to applet interfaceZach Hilman2018-12-281-0/+5
| |
* | core: Add getter and setter for WebBrowserApplet frontendZach Hilman2018-12-281-0/+13
|/
* Merge pull request #1781 from DarkLordZach/applet-profile-selectbunnei2018-12-231-0/+11
|\ | | | | am: Implement HLE profile selector applet
| * core: Add getter/setter for ProfileSelector in SystemZach Hilman2018-12-031-0/+11
| |
* | core: Make GetGameFileFromPath function externally accessibleZach Hilman2018-12-031-3/+5
|/
* core: Relocate CPU core management to its own classLioncash2018-11-221-97/+22
| | | | | | | | | | | | | | | | | | | | | | | | Keeps the CPU-specific behavior from being spread throughout the main System class. This will also act as the home to contain member functions that perform operations on all cores. The reason for this being that the following pattern is sort of prevalent throughout sections of the codebase: If clearing the instruction cache for all 4 cores is necessary: Core::System::GetInstance().ArmInterface(0).ClearInstructionCache(); Core::System::GetInstance().ArmInterface(1).ClearInstructionCache(); Core::System::GetInstance().ArmInterface(2).ClearInstructionCache(); Core::System::GetInstance().ArmInterface(3).ClearInstructionCache(); This is kind of... well, silly to copy around whenever it's needed. especially when it can be reduced down to a single line. This change also puts the basics in place to begin "ungrafting" all of the forwarding member functions from the System class that are used to access CPU state or invoke CPU-specific behavior. As such, this change itself makes no changes to the direct external interface of System. This will be covered by another changeset.
* am: Deglobalize software keyboard appletZach Hilman2018-11-181-0/+17
|
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-1/+1
| | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
* core: Add missing const variants of getters for the System classLioncash2018-10-281-2/+26
| | | | | | Many of the Current<Thing> getters (as well as a few others) were missing const qualified variants, which makes it a pain to retrieve certain things from const qualified references to System.
* core: Remove unnecessary assert in ArmInterface()Lioncash2018-10-181-2/+1
| | | | | CpuCore already does this sort of checking, so we can just call that instead of duplicating the assertions.
* core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrsLioncash2018-10-151-4/+12
|
* core: Make the live Cpu instances unique_ptrs instead of shared_ptrsLioncash2018-10-151-9/+9
| | | | | | | | There's no need for shared ownership here, as the only owning class instance of those Cpu instances is the System class itself. We can also make the thread_to_cpu map use regular pointers instead of shared_ptrs, given that the Cpu instances will always outlive the cases where they're used with that map.
* core: Make the exclusive monitor a unique_ptr instead of a shared_ptrLioncash2018-10-151-2/+3
| | | | | | Like the barrier, this is owned entirely by the System and will always outlive the encompassing state, so shared ownership semantics aren't necessary here.
* core: Make CPUBarrier a unique_ptr instead of a shared_ptrLioncash2018-10-151-3/+3
| | | | | | This will always outlive the Cpu instances, since it's destroyed after we destroy the Cpu instances on shutdown, so there's no need for shared ownership semantics here.
* filesystem: Make CreateFactories() and InstallInterface() take a ↵Lioncash2018-10-131-1/+1
| | | | | | | | | VfsFilesystem instance by reference Neither of these functions alter the ownership of the provided pointer, so we can simply make the parameters a reference rather than a direct shared pointer alias. This way we also disallow passing incorrect memory values like nullptr.
* kernel/thread: Use a regular pointer for the owner/current processLioncash2018-10-101-3/+4
| | | | | | | | | | | There's no real need to use a shared pointer in these cases, and only makes object management more fragile in terms of how easy it would be to introduce cycles. Instead, just do the simple thing of using a regular pointer. Much of this is just a hold-over from citra anyways. It also doesn't make sense from a behavioral point of view for a process' thread to prolong the lifetime of the process itself (the process is supposed to own the thread, not the other way around).
* loader: Make the Load() function take a process as a regular reference, not ↵Lioncash2018-09-291-1/+1
| | | | | | | | | | a SharedPtr A process should never require being reference counted in this situation. If the handle to a process is freed before this function is called, it's definitely a bug with our lifetime management, so we can put the requirement in place for the API that the process must be a valid instance.
* vfs_concat/vfs_layered: Remove friend declarations from ConcatenatedVfsFileLioncash2018-09-251-1/+1
| | | | | | Given these are only added to the class to allow those functions to access the private constructor, it's a better approach to just make them static functions in the interface, to make the dependency explicit.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-7/+7
|
* core: Migrate current_process pointer to the kernelLioncash2018-09-061-4/+7
| | | | | | | | | | 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.
* core/core: Remove unnecessary sm/controller includeLioncash2018-09-061-1/+0
| | | | | | | | | | 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.