Commit Graph

72 Commits

Author SHA1 Message Date
JMC47 88cf25e915
Merge pull request #13114 from TryTwo/PR_Turbo_Mutes_Audio
Audio: Add option to temporarily mute audio when using turbo
2024-10-19 13:11:05 -04:00
TryTwo a56a27a219 Audio: Add option to AudioPane to temporarily mute audio when emulation speed limit is disabled. 2024-10-15 03:05:19 -07:00
JosJuice 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
Dentomologist c3d6d2189a Texture Dumping: Show OSD message on startup and when toggled
If texture dumping is enabled, notify the user on emulation startup
using an On Screen Display message.

Also notify the user when texture dumping is toggled.

Addresses https://bugs.dolphin-emu.org/issues/12445.
2024-09-06 13:00:25 -07:00
Dentomologist 16bf5a86d3 HotkeyScheduler: Handle Wii Remote connections independently
Allow connecting or disconnecting multiple Wii Remotes simultaneously
instead of only handling the highest index whose hotkey is pressed. This
allows using a single hotkey to toggle multiple remotes.
2024-08-26 21:30:30 -07:00
LillyJadeKatrin 2372b6a386 Add Open Achievements Hotkey
Adds a hotkey to pause emulation and bring up the Achievements dialog.
2024-07-06 07:36:31 -04:00
Admiral H. Curtiss 1fb4dbcea4
Merge pull request #12784 from TryTwo/PR_Frame_Advance_Fix
Frame Advance:  Fix UI update spam when continuously advancing.
2024-07-04 20:07:03 +02:00
TryTwo f29fe15d77 FrameAdvance: Fix continuous frame advancing while the debug UI is open. Blocks signals from being spammed to update the UI. 2024-06-26 16:19:03 -07:00
JosJuice bc67fc97c3 Revert "Audit uses of IsRunning and GetState"
This reverts commit 72cf2bdb87.

SYSCONF settings are getting cleared when they shouldn't be. Let's
revert the change until I get proper time to figure out why it's broken.
2024-06-26 20:36:46 +02:00
Admiral H. Curtiss 9b33b777cf
Merge pull request #12828 from JosJuice/unify-state-variables-2
Clean up Core::GetState
2024-06-22 20:20:54 +02:00
JosJuice 72cf2bdb87 Audit uses of IsRunning and GetState
Some pieces of code are calling IsRunning because there's some
particular action that only makes sense when emulation is running, for
instance showing the state of the emulated CPU. IsRunning is appropriate
to use for this. Then there are pieces of code that are calling
IsRunning because there's some particular thing they must avoid doing
e.g. when the CPU thread is running or IOS is running. IsRunning isn't
quite appropriate for this. Such code should also be checking for the
states Starting and Stopping. Keep in mind that:

* When the state is Starting, the state can asynchronously change to
  Running at any time.
* When we try to stop the core, the state gets set to Stopping before we
  take any action to actually stop things.

This commit adds a new method Core::IsUninitialized, and changes all
callers of IsRunning and GetState that look to me like they should be
changed.
2024-06-21 20:52:55 +02:00
JosJuice 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
LillyJadeKatrin fe517ad2c6 Remove Extra Speed Limit Message
Prior to this change, attempting to decrease the speed limit below 100% in hardmode would display the new attempted speed and then warn that the speed can not be decreased below 100%; this disables that first message under those conditions.
2024-06-12 06:39:46 -04:00
JosJuice 22aa88109f Use a stub AchivementManager when USE_RETRO_ACHIEVEMENTS isn't defined
This lets us reduce the number of USE_RETRO_ACHIEVEMENTS ifdefs in the
code base, reducing visual clutter. In particular, needing an ifdef for
each call to IsHardcodeModeActive was annoying to me. This also reduces
the risk that someone writes code that accidentally fails to compile
with USE_RETRO_ACHIEVEMENTS disabled.

We could cut down on ifdefs even further by making HardcodeWarningWidget
always exist, but that would result in non-trivial code ending up in the
binary even with USE_RETRO_ACHIEVEMENTS disabled, so I'm leaving it out
of this PR. It's not a lot of code though, so I might end up revisiting
it at some point.
2024-06-06 08:26:20 +02:00
iwubcode 4f1a5e0b3a DolphinQt: trigger frame advance from hotkeys on the host thread (the underlying SetState is only valid on the host thread) 2024-05-18 11:54:12 -05:00
mitaclaw eb92d6f0a8 Core::GetState: Avoid Global System Accessor 2024-04-08 16:23:23 -07:00
Filoppi 41b19e262f Add custom relative and raw (squared pixels) aspect ratio modes 2024-02-29 21:11:19 +02:00
Admiral H. Curtiss 9a3e770c23
Migrate SConfig::bWii to System. 2024-01-31 12:54:07 +01:00
Filoppi b3aa6ad93b Video: implement custom aspect ratio support (already exposed to Qt).
This also renamed some variables/functions.
2023-12-18 02:00:24 +02:00
Lioncash e55f9ed102 AchievementManager: Make GetInstance() return a reference
The internal static member will always have a valid lifetime. Makes this
consistent with other instance based objects in our code.
2023-12-11 13:36:39 -05:00
LillyJadeKatrin 0abfa94bc8 Disable Freelook in hardcore mode
The player getting a better view of their surroundings than the game would normally allow could possibly give the player an advantage over the original hardware, so Freelook is disabled in hardcore mode. To do this, I disable the config flag for Freelook when it is accessed, to make sure that it is disabled whether it was enabled before or after hardcore mode was enabled.
2023-12-02 16:41:16 -05:00
LillyJadeKatrin cb2fa9a1f2 Disable Debug Mode in hardcore mode
Debug Mode gives players direct read and write access to memory, which could be used to completely manipulate RetroAchievements logic and therefore is not allowed in hardcore mode.
2023-12-02 16:41:16 -05:00
sowens99 eac318a1d8 DolphinQt: Fix decrease emulation speed hotkey rollover 2023-09-27 21:40:16 -04:00
JosJuice 58f247290f Use latest resolution value for resolution hotkey OSD
Because CPU thread config changed callbacks are no longer instant,
g_Config.iEFBScale doesn't yet contain the new value when the hotkey OSD
code tries to read it.

Should fix https://bugs.dolphin-emu.org/issues/13343.
2023-08-27 15:38:00 +02:00
jnaidu360 5eb1669573 Add Hotkeys for Skylanders Portal and Infinity Base Menus
Adds two new hotkeys to open the menus for emulated USB devices- Skylanders Portal of Power and the Infinity Base. (Hotkeys only active when game is running).

Portal menu: Default is <Ctrl+P>.
Infinity base: Default is <Ctrl+I>
2023-05-26 13:36:08 -07:00
Scott Mansell 4422af1272 Cleanup headers 2023-02-09 18:36:20 +13:00
Admiral H. Curtiss 1c63349984
AudioCommon: Pass Core::System to AudioCommon functions. 2022-11-06 02:13:58 +01:00
Pokechu22 f9fe25291d Remove most uses of StringFromFormat in favor of fmt 2022-10-12 16:50:47 -07:00
askew-etc 914f38753a Add hotkeys for incrementing/decrementing selected state slot (like RetroArch) 2022-08-07 12:20:09 -05:00
Admiral H. Curtiss 4d27022d0e
Add hotkey for centering mouse in render window. 2022-07-25 00:59:47 +02:00
JosJuice 2f3c0cdbc5 Split out controller initialization to UICommon 2022-07-17 14:02:03 +02:00
Admiral H. Curtiss fb47035f97
Config: Port emulation speed setting to new config system. 2022-01-06 16:13:54 +01:00
Admiral H. Curtiss d6331c1e71
Config: Port remaining Interface settings to new config system. 2021-12-31 17:40:04 +01:00
Léo Lam f0faf3712d
Merge pull request #10171 from malleoz/fix-frame-advance-speed
Fix swapped frame advance speed increase/decrease
2021-10-16 11:36:07 +02:00
sowens99 8ea6bef98f Port Main.DSP to MainSettings
While trying to work on adding audiodump support for CLI, I was alerted that it was important to first try moving the DSP configs to the new config before continuing, as that makes it substantially easier to write clean code to add such a feature.

This commit aims to allow for Dolphin to only rely on the new config for DSP-related settings.
2021-10-15 23:24:46 -04:00
sowens99 ea81346fc3 Fix swapped frame advance speed increase/decrease
Frame Advance Speed hotkeys were swapped. This likely occurred because speed and delay are inverses (i.e. a speed increase should DECREASE the delay and vice versa).
2021-10-15 23:22:22 -04:00
sowens99 d5845ff281 HotkeyScheduler: add PlayRecording hotkey support
This hotkey was not previously implemented in the scheduler, even though it's present in the hotkey menu.
2021-09-24 11:58:41 -04:00
sowens99 e5051c516f Check for certain hotkeys in game list
There are certain hotkeys that we absolutely want to be able to use
without being in-game. Presently, no hotkeys are recognized unless we
are in-game.

I've identified and moved the following hotkeys to be checked before the
HotkeyScheduler checks to see if the Core is running:

- Open
- Exit
- Start Recording
- Refresh Game List

Note that Play Recording should also be implemented here, however it
looks like there is no signal for a PlayRecording() function, so this
will have to be handled in a later PR once that signal is created and
implemented.
2021-09-23 10:46:04 -04:00
Bonta b73d16a71a Qt/Core: Implement GBA Hotkeys 2021-07-13 16:43:42 +02:00
Pierre Bourdon 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
Filoppi 3c7c2dfaa1 Implement Cursor Locking and new input focus checks for it 2021-05-27 10:31:12 +03:00
Léo Lam 336518049d
WiiUtils: Add helper functions to get emulated/real Bluetooth device
This adds a function to get the emulated or real Bluetooth device for
an active emulation instance. This lets us deduplicate all the
`ios->GetDeviceByName("/dev/usb/oh1/57e/305")` calls that are currently
scattered in the codebase and ensures Bluetooth passthrough is being
handled correctly.

This also fixes the broken check in WiimoteCommon::UpdateSource.
There was a confusion between "emulated Bluetooth" (as opposed to
"real Bluetooth" aka Bluetooth passthrough) and "emulated Wiimote".
2021-04-12 18:16:56 +02:00
iwubcode 28e880efb6 DolphinQt: update hotkeyscheduler to run at 200hz, giving more precision for FreeLook motion devices 2021-03-18 17:54:12 -05:00
iwubcode f1ce921844 DolphinQt: update FreeLook to use relative input 2021-03-17 20:58:33 -05:00
iwubcode db4b4e40cb InputCommon / DolphinQt / Core: Add a "RelativeMouse" input which provides the raw delta mouse input
Co-authored-by: Jordan Woyak <jordan.woyak@gmail.com>
2021-03-17 20:58:33 -05:00
Léo Lam 522cb6b137
IOS: Use less ambiguous names for classes
Some of the device names can be ambiguous and require fully or partly
qualifying the name (e.g. IOS::HLE::FS::) in a somewhat verbose way.

Additionally, insufficiently qualified names are prone to breaking.
Consider the example of IOS::HLE::FS:: (namespace) and
IOS::HLE::Device::FS (class). If we use FS::Foo in a file that doesn't
know about the class, everything will work fine. However, as soon as
Device::FS is declared via a header include or even just forward
declared, that code will cease to compile because FS:: now resolves
to Device::FS if FS::Foo was used in the Device namespace.

It also leads to having to write IOS::ES:: to access ES types and
utilities even for code that is already under the IOS namespace.

The fix for this is simple: rename the device classes and give them
a "device" suffix in their names if the existing ones may be ambiguous.
This makes it clear whether we're referring to the device class or to
something else.

This is not any longer to type, considering it lets us get rid of the
Device namespace, which is now wholly unnecessary.

There are no functional changes in this commit.

A future commit will fix unnecessarily qualified names.
2021-02-12 21:40:31 +01:00
iwubcode 9a744ab25b DolphinQt: Move Free Look out of Graphics/Hotkey and into its own configuration window. Launched from a new menu option - "Free Look Settings". The HotKeyScheduler still calls the Free Look functionality to reduce the total number of threads 2020-12-24 13:49:25 -06:00
Losucaru 407ef8b596 Add a Skip EFB Access from CPU Hotkey 2020-10-29 21:03:06 -03:00
Shawn Hoffman 6ef9d70701 name some threads 2020-08-22 17:22:07 -07:00
iwubcode 69bd6bbdef DolphinQt: change freelook fov by the step size 2020-06-25 13:34:42 -05:00