Commit Graph

199 Commits

Author SHA1 Message Date
Jordan Woyak
535c81c8df Triforce: Automatically set SuggestedAspectRatio as ForceStandard to work around widescreen heuristic issues. 2026-02-15 20:14:15 -06:00
Jordan Woyak
84b136c994 BootManager: Fix "enumeration value not handled in switch" warning. 2026-02-15 20:14:15 -06:00
Jordan Woyak
b15c593eec BootManager: Automatically attach Triforce Baseboard hardware. 2026-02-15 20:14:15 -06:00
JosJuice
5440c7737f Explicitly transfer control of SYSCONF to emulated system
The functions SaveToSYSCONF and LoadFromSYSCONF contain checks for
whether emulation is running. The intent of this is that when we're
emulating a Wii, the emulated system may write to SYSCONF whenever it
likes and does not expect anything else to write to SYSCONF, so the
host code shouldn't access SYSCONF while emulation is ongoing. However,
Core::IsRunning is an imperfect proxy for whether we've handed over
control of SYSCONF to the emulated system yet, as the actual handover
happens at a slightly different point in time than when the emulation
state is changed. This usually isn't a problem, but in theory it could
be a determinism problem if a setting is changed right as emulation is
starting, or it could cause the emulated software to briefly misbehave
if a setting is changed right as emulation is stopping.

Things got worse in 72cf2bdb87 when I
replaced the Core::IsRunning calls with !Core::IsUninitialized. With
IsRunning, there was be a period of time where SYSCONF should have been
protected but wasn't. With !IsUninitialized, there was a period of time
where SYSCONF shouldn't have been protected but was, and crucially, this
period of time included the moments where we do setup and teardown of
the emulated NAND, which broke transferring SYSCONF settings between the
host and the guest. 72cf2bdb87 was
reverted because of this.

This commit adds a flag that we explicitly flip when control is handed
over to or from the emulated system. This protects the SYSCONF file
for exactly as long as is needed.
2026-02-14 10:05:27 +01:00
Martino Fontana
a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00
Luz Paz
fb6c625fed Core/Core: fix typos
Found via `codespell -q 3 -S "./Externals,./Data/Sys/wiitdb-??.txt,*.po,*.pot" -L andf,asnd,bootup,bufferin,clen,collet,datas,delt,fpr,inout,inport,interm,pixelx,re-use,re-used,sav,stateman,strat,wil`
2025-03-08 15:41:53 -05:00
Martino Fontana
991bce2d68 Config: Don't depend on is_dirty to save SYSCONF during restore
`Layer::Save` only does its thing if the layer has `is_dirty == true`.
But SYSCONF could have been modified by other layers, so if the base layer wasn't made dirty by anything else, then it wouldn't be restored.
Fixes https://bugs.dolphin-emu.org/issues/13580
2024-07-27 16:45:33 +02: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
LillyJadeKatrin
b05028da1f Added Change Media client functionality to AchievementMananger
The client can handle media changes natively so disabling can take place internally. This code uses the same external calls to load data, but will call either BeginLoad or BeginChangeMedia based on whether any media is already loaded.
Due to the client's handling of media changes (it simply disables hardcore if an unknown media is detected) the existing functionality for "disabling" the achievements is no longer necessary and can be deleted.
2024-05-01 07:04:32 -04:00
mitaclaw
f09b71582e Core: Avoid (Some) Global System Accessor 2024-03-18 01:35:42 -07:00
mitaclaw
16c609dcd4 BootManager: Avoid Global System Accessor 2024-03-01 23:39:04 -08:00
Admiral H. Curtiss
9a3e770c23 Migrate SConfig::bWii to System. 2024-01-31 12:54:07 +01:00
Admiral H. Curtiss
8d515d407c Migrate SConfig::m_is_mios to System. 2024-01-30 03:45:17 +01:00
Admiral H. Curtiss
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
Admiral H. Curtiss
2155a61176 Core: Pass System through more of the emulation thread init process. 2024-01-05 05:19:29 +01: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
c8d8ca2ff7 Added Disabled flag to Achievement Manager
The Disabled state sits between Game Closed and completely Shutdown - stronger than the former, as it refuses to let a game be opened again until AchievementManager is restored (which only happens upon a fresh core boot) but it isn't completely shut down and will still allow the player to be logged in and access the achievement settings and their (global) achievement header.
2023-12-05 16:17:17 -05:00
LillyJadeKatrin
148c2f3c0d Refactored AchievementManager hash code to take a volume.
This change splits LoadGameAsync into three methods: two HashGame methods to accept either a string filepath or a volume, and a common LoadGameSync that both HashGames call to actually process the code. In the process, some minor cleanup, and the hash resolution now takes place on the work queue asynchronously.
2023-12-05 16:17:11 -05:00
LillyJadeKatrin
8b57c4b239 Added LoadGameByFilenameAsync and CloseGame to AchievementManager
LoadGameByFilenameAsync sets up a volume reader and hashes the volume, then uses that hash to make the three consecutive API requests to resolve hash, start session and load game data.

CloseGame resets the m_is_game_loaded flag, wipes the queue, and destroys all the game data responses.
2023-04-12 03:08:47 -04:00
Admiral H. Curtiss
0d095b4d9b Netplay: Simplify save data options. 2022-09-20 01:37:32 +02:00
Admiral H. Curtiss
0a517ebdbd Core: Pass Netplay SRAM through boot process.
This removes the Netplay classes touching emulated hardware structures before emulation even starts.
2022-09-19 21:47:12 +02:00
Admiral H. Curtiss
bec4850fc3 Netplay: Rename variable names in NetSettings to match style guide. 2022-09-19 01:25:46 +02:00
Admiral H. Curtiss
1732071a10 Netplay: Pass netplay settings via BootSessionData. 2022-09-11 04:18:26 +02:00
JosJuice
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
Pokechu22
777bb4d82c Use Slot in EXI devices 2022-01-16 14:21:28 -08:00
Admiral H. Curtiss
c82b2dccb5 Config: Port SyncGPU settings to new config system. 2022-01-09 21:29:12 +01:00
Admiral H. Curtiss
92d2fd9d5f Config: Port MMU setting to new config system. 2022-01-09 21:29:12 +01:00
Admiral H. Curtiss
d8825f5635 Config: Port dual core setting to new config system. 2022-01-09 21:29:11 +01:00
Admiral H. Curtiss
5c325eef38 Config: Port SI device settings to new config system. 2022-01-08 20:08:21 +01:00
Admiral H. Curtiss
a0a0bfc5ca Config: Port EXI device settings to new config system. 2022-01-08 19:57:58 +01:00
Admiral H. Curtiss
dc7e7d08ad Config: Port Fastmem setting to new config system. 2022-01-06 16:13:56 +01:00
Admiral H. Curtiss
88d725c918 Config: Port SyncOnSkipIdle setting to new config system. 2022-01-06 16:13:56 +01:00
Admiral H. Curtiss
e613cbf395 Config: Port FastDiscSpeed setting to new config system. 2022-01-06 16:13:55 +01:00
Admiral H. Curtiss
7184983ee8 Config: Port DisableICache setting to new config system. 2022-01-06 16:13:55 +01:00
Admiral H. Curtiss
d98c6b0b1d Config: Port GPUDeterminismMode setting to new config system. 2022-01-06 16:13:55 +01: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
032f0da35e Config: Remove CompareServer and CompareClient settings. 2022-01-05 21:26:17 +01:00
Admiral H. Curtiss
e08171fa24 Config: Port remaining Core settings to new config system (partial). 2022-01-05 00:54:15 +01:00
Admiral H. Curtiss
526887899e Config: Port BluetoothPassthrough settings to new config system. 2021-12-30 23:17:19 +01:00
Admiral H. Curtiss
cae4b545bd Config: Port CPU overclock settings to new config system. 2021-12-25 21:52:50 +01:00
Admiral H. Curtiss
83ad84061e Core/Boot: Refactor storage of boot-to-savestate data into a separate class. 2021-11-22 00:35:35 +01:00
Admiral H. Curtiss
d0c11f76b5 Core/BootManager: Disable loading time emulation for Riivolution-patched games until we have proper emulation for that. 2021-10-24 00:09: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
Pokechu22
78bfd25964 Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
JosJuice
9f525d69c8 Jit: Raise program exception on floating point exceptions
This is done entirely through interpreter fallbacks. It would
probably be possible to implement this using host exception
handlers instead, but I think it would be a lot of complexity
for a rarely used feature, so let's not do it for now.

For performance reasons, there are two settings for this feature:
One setting which does enables just what True Crime: New York City
needs and one setting which enables it all. The latter makes
almost all float instructions fall back to the interpreter.
2021-10-13 17:42:56 +02:00
JosJuice
fa0525f826 Port Enable Cheats to the new config system 2021-08-11 18:07:43 +02:00
Techjar
3ce5caf887 NetPlay: Split save and SD card write settings
This actually eliminates any setting pertaining to SD cards from the
NetPlay dialog, as it would effectively just be a duplicate of the
setting in the Wii pane, potentially causing confusion.

This also enables save data writing by default, as this is probably
what most players want, and should avoid them losing hours of progress
because they forgot to tick a checkbox.
2021-07-22 01:16:20 -04: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
Pokechu22
dad309d365 Disable ICache emulation for some games
Specifically, 'Scooby-Doo! Mystery Mayhem', 'Scooby-Doo! Unmasked', 'Ed, Edd n Eddy: The Mis-Edventures', and the Wii version of 'Happy Feet'.

The JIT cache causes problems with emulated icache invalidation in these games, resulting in areas failing to load.
2021-04-06 12:44:10 -07:00
JosJuice
a1000afacc Add utility functions for GameCube language codes 2021-03-27 09:46:46 +01:00