Commit Graph

111 Commits

Author SHA1 Message Date
ad3650abfc Merge pull request #13093 from mitaclaw/ranges-modernization-4-projection
Ranges Algorithms Modernization - Projection
2025-03-23 15:56:13 -04:00
e18d98d4fc Core: properly distinguish between ES title switches (Wii titles) and normal loading (GC, also called for Wii..); update config for ES title change, generate textures for both situations 2025-03-22 14:55:20 -05:00
62b2b939b5 Simplify std::find_if with std::ranges::find and projections
In LabelMap.cpp, the code is currently unused so I was unable to test it.

In WiiUtils.cpp, the magic value `1u` was replaced by the constant value `DiscIO::PARTITION_UPDATE`.
2025-03-09 13:26:35 -07:00
3c11360335 IOS: log cIOS device checks as warnings, not errors
Some games do this to detect piracy.
2024-10-09 21:18:36 +01:00
6ca2da53e8 Partially revert "Revert "Audit uses of IsRunning and GetState""
This reverts the revert commit bc67fc97c3,
except for the changes in BaseConfigLoader.cpp, which caused the bug
that made us revert 72cf2bdb87. PR 12917
contains an improved change to BaseConfigLoader.cpp, which can be merged
(or rejected) independently.

A few changes have also been made based on review comments.
2024-10-04 18:35:41 +02:00
82b97ca904 IOS::HLE::EmulationKernel::InitIPC: Fix WiiIPC ack generation 2024-07-11 19:41:28 +02:00
962230f91e Core: Store current state in less places
Core::GetState reads from four different pieces of state: s_is_stopping,
s_hardware_initialized, s_is_booting, and CPUManager::IsStepping.
I'm keeping that last one as is for now because there's code in Dolphin
that sets it directly, but we can unify the other three to make things
easier to reason about.

This commit also gets rid of s_is_started. This was previously used in
Core::IsRunningAndStarted to ensure true wouldn't be returned until the
CPU thread was started, but it wasn't used in Core::GetState, so
Core::GetState would happily return State::Running after we had
initialized the hardware but before we had initialized the CPU thread.
As far as I know, there are no callers that have any real need to know
whether the boot process is currently initializing the hardware or the
CPU thread. Perhaps once upon a time there was a desire to make the
apploader debuggable, but a long time has passed without anyone stepping
up to implement it, and the way CBoot::RunApploader is implemented makes
it rather difficult. So this commit makes all the functions in Core.cpp
consider the core to still be starting until the CPU thread is started.
2024-06-21 20:46:44 +02:00
0df401b164 Core::IsRunning: Avoid Global System Accessor 2024-05-01 08:54:17 -07:00
932645f245 Apply modernize-use-starts-ends-with 2024-04-19 14:55:29 -04:00
e6ee217a7c Core: Move Emulation IOS instance to System. 2024-02-07 22:07:30 +01:00
17753d5168 Core/IOS/WiiIPC: Refactor to class, move to System. 2024-01-12 06:37:10 +01:00
e212d1c395 Merge pull request #12463 from Dentomologist/netkdrequestdevice_fix_crashes
NetKDRequestDevice: Fix sporadic crashes during emulation shutdown
2023-12-27 21:47:18 +01:00
ecf4f1b1f9 NetKDRequestDevice: Fix nullptr dereference crash
Keep a shared_ptr to NetKDTimeDevice inside NetKDRequestDevice.

This allows the KDDownload task to finish its work without potentially
trying to dereference nullptr, which can potentially come from either
GetIOS() or GetDeviceByName() if EmulationKernel's destructor has
started running.
2023-12-24 16:46:08 -08:00
e9fa335fbe Socket: Fix a nullptr dereference when operations are pending 2023-12-24 09:23:02 +04:00
f1b18d8ae3 Core/IOS/ES: Remove global system accessor in InitializeEmulationState()
We can pass the core timing instance into the function.
2023-12-18 19:06:45 -05:00
e6db08e03a Core/IOS/IOS: Remove global system accessor from Init()
Removes the final global system accessor from the main IOS code by
passing the system instance through it.
2023-12-18 12:28:21 -05:00
1f50a2fd5b Core/IOS/IOS: Remove global system accessor from WriteReturnValue()
We can pass the memory instance into it instead of using the global accessor.
2023-12-18 12:22:01 -05:00
b8c657b06f Core/IOS/IOS: Remove global system accessor from RAMOverrideForIOSMemoryValues()
We can allow passing in the memory instance instead of directly going for the
global system instance.
2023-12-18 12:10:25 -05:00
a13bcd87d4 Core/IOS/IOS: Remove global system accessors from internal functions
These functions can all be modified to take in the required instance,
rather than using the global system accessor.
2023-12-18 12:04:58 -05:00
0c9f9ca8b6 Core/IOS/IOS: Remove global system accessor from destructor
An EmulationKernel already houses a reference to the current system
2023-12-18 11:55:30 -05:00
0d75d658b1 Core/IOS/IOS: Remove system parameters from BootstrapPPC() and BootIOS()
An EmulationKernel instance already houses a reference to the currently active system instance.
2023-12-18 11:54:03 -05:00
5e9763c0fa IOS/MIOS: Eliminate global system accessors
We can pass the system instance through the EmulationKernel instance.
2023-12-14 16:05:59 -05:00
77a1eaa740 IOS: fix crash when closing invalid file descriptor
This regression was introduced in 5.0-20284.
2023-11-21 12:00:34 +00:00
2241aaf168 IOS: implement /dev/aes 2023-11-01 22:08:39 +01:00
d4c18f3f31 IOS: implement /dev/sha 2023-11-01 22:08:39 +01:00
get
07ad75f34f EnumUtils: Add Common::ToUnderlying
Mirrors the C++23 <utility> function, std::to_underlying
2023-06-17 07:15:33 -05:00
28b82ff8d8 IOS/EmulationKernel: Remove m_device_map_mutex, m_device_map is only modified in the constructor and destructor. 2023-05-15 20:54:21 +02:00
b8f3a47fba IOS: Move more emulation-only stuff from Kernel to EmulationKernel. 2023-05-15 20:41:49 +02:00
3d767edd8a IOS/FS: Split FSDevice into FSCore and FSDevice.
FSCore implements the core functionality that can also be used outside of emulation. FSDevice implements the IOS device and is only available during emulation.
2023-05-15 20:41:47 +02:00
6a339cbdb3 IOS/ES: Split ESDevice into ESCore and ESDevice.
ESCore implements the core functionality that can also be used outside of emulation. ESDevice implements the IOS device and is only available during emulation.
2023-05-15 20:41:05 +02:00
15a0860f15 IOS: Leverage Kernel/EmulationKernel difference for passing System to most IOS devices. 2023-04-25 02:22:34 +02:00
4d49902b34 IOS: Only construct DolphinDevice on EmulationKernel IOS instances.
Doesn't make much sense to have this active without a game.
2023-04-23 20:09:32 +02:00
b2ee958058 IOS/WiiSockMan: Move instance to IOS Kernel. 2023-04-18 01:24:10 +02:00
23843583bf PowerPC: Refactor to class, move to System. 2023-04-09 21:48:37 +02:00
7044cff011 Core/Boot: Pass around System. 2023-03-08 22:41:43 +01:00
912cd456fb Core: Add System parameter to CPUThreadGuard. 2023-03-08 22:41:42 +01:00
7cecb28bdf DolphinQt: Properly lock CPU before accessing emulated memory
This fixes a problem I was having where using frame advance with the
debugger open would frequently cause panic alerts about invalid addresses
due to the CPU thread changing MSR.DR while the host thread was trying
to access memory.

To aid in tracking down all the places where we weren't properly locking
the CPU, I've created a new type (in Core.h) that you have to pass as a
reference or pointer to functions that require running as the CPU thread.
2023-02-12 11:27:50 +01:00
f1b1f5c013 IOS: Fix shadowing warnings 2023-02-09 16:23:02 -08:00
ed633476e6 IOS: Avoid ppcState global. 2023-01-27 15:22:47 +01:00
be8d0b76ca PowerPC: Remove PC macro. 2023-01-27 15:22:41 +01:00
839db591d9 HW/Memmap: Refactor Memory to class, move to Core::System. 2022-12-03 13:27:02 +01:00
c9558ecb4c CoreTiming: Refactor to class. 2022-11-27 03:47:12 +01:00
cc5640245c Fix build errors related to formatting non-scoped enums 2022-11-23 13:45:43 -08:00
a36a5c1308 CoreTiming: Pass Core::System to Events. 2022-11-06 17:54:58 +01:00
82d20ce352 Support for loading Ancast images 2022-10-22 13:35:49 +02:00
2fb45660b3 IOS::HLE::Kernel::InitIPC: Replace s_ios check with Core::IsRunning 2022-10-21 20:38:02 +02:00
4ae475b6a1 fix verifying wii dev signatures
allows verifying dev-signed discs and wads
2022-08-16 12:47:26 -07:00
09089eeee0 Common::Timer: use chrono::steady_clock internally 2022-08-02 22:24:06 -07:00
f6b9acccfc Common: Refactor PointerWrap 2022-05-25 13:06:41 -07:00
90c576e075 Use config changed callback to detect SD insertion/ejection
This saves the GUI from having to manually call SDIO_EventNotify.
With that out of the way, we can let users change the
"Insert SD Card" setting on Android while a game is running.
2022-02-20 10:55:55 +01:00