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.
The low-pass and biquad filters run in set40 mode where accessing ac#.m
returns the value of ac#.hm clamped to 16 bits.
This fixes the crackling in "Need for Speed: Nitro" (issue 13610).
Also make the lower bound match hardware (-0x8000 instead of -0x7FFF).
During 25-bit rounding, subnormals are "normalized"
This would normally mean that the exponent needs to be able to be <-1023
Instead, you can modify at what bit you round and get the same results!
This is done by finding the highest bit and shifting right the round bit
Co-Authored-By: JosJuice <josjuice@gmail.com>
Changes integer rounding to more closely meet the documentation
The documentation explains to round before doing any bounds checks
All this really does is make sure some exception bits won't be set wrong
This depends on the rounding mode, fixing cases such as:
- Round to even, (0x7fffffff, 0x7fffffff.8)
- Round to down, (0x7fffffff, 0x80000000)
This change also uses some standard functions for rounding
Previously using them was casting to an s32 directly, now keeps the f64
RoundToIntegerMode introduced due to roundeven not being part of C++17
Finally, it can change a >0x7fffffff to >=0x80000000, done because:
- It looks nicer now with integers (I liked 0s)
- It gives ever so slightly better codegen on Aarch64
Co-Authored-By: JosJuice <josjuice@gmail.com>
I wasn't aware that even with a size of zero, it's still not safe to pass a nullptr to `std::memcpy`. When `CachedInterpreterEmitter::PoisonCallback` is written, UB is happening.
Invert conditions, invert decrement checks, and make conditional branches unconditional. USnapshotMetadata in prior versions of Dolphin is forward-compatible with these changes (tested on x86_64).
Objects which get parented automatically by later processing now pass a nullptr to the constructor to make the intent clearer. Also fixed "true" and "false" not being translatable strings.
This is a minor improvement to add line numbers to the LOG_VULKAN_ERROR
define. Basically error logs for Vulkan will now look like:
```
// This
25:03:347 VideoBackends/Vulkan/VulkanLoader.cpp:247 E[Video]: (WaitForCommandBufferCompletion:278) vkWaitForFences failed: (2: VK_TIMEOUT)
// Instead of
15:45:154 VideoBackends/Vulkan/VulkanLoader.cpp:247 E[Video]: (WaitForCommandBufferCompletion) vkWaitForFences failed: (2: VK_TIMEOUT)
```
Set the Render Window as the parent of the Confirm On Stop confirmation
dialog when Keep Window On Top is enabled, ensuring it will always be
visible.
Previously, when Confirm On Stop and Keep Window On Top were both
enabled the Confirm On Stop dialog could be hidden by the render window
in the following situations:
* Clicking Stop in the Main Window
* Clicking the Main Window's close button
* Pressing the Stop hotkey while in FullScreen mode
This was particularly troublesome because the confirm dialog is modal,
preventing the user from moving the render window out of the way if it
was obscuring the dialog.
Fixes https://bugs.dolphin-emu.org/issues/13247.
A vector of length 0 can have a null data pointer, which causes UB when
passed to memcpy, so only copy when we actually have data to copy. This
caused crashes in certain cases when compiling Dolphin with Clang and
LTO enabled.
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.
Before the call to OnSelectionChange, m_code_edit and m_code_remove are
disabled and UpdateList calls m_code_list->clear(), thereby deselecting
any selected items.
When no items are selected, OnSelectionChange disables m_code_edit and
m_code_remove and then returns. Since that was already done, the call
doesn't change anything and can be removed.
Create ARCodeWidget and GeckoCodeWidget once on startup rather than
every time a game is launched or shutdown.
In addition to losing focus on the tab (since the previous widget and
tab no longer existed), the behavior prior to this commit could cause a
crash if the user initiated a game shutdown and then opened a code edit
window since the AR/GeckoCodeWidget would get deleted in the meantime.
Also some minor refactoring of nearby/related code:
* Make non-obvious variable types explicit instead of auto.
* Throw some consts around.
* Use setDisabled(empty) instead of setEnabled(!empty).
Changes the RetroAchievements "Log In" button's text to "To log in, stop the current emulation." when the button is disabled because an emulation session is active. This allows a user to understand why the button is disabled, and how this state can be resolved.
Previously, it could be unclear why this button was disabled without an understanding of the underlying system.
Co-Authored-By: JosJuice <josjuice@gmail.com>
The description of the Speed Limit setting currently uses a lot of
complicated terms, like "emulated time" (known to many Dolphin
developers, but in my experience not known by even advanced emulator
users) and "maximum time scale" (I have never heard it before). The
meaning of "sustainable" is also unclear in context.
This commit rewords the description to be easier to understand.
Fixes https://bugs.dolphin-emu.org/issues/13593. Before, it would attempt to
use the old shader, which did not exist for the new stereo mode. Changing the
postprocessing shader afterwards would work properly, although passive 3D only
has one option, so it was just broken without restarting Dolphin.
This also fixes the UI not updating when using one of the stereo toggle hotkeys.
These patches were added in bde9a459cd
and enabled by default in 36ecfdd6b5.
They allowed the game to run in Dolphin but disabled dynamic shadows.
The game adds 4 to the start address of otherwise valid display lists
for no obvious reason. Now that Dolphin forces 32-byte alignment these
patches are no longer needed.
`std::bit_cast` participates in overload resolution only if `sizeof(To) == sizeof(From)` and both `To` and `From` are *TriviallyCopyable* types, so the static assertions here can be removed. `[[nodiscard]]` was added as well.
For a long time now, we've had a problem where game INIs persist in
the copied Sys folder if they've been deleted from the original Sys
folder. (I still have hundreds of game INIs locally that only set
EmulationStateId, and we removed those game INIs 6 years ago. On the
buildbot, we do occasionally clear out the build directories manually,
so I'd assume it's not quite as bad there.)
This commit fixes the problem by deleting the output Sys folder before
copying the original Sys folder to the output Sys folder. This should be
a bit slower, but in my testing, the difference seems small. At least if
you have an SSD, which I really hope people have nowadays!
Operating systems other than Windows have not been touched, because:
* Android: Already explicitly deletes the output Sys folder.
* macOS: Does some magic to put the Sys folder in the app bundle, which I
will simply assume isn't affected by this problem, without testing.
* Linux: Expects the person building to manually manage the Sys folder.
Update the checkmarked slot in the Select State Slot menu when the
Increase Selected State Slot or Decrease Selected State Slot hotkeys are
pressed.
The actual selected save slot was being changed correctly before this
commit; this just fixes the menu checkmark.
The biquad filter is used in all Pikmin games for cursor sound effects
in the main menu, although the difference is subtle.
The low-pass filter is used at least by Pikmin 2 Wii during the
spaceship crash in the intro and fixes the missing "puff" sound effects
whenever there is black smoke coming out of the engine.
With this change, a different message is displayed if starting a game with RetroAchievements fails due to the Dolphin version being blocked as opposed to failing because the game hash is unsupported.
This compile definition was removed in 68cbd2640d because it was complicated by changes in 50dc0ffbce. Thus, the LLVM disassembler would never be used in UICommon's Disassembler class.
`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
I tried making the new templated Interpret callback test only the relevant exceptions (EXCEPTION_DSI, EXCEPTION_PROGRAM, or both), but didn't find a significant performance boost in it. As I am learning, the biggest bottleneck is the number of callbacks emitted, not usually the actual contents of them.
WritePC is now needed far less, only for instructions that end the block. Unfortunately, WritePC still needs to update `PowerPCState::npc` to support the false path of conditional branch instructions. Both drawbacks should be smoothed over by optimized cached instructions in the future.
Use QObject->deleteLater() instead of the delete operator to destroy
child widgets of the layout. This prevents crashes caused by pending
events trying to access the now-destroyed widget.
The player_index field in question is ultimately what gets used to determine which ranks get displayed in the leaderboards chart, and because this was missing the chart was simply displaying the top four results no matter what.
The cause of the leaderboard spam was primarily this call where if there was an attempt to get leaderboard info and there wasn't already, there would be a fetch request. This is bad for many reasons: some games have hundreds of boards that will be fetched at startup, if there's simply no data to populate that board, this will just continue to fetch every time the dialog needs to update. To mitigate this, I simply don't load leaderboard information until there are events for that leaderboard - less information for the player, sadly, but heavily cuts down on the number of leaderboard fetches.
Now that we have some test data, it wasn't showing up in the leaderboards tab; this fixes it to ensure (1) that the right ID is being passed to UpdateRow and (2) the map of leaderboard entries is being populated correctly.
Currently we're showing OSD messages for unknown patches in known INI
files, but not for unknown patches in unknown INI files. I don't think
this distinction makes much sense to the user. If there's a patch the
user can't use, they probably want to be aware of that fact.
0c14b0c8a7 made Dolphin load a file from
the Sys folder the first time AchievementManager::GetInstance() is
called. Because Android calls AchievementManager::GetInstance() from
setBackgroundExecutionAllowedNative, this had two negative consequences
on Android:
1. The first time setBackgroundExecutionAllowedNative gets called is
often before directory initialization is done. Getting the path of
the Sys folder before directory initialization is done causes a crash.
2. setBackgroundExecutionAllowedNative is called from the GUI thread,
and we don't want file I/O on the GUI thread for performance reasons.
This change makes us load the data from the Sys folder the first time
the data is needed instead. This also saves us from having to load the
data at all when hardcore mode is inactive.
We mustn't use m_system when it is nullptr. This was causing Dolphin to
crash on Android whenever an activity was recreated or resumed while
emulation is running, which is super common.
Prototype of a system to whitelist known game patches that are allowed to be used while RetroAchievements Hardcore mode is active. ApprovedInis.txt contains known hashes for the ini files as they appear in the repo, and can be compared to the local versions of these files to ensure they have not been edited locally by the player. ApprovedInis.txt is hashed and verified similarly first, with its hash residing as a const string within AchievementManager.h, ensuring ApprovedInis and the hashes within cannot be modified without editing Dolphin's source code and recompiling completely.
The challenge popups have proven to be excessive and are no longer useful thanks to the achievements hotkey. Instead, those events will ask for an immediate RP-level update to the achievements dialog, which will among other things re-sort the dialog to show challenges on top faster.
This way, by pressing Continue on top of a breakpoint, the emulation will actually continue (like on Cached Interpreter and JIT), instead of doing nothing.