I have a byte that contains flags where one, and only one, bit should be set. I tried using the "Use Mask" setting in the "Bit Number" drop-down, but the setting is not saved and reverts back to the specific Bit.
Also, "Use Mask" isn't documented, but I'm hoping "Use Mask" means that the byte to be edited is or'd with the specified bit, and then anded with it to turn the other bits off.
Thanks,
Dave
Flags Definition Editor - Bit Number
Moderators: Mangus, robertisaar, dex
Flags Definition Editor - Bit Number
NismotronicSA Tuning Package/Powered by TunerCodeSA
Speed-Density Tuning for Nissans
Speed-Density Tuning for Nissans
"Use Bitmask" causes the mask you provide to be ANDed on read, and ORed on write. If you select "Use Bitmask," and you specify a mask that's a single bit, it will revert to bit mode with the bit corresponding your mask. (e.g. if you select "use mask" and set a mask of 0x01, then it will be saved as bit mode with bit 0 as the bit.)
***************************************
TunerPro Author
1989 Trans Am
TunerPro Author
1989 Trans Am
A single bit is a legitimate mask. Why would you force the use of multiple bits in order to enable the mask feature?Mangus wrote:"Use Bitmask" causes the mask you provide to be ANDed on read, and ORed on write. If you select "Use Bitmask," and you specify a mask that's a single bit, it will revert to bit mode with the bit corresponding your mask. (e.g. if you select "use mask" and set a mask of 0x01, then it will be saved as bit mode with bit 0 as the bit.)
Thanks,
Dave
NismotronicSA Tuning Package/Powered by TunerCodeSA
Speed-Density Tuning for Nissans
Speed-Density Tuning for Nissans
I mentioned that "Use Mask" isn't documented, so misunderstanding is possible. Of course, in my case, documentation does not guarantee understanding.
Please explain how "Use Mask" works, it's affect on bin contents, and how it differs from bit mode, and why it is only applied when more than 1 bit is specified.
What I would like to accomplish is having multiple flag definitions for a single byte (same address for each flag definition), where only one of the specified bits defined is allowed to be ON (all other bits in that byte OFF).
Thanks,
Dave
Please explain how "Use Mask" works, it's affect on bin contents, and how it differs from bit mode, and why it is only applied when more than 1 bit is specified.
What I would like to accomplish is having multiple flag definitions for a single byte (same address for each flag definition), where only one of the specified bits defined is allowed to be ON (all other bits in that byte OFF).
Thanks,
Dave
NismotronicSA Tuning Package/Powered by TunerCodeSA
Speed-Density Tuning for Nissans
Speed-Density Tuning for Nissans
Because the mask you specify is ORed with the source data on save, you won't be able to accomplish this. One do, should I implement table-based constants, you may be able to.dfddfd2 wrote: What I would like to accomplish is having multiple flag definitions for a single byte (same address for each flag definition), where only one of the specified bits defined is allowed to be ON (all other bits in that byte OFF).
Thanks,
Dave
***************************************
TunerPro Author
1989 Trans Am
TunerPro Author
1989 Trans Am
Sorry to hijack thread but same kind of problem.
How i would be able now make flag this way:
Normally byte is C7 which means Off. 10 Means On.
If i try to make "Mask" Mask is too big to be added and i end up to incorrect values when "Set" has been Enabled and wrong On value when Disabled (Or not "Set")..
Need to make it Scalar which feels stupid.
Advice me for this please.
How i would be able now make flag this way:
Normally byte is C7 which means Off. 10 Means On.
If i try to make "Mask" Mask is too big to be added and i end up to incorrect values when "Set" has been Enabled and wrong On value when Disabled (Or not "Set")..
Need to make it Scalar which feels stupid.
Advice me for this please.