Commit graph

314 commits

Author SHA1 Message Date
bunnei
9680991009 Merge pull request #2654 from DarkLordZach/lm-log-rewrite
lm: Rewrite logger to use core reporting services
2019-10-08 20:23:13 -04:00
Lioncash
e4e4af80e8 hle/service: Replace global system instance calls with instance-based ones
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.
2019-10-06 13:42:23 -04:00
Fernando Sahmkow
ded3d555e1 Core: Wait for GPU to be idle before shutting down. 2019-10-04 19:59:53 -04:00
Zach Hilman
d2d7eacee7 core/loader: Track the NSO build ID of the current process 2019-09-30 17:21:53 -04:00
Zach Hilman
13933f0af3 lm: Flush manager output on core shutdown 2019-09-22 12:34:55 -04:00
Zach Hilman
2fa697bb7c core: Add LM::Manager to system
Allows centralized control over logging mechanisms.
2019-09-22 12:34:55 -04:00
David
16104f4eae Merge pull request #2683 from DarkLordZach/lock-exit
am: Implement exit locking and self exit commands
2019-09-23 00:37:12 +10:00
Zach Hilman
dd7a489e5c core: Track system exit lock status
Used to determine if yuzu should confirm before pausing or stopping a game.
2019-09-21 22:23:44 -04:00
Zach Hilman
0c7d9704c8 dmnt_cheat_vm: Make Cheat VM compliant to code style 2019-09-21 21:45:05 -04:00
Zach Hilman
0d2e645cb2 core: Initialize cheats after load to avoid VMManager crash
This used to occur due to the VMManager being nullptr at the time cheats were registered (during load, but before it was done). This is bypassed by not accessing the VMManager for offset data until load is complete,
2019-09-21 21:45:05 -04:00
Zach Hilman
3ad3191d56 core: Update RegisterCheatList for new VM 2019-09-21 21:45:05 -04:00
Zach Hilman
89239c8647 core: Store FileSystemController in core 2019-09-21 16:50:39 -04:00
fearlessTobi
32c6e238fd Add frametime logging for tracking performance over time
Co-Authored-By: jroweboy <jroweboy@gmail.com>
2019-09-10 12:44:19 +02:00
Lioncash
6952478449 service/am: Remove usages of global system accessors
Avoids the use of global accessors, removing the reliance on global
state. This also makes dependencies explicit in the interface, as
opposed to being hidden
2019-09-04 20:38:43 -04:00
bunnei
6b8b59ee75 Merge pull request #2592 from FernandoS27/sync1
Implement GPU Synchronization Mechanisms & Correct NVFlinger
2019-07-26 14:26:44 -04:00
bunnei
c8db8fa033 Merge pull request #2651 from DarkLordZach/apm-boost-mode-1
apm: Initial implementation of performance config and boost mode
2019-07-07 21:40:30 -04:00
bunnei
28c3099b5e Merge pull request #2642 from DarkLordZach/fsp-log-2
fsp-srv: Implement Access Logging Functionality
2019-07-07 21:39:40 -04:00
Fernando Sahmkow
1fb8727a9a Gpu: Implement Hardware Interrupt Manager and manage GPU interrupts 2019-07-05 15:49:14 -04:00
Zach Hilman
f7ed383a84 core: Keep instance of APM Controller 2019-06-28 22:46:31 -04:00
Zach Hilman
512a47c184 fsp-srv: Implement OutputAccessLogToSdCard
Allows games to log data to the SD.
2019-06-28 21:02:34 -04:00
bunnei
e82d461580 Merge pull request #2533 from DarkLordZach/memory-frozen
memory: Add class to manage and enforce memory freezing
2019-06-28 14:03:38 -04:00
Zach Hilman
12105d8909 glue: Correct missing bytes in ApplicationLaunchParameter 2019-06-25 22:25:10 -04:00
Zach Hilman
22bea84c51 core: Keep track of ARPManager and register current application on boot 2019-06-24 19:27:35 -04:00
bunnei
9ee4e61659 Merge pull request #2575 from DarkLordZach/process-id-types
kernel: Differentiate kernel and user processes when picking ID
2019-06-21 15:25:50 -04:00
bunnei
36090e6a67 Merge pull request #2482 from DarkLordZach/prepo
core: Add detailed local reporting feature for development
2019-06-21 14:05:18 -04:00
Zach Hilman
c0126e6779 core: Move Freezer class to tools namespace 2019-06-20 19:22:53 -04:00
Zach Hilman
9ab4d3de50 memory: Add class to manage and enforce memory freezing 2019-06-20 19:22:04 -04:00
Zach Hilman
3f221f8e3f kernel: Differentiate kernel and user processes when picking ID
This allows kernel internal type processes to be assigned IDs in the KIP range while userland processes are assigned in the user range.
2019-06-10 00:28:33 -04:00
Lioncash
9ac89fde57 core/core: Remove unnecessary includes
The contents of these includes aren't used anywhere in this translation
unit.
2019-05-29 00:00:27 -04:00
Lioncash
7dd4fbf551 core/loader: Remove LoadKernelSystemMode
This is a hold-over from Citra and doesn't apply to yuzu.
2019-05-28 22:28:44 -04:00
Lioncash
5fe132ec98 core/telemetry_session: Remove usages of the global system accessor
Makes the dependency explicit in the TelemetrySession's interface
instead of making it a hidden dependency.

This also revealed a hidden issue with the way the telemetry session was
being initialized. It was attempting to retrieve the app loader and log
out title-specific information. However, this isn't always guaranteed to
be possible.

During the initialization phase, everything is being constructed. It
doesn't mean an actual title has been selected. This is what the Load()
function is for. This potentially results in dead code paths involving
the app loader. Instead, we explicitly add this information when we know
the app loader instance is available.
2019-05-28 22:28:15 -04:00
Zach Hilman
227430a157 loader: Move NSO module tracking to AppLoader
Also cleanup of general stuff
2019-05-26 11:40:46 -04:00
Zach Hilman
8d16f91049 core: Add Reporter class to take/save reports 2019-05-25 16:09:20 -04:00
Zach Hilman
c1475193ba core: Track load offsets of NSO modules
Needed for backtrace decomposition
2019-05-25 16:06:53 -04:00
bunnei
39d7115730 Merge pull request #2228 from DarkLordZach/applet-manager-p1
applets: Add AppletManager and implement PhotoViewer and Error applets
2019-04-24 22:53:21 -04:00
Zach Hilman
4399df50e3 core: Remove specific applets in favor of AppletManager 2019-04-17 11:35:24 -04:00
Lioncash
e49ee38660 core/core: Move process execution start to System's Load()
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.
2019-04-11 22:11:41 -04:00
Lioncash
3cfaddba85 core/core: Move main process creation into Load()
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.
2019-04-11 22:11:40 -04:00
Lioncash
e0962940a2 video_core/gpu: Create threads separately from initialization
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.
2019-04-11 22:11:40 -04:00
Lioncash
567b7de124 core/cpu_core_manager: Create threads separately from initialization.
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.
2019-04-11 22:11:40 -04:00
Zach Hilman
73a4412736 core: Store system-wide ContentProvider for the emulator 2019-03-26 22:05:37 -04:00
Lioncash
b59b7084c7 file_sys/cheat_engine: Remove use of global system accessors
Instead, pass in the core timing instance and make the dependency
explicit in the interface.
2019-03-22 14:43:37 -04:00
bunnei
92870ed060 Merge pull request #1933 from DarkLordZach/cheat-engine
file_sys: Implement parser and interpreter for game memory cheats
2019-03-21 21:41:59 -04:00
Lioncash
1f5cd8cac7 kernel: Make the address arbiter instance per-process
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.
2019-03-07 23:27:51 -05:00
bunnei
757fd21d98 Merge pull request #2055 from bunnei/gpu-thread
Asynchronous GPU command processing
2019-03-07 10:41:53 -05:00
bunnei
83079031b3 gpu: Refactor a/synchronous implementations into their own classes. 2019-03-06 21:48:57 -05:00
bunnei
d6be1f1a53 Merge pull request #2190 from lioncash/ogl-global
core: Remove the global telemetry accessor function
2019-03-06 21:41:53 -05:00
bunnei
1e27162275 gpu: Refactor to take RendererBase instead of RasterizerInterface. 2019-03-06 21:09:09 -05:00
bunnei
fca1122cef core: Set is_powered_on before GPU is initialized. 2019-03-06 21:07:33 -05:00
Lioncash
b46942d789 kernel/address_arbiter: Pass in system instance to constructor
Allows getting rid of reliance on the global accessor functions and
instead operating on the provided system instance.
2019-03-05 15:47:03 -05:00