diff --git a/nml/actions/action2var.py b/nml/actions/action2var.py index 4a95ab90..acf08c0c 100644 --- a/nml/actions/action2var.py +++ b/nml/actions/action2var.py @@ -575,6 +575,7 @@ def parse_binop(self, expr): isinstance(expr.expr2, (expression.ConstantNumeric, expression.Variable)) or isinstance(expr.expr2, (VarAction2LoadTempVar, VarAction2LoadCallParam)) or (isinstance(expr.expr2, expression.Parameter) and isinstance(expr.expr2.num, expression.ConstantNumeric)) + or (isinstance(expr.expr2, expression.StorageOp) and expr.expr2.name == "LOAD_TEMP") or expr.op == nmlop.VAL2 ): expr2 = expr.expr2 diff --git a/regression/expected/example_industry.grf b/regression/expected/example_industry.grf index e4cb38bf..6d1bd3dc 100644 Binary files a/regression/expected/example_industry.grf and b/regression/expected/example_industry.grf differ diff --git a/regression/expected/example_industry.nfo b/regression/expected/example_industry.nfo index ec7ecca9..9311b1bd 100644 --- a/regression/expected/example_industry.nfo +++ b/regression/expected/example_industry.nfo @@ -24,21 +24,19 @@ "VALU" // Name: consume_all_prod -5 * 17 02 0A FF 02 \b3 01 01 08 02 06 03 \b2 09 81 05 82 83 +5 * 17 02 0A FF 02 \b3 01 01 08 02 06 03 \b2 09 80 05 81 82 // Name: consume_all_prod@registers -6 * 97 02 0A FF 89 -7D 02 20 \dxFFFFFFFF -\2sto 1A 20 \dx00000080 -\2r 7D 01 20 \dxFFFFFFFF +6 * 82 02 0A FF 89 +7D 01 20 \dxFFFFFFFF \2/ 1A 20 \dx00000002 -\2+ 7D 80 20 \dxFFFFFFFF -\2sto 1A 20 \dx00000081 +\2+ 7D 02 20 \dxFFFFFFFF +\2sto 1A 20 \dx00000080 \2r 7D 03 20 \dxFFFFFFFF \2* 1A 20 \dx00000002 -\2sto 1A 20 \dx00000082 +\2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 -\2sto 1A 00 \dx00000083 +\2sto 1A 00 \dx00000082 \b1 \wx00FF \dx00000000 \dx00000000 \wx00FF // diff --git a/regression/expected/example_object.grf b/regression/expected/example_object.grf index 017d76c2..89c32ff6 100644 Binary files a/regression/expected/example_object.grf and b/regression/expected/example_object.grf differ diff --git a/regression/expected/example_object.nfo b/regression/expected/example_object.nfo index 3df859e6..3972ee35 100644 --- a/regression/expected/example_object.nfo +++ b/regression/expected/example_object.nfo @@ -56,22 +56,18 @@ 29 cc_grid.png 8bpp 1437 1 64 31 -31 -8 normal // Name: company_land_layout - feature 0F -30 * 31 02 0F FF \b66 \dx00000000 \wx0002 81 +30 * 31 02 0F FF \b66 \dx00000000 \wx0002 80 \dxC0008000 \wx0002 \b0 \b0 80 00 -\dx00000000 \wx0002 \b0 \b0 80 83 +\dx00000000 \wx0002 \b0 \b0 80 81 // Name: company_land_layout@registers - feature 0F -31 * 92 02 0F FF 89 -7D 01 20 \dxFFFFFFFF +31 * 62 02 0F FF 89 +7D 00 20 \dxFFFFFFFF +\2+ 7D 01 20 \dxFFFFFFFF \2sto 1A 20 \dx00000080 \2r 7D 00 20 \dxFFFFFFFF -\2+ 7D 80 20 \dxFFFFFFFF -\2sto 1A 20 \dx00000081 -\2r 7D 01 20 \dxFFFFFFFF -\2sto 1A 20 \dx00000082 -\2r 7D 00 20 \dxFFFFFFFF -\2+ 7D 82 20 \dxFFFFFFFF -\2sto 1A 00 \dx00000083 +\2+ 7D 01 20 \dxFFFFFFFF +\2sto 1A 00 \dx00000081 \b1 \wx00FF \dx00000000 \dx00000000 \wx00FF //