Skip to content

Conversation

gooosedev
Copy link
Contributor

This PR enables basic support for the search in memory view widget
I used the already existing search code as a base.

It adds a few controls above the hexview rather than using a dialog box

currently the following search are supported:

  • int/uint 8/16/32/64
  • float
  • string
  • bytes sequence following this format: "AA BB CC"

@hrydgard
Copy link
Owner

This is cool. Two things:

From an architecture perspective, maybe the UI should actually belong to the surrounding window rather than the MemView itself? Could just call methods on the MemView to set the search.

When making UI PRs, please provide screenshots for quick evaluation :)

@hrydgard hrydgard added this to the v1.20 milestone Jun 10, 2025
- added a simple string search for string using char16 in memory
(currently limite to ASCII)
@hrydgard
Copy link
Owner

It's still in draft mode - is it ready for review?

@gooosedev gooosedev marked this pull request as ready for review June 10, 2025 19:23
@hrydgard
Copy link
Owner

I'll check it out soon, just got suddenly swamped with bug reports :)

@anr2me
Copy link
Collaborator

anr2me commented Jun 12, 2025

Btw, is the float only for single-precision? or double-precision too? in case there are games that use double-precision to store value that need higher precision, less likely but possible.

@gooosedev
Copy link
Contributor Author

Thanks for the feedback,
for now I've only considered single precision, as the PSP was built with a single precision FPU, but if needed I'll add double precision too.

@hrydgard
Copy link
Owner

There is some soft-fpu use of double in games, but of course much less than actual floats. So not sure if worth adding to a searcher.

@hrydgard
Copy link
Owner

hrydgard commented Jun 13, 2025

To fix the Windows error, on this line:

enum MemorySearchType {BITS_8, BITS_16, BITS_32, BITS_64, FLOAT, STRING, STRING_16, BYTESEQ};

Rename FLOAT to FLOAT_32 to avoid clashing with some Windows typedef (ugh).

Maybe also rename BYTESEQ to BYTE_SEQ for consistency with the others.

Also maybe throw the Search UI into a ImGui::CollapsibleHeader.

After that, I'm happy to merge!

- added search highlight with green background in the hexview
@hrydgard hrydgard enabled auto-merge June 13, 2025 14:15
@hrydgard hrydgard merged commit 1217fbd into hrydgard:master Jun 13, 2025
21 checks passed
@gooosedev gooosedev deleted the feature-ImMemView-search branch June 13, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants