VarAction2: Add flags to skip adjust if value is 0 or LSB set

This commit is contained in:
Jonathan G Rennison
2022-06-06 23:04:45 +01:00
parent 236cbc4e83
commit e41a5d2f63
3 changed files with 39 additions and 2 deletions

View File

@@ -202,6 +202,13 @@ enum DeterministicSpriteGroupAdjustOperation : uint8 {
static_assert((DSGA_OP_SLT ^ 1) == DSGA_OP_SGE);
static_assert((DSGA_OP_SLE ^ 1) == DSGA_OP_SGT);
enum DeterministicSpriteGroupAdjustFlags : uint8 {
DSGAF_NONE = 0,
DSGAF_SKIP_ON_ZERO = 1 << 0,
DSGAF_SKIP_ON_LSB_SET = 1 << 1,
};
DECLARE_ENUM_AS_BIT_SET(DeterministicSpriteGroupAdjustFlags);
inline bool IsEvalAdjustWithZeroRemovable(DeterministicSpriteGroupAdjustOperation op)
{
switch (op) {
@@ -333,6 +340,7 @@ struct DeterministicSpriteGroupAdjust {
DeterministicSpriteGroupAdjustType type;
uint16 variable;
byte shift_num;
DeterministicSpriteGroupAdjustFlags adjust_flags = DSGAF_NONE;
uint32 parameter; ///< Used for variables between 0x60 and 0x7F inclusive.
uint32 and_mask;
uint32 add_val;
@@ -340,7 +348,6 @@ struct DeterministicSpriteGroupAdjust {
const SpriteGroup *subroutine;
};
struct DeterministicSpriteGroupRange {
const SpriteGroup *group;
uint32 low;