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

GE Debugger: Add fields to register expressions #16007

Merged
merged 4 commits into from
Sep 11, 2022

Conversation

unknownbrackets
Copy link
Collaborator

@unknownbrackets unknownbrackets commented Sep 11, 2022

Follow up from #15974. This makes GE conditions easier to use, by providing a few more values, some constants, and fields. It also evaluates the expression as if the op had already run (at least for registers, not for matrix data or vtype, etc.)

For example, this allows you to add conditions like:

  • vtype.through == 1
  • alphatest.func == GREATER
  • transfersrc == 0x08804000
  • prim.type == TRIANGLE_FAN
  • fogcolor.red == 0xFF
  • texsize0.h == 512
  • texfunc.func == GE_TEXFUNC_REPLACE

Which means you need to memorize less about the bits to evaluate expressions. It'd be nice to make this more friendly, but I already think this is better (and more usable from a debugger API, which doesn't exist yet but I plan for it to.) Of course, they're also useful for actual conditions.

Note: you can also use these when using "goto address" in a displaylist. You can't (yet?) use them in the memory viewer.

There's no way to discover these constants or field names aside from reading the code, but it'll error out at you if they're wrong.

This also gives metadata structure that might allow for "assembling" displaylist commands too.

-[Unknown]

Easier to just refer to the full address.
This means a conditional breakpoint can now use, for example,
vtype.through == 1 to check the through mode flag.

No constants, but this makes it easier to get right.  Would be nice to
have an autocomplete of the field names, of course...
Hard to remember, but at least can be copy/pasted.
Allows for things like "alphatest.func == GREATER".
@unknownbrackets unknownbrackets added this to the v1.14.0 milestone Sep 11, 2022
@hrydgard
Copy link
Owner

hrydgard commented Sep 11, 2022

looks good to me! and this will be quite useful for some investigations, for sure.

@hrydgard hrydgard merged commit c37049f into hrydgard:master Sep 11, 2022
@unknownbrackets unknownbrackets deleted the gedebugger branch September 11, 2022 22:30
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.

2 participants