VarAction2: Add a NOOP operator
This commit is contained in:
@@ -217,6 +217,7 @@ static U EvalAdjustT(const DeterministicSpriteGroupAdjust &adjust, ScopeResolver
|
||||
case DSGA_OP_JNZ: return handle_jump(value != 0, value);
|
||||
case DSGA_OP_JZ_LV: return handle_jump(last_value == 0, last_value);
|
||||
case DSGA_OP_JNZ_LV: return handle_jump(last_value != 0, last_value);
|
||||
case DSGA_OP_NOOP: return last_value;
|
||||
default: return value;
|
||||
}
|
||||
}
|
||||
@@ -708,6 +709,7 @@ static const char *_dsg_op_special_names[] {
|
||||
"JNZ",
|
||||
"JZ_LV",
|
||||
"JNZ_LV",
|
||||
"NOOP",
|
||||
};
|
||||
static_assert(lengthof(_dsg_op_special_names) == DSGA_OP_SPECIAL_END - DSGA_OP_TERNARY);
|
||||
|
||||
@@ -778,6 +780,11 @@ static char *DumpSpriteGroupAdjust(char *p, const char *last, const Deterministi
|
||||
append_flags();
|
||||
return p;
|
||||
}
|
||||
if (adjust.operation == DSGA_OP_NOOP) {
|
||||
p += seprintf(p, last, "NOOP");
|
||||
append_flags();
|
||||
return p;
|
||||
}
|
||||
if (adjust.operation == DSGA_OP_JZ_LV || adjust.operation == DSGA_OP_JNZ_LV) {
|
||||
p = GetAdjustOperationName(p, last, adjust.operation);
|
||||
p += seprintf(p, last, " +%u", adjust.jump);
|
||||
|
Reference in New Issue
Block a user