Replies: 2 comments 2 replies
-
struct SpriteDimensionValues {
u16 X [[format_read("invert"), format_write("invert")]];
u16 Y [[format_read("invert"), format_write("invert")]];
};
fn invert(u16 val) {
return u16(~val);
};
SpriteDimensionValues v @ 0x00; |
Beta Was this translation helpful? Give feedback.
-
I'll apologize but in my defense I never said or implied that the code didn't work. Yes, you can also return a pattern instead of a string, but in this case that creates an additional problem as noted so it seems that returning a string would be preferred. Not only that would require no casting, but it also gives you more control on the output (for example you could write "~value = {}" to indicate that the data displayed is the binary neg of the data at that variable, or maybe you want to display the value in binary, ...) |
Beta Was this translation helpful? Give feedback.
-
Trying to display at set of X and Y coords that are stored inverted/Bitwise NOT.
Tried this:
struct SpriteDimensionValues{
u16 X [[~a]];
u16 Y [[~a]];
};
Tried this:
struct SpriteDimensionValues{
u16 X [[format("~a")]];
u16 Y [[format("~a")]];
};
and tried this:
struct SpriteDimensionValues{
u16 X [[transform("~a")]];
u16 Y [[transform("~a")]];
};
and finally tried this:
struct SpriteDimensionValues{
u16 ~X;
u16 ~Y;
};
The error just keeps saying "~a" doesn't exist but it's listed in the expressions (https://imhex.werwolv.net/docs/core_language/expressions.html).
@WerWolv in response to adding a feature request not to long ago indicated both the [[format]] and [[transform]] should work to translate the values from the inverted data. However, I cannot find anything in documentation on either of these tools to apply within the pattern. Since both state they require a defined name and neither accept the math expression of Bitwise Not... I am at a loss how to actually impliment this within my pattern...
I wholeheartly believe this is user error and that the app can support the needs... just need someone to point out the actually usage for the Pattern to do its thing. :D
Beta Was this translation helpful? Give feedback.
All reactions