Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DolphinQt: add ability to lock / freeze values in the watches window #11365

Merged

Conversation

iwubcode
Copy link
Contributor

@iwubcode iwubcode commented Dec 22, 2022

Was looking to find some values in memory for a new feature I'm working on. I wanted the ability to lock the value so I could see if I found the right one. To my dismay, the feature wasn't available. Looking at #9886 I see that the solution was broken and therefore removed.

I decided to take a stab at implementing it. I feel like there are too many interfaces for interacting with patches and would prefer to consolidate them but didn't want to do anything too heavy handed at the moment. So this PR adds a way for PatchEngine to apply memory patches on each frame.

This adds the ability to lock/freeze values to the watches window. It also allows multi-selection for easy deletion and lock/unlocking of values. Finally, it adds an 'Add to Watch' option to the cheat search, so you don't have to go through the memory view

watch_window_lock

@iwubcode iwubcode marked this pull request as draft December 22, 2022 23:50
@iwubcode

This comment was marked as outdated.

@iwubcode iwubcode changed the title DolphinQt: add ability to lock / freeze values in the cheat manager DolphinQt: add ability to lock / freeze values in the watches window Dec 23, 2022
@iwubcode iwubcode marked this pull request as ready for review December 23, 2022 18:12
Copy link
Member

@lioncash lioncash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one tiny nit

@@ -257,6 +262,15 @@ static void ApplyPatches(const std::vector<Patch>& patches)
}
}

static void ApplyMemoryPatches(const std::vector<std::size_t>& memory_patch_indices)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget if we're completely over to C++20, but if we are, perhaps make this a std::span

Suggested change
static void ApplyMemoryPatches(const std::vector<std::size_t>& memory_patch_indices)
static void ApplyMemoryPatches(std::span<const std::size_t> memory_patch_indices)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll try and see if buildbot complains :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to change this, or...?

@AdmiralCurtiss AdmiralCurtiss merged commit 653e0cc into dolphin-emu:master Jan 9, 2023
11 checks passed
@iwubcode iwubcode deleted the cheat_manager_freeze_value branch January 9, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants