Commit Graph

159 Commits (d14e74132ceaa8b5efef8a7d543cb50429cb4fb3)

Author SHA1 Message Date
David aaec1562f8
Merge pull request #2683 from DarkLordZach/lock-exit
am: Implement exit locking and self exit commands
6 years ago
Zach Hilman bbc1437188 core: Track system exit lock status
Used to determine if yuzu should confirm before pausing or stopping a game.
6 years ago
Zach Hilman 37850eeee5 core: Update RegisterCheatList for new VM 6 years ago
Zach Hilman c182688ad6 core: Store FileSystemController in core 6 years ago
bunnei 52f54c728d
Merge pull request #2592 from FernandoS27/sync1
Implement GPU Synchronization Mechanisms & Correct NVFlinger
6 years ago
Lioncash 093e5440e2 core: Remove CurrentArmInterface() global accessor
Replaces the final usage of the global accessor function and removes it.
Removes one more enabler of global state.
6 years ago
Fernando Sahmkow 8942047d41 Gpu: Implement Hardware Interrupt Manager and manage GPU interrupts 6 years ago
Zach Hilman e2ad3e1fb0 core: Keep instance of APM Controller 6 years ago
Zach Hilman d40a38df8d core: Keep track of ARPManager and register current application on boot 6 years ago
bunnei 96412848a9
Merge pull request #2482 from DarkLordZach/prepo
core: Add detailed local reporting feature for development
6 years ago
Lioncash 84a8fb9264 core/loader: Remove LoadKernelSystemMode
This is a hold-over from Citra and doesn't apply to yuzu.
6 years ago
Zach Hilman b77fde7c5c loader: Move NSO module tracking to AppLoader
Also cleanup of general stuff
6 years ago
Zach Hilman 2dde8f5cfe core: Add Reporter class to take/save reports 6 years ago
Zach Hilman 2179ad7483 core: Track load offsets of NSO modules
Needed for backtrace decomposition
6 years ago
Zach Hilman ec0bc3061e core: Remove specific applets in favor of AppletManager 6 years ago
Zach Hilman 45cb41f517 core: Store system-wide ContentProvider for the emulator 6 years ago
bunnei 639f0c524d
Merge pull request #1933 from DarkLordZach/cheat-engine
file_sys: Implement parser and interpreter for game memory cheats
6 years ago
Zach Hilman 52ac6419da vm_manager: Remove cheat-specific ranges from VMManager 6 years ago
Zach Hilman 7053546687 core: Add support for registering and controlling ownership of CheatEngine 6 years ago
Lioncash b114928459 core/core: Remove the global telemetry accessor function
With all usages converted off of it, this function can be removed.
6 years ago
Lioncash bd983414f6 core_timing: Convert core timing into a class
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.
6 years ago
Lioncash a661025637 core/frontend/applets/web_browser: Make OpenPage() non-const
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.
6 years ago
Zach Hilman 32bfa92c71 core: Add getter and setter for WebBrowserApplet frontend 7 years ago
bunnei f95f6c7d86
Merge pull request #1781 from DarkLordZach/applet-profile-select
am: Implement HLE profile selector applet
7 years ago
Zach Hilman 58fd0a1c50 core: Add getter/setter for ProfileSelector in System 7 years ago
Zach Hilman c7b41ade74 core: Make GetGameFileFromPath function externally accessible 7 years ago
Zach Hilman e696ed1f4d am: Deglobalize software keyboard applet 7 years ago
Lioncash b77f571d20 core: Add missing const variants of getters for the System class
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.
7 years ago
Lioncash 5484742fda core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs 7 years ago
Lioncash 5c0408596f kernel/thread: Use a regular pointer for the owner/current process
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).
7 years ago
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 7 years ago
Lioncash 3f17fe7133 core: Migrate current_process pointer to the kernel
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.
7 years ago
Markus Wick dce624e3f1 core: Use a raw pointer in GetGPUDebugContext.
This helper is called very often. The memory ownership shall not be transfered, so just return the raw pointer.
7 years ago
Lioncash 4a587b81b2 core/core: Replace includes with forward declarations where applicable
The follow-up to e2457418da, 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.
7 years ago
Lioncash e2457418da core: Make the main System class use the PImpl idiom
core.h is kind of a massive header in terms what it includes within
itself. It includes VFS utilities, kernel headers, file_sys header,
ARM-related headers, etc. This means that changing anything in the
headers included by core.h essentially requires you to rebuild almost
all of core.

Instead, we can modify the System class to use the PImpl idiom, which
allows us to move all of those headers to the cpp file and forward
declare the bulk of the types that would otherwise be included, reducing
compile times. This change specifically only performs the PImpl portion.
7 years ago
Lioncash 0cbcd6ec9a kernel: Eliminate kernel global state
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.
7 years ago
bunnei 62edc01525
Merge pull request #1175 from lioncash/ns
core: Namespace all code in the arm subdirectory under the Core namespace
7 years ago
bunnei f96ded9815
Merge pull request #1174 from lioncash/debug
debug_utils: Minor individual interface changes
7 years ago
Lioncash 43e0d865fa core: Namespace all code in the arm subdirectory under the Core namespace
Gets all of these types and interfaces out of the global namespace.
7 years ago
Lioncash c65713832c debug_utils: Remove unused includes
Quite a bit of these aren't necessary directly within the debug_utils
header and can be removed or included where actually necessary.
7 years ago
Zach Hilman 67fa51ea2f qt: Add filename and title id to window title while running 7 years ago
Lioncash a0ce6de913 core: Delete System copy/move constructors and assignment operators
Prevents potentially making copies or doing silly things by accident
with the System instance, particularly given our current core is
designed (unfortunately) around one instantiable instance.

This will prevent the accidental case of:

auto instance = System::Instance();

being compiled without warning when it's supposed to be:

auto& instance = System::Instance();
7 years ago
Lioncash 0a93b45b6a core: Namespace EmuWindow
Gets the class out of the global namespace.
7 years ago
Zach Hilman ec3bef7b4c loader: Add more descriptive errors
Full list of new errors and descriptions in core/loader/loader.h
7 years ago
Zach Hilman 4b471f0554 core: Port core to VfsFilesystem for file access 7 years ago
Hedges e2b74f6354 GDBStub works with both Unicorn and Dynarmic now (#941)
* GDBStub works with both Unicorn and Dynarmic now

* Tidy up
7 years ago
bunnei c0af42d6eb
Merge pull request #912 from lioncash/global-var
video_core: Eliminate the g_renderer global variable
7 years ago
bunnei 2b06301dbf
Merge pull request #849 from DarkLordZach/xci
XCI and Encrypted NCA Support
7 years ago
Lioncash 6030c5ce41 video_core: Eliminate the g_renderer global variable
We move the initialization of the renderer to the core class, while
keeping the creation of it and any other specifics in video_core. This
way we can ensure that the renderer is initialized and doesn't give
unfettered access to the renderer. This also makes dependencies on types
more explicit.

For example, the GPU class doesn't need to depend on the
existence of a renderer, it only needs to care about whether or not it
has a rasterizer, but since it was accessing the global variable, it was
also making the renderer a part of its dependency chain. By adjusting
the interface, we can get rid of this dependency.
7 years ago
Lioncash 26de4bb521 core/memory: Get rid of 3DS leftovers
Removes leftover code from citra that isn't needed.
7 years ago
bunnei 00ba704a7f
Merge pull request #892 from lioncash/global
video_core: Make global EmuWindow instance part of the base renderer …
7 years ago
Lioncash bf45092c61 kernel: Move object class to its own source files
General moving to keep kernel object types separate from the direct
kernel code. Also essentially a preliminary cleanup before eliminating
global kernel state in the kernel code.
7 years ago
Lioncash 0f2ac928f2 video_core: Make global EmuWindow instance part of the base renderer class
Makes the global a member of the RendererBase class. We also change this
to be a reference. Passing any form of null pointer to these functions
is incorrect entirely, especially given the code itself assumes that the
pointer would always be in a valid state.

This also makes it easier to follow the lifecycle of instances being
used, as we explicitly interact the renderer with the rasterizer, rather
than it just operating on a global pointer.
7 years ago
Zach Hilman 187d8e215f Use more descriptive error codes and messages 7 years ago
bunnei eaf66b4c9f audio_core: Move to audout_u impl.
- This is necessary so streams are created on the same thread.
7 years ago
bunnei 2a742229ee core: Add AudioCore to global state. 7 years ago
MerryMage 0b1c2e5505 Implement exclusive monitor 7 years ago
Lioncash 10d2ab8098 core: Make System's default constructor private
This makes it a compilation error to construct additional instances of
the System class directly, preventing accidental wasteful constructions
over and over.
7 years ago
bunnei 811dae12f9 core: Add several missing docstrings. 7 years ago
bunnei edc52250b8 core: Run all CPU cores separately, even in single-thread mode. 7 years ago
bunnei 8aa5d25f82 threading: Reschedule only on cores that are necessary. 7 years ago
bunnei 9bf2a428f9 core: Add a configuration setting for use_multi_core. 7 years ago
bunnei cba69fdcd4 core: Support session close with multicore. 7 years ago
bunnei a434fdcb10 core: Implement multicore support. 7 years ago
bunnei 9776ff9179 core: Create a thread for each CPU core, keep in lock-step with a barrier. 7 years ago
bunnei 5590245930 core: Move common CPU core things to its own class. 7 years ago
Lioncash 659a612368 core: Relocate g_service_manager to the System class
Converts the service manager from a global into an instance-based
variable.
7 years ago
N00byKing 358050cfc6 core, main.h: Abort on 32Bit ROMs (#309)
* core, main.h: Abort on 32Bit ROMs

* main.cpp: Fix Grammar
7 years ago
Subv 0ce52b1da2 GPU: Make the debug_context variable a member of the frontend instead of a global. 7 years ago
bunnei 23a0d2d7b7
Merge pull request #193 from N00byKing/3184_2_robotic_boogaloo
Implement Pull #3184 from citra: core/arm: Improve timing accuracy before service calls in JIT (Rebased)
7 years ago
bunnei 7d6653268f core: Move process creation out of global state. 7 years ago
N00byKing bc88cae0c7 Implements citra-emu/citra#3184 7 years ago
bunnei ac81c02ed9 kernel: Use Scheduler class for threading. 7 years ago
bunnei 2d4a6883bc core: Use shared_ptr for cpu_core. 7 years ago
Subv 6cddf9d88e Make a GPU class in VideoCore to contain the GPU state.
Also moved the GPU MemoryManager class to video_core since it makes more sense for it to be there.
7 years ago
N00byKing afa1ed6ad9
Correct Spelling 7 years ago
bunnei 24f10a20e7 core: Increase tight_loop 100x for speed. 8 years ago
bunnei 9b8e5bea66 core: Expose AppLoader as a public interface. 8 years ago
TheKoopaKingdom f008b22e3b Addressed Bunnei's review comments, and made some other tweaks:
- Deleted GetStatus() because it wasn't used anywhere outside of Core::System.
 - Fixed design flaw where the message bar status could be set despite the game being stopped.
8 years ago
TheKoopaKingdom a8aef599e0 Created a whitelist of system archives to prevent false positives creating dialogs. 8 years ago
TheKoopaKingdom 0409bdfea5 Optimized messages that were repetitive and added ability for core errors to specify more details optionally. 8 years ago
TheKoopaKingdom 37bec598ea Made some changes from review comments:
- Made LoadKernelSystemMode return a pair consisting of a system mode and a result code (Could use review).
- Deleted ErrorOpenGL error code in favor of just having ErrorVideoCore.
- Made dialog messages more clear.
- Compared archive ID in fs_user.cpp to ArchiveIdCode::NCCH as opposed to hex magic.
- Cleaned up some other stuff.
8 years ago
TheKoopaKingdom 1ecb322daa Added system for handling core errors in citra-qt. 8 years ago
bunnei f3e14cae1e core: Keep track of telemetry for the current emulation session. 8 years ago
Yuri Kunde Schlesner fb1979d7e2 Core: Re-write frame limiter
Now based on std::chrono, and also works in terms of emulated time
instead of frames, so we can in the future frame-limit even when the
display is disabled, etc.

The frame limiter can also be enabled along with v-sync now, which
should be useful for those with displays running at more than 60 Hz.
8 years ago
Yuri Kunde Schlesner b285c2a4ed Core: Make PerfStats internally locked
More ergonomic to use and will be required for upcoming changes.
8 years ago
Yuri Kunde Schlesner c75ae6c585 Add performance statistics to status bar 8 years ago
Kloen b3a0b1489b core: inline CPU, 132 warnings fixed on GCC 8 years ago
bunnei 8b1e269e58 ThreadContext: Move from "core" to "arm_interface". 9 years ago
bunnei e26fbfd1d7 core: Replace "AppCore" nomenclature with just "CPU". 9 years ago
bunnei 5ac5cbeab7 Address clang-format issues. 9 years ago
bunnei 4fc8b8229e core: Remove HLE module, consolidate code & various cleanups. 9 years ago
bunnei 232ef55c1a core: Consolidate core and system state, remove system module & cleanups. 9 years ago
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 9 years ago
LittleWhite 4be68dddfb Improve error report from Init() functions
Add error popup when citra initialization failed
9 years ago
Lioncash cee8df6ff0 core: Use unique_ptr for holding the interpreter instances 10 years ago
Subv 1d02eb0587 Core/ARM11: Correct the size of the VFP register array in the ThreadContext structure.
The VFP registers are 64 bits each, and there are 32 of them.
10 years ago
Lioncash 8b2b620a5e dyncom: Remove more unused/unnecessary code
Gets rid of a sizeable amount of stuff in armdefs.
10 years ago
Lioncash 3f00dd9117 arm: Clean up ARMul_State
Remove unnecessary/unused struct variables.
10 years ago
Lioncash f44781fd7b arm: Adios armemu 10 years ago