VarAction2: Combine RST, UMIN sequence to load with neq 0 adjust

This commit is contained in:
Jonathan G Rennison
2022-06-03 15:34:50 +01:00
parent 9116ca6bb0
commit 04a9c73ec2

View File

@@ -5920,6 +5920,15 @@ static void OptimiseVarAction2Adjust(VarAction2OptimiseState &state, const GrfSp
break;
} else {
state.inference = VA2AIF_SIGNED_NON_NEGATIVE | VA2AIF_ONE_OR_ZERO;
if (group->adjusts.size() >= 2) {
DeterministicSpriteGroupAdjust &prev = group->adjusts[group->adjusts.size() - 2];
if (prev.operation == DSGA_OP_RST && prev.type == DSGA_TYPE_NONE) {
prev.type = DSGA_TYPE_NEQ;
prev.add_val = 0;
group->adjusts.pop_back();
state.inference |= VA2AIF_SINGLE_LOAD;
}
}
}
}
break;