VarAction2: Add a JNZ op analogous to JZ for OR ops

This commit is contained in:
Jonathan G Rennison
2022-07-30 22:40:41 +01:00
parent 5ec802a3d4
commit cbc6199542
3 changed files with 39 additions and 9 deletions

View File

@@ -207,6 +207,7 @@ enum DeterministicSpriteGroupAdjustOperation : uint8 {
DSGA_OP_STO_NC, ///< store b into temporary storage, indexed by c. return a
DSGA_OP_ABS, ///< abs(a)
DSGA_OP_JZ, ///< jump forward fixed number of adjusts (to adjust after DSGAF_END_BLOCK marker (taking into account nesting)) if b is zero. return 0 if jumped, return a if not jumped
DSGA_OP_JNZ, ///< jump forward fixed number of adjusts (to adjust after DSGAF_END_BLOCK marker (taking into account nesting)) if b is non-zero. return b if jumped, return a if not jumped
DSGA_OP_SPECIAL_END,
};
@@ -402,6 +403,18 @@ inline bool IsEvalAdjustWithZeroLastValueAlwaysZero(DeterministicSpriteGroupAdju
}
}
inline bool IsEvalAdjustJumpOperation(DeterministicSpriteGroupAdjustOperation op)
{
switch (op) {
case DSGA_OP_JZ:
case DSGA_OP_JNZ:
return true;
default:
return false;
}
}
inline bool IsConstantComparisonAdjustType(DeterministicSpriteGroupAdjustType adjust_type)
{
switch (adjust_type) {