- Apr 12, 2019
-
-
Lioncash authored
Initially required due to the split codepath with how the initial main process instance was initialized. We used to initialize the process like: Init() { main_process = Process::Create(...); kernel.MakeCurrentProcess(main_process.get()); } Load() { const auto load_result = loader.Load(*kernel.GetCurrentProcess()); if (load_result != Loader::ResultStatus::Success) { // Handle error here. } ... } which presented a problem. Setting a created process as the main process would set the page table for that process as the main page table. This is fine... until we get to the part that the page table can have its size changed in the Load() function via NPDM metadata, which can dictate either a 32-bit, 36-bit, or 39-bit usable address space. Now that we have full control over the process' creation in load, we can simply set the initial process as the main process after all the loading is done, reflecting the potential page table changes without any special-casing behavior. We can also remove the cache flushing within LoadModule(), as execution wouldn't have even begun yet during all usages of this function, now that we have the initialization order cleaned up.
-
Lioncash authored
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.
-
Lioncash authored
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.
-
Lioncash authored
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.
-
- Apr 11, 2019
-
-
Lioncash authored
Some objects declare their handle type as const, while others declare it as constexpr. This makes the const ones constexpr for consistency, and prevent unexpected compilation errors if these happen to be attempted to be used within a constexpr context.
-
Fernando Sahmkow authored
-
- Apr 10, 2019
-
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
-
ReinUsesLisp authored
sirit is a runtime assembler for SPIR-V
-
Lioncash authored
These are holdovers from Citra.
-
Fernando Sahmkow authored
-
- Apr 09, 2019
-
-
Fernando Sahmkow authored
-
Lioncash authored
We need to ensure dynarmic gets a valid pointer if the page table is resized (the relevant pointers would be invalidated in this scenario). In this scenario, the page table can be resized depending on what kind of address space is specified within the NPDM metadata (if it's present).
-
Lioncash authored
In our error console, when loading a game, the strings: QString::arg: Argument missing: "Loading...", 0 QString::arg: Argument missing: "Launching...", 0 would occasionally pop up when the loading screen was running. This was due to the strings being assumed to have formatting indicators in them, however only two out of the four strings actually have them. This only applies the arguments to the strings that have formatting specifiers provided, which avoids these warnings from occurring.
-
- Apr 08, 2019
-
-
Fernando Sahmkow authored
This commit makes sure GL reads on the correct pack size for the respective texture buffer.
-
Fernando Sahmkow authored
-
Fernando Sahmkow authored
-
Lioncash authored
Adjusts the interface of the wrappers to take a system reference, which allows accessing a system instance without using the global accessors. This also allows getting rid of all global accessors within the supervisor call handling code. While this does make the wrappers themselves slightly more noisy, this will be further cleaned up in a follow-up. This eliminates the global system accessors in the current code while preserving the existing interface.
-
- Apr 07, 2019
-
-
Fernando Sahmkow authored
-
Lioncash authored
These are holdovers from Citra and can be removed.
-
Lioncash authored
Now that nothing actually touches the internal page table aside from the memory subsystem itself, we can remove the accessor to it.
-
Lioncash authored
Given the page table will always be guaranteed to be that of whatever the current process is, we no longer need to keep this around.
-
Lioncash authored
Centralizes the page table switching to one spot, rather than making calling code deal with it everywhere.
-
- Apr 06, 2019
-
-
Lioncash authored
Keeps the return type consistent with the function name. While we're at it, we can also reduce the amount of boilerplate involved with handling these by using structured bindings.
-
Lioncash authored
Returns the same type that the function name describes.
-
ReinUsesLisp authored
-
Lioncash authored
Avoids dragging in a direct dependency in a header.
-
Lioncash authored
Nothing in this header relies on common_funcs or the memory manager. This gets rid of reliance on indirect inclusions in the OpenGL caches.
-
Lioncash authored
This doesn't actually work anymore, and given how long it's been left in that state, it's unlikely anyone actually seriously used it. Generally it's preferable to use RenderDoc or Nsight to view surfaces.
-
bunnei authored
- Fixes graphical issues with Chocobo's Mystery Dungeon EVERY BUDDY! - Fixes a crash with Mario Tennis Aces
-
Lioncash authored
We can just use .at(), which essentially does the same thing, but with less code.
-
Lioncash authored
Given we already ensure nothing can set the zeroth register in SetRegister(), we don't need to check if the index is zero and special case it. We can just access the register normally, since it's already going to be zero. We can also replace the assertion with .at() to perform the equivalent behavior inline as part of the API.
-