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: Patches window added #9531

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sepalani
Copy link
Contributor

@sepalani sepalani commented Feb 22, 2021

This PR adds a widget to handle memory patches like replaced instructions. (based on #7081)

At the moment, it looks like this:
image

There are few things I need to address before making this PR ready to merge:

  • Fix a crash when ClearPatches() is called on shutdown (MMU: Fix IsRAMAddress not working #9533)
  • Show both the original value and the patched value in the table
  • Add buttons to load from and save all patches to a file
  • Add button to inject a file into a specific memory address (will be done in another PR)

Ready to be reviewed & merged (depends on #9533).

@sepalani sepalani marked this pull request as ready for review February 28, 2021 10:09
std::vector<std::string> patches;
for (const auto& patch : m_patches)
{
std::ostringstream oss;
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it makes sense to make a fmt::formatter for MemoryPatch then you just do: fmt::to_string(patch)...

Copy link
Contributor

Choose a reason for hiding this comment

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

Another option is to implement std::ostream& operator<< and use fmt's ostream support, if that'd make it easier to be consistent with the parsing code.

if (!PowerPC::HostIsRAMAddress(address))
return;

const bool is_enabled = patch.is_enabled == Common::Debug::MemoryPatch::State::Enabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen this a couple times, maybe it makes sense to make a function?

@iwubcode
Copy link
Contributor

One other idea, maybe adding a 'note' field or 'description' would be useful.

@AdmiralCurtiss
Copy link
Contributor

Can you rebase this on master?

@sepalani
Copy link
Contributor Author

sepalani commented Apr 8, 2022

Sure. However, I'm not satisfied with the current PR state anymore. There are some improvements I'd like to make first, so I'll switch this PR as a draft meanwhile.

@sepalani sepalani marked this pull request as draft April 8, 2022 08:49
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • ab11-homebrew on ogl-lin-radeon: diff
  • aeon-charge-attack on ogl-lin-radeon: diff
  • bk-tev on ogl-lin-radeon: diff
  • burnout2-vehicletextures on ogl-lin-radeon: diff
  • chibi-robo-fastdepth on ogl-lin-radeon: diff
  • chibi-robo-zfighting on ogl-lin-radeon: diff
  • custom-brawl-char on ogl-lin-radeon: diff
  • dbz-depth on ogl-lin-radeon: diff
  • djfny-menu on ogl-lin-radeon: diff
  • djhero2-blend on ogl-lin-radeon: diff
  • DKCR-Char on ogl-lin-radeon: diff
  • DKCR-fast-depth on ogl-lin-radeon: diff
  • ea-pink on ogl-lin-radeon: diff
  • ed-updated on ogl-lin-radeon: diff
  • et-vid on ogl-lin-radeon: diff
  • find-mii on ogl-lin-radeon: diff
  • fishing-resort-map on ogl-lin-radeon: diff
  • fog-adj on ogl-lin-radeon: diff
  • fortune-street on ogl-lin-radeon: diff
  • fortune-street-fog on ogl-lin-radeon: diff
  • fortune-street-white-box on ogl-lin-radeon: diff
  • fsa-layers on ogl-lin-radeon: diff
  • f-zero-rain on ogl-lin-radeon: diff
  • goldeneye-depth on ogl-lin-radeon: diff
  • hb-discgolf on ogl-lin-radeon: diff
  • inverted-depth-range on ogl-lin-radeon: diff
  • jb-shadow on ogl-lin-radeon: diff
  • jd2-fmv on ogl-lin-radeon: diff
  • jj-awae-mirrored on ogl-lin-radeon: diff
  • kirby-logicop on ogl-lin-radeon: diff
  • kirby-shadows on ogl-lin-radeon: diff
  • last-story-shadows on ogl-lin-radeon: diff
  • lego-star-wars-crane-shadow on ogl-lin-radeon: diff
  • lesson08 on ogl-lin-radeon: diff
  • line-width-test on ogl-lin-radeon: diff
  • lm-mario-portrait on ogl-lin-radeon: diff
  • luigi-shadows on ogl-lin-radeon: diff
  • mario-baseball-shadows on ogl-lin-radeon: diff
  • mario-golf-oob on ogl-lin-radeon: diff
  • mario-sluggers-bar on ogl-lin-radeon: diff
  • mario-tennis-menu on ogl-lin-radeon: diff
  • MaS-LOG-wiimote on ogl-lin-radeon: diff
  • megaman-heat on ogl-lin-radeon: diff
  • melee-depth on ogl-lin-radeon: diff
  • melee-lighting on ogl-lin-radeon: diff
  • metroid-visor on ogl-lin-radeon: diff
  • mii-channel on ogl-lin-radeon: diff
  • milotic-texture on ogl-lin-radeon: diff
  • mini-ninjas on ogl-lin-radeon: diff
  • mkdd-babypark on ogl-lin-radeon: diff
  • mkdd-efb on ogl-lin-radeon: diff
  • mkw-bridge on ogl-lin-radeon: diff
  • mkw-flags on ogl-lin-radeon: diff
  • mkwii-bluebox on ogl-lin-radeon: diff
  • monkeyball-fuse on ogl-lin-radeon: diff
  • mp2-scanner on ogl-lin-radeon: diff
  • mp3-bloom on ogl-lin-radeon: diff
  • mp4-vertexcache on ogl-lin-radeon: diff
  • mp7-text on ogl-lin-radeon: diff
  • mp8-widescreen on ogl-lin-radeon: diff
  • mtennis-zfreeze on ogl-lin-radeon: diff
  • my-word-coach on ogl-lin-radeon: diff
  • nddemo-bumpmapping on ogl-lin-radeon: diff
  • nddemo-lighting on ogl-lin-radeon: diff
  • nfsu-purplerect on ogl-lin-radeon: diff
  • nfsu-reflections on ogl-lin-radeon: diff
  • nhl-slap on ogl-lin-radeon: diff
  • nintendo-channel on ogl-lin-radeon: diff
  • nsmbw-coins on ogl-lin-radeon: diff
  • nsmbw-intro on ogl-lin-radeon: diff
  • pbr-sfx on ogl-lin-radeon: diff
  • pm-hc-jp on ogl-lin-radeon: diff
  • pw-black-bars on ogl-lin-radeon: diff
  • rs2-bumpmapping on ogl-lin-radeon: diff
  • rs2-glass on ogl-lin-radeon: diff
  • rs2-skybox on ogl-lin-radeon: diff
  • rs2-zfreeze on ogl-lin-radeon: diff
  • rs3-bumpmapping on ogl-lin-radeon: diff
  • rs3-skybox2 on ogl-lin-radeon: diff
  • sadx-ui on ogl-lin-radeon: diff
  • sfa-shadows on ogl-lin-radeon: diff
  • sf-assault-flashing on ogl-lin-radeon: diff
  • shadow-eyes on ogl-lin-radeon: diff
  • simpsons-game on ogl-lin-radeon: diff
  • smb-mirror on ogl-lin-radeon: diff
  • smg2-fog on ogl-lin-radeon: diff
  • smg-marioeyes on ogl-lin-radeon: diff
  • smg-mmg on ogl-lin-radeon: diff
  • smg-roar on ogl-lin-radeon: diff
  • sms-bubbles on ogl-lin-radeon: diff
  • sms-gc on ogl-lin-radeon: diff
  • sms-water on ogl-lin-radeon: diff
  • soa-black on ogl-lin-radeon: diff
  • soniccolors-mm on ogl-lin-radeon: diff
  • sonic-riders-blur on ogl-lin-radeon: diff
  • sonic-riders-zg-4p on ogl-lin-radeon: diff
  • sonicriderszg-gb on ogl-lin-radeon: diff
  • spyro-bloom on ogl-lin-radeon: diff
  • spyro-depth on ogl-lin-radeon: diff
  • ssbb-mod-lloyd on ogl-lin-radeon: diff
  • ssbm-pointsize on ogl-lin-radeon: diff
  • ss-map on ogl-lin-radeon: diff
  • super-sluggers-white-out on ogl-lin-radeon: diff
  • sw3-dt on ogl-lin-radeon: diff
  • thps3-earlyz on ogl-lin-radeon: diff
  • thps4-shadow on ogl-lin-radeon: diff
  • tla-menu on ogl-lin-radeon: diff
  • tos-invis-char on ogl-lin-radeon: diff
  • tp-skin on ogl-lin-radeon: diff
  • tsp3-pinkgrass on ogl-lin-radeon: diff
  • vegas-party-depth on ogl-lin-radeon: diff
  • viewitful-joe-distortion on ogl-lin-radeon: diff
  • xenoblade-menu on ogl-lin-radeon: diff
  • ztp-grass on ogl-lin-radeon: diff
  • zww-armos on ogl-lin-radeon: diff
  • zww-water on ogl-lin-radeon: diff
  • zww-waves on ogl-lin-radeon: diff
  • ab11-homebrew on uberogl-lin-radeon: diff
  • aeon-charge-attack on uberogl-lin-radeon: diff
  • bk-tev on uberogl-lin-radeon: diff
  • burnout2-vehicletextures on uberogl-lin-radeon: diff
  • chibi-robo-fastdepth on uberogl-lin-radeon: diff
  • chibi-robo-zfighting on uberogl-lin-radeon: diff
  • custom-brawl-char on uberogl-lin-radeon: diff
  • dbz-depth on uberogl-lin-radeon: diff
  • djfny-menu on uberogl-lin-radeon: diff
  • djhero2-blend on uberogl-lin-radeon: diff
  • DKCR-Char on uberogl-lin-radeon: diff
  • DKCR-fast-depth on uberogl-lin-radeon: diff
  • ea-pink on uberogl-lin-radeon: diff
  • ed-updated on uberogl-lin-radeon: diff
  • et-vid on uberogl-lin-radeon: diff
  • find-mii on uberogl-lin-radeon: diff
  • fishing-resort-map on uberogl-lin-radeon: diff
  • fog-adj on uberogl-lin-radeon: diff
  • fortune-street on uberogl-lin-radeon: diff
  • fortune-street-fog on uberogl-lin-radeon: diff
  • fortune-street-white-box on uberogl-lin-radeon: diff
  • fsa-layers on uberogl-lin-radeon: diff
  • f-zero-rain on uberogl-lin-radeon: diff
  • goldeneye-depth on uberogl-lin-radeon: diff
  • hb-discgolf on uberogl-lin-radeon: diff
  • inverted-depth-range on uberogl-lin-radeon: diff
  • jb-shadow on uberogl-lin-radeon: diff
  • jd2-fmv on uberogl-lin-radeon: diff
  • jj-awae-mirrored on uberogl-lin-radeon: diff
  • kirby-logicop on uberogl-lin-radeon: diff
  • kirby-shadows on uberogl-lin-radeon: diff
  • last-story-shadows on uberogl-lin-radeon: diff
  • lego-star-wars-crane-shadow on uberogl-lin-radeon: diff
  • lesson08 on uberogl-lin-radeon: diff
  • line-width-test on uberogl-lin-radeon: diff
  • lm-mario-portrait on uberogl-lin-radeon: diff
  • luigi-shadows on uberogl-lin-radeon: diff
  • mario-baseball-shadows on uberogl-lin-radeon: diff
  • mario-golf-oob on uberogl-lin-radeon: diff
  • mario-sluggers-bar on uberogl-lin-radeon: diff
  • mario-tennis-menu on uberogl-lin-radeon: diff
  • MaS-LOG-wiimote on uberogl-lin-radeon: diff
  • megaman-heat on uberogl-lin-radeon: diff
  • melee-depth on uberogl-lin-radeon: diff
  • melee-lighting on uberogl-lin-radeon: diff
  • metroid-visor on uberogl-lin-radeon: diff
  • mii-channel on uberogl-lin-radeon: diff
  • milotic-texture on uberogl-lin-radeon: diff
  • mini-ninjas on uberogl-lin-radeon: diff
  • mkdd-babypark on uberogl-lin-radeon: diff
  • mkdd-efb on uberogl-lin-radeon: diff
  • mkw-bridge on uberogl-lin-radeon: diff
  • mkw-flags on uberogl-lin-radeon: diff
  • mkwii-bluebox on uberogl-lin-radeon: diff
  • monkeyball-fuse on uberogl-lin-radeon: diff
  • mp2-scanner on uberogl-lin-radeon: diff
  • mp3-bloom on uberogl-lin-radeon: diff
  • mp4-vertexcache on uberogl-lin-radeon: diff
  • mp7-text on uberogl-lin-radeon: diff
  • mp8-widescreen on uberogl-lin-radeon: diff
  • mtennis-zfreeze on uberogl-lin-radeon: diff
  • my-word-coach on uberogl-lin-radeon: diff
  • nddemo-bumpmapping on uberogl-lin-radeon: diff
  • nddemo-lighting on uberogl-lin-radeon: diff
  • nfsu-purplerect on uberogl-lin-radeon: diff
  • nfsu-reflections on uberogl-lin-radeon: diff
  • nhl-slap on uberogl-lin-radeon: diff
  • nintendo-channel on uberogl-lin-radeon: diff
  • nsmbw-coins on uberogl-lin-radeon: diff
  • nsmbw-intro on uberogl-lin-radeon: diff
  • pbr-sfx on uberogl-lin-radeon: diff
  • pm-hc-jp on uberogl-lin-radeon: diff
  • pw-black-bars on uberogl-lin-radeon: diff
  • rs2-bumpmapping on uberogl-lin-radeon: diff
  • rs2-glass on uberogl-lin-radeon: diff
  • rs2-skybox on uberogl-lin-radeon: diff
  • rs2-zfreeze on uberogl-lin-radeon: diff
  • rs3-bumpmapping on uberogl-lin-radeon: diff
  • rs3-skybox2 on uberogl-lin-radeon: diff
  • sadx-ui on uberogl-lin-radeon: diff
  • sfa-shadows on uberogl-lin-radeon: diff
  • sf-assault-flashing on uberogl-lin-radeon: diff
  • shadow-eyes on uberogl-lin-radeon: diff
  • simpsons-game on uberogl-lin-radeon: diff
  • smb-mirror on uberogl-lin-radeon: diff
  • smg2-fog on uberogl-lin-radeon: diff
  • smg-marioeyes on uberogl-lin-radeon: diff
  • smg-mmg on uberogl-lin-radeon: diff
  • smg-roar on uberogl-lin-radeon: diff
  • sms-bubbles on uberogl-lin-radeon: diff
  • sms-gc on uberogl-lin-radeon: diff
  • sms-water on uberogl-lin-radeon: diff
  • soa-black on uberogl-lin-radeon: diff
  • soniccolors-mm on uberogl-lin-radeon: diff
  • sonic-riders-blur on uberogl-lin-radeon: diff
  • sonic-riders-zg-4p on uberogl-lin-radeon: diff
  • sonicriderszg-gb on uberogl-lin-radeon: diff
  • spyro-bloom on uberogl-lin-radeon: diff
  • spyro-depth on uberogl-lin-radeon: diff
  • ssbb-mod-lloyd on uberogl-lin-radeon: diff
  • ssbm-pointsize on uberogl-lin-radeon: diff
  • ss-map on uberogl-lin-radeon: diff
  • super-sluggers-white-out on uberogl-lin-radeon: diff
  • sw3-dt on uberogl-lin-radeon: diff
  • thps3-earlyz on uberogl-lin-radeon: diff
  • thps4-shadow on uberogl-lin-radeon: diff
  • tla-menu on uberogl-lin-radeon: diff
  • tos-invis-char on uberogl-lin-radeon: diff
  • tp-skin on uberogl-lin-radeon: diff
  • tsp3-pinkgrass on uberogl-lin-radeon: diff
  • vegas-party-depth on uberogl-lin-radeon: diff
  • viewitful-joe-distortion on uberogl-lin-radeon: diff
  • xenoblade-menu on uberogl-lin-radeon: diff
  • ztp-grass on uberogl-lin-radeon: diff
  • zww-armos on uberogl-lin-radeon: diff
  • zww-water on uberogl-lin-radeon: diff
  • zww-waves on uberogl-lin-radeon: diff

automated-fifoci-reporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants