Commit Graph

259 Commits

Author SHA1 Message Date
0df401b164 Core::IsRunning: Avoid Global System Accessor 2024-05-01 08:54:17 -07:00
9c705f1011 Movie: simplify silly loop 2024-04-06 18:28:43 +01:00
6e6b298030 Core::RunOnCPUThread: Avoid Global System Accessor 2024-03-28 10:10:03 -07:00
3948ac9513 Merge pull request #12606 from mitaclaw/state-global-system
State: Avoid Global System Accessor
2024-03-22 04:27:12 +01:00
f09b71582e Core: Avoid (Some) Global System Accessor 2024-03-18 01:35:42 -07:00
fe61efcd7a DVDInterface: Modernize With CPUThreadGuard 2024-03-08 15:17:41 -08:00
0d4cb5ddc7 State: Avoid Global System Accessor 2024-03-01 10:52:50 -08:00
5ade2e39ef Core/Movie: Remove lingering global system instance accessors
The movie manager is already passed in a reference to the relevant
system, so we can use that instead.
2024-01-31 13:30:24 -05:00
9a3e770c23 Migrate SConfig::bWii to System. 2024-01-31 12:54:07 +01:00
1b3f61041a Movie: Remove global system accessor from GetRTCDisplay()
We can just use m_system instance reference instead.
2024-01-23 15:15:13 -05:00
763562357b Movie: Mark getters as const
These don't modify internal member state.
2024-01-23 15:15:13 -05:00
c0b0023b64 Movie: Use re-entrant variant of gmtime in GetRTCDisplay()
Makes this member function thread-safe.
2024-01-23 15:15:10 -05:00
95cba6be2b Core/Movie: Refactor to class, move to System.
A bit of global state remains (the `header` in `BeginRecordingInput()`) due to unclear lifetime requirements.
2024-01-15 08:05:30 +01:00
Mai
6e6695c24b Merge pull request #11904 from LillyJadeKatrin/retroachievements-hardcore-v2
RetroAchievements - Hardcore Mode (V2)
2023-12-05 01:31:54 -05:00
1c62ebc9fb Use ExtensionNumber in Movie.cpp 2023-12-03 11:36:54 -08:00
6f7e02e201 Disable TAS recording playback in hardcore mode
Play Input Recording would potentially unlock achievements without any player input and needs to be disabled. If a recording is already playing, hardcore mode cannot be enabled.
2023-12-02 16:41:17 -05:00
1dff22d576 Movie: Fix crash when starting input recording on OpenGL single-core
Use RunOnCPUThread instead of RunAsCPUThread in BeginRecordingInput.

Most OpenGL functions require an OpenGL context to have been created on
that thread before calling the function; when that isn't the case they
return invalid results which can cause crashes when passed into other
functions.

Dolphin creates the OpenGL context in the EmuThread which then becomes
either the CPU-GPU thread or the Video thread for single and dual core
respectively. OpenGL functions must therefore be called from that
thread.

Movie::BeginRecordingInput is called from the Host thread and runs a
block of code which ultimately creates a savestate, which in turn embeds
the framebuffer which requires calling various OpenGL functions.

In single core the use of RunAsCPUThread leads to this all happening on
the Host thread, eventually leading to invalid OpenGL calls and a crash.

In Dual core the crash is avoided because VideoBackendBase::DoState uses
the AsyncRequests::DO_SAVE_STATE event which causes VideoCommon_DoState
and its subsequent OpenGL calls to safely run on the Video thread.

This commit uses RunOnCPUThread instead of RunAsCPUThread, which causes
the subsequent code to run on the CPU-GPU thread in single core which
has the valid OpenGL context and so doesn't crash.
2023-11-08 19:14:54 -08:00
7ff7c9e84f Common: Convert FromWhichRoot to enum class 2023-06-13 13:25:22 -07:00
bf2f901a99 HW/SerialInterface: Refactor to class. 2023-03-12 16:08:56 +01:00
eb25c46a91 HW/DVDInterface: Refactor to class. 2023-03-10 18:12:59 +01:00
a1c2651fee HW/EXI: Pass System to IEXIDevice. 2023-03-08 22:51:17 +01:00
3b364c5c16 HW/CPU: Refactor to class, move to System. 2023-03-08 12:23:37 +01:00
e52aa52a66 Common/FileUtil: Rename Copy() to CopyRegularFile().
This is to clarify that it can only copy files, not folders.
2023-02-22 11:43:58 +01:00
e48424065b Merge pull request #10839 from CasualPokePlayer/fix_sysconf_settings
Fix SYSCONF movie settings
2023-01-30 09:50:21 +01:00
74e1577a2c HW/ProcessorInterface: Refactor to class, move to Core::System. 2023-01-04 03:00:10 +01:00
c9558ecb4c CoreTiming: Refactor to class. 2022-11-27 03:47:12 +01:00
b296248b49 DolphinQt: Use input override system for TAS input windows
This lets the TAS input code use a higher-level interface for
overriding inputs instead of having to fiddle with raw bits.
WiiTASInputWindow in particular was messy with how much
controller code it had to re-implement.
2022-10-03 22:04:09 +02:00
581fd2b1e3 Fix SYSCONF movie settings
The movie config layer is not active for recording, only playback. Thus, recording ends up stuck with default SYSCONF settings.
The fix is simply to add in the movie config layer when recording. The way it's done is a bit hacky, but seems to work.
2022-07-16 23:16:35 -07:00
deb9964333 Core: Unify handling of raw memory card path. 2022-06-05 21:43:48 +02:00
61a144ba06 Show a panic alert if movie is missing its starting savestate 2022-05-09 13:32:38 -07:00
0c78167404 Merge pull request #10443 from JosJuice/port-wiimote-source
Port Wiimote source settings to the new config system
2022-02-18 21:38:02 +01:00
aff45c91fc Port Wiimote source settings to the new config system
This lets us finally get rid of BootManager's ConfigCache!
2022-02-18 21:27:10 +01:00
8b0c6af75a Merge pull request #10459 from Dentomologist/convert_movie_playmode_to_enum_class
Movie: Convert PlayMode to enum class and move to cpp file
2022-02-18 10:00:33 -05:00
f56251168e Movie: Convert PlayMode to enum class and move to cpp file 2022-02-16 16:04:36 -08:00
a81b44f697 Fix menu bar becoming desynced when Pause at End of Movie is disabled
Previously, when Pause at End of Movie was disabled, the game would continue running as it should, but the menu bar would think the game was paused, showing the play button instead of the pause button.  To make things worse, clicking the play button would then restart the game, instead of pausing or doing nothing.  F10 paused/unpaused as normal, though.

The old behavior was essentially to enable stepping/pause mode (via `CPU::Break()`) and then if Pause at End of Movie was disabled, to un-pause on the host thread (via `CPU::EnableStepping(false)`).  For reasons which aren't entirely clear to me, the first one notified the menu bar (through the `Host::UpdateDisasmDialog` callback, not the `Settings::EmulationStateChanged` one), and the second did not.  In any case, this approach does not particularly make sense; I don't see any reason to pause and unpause if Pause at End of Movie is disabled; instead, we should only pause when Pause at End of Movie is enabled.

This behavior was probably introduced in c1944f623b, though I haven't tested it.
2022-02-16 11:07:12 -08:00
36cfcb530f IOFile: Make origin parameter to Seek() an enum class. 2022-01-29 06:49:21 +01:00
777bb4d82c Use Slot in EXI devices 2022-01-16 14:21:28 -08:00
d354163fbe Replace TEXIDevices with an enum class 2022-01-14 20:24:53 -08:00
83c5446d85 Fix static initialisation order fiasco issue for Version variables
Fixes a crash that could occur if the static constructor function for
the MainSettings.cpp TU happened to run before the variables in
Common/Version.cpp are initialised. (This is known as the static
initialisation order fiasco.)

By using wrapper functions, those variables are now guaranteed to be
constructed on first use.
2022-01-14 00:04:22 +01:00
5c325eef38 Config: Port SI device settings to new config system. 2022-01-08 20:08:21 +01:00
a0a0bfc5ca Config: Port EXI device settings to new config system. 2022-01-08 19:57:58 +01:00
e08171fa24 Config: Port remaining Core settings to new config system (partial). 2022-01-05 00:54:15 +01:00
aa437d9805 Config: Port Movie settings to new config system. 2021-12-30 20:16:17 +01:00
e4fed7cce8 Add Rerecord Count display
Simply shows Movie::s_rerecords in the ImGui Movie window
2021-11-30 20:08:29 -05:00
9de7ef6d8d Fix improper naming
I'm so sorry
2021-11-24 17:04:30 +01:00
dd936c5072 Merge pull request #10126 from malleoz/l-r-digital-input-display
Include digital L and R buttons in Input Display
2021-10-13 02:06:20 +02:00
faa5cf40ce Movie: display correct input difference on movie mismatch
Previously, s_temp_input was being used for BOTH the savestate's and the movie's input printout in the panic alert.

This commit simply performs memcpy from the correct vector for the movInput printout.
2021-09-29 20:58:19 -04:00
6fd54276ea Include digital L and R buttons in Input Display
Previously, using TAS Input to activate the digital L and R buttons would not show these inputs in the Input Display. This commit adds the digital L and R presses to the Input Display, and also displays just "L" or "R" if the analog is set to 255.
2021-09-25 18:07:42 -04:00
b8f0e97c02 Movie: GBA Support 2021-07-13 16:44:04 +02:00
e149ad4f0a treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00