diff --git a/nml/actions/action2var.py b/nml/actions/action2var.py index d7f06dd1..875a1387 100644 --- a/nml/actions/action2var.py +++ b/nml/actions/action2var.py @@ -1259,11 +1259,20 @@ def parse_varaction2(switch_block): # Computed result is not returned, but there are no ranges # Add one range, to avoid the nvar == 0 bear trap offset += 10 + range_result, range_comment = parse_result( + expression.SpriteGroupRef(expression.Identifier("CB_FAILED", None), [], None), + action_list, + act6, + offset, + varaction2, + none_result, + switch_block.var_range, + ) varaction2.ranges.append( VarAction2Range( expression.ConstantNumeric(1), expression.ConstantNumeric(0), - expression.ConstantNumeric(0), + range_result, "Bogus range to avoid nvar == 0", ) ) diff --git a/regression/expected/013_train_callback.grf b/regression/expected/013_train_callback.grf index 607c77f0..d1daeed3 100644 Binary files a/regression/expected/013_train_callback.grf and b/regression/expected/013_train_callback.grf differ diff --git a/regression/expected/013_train_callback.nfo b/regression/expected/013_train_callback.nfo index 4184fe60..96ffa9ae 100644 --- a/regression/expected/013_train_callback.nfo +++ b/regression/expected/013_train_callback.nfo @@ -149,7 +149,7 @@ FF \wx00FD // No default specified -> fail callback // Name: bulk_wagon_cb_weight_switch -52 * 53 02 00 FD 89 +52 * 53 02 00 FF 89 47 00 \dx000000FF \b4 \wx8012 \dx00000013 \dx00000013 // 19 .. 19: return 18; @@ -159,11 +159,11 @@ FF \wx00FD // No default specified -> fail callback // Name: bulk_wagon_cb_name_switch -53 * 30 02 00 FF 89 +53 * 30 02 00 FD 89 1A 20 \dx0000DC00 \2sto 1A 00 \dx00000100 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FD \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return string(STR_JUST_STRING); // param[125] = (param[1] * 5000) @@ -263,11 +263,11 @@ FF 31 01 // Name: @action3_0 -74 * 33 02 00 FD 89 +74 * 33 02 00 FF 89 10 00 \dx000000FF \b2 \wx00FE \dx00000014 \dx00000014 // bulk_wagon_cb_capacity_switch; -\wx00FD \dx00000016 \dx00000016 // bulk_wagon_cb_weight_switch; +\wx00FF \dx00000016 \dx00000016 // bulk_wagon_cb_weight_switch; \wx00FC // bulk_wagon_graphics_switch; // Name: @action3_1 @@ -279,11 +279,11 @@ FF \wx00FC // bulk_wagon_graphics_switch; // Name: @action3_2 -76 * 33 02 00 FD 89 +76 * 33 02 00 FF 89 0C 00 \dx0000FFFF \b2 \wx00FE \dx00000015 \dx00000015 // bulk_wagon_cb_capacity_switch; -\wx00FD \dx00000036 \dx00000036 // @action3_0; +\wx00FF \dx00000036 \dx00000036 // @action3_0; \wx00FC // bulk_wagon_graphics_switch; // Name: @action3_3 @@ -291,10 +291,10 @@ FF 0C 00 \dx0000FFFF \b2 \wx00FB \dx00000036 \dx00000036 // @action3_1; -\wx00FF \dx00000161 \dx00000161 // bulk_wagon_cb_name_switch; +\wx00FD \dx00000161 \dx00000161 // bulk_wagon_cb_name_switch; \wx00FC // bulk_wagon_graphics_switch; 78 * 12 03 00 01 FF \wx0074 \b1 FF \wx00FC // @action3_3; -\wx00FD // @action3_2; +\wx00FF // @action3_2; diff --git a/regression/expected/019_switch.grf b/regression/expected/019_switch.grf index 5ceb1c15..296c3e2a 100644 Binary files a/regression/expected/019_switch.grf and b/regression/expected/019_switch.grf differ diff --git a/regression/expected/019_switch.nfo b/regression/expected/019_switch.nfo index abb465a0..9cf8eeca 100644 --- a/regression/expected/019_switch.nfo +++ b/regression/expected/019_switch.nfo @@ -18,66 +18,66 @@ 2 * 52 08 08 "NML\19" "NML regression test" 00 "A test newgrf testing NML" 00 3 * 51 04 00 FF 03 \wxD000 "\98coal" 00 "\98diamonds" 00 "\98Extra info for coal mine: \7B" 00 +// Name: @CB_FAILED_PROD +4 * 15 02 0A FF 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 + +// Name: @CB_FAILED0A +5 * 23 02 0A FF 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FF // Non-graphics callback, return graphics result + // Name: return_switch -4 * 38 02 0A FF 89 +6 * 38 02 0A FE 89 24 60 \dxFFFFFFFF \dxFFFFF862 \dx00000001 \2psto 1A 00 \dx00000001 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return 0; // Name: coal_mine_subtype_switch // a : register 80 -5 * 48 02 0A FF 89 +7 * 48 02 0A FE 89 7D 80 20 \dxFFFFFFFF // a \2psto 1A 20 \dx00000000 \2r 02 00 \dx000000FF \b2 \wx8000 \dx00000000 \dx0000000A // 0 .. 10: return string(STR_COALMINE_MONTH_0_10); -\wx00FF \dx0000000D \dx0000000D // 13 .. 13: return_switch; +\wx00FE \dx0000000D \dx0000000D // 13 .. 13: return_switch; \wx8001 // default: return string(STR_COALMINE_MONTH_11); -6 * 11 00 0A \b2 01 FF \wx0000 +8 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -7 * 11 00 0A \b2 01 FF \wx0000 +9 * 11 00 0A \b2 01 FF \wx0000 21 40 22 03 // Name: @return_action_0 -8 * 30 02 0A FF 89 +10 * 30 02 0A FE 89 1A 20 \dx00000004 \2sto 1A 00 \dx00000080 \b1 -\wx00FF \dx00000000 \dx00000000 // coal_mine_subtype_switch -\wx00FF // coal_mine_subtype_switch +\wx00FE \dx00000000 \dx00000000 // coal_mine_subtype_switch +\wx00FE // coal_mine_subtype_switch // Name: @return_action_1 -9 * 13 02 0A FE 89 +11 * 13 02 0A FD 89 10 00 \dx00000001 \b0 \wx8000 // Return computed value -// Name: @CB_FAILED_PROD -10 * 15 02 0A FD 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 - -// Name: @CB_FAILED0A -11 * 23 02 0A FD 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FD // Non-graphics callback, return graphics result - // Name: @action3_0 -12 * 43 02 0A FD 89 +12 * 43 02 0A FF 89 0C 00 \dx0000FFFF \b3 -\wx00FF \dx00000037 \dx00000037 // @return_action_0; +\wx00FE \dx00000037 \dx00000037 // @return_action_0; \wx8002 \dx0000003A \dx0000003A // return string(STR_COALMINE_EXTRA_TEXT); -\wx00FE \dx0000003B \dx0000003B // return var[0x10, 0, 1] -\wx00FD // @CB_FAILED0A; +\wx00FD \dx0000003B \dx0000003B // return var[0x10, 0, 1] +\wx00FF // @CB_FAILED0A; 13 * 7 03 0A 01 00 \b0 -\wx00FD // @action3_0; +\wx00FF // @action3_0; diff --git a/regression/expected/033_procedure.grf b/regression/expected/033_procedure.grf index 30879f71..d6ea541c 100644 Binary files a/regression/expected/033_procedure.grf and b/regression/expected/033_procedure.grf differ diff --git a/regression/expected/033_procedure.nfo b/regression/expected/033_procedure.nfo index 1677a709..bdf590ac 100644 --- a/regression/expected/033_procedure.nfo +++ b/regression/expected/033_procedure.nfo @@ -25,8 +25,18 @@ \b0 \wx8000 // Return computed value +// Name: @CB_FAILED_PROD +4 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 + +// Name: @CB_FAILED0A +5 * 23 02 0A FE 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FE // Non-graphics callback, return graphics result + // Name: @return_action_0 -4 * 66 02 0A FE 89 +6 * 66 02 0A FD 89 1A 20 \dx00000005 \2sto 1A 20 \dx00000088 \2r 7D 86 20 \dxFFFFFFFF // a @@ -40,7 +50,7 @@ // Name: callee // a : register 86 -5 * 67 02 0A FE 89 +7 * 67 02 0A FD 89 45 30 \dx00000003 \2+ 45 38 \dx0000000F \2sto 1A 20 \dx00000087 @@ -49,11 +59,11 @@ \2* 7D 87 20 \dxFFFFFFFF \2+ 7D 86 00 \dxFFFFFFFF // a \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00FE // default: return (a + dumb_add(5, a)) +\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FD // default: return (a + dumb_add(5, a)) // Name: caller2 -6 * 232 02 0A FD 89 +8 * 232 02 0A FC 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -62,7 +72,7 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000001 \2sto 1A 20 \dx00000086 -\2r 7E FE 20 \dxFFFFFFFF // callee(1) +\2r 7E FD 20 \dxFFFFFFFF // callee(1) \2+ 5F 28 \dx0000FFFF \2sto 1A 20 \dx00000082 \2r 43 20 \dxFFFFFFFF @@ -89,7 +99,7 @@ B3 20 \dx00000003 \wx8000 // Return computed value // Name: caller1 -7 * 145 02 0A FF 89 +9 * 145 02 0A FF 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -97,7 +107,7 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000086 -\2r 7E FE 20 \dxFFFFFFFF // callee(0) +\2r 7E FD 20 \dxFFFFFFFF // callee(0) \2sto 1A 20 \dx00000082 \2r 7D 81 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 @@ -112,28 +122,18 @@ B3 20 \dx00000003 \b0 \wx8000 // Return computed value -8 * 11 00 0A \b2 01 FF \wx0000 +10 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -9 * 9 00 0A \b1 01 FF \wx0000 +11 * 9 00 0A \b1 01 FF \wx0000 22 42 -// Name: @CB_FAILED_PROD -10 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 - -// Name: @CB_FAILED0A -11 * 23 02 0A FE 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result - // Name: @action3_0 12 * 33 02 0A FE 89 0C 00 \dx0000FFFF \b2 -\wx00FD \dx0000003B \dx0000003B // caller2; +\wx00FC \dx0000003B \dx0000003B // caller2; \wx00FF \dx0000015F \dx0000015F // caller1; \wx00FE // @CB_FAILED0A; diff --git a/regression/expected/036_procedure_scope.grf b/regression/expected/036_procedure_scope.grf index 4b5cbc69..8baad11d 100644 Binary files a/regression/expected/036_procedure_scope.grf and b/regression/expected/036_procedure_scope.grf differ diff --git a/regression/expected/036_procedure_scope.nfo b/regression/expected/036_procedure_scope.nfo index 4c999721..19cb15bd 100644 --- a/regression/expected/036_procedure_scope.nfo +++ b/regression/expected/036_procedure_scope.nfo @@ -37,29 +37,39 @@ \wx00FF \dx00000000 \dx00000000 // proc_call_optimisation; \wx8001 // return 1; +// Name: @CB_FAILED_PROD +6 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 + +// Name: @CB_FAILED0A +7 * 23 02 0A FE 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FE // Non-graphics callback, return graphics result + // Name: ternary_optimisation -6 * 24 02 0A FF 89 +8 * 24 02 0A FF 89 7E FF 00 \dxFFFFFFFF // @ternary_action_0 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8005 // default: return 5; // Name: dumb_add // a : register 88 // b : register 89 -7 * 22 02 0A FE 89 +9 * 22 02 0A FD 89 7D 88 20 \dxFFFFFFFF // a \2+ 7D 89 00 \dxFFFFFFFF // b \b0 \wx8000 // Return computed value // Name: @return_action_0 -8 * 66 02 0A FD 8A +10 * 66 02 0A FC 8A 1A 20 \dx00000005 \2sto 1A 20 \dx00000088 \2r 7D 86 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000089 -\2r 7E FE 20 \dxFFFFFFFF // dumb_add(5, a) +\2r 7E FD 20 \dxFFFFFFFF // dumb_add(5, a) \2sto 1A 20 \dx00000087 \2r 7D 86 20 \dxFFFFFFFF // a \2+ 7D 87 00 \dxFFFFFFFF @@ -67,12 +77,12 @@ \wx8000 // Return computed value // Name: @return_action_1 -9 * 66 02 0A FC 8A +11 * 66 02 0A FB 8A 1A 20 \dx00000006 \2sto 1A 20 \dx00000088 \2r 7D 86 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000089 -\2r 7E FE 20 \dxFFFFFFFF // dumb_add(6, a) +\2r 7E FD 20 \dxFFFFFFFF // dumb_add(6, a) \2sto 1A 20 \dx00000087 \2r 7D 86 20 \dxFFFFFFFF // a \2+ 7D 87 00 \dxFFFFFFFF @@ -81,7 +91,7 @@ // Name: callee // a : register 86 -10 * 110 02 0A FC 8A +12 * 110 02 0A FB 8A 92 22 \dx00000001 \2* 1A 20 \dx00000004 \2sto 1A 20 \dx00000087 @@ -96,11 +106,11 @@ \2* 7D 88 20 \dxFFFFFFFF \2+ 7D 86 00 \dxFFFFFFFF // a \b1 -\wx00FD \dx00000000 \dx00000005 // 0 .. 5: return (a + dumb_add(5, a)) -\wx00FC // default: return (a + dumb_add(6, a)) +\wx00FC \dx00000000 \dx00000005 // 0 .. 5: return (a + dumb_add(5, a)) +\wx00FB // default: return (a + dumb_add(6, a)) // Name: caller2 -11 * 232 02 0A FD 89 +13 * 232 02 0A FC 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -109,7 +119,7 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000001 \2sto 1A 20 \dx00000086 -\2r 7E FC 20 \dxFFFFFFFF // callee(1) +\2r 7E FB 20 \dxFFFFFFFF // callee(1) \2+ 5F 28 \dx0000FFFF \2sto 1A 20 \dx00000082 \2r 43 20 \dxFFFFFFFF @@ -121,13 +131,13 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000088 \2r 46 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FE 20 \dxFFFFFFFF // dumb_add(var[0x45, 28, 15], var[0x46, 0, -1]) +\2r 7E FD 20 \dxFFFFFFFF // dumb_add(var[0x45, 28, 15], var[0x46, 0, -1]) \2sto 1A 20 \dx00000085 \2r 7D 84 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 \2r 7D 85 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FE 20 \dxFFFFFFFF // dumb_add(1, dumb_add(var[0x45, 28, 15], var[0x46, 0, -1])) +\2r 7E FD 20 \dxFFFFFFFF // dumb_add(1, dumb_add(var[0x45, 28, 15], var[0x46, 0, -1])) \2* 7D 83 20 \dxFFFFFFFF \2* 7D 82 20 \dxFFFFFFFF \2* 7D 81 20 \dxFFFFFFFF @@ -136,7 +146,7 @@ B3 20 \dx00000003 \wx8000 // Return computed value // Name: caller1 -12 * 145 02 0A FE 89 +14 * 145 02 0A FD 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -144,13 +154,13 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000086 -\2r 7E FC 20 \dxFFFFFFFF // callee(0) +\2r 7E FB 20 \dxFFFFFFFF // callee(0) \2sto 1A 20 \dx00000082 \2r 7D 81 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 \2r 7D 82 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FE 20 \dxFFFFFFFF // dumb_add(var[0x5F, 8, 65535], callee(0)) +\2r 7E FD 20 \dxFFFFFFFF // dumb_add(var[0x5F, 8, 65535], callee(0)) \2sto 1A 20 \dx00000083 \2r 45 3C \dx0000000F \2+ 46 20 \dxFFFFFFFF @@ -159,33 +169,23 @@ B3 20 \dx00000003 \b0 \wx8000 // Return computed value -13 * 11 00 0A \b2 01 FF \wx0000 +15 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -14 * 11 00 0A \b2 01 FF \wx0000 +16 * 11 00 0A \b2 01 FF \wx0000 21 01 22 42 -// Name: @CB_FAILED_PROD -15 * 15 02 0A FC 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 - -// Name: @CB_FAILED0A -16 * 23 02 0A FC 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FC // Non-graphics callback, return graphics result - // Name: @action3_0 -17 * 43 02 0A FC 89 +17 * 43 02 0A FE 89 0C 00 \dx0000FFFF \b3 \wx00FF \dx00000022 \dx00000022 // ternary_optimisation; -\wx00FD \dx0000003B \dx0000003B // caller2; -\wx00FE \dx0000015F \dx0000015F // caller1; -\wx00FC // @CB_FAILED0A; +\wx00FC \dx0000003B \dx0000003B // caller2; +\wx00FD \dx0000015F \dx0000015F // caller1; +\wx00FE // @CB_FAILED0A; 18 * 7 03 0A 01 00 \b0 -\wx00FC // @action3_0; +\wx00FE // @action3_0; diff --git a/regression/expected/039_storage.grf b/regression/expected/039_storage.grf index 06557e87..8aa90273 100644 Binary files a/regression/expected/039_storage.grf and b/regression/expected/039_storage.grf differ diff --git a/regression/expected/039_storage.nfo b/regression/expected/039_storage.nfo index d62cdd16..75d28b6e 100644 --- a/regression/expected/039_storage.nfo +++ b/regression/expected/039_storage.nfo @@ -16,8 +16,18 @@ 00 00 2 * 52 08 08 "NML\39" "NML regression test" 00 "A test newgrf testing NML" 00 +// Name: @CB_FAILED_PROD +3 * 15 02 0A FF 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 + +// Name: @CB_FAILED0A +4 * 23 02 0A FF 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FF // Non-graphics callback, return graphics result + // Name: switch_storage2 -3 * 96 02 0A FF 8A +5 * 96 02 0A FE 8A 1A 20 \dxFFFFFFFF \2sto 1A 20 \dx00000100 \2r 1A 20 \dx44495247 @@ -30,42 +40,32 @@ \2+ 7D 80 20 \dxFFFFFFFF \2psto 1A 00 \dx00000000 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return 0; // Name: switch_storage1 -4 * 38 02 0A FF 89 +6 * 38 02 0A FE 89 7C 00 20 \dxFFFFFFFF \2+ 1A 20 \dx00000001 \2psto 1A 00 \dx00000000 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00FF // default: switch_storage2; +\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FE // default: switch_storage2; -5 * 11 00 0A \b2 01 FF \wx0000 +7 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -6 * 9 00 0A \b1 01 FF \wx0000 +8 * 9 00 0A \b1 01 FF \wx0000 21 20 -// Name: @CB_FAILED_PROD -7 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 - -// Name: @CB_FAILED0A -8 * 23 02 0A FE 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result - // Name: @action3_0 -9 * 23 02 0A FE 89 +9 * 23 02 0A FF 89 0C 00 \dx0000FFFF \b1 -\wx00FF \dx00000035 \dx00000035 // switch_storage1; -\wx00FE // @CB_FAILED0A; +\wx00FE \dx00000035 \dx00000035 // switch_storage1; +\wx00FF // @CB_FAILED0A; 10 * 7 03 0A 01 00 \b0 -\wx00FE // @action3_0; +\wx00FF // @action3_0; diff --git a/regression/expected/example_industry.grf b/regression/expected/example_industry.grf index 6d1bd3dc..9b9474a9 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 9311b1bd..adafcae6 100644 --- a/regression/expected/example_industry.nfo +++ b/regression/expected/example_industry.nfo @@ -65,15 +65,25 @@ \wx00FE \dx00000000 \dx00000000 // 0 .. 0: do_nothing_prod; \wx00FF // default: consume_all_prod; +// Name: @CB_FAILED_PROD +10 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 + +// Name: @CB_FAILED0A +11 * 23 02 0A FE 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FE // Non-graphics callback, return graphics result + // Name: extra_text_switch -10 * 31 02 0A FE 89 +12 * 31 02 0A FD 89 6A 05 20 \dxFFFFFFFF \2sto 1A 00 \dx00000100 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return string(STR_INDUSTRY_EXTRA_TEXT); -11 * 27 00 0A \b6 01 FF \wx0000 +13 * 27 00 0A \b6 01 FF \wx0000 08 06 09 06 25 \b2 @@ -83,37 +93,27 @@ 27 \b2 00 00 28 \b0 \b0 -12 * 11 00 0A \b2 01 FF \wx0000 +14 * 11 00 0A \b2 01 FF \wx0000 21 02 22 01 -// Name: @CB_FAILED_PROD -13 * 15 02 0A FD 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 - -// Name: @CB_FAILED0A -14 * 23 02 0A FD 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FD // Non-graphics callback, return graphics result - // Name: @action3_0 15 * 23 02 0A FF 89 18 00 \dx000000FF \b1 \wx00FF \dx00000000 \dx00000000 // factory_production_switch; -\wx00FD // @CB_FAILED0A; +\wx00FE // @CB_FAILED0A; // Name: @action3_1 -16 * 33 02 0A FD 89 +16 * 33 02 0A FE 89 0C 00 \dx0000FFFF \b2 \wx00FF \dx00000000 \dx00000000 // @action3_0; -\wx00FE \dx0000003A \dx0000003A // extra_text_switch; -\wx00FD // @CB_FAILED0A; +\wx00FD \dx0000003A \dx0000003A // extra_text_switch; +\wx00FE // @CB_FAILED0A; 17 * 7 03 0A 01 00 \b0 -\wx00FD // @action3_1; +\wx00FE // @action3_1; 18 * 13 00 09 \b3 01 FF \wx0000 08 27 diff --git a/regression/expected/example_object.grf b/regression/expected/example_object.grf index 89c32ff6..afa90177 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 3972ee35..468db217 100644 --- a/regression/expected/example_object.nfo +++ b/regression/expected/example_object.nfo @@ -5,7 +5,7 @@ // Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% // Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags -0 * 4 \d37 +0 * 4 \d39 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000001 @@ -72,8 +72,18 @@ \wx00FF \dx00000000 \dx00000000 \wx00FF // +// Name: @CB_FAILED_LAYOUT0F +32 * 17 02 0F FE \b0 \dx00000000 +\dx00000000 \b0 \b0 \b0 \b0 \b0 +// Name: @CB_FAILED0F +33 * 23 02 0F FE 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FE // Non-graphics callback, return graphics result + // Name: company_land_terrain_switch -32 * 470 02 0F FE 89 +34 * 470 02 0F FD 89 41 28 \dx0000001F \2cmp 1A 20 \dx0000001E \2& 1A 20 \dx00000001 @@ -138,21 +148,21 @@ \2+ 7D 8A 20 \dxFFFFFFFF \2sto 1A 00 \dx00000001 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx00FF // default: company_land_layout; // Name: company_land_purchase_switch -33 * 51 02 0F FF 89 +35 * 51 02 0F FF 89 1A 20 \dx00000000 \2sto 1A 20 \dx00000000 \2r 1A 20 \dx00000F8D \2sto 1A 20 \dx00000001 \2r 1A 00 \dx00000001 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx00FF // default: company_land_layout; -34 * 43 00 0F \b12 01 FF \wx0000 +36 * 43 00 0F \b12 01 FF \wx0000 08 "INFR" 09 \wxD000 0A \wxD001 @@ -166,19 +176,19 @@ 16 00 17 01 -35 * 10 00 0F \b1 01 FF \wx0000 +37 * 10 00 0F \b1 01 FF \wx0000 15 \wx0011 // Name: @action3_0 -36 * 43 02 0F FF 89 +38 * 43 02 0F FF 89 0C 00 \dx0000FFFF \b3 \wx00FF \dx00000000 \dx00000000 // company_land_purchase_switch; \wx8400 \dx00000157 \dx00000157 // return 1024; \wx8002 \dx0000015C \dx0000015C // return string(STR_NAME_COMPANY_LAND); -\wx00FE // company_land_terrain_switch; +\wx00FD // company_land_terrain_switch; -37 * 10 03 0F 01 00 \b1 +39 * 10 03 0F 01 00 \b1 FF \wx00FF // @action3_0; -\wx00FE // company_land_terrain_switch; +\wx00FD // company_land_terrain_switch; diff --git a/regression/expected/example_train.grf b/regression/expected/example_train.grf index dfe9ddb3..00b39524 100644 Binary files a/regression/expected/example_train.grf and b/regression/expected/example_train.grf differ diff --git a/regression/expected/example_train.nfo b/regression/expected/example_train.nfo index 86887807..a9f22c1c 100644 --- a/regression/expected/example_train.nfo +++ b/regression/expected/example_train.nfo @@ -488,7 +488,7 @@ FF \wx00FD // @action3_4; 1A 20 \dx80000000 \2sto 1A 00 \dx00000100 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx00F1 // default: set_cargo_wagon; // Name: set_cargo_wagon_load - feature 00 @@ -501,7 +501,7 @@ FF \wx00FD // @action3_4; 1A 20 \dx00000000 \2sto 1A 00 \dx00000100 \b1 -\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx00FD // default: set_cargo_wagon_load; // Name: cargo_wagon_switch_graphics