Commit Graph

85 Commits

Author SHA1 Message Date
9dcc7bde8b time: Use compile time division for TimeSpanType conversion 2023-06-07 21:44:42 -04:00
65be230fdd service: move hle_ipc from kernel 2023-03-01 10:39:49 -05:00
a936972614 service: refactor server architecture
Converts services to have their own processes
2023-02-21 12:19:25 -05:00
a7d9be1384 core: Replace all instances of ResultCode with Result 2022-06-26 20:21:37 -05:00
99ceb03a1c general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
7c4b6aab2e core: Remove unused includes 2021-11-03 21:42:57 -04:00
7bb2dd75cd service: Reduce header include overhead 2021-10-07 13:32:21 -04:00
c6d7da88c7 service: Append service name prefix to common filenames 2021-07-14 02:09:14 -04:00
12c1766997 general: Replace RESULT_SUCCESS with ResultSuccess
Transition to PascalCase for result names.
2021-06-02 00:39:27 -04:00
0297448fbc hle: kernel: Migrate KClientPort to KAutoObject. 2021-05-05 16:40:52 -07:00
7444963bbb hle: kernel: Migrate KSession, KClientSession, and KServerSession to KAutoObject. 2021-05-05 16:40:51 -07:00
5e5933256b hle: kernel: Refactor IPC interfaces to not use std::shared_ptr. 2021-05-05 16:40:50 -07:00
8285776603 time: Write buffer before pushing RESULT_SUCCESS in GetClockSnapshot 2021-04-19 12:09:28 -04:00
a223006c50 time: Fix GetClockSnapshotFromSystemClockContext
This removes an incorrect alignment usage and corrects the positions of the popped parameters.

- Fixes Super Kirby Clash crashing on boot
2021-04-19 11:17:47 -04:00
0c19147e09 Merge pull request #6170 from Morph1984/more-time-fixes
service: time: Setup the network clock with the local clock context
2021-04-11 10:50:08 -07:00
2283fccc1b service: time: Setup the network clock with the local clock context
Setting the network time allows some time based events using the network clock to not reset.
2021-04-08 13:26:38 -04:00
28d3661a5c service: time: Fix CalculateStandardUserSystemClockDifferenceByUser
CalculateStandardUserSystemClockDifferenceByUser passes in the ClockSnapshots through 2 input buffers and not as raw arguments. Fix this by reading the 2 input buffers instead of popping raw arguments.
2021-04-07 23:34:14 -04:00
d3a4a192fe Merge pull request #6054 from Morph1984/time-GetClockSnapshot
time: Assign the current time point to the ClockSnapshot
2021-03-13 23:15:54 -08:00
87cfe5b1da time: Fix CalculateSpanBetween implementation
CalculateSpanBetween passes in the ClockSnapshots through 2 input buffers and not as raw arguments. Fix this by reading the 2 input buffers instead of popping raw arguments.

Partially fixes Super Smash Bros. Ultimate's Spirit Board
2021-03-10 11:42:59 -05:00
2490ffbbce time: Assign the current time point to the ClockSnapshot
Fixes the timer in Super Smash Bros Ultimate's Spirit Board.
2021-03-10 11:40:51 -05:00
c0d3aef28c core: hle: kernel: Rename Thread to KThread. 2021-01-28 21:42:25 -08:00
9e29e36a78 hle: kernel: Rewrite scheduler implementation based on Mesopshere. 2020-12-06 00:03:24 -08:00
1a954b2a59 service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
2020-11-26 20:03:11 -05:00
62c6c9f6a6 service: time: Update current time with changes to RTC setting.
- This can be used to advance time, e.g. for Pokemon Sword/Shield pokejobs.
2020-10-12 18:09:15 -07:00
9b75481755 ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer (#4465)
* ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer

With the support of C++20, we can use concepts to deduce if a type is an STL container or not.

* More agressive concept for stl containers

* Add -fconcepts

* Move to common namespace

* Add Common::IsBaseOf
2020-08-03 07:28:54 -04:00
a0ee597b19 Merge pull request #4203 from VolcaEM/services
service: Update function tables
2020-07-11 00:02:36 -04:00
6a0010d0c6 service: Update function tables 2020-06-29 04:01:34 +02:00
e31425df38 General: Recover Prometheus project from harddrive failure
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host 
Timing, Reworks the Kernel's Scheduler, Introduce Idle State and 
Suspended State, Recreates the bootmanager, Initializes Multicore 
system.
2020-06-27 11:35:06 -04:00
bfee33cce3 service/time: Remove reliance on the global system accessor
Eliminates usages of the global system accessor and instead passes the
existing system instance into the interfaces.
2020-04-19 16:31:28 -04:00
eb676c343a service: time: Implement CalculateStandardUserSystemClockDifferenceByUser.
- Used by Animal Crossing: New Horizons.
2020-04-14 22:28:41 -04:00
a60f34a850 services: time: Implement CalculateSpanBetween.
- Used by Super Smash Bros. Ultimate.
2020-03-27 10:42:13 -04:00
1e6f8aba04 Core: Set all hardware emulation constants in a single file. 2020-02-11 20:19:11 -04:00
be5c149d37 service: time: Implement GetStandardLocalSystemClock. 2020-01-04 22:18:54 -05:00
a4e840181c service: time: Implement GetClockSnapshotFromSystemClockContext. 2020-01-04 13:48:30 -05:00
fab2607c6b service: time: Implement IsStandardNetworkSystemClockAccuracySufficient. 2020-01-04 13:48:30 -05:00
78f977c980 service: time: Rewrite implementation of glue services. 2020-01-04 13:48:29 -05:00
50c7539108 Merge pull request #3094 from lioncash/tables
service: Update function tables
2019-11-24 20:30:58 -05:00
e21b6ff79d service: Update function tables
Keeps the function tables up to date.

Updated based off information from Switchbrew.
2019-11-12 10:32:56 -05:00
f11b87ebf1 service: Resolve sign conversion errors
These are fairly trivial to resolve and most of the changes entail
using RESULT_UNKNOWN over ResultCode(-1).
2019-11-12 07:55:39 -05:00
2c6e4ce0ad Deglobalize System: Time 2019-09-22 16:38:02 +10:00
f67039c067 Addressed issues 2019-06-26 16:52:34 +10:00
19dc36ce06 Implement Time::GetSharedMemoryNativeHandle
This PR attempts to implement the shared memory provided by GetSharedMemoryNativeHandle. There is still more work to be done however that requires a rehaul of the current time module to handle clock contexts. This PR is mainly to get the basic functionality of the SharedMemory working and allow the use of addition to it whilst things get improved on.

Things to note:
Memory Barriers are used in the SharedMemory and a better solution would need to be done to implement this. Currently in this PR I’m faking the memory barriers as everything is sync and single threaded. They work by incrementing the counter and just populate the two data slots. On data reading, it will read the last added data.

Specific values in the shared memory would need to be updated periodically. This isn't included in this PR since we don't actively do this yet. In a later PR when time is refactored this should be done.

Finally, as we don't handle clock contexts. When time is refactored, we will need to update the shared memory for specific contexts. This PR does this already however since the contexts are all identical and not separated. We're just updating the same values for each context which in this case is empty.

Tiime:SetStandardUserSystemClockAutomaticCorrectionEnabled, Time:IsStandardUserSystemClockAutomaticCorrectionEnabled are also partially implemented in this PR. The reason the implementation is partial is because once again, a lack of clock contexts. This will be improved on in a future PR.

This PR closes issue #2556
2019-06-26 00:45:53 +10:00
2548661c08 core/core_timing_util: Amend casing of cyclesTo* functions
Makes the casing consistent with all of our general function naming
conventions.
2019-06-04 20:31:46 -04:00
42f5fd0ab3 core/core_timing_util: Use std::chrono types for specifying time units
Makes the interface more type-safe and consistent in terms of return
values.
2019-06-04 20:31:24 -04:00
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.
2019-02-15 21:50:25 -05:00
48d9d66dc5 core_timing: Rename CoreTiming namespace to Core::Timing
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.
2019-02-12 12:42:17 -05:00
05dbb47af5 settings: Use std::chrono::seconds instead of s64 for RTC 2019-01-07 19:19:40 -05:00
dbb1eb9c29 time: Use custom RTC settings if applicable for game 2019-01-07 19:19:40 -05:00
fa97f50bff service/time: Minor cleanup to GetClockSnapshot()
Moves some variables closer to their actual usage sites.
2018-12-29 21:42:13 -05:00
af51f123fa service/time: Fill in some structures and remove padding where not necessary 2018-12-29 18:26:32 -05:00