From 2583ad397aca4339a5de124a05859ed4019d4501 Mon Sep 17 00:00:00 2001 From: Cyprian Klimaszewski Date: Fri, 5 Jun 2026 20:47:27 +0200 Subject: [PATCH] Change: Use explicit (Var)Action2 results for "callback failed" and "calculated result". --- nml/actions/action1.py | 19 -- nml/actions/action2layout.py | 20 -- nml/actions/action2production.py | 14 -- nml/actions/action2var.py | 92 +--------- nml/expression/spritegroup_ref.py | 4 +- regression/expected/006_vehicle.grf | Bin 6709 -> 6667 bytes regression/expected/006_vehicle.nfo | 32 +--- regression/expected/013_train_callback.grf | Bin 7873 -> 7831 bytes regression/expected/013_train_callback.nfo | 88 ++++----- regression/expected/019_switch.grf | Bin 493 -> 445 bytes regression/expected/019_switch.nfo | 44 ++--- regression/expected/026_asl.grf | Bin 1991 -> 1941 bytes regression/expected/026_asl.nfo | 16 +- regression/expected/033_procedure.grf | Bin 833 -> 785 bytes regression/expected/033_procedure.nfo | 48 ++--- regression/expected/035_switch_scope.grf | Bin 706 -> 656 bytes regression/expected/035_switch_scope.nfo | 20 +- regression/expected/036_procedure_scope.grf | Bin 1070 -> 1022 bytes regression/expected/036_procedure_scope.nfo | 66 +++---- regression/expected/038_optimised_scope.grf | Bin 731 -> 678 bytes regression/expected/038_optimised_scope.nfo | 48 ++--- regression/expected/039_storage.grf | Bin 410 -> 362 bytes regression/expected/039_storage.nfo | 34 ++-- regression/expected/040_station.grf | Bin 1307 -> 1267 bytes regression/expected/040_station.nfo | 22 +-- regression/expected/042_badges.grf | Bin 1025 -> 972 bytes regression/expected/042_badges.nfo | 52 ++---- regression/expected/example_industry.grf | Bin 903 -> 855 bytes regression/expected/example_industry.nfo | 42 ++--- regression/expected/example_object.grf | Bin 7095 -> 7045 bytes regression/expected/example_object.nfo | 32 ++-- regression/expected/example_train.grf | Bin 12461 -> 12419 bytes regression/expected/example_train.nfo | 194 +++++++++----------- 33 files changed, 297 insertions(+), 590 deletions(-) diff --git a/nml/actions/action1.py b/nml/actions/action1.py index ed3508776..a34b7467d 100644 --- a/nml/actions/action1.py +++ b/nml/actions/action1.py @@ -240,22 +240,3 @@ def get_action1_index(spriteset, feature): if spriteset in spriteset_collection.spritesets: return spriteset_collection.get_index(spriteset) assert False - - -def make_cb_failure_action1(feature): - """ - Create an action1 that may be used for a callback failure - If the last action1 is of the correct feature, no new action1 is needed - Else, add a new action1 with 1 spriteset containing 0 sprites - - @param feature: Feature of the requested action 1 - @type feature: C{int} - - @return: List of actions to append (if any) and action1 index to use - @rtype: C{tuple} of (C{list} of L{BaseAction}, C{int}) - """ - if feature in spriteset_collections: - actions = [] - else: - actions = [Action1(feature, 0, 1, 0)] - return (actions, 0) # Index is currently always 0, but will change with ext. A1 diff --git a/nml/actions/action2layout.py b/nml/actions/action2layout.py index 1371e6340..6b57dd21b 100644 --- a/nml/actions/action2layout.py +++ b/nml/actions/action2layout.py @@ -610,26 +610,6 @@ def get_layout_action2s(spritelayout, feature): return actions -def make_empty_layout_action2(feature, pos): - """ - Make an empty layout action2 - For use with failed callbacks - - @param feature: Feature of the sprite layout to create - @type feature: C{int} - - @param pos: Positional context. - @type pos: L{Position} - - @return: The created sprite layout action2 - @rtype: L{Action2Layout} - """ - layout = ParsedSpriteLayout() - layout.ground_sprite = Action2LayoutSprite(feature, Action2LayoutSpriteType.GROUND) - layout.ground_sprite.set_param(expression.Identifier("sprite"), expression.ConstantNumeric(0)) - return Action2Layout(feature, "@CB_FAILED_LAYOUT{:02X}".format(feature), pos, layout, []) - - class StationSpriteset(expression.Expression): def __init__(self, spriteset, args, var10, pos=None): expression.Expression.__init__(self, pos) diff --git a/nml/actions/action2production.py b/nml/actions/action2production.py index 07f7388a7..8b673b32e 100644 --- a/nml/actions/action2production.py +++ b/nml/actions/action2production.py @@ -197,17 +197,3 @@ def resolve_cargoitem(item): prod_action = Action2Production(produce.name.value, produce.pos, 2, sub_in, add_out, again) return finish_production_actions(produce, prod_action, action_list, varact2parser) - - -def make_empty_production_action2(pos): - """ - Make an empty production action2 - For use with failed callbacks - - @param pos: Positional context. - @type pos: L{Position} - - @return: The created production action2 - @rtype: L{Action2Production} - """ - return Action2Production("@CB_FAILED_PROD", pos, 0, [0, 0, 0], [0, 0], 0) diff --git a/nml/actions/action2var.py b/nml/actions/action2var.py index 128e6237e..541e23774 100644 --- a/nml/actions/action2var.py +++ b/nml/actions/action2var.py @@ -920,80 +920,6 @@ def create_return_action(expr, feature, name, var_range): return (action_list, ref) -failed_cb_results = {} - - -def get_failed_cb_result(feature, action_list, parent_action, pos): - """ - Get a sprite group reference to use for a failed callback - The actions needed are created on first use, then cached in L{failed_cb_results} - - @param feature: Feature to use - @type feature: C{int} - - @param action_list: Action list to append any extra actions to - @type action_list: C{list} of L{BaseAction} - - @param parent_action: Reference to the action of which this is a result - @type parent_action: L{BaseAction} - - @param pos: Positional context. - @type pos: L{Position} - - @return: Sprite group reference to use - @rtype: L{SpriteGroupRef} - """ - if feature in failed_cb_results: - varaction2 = failed_cb_results[feature] - else: - # Create action2 (+ action1, if needed) - # Import here to avoid circular imports - from nml.actions import action1, action2layout, action2production, action2real - - if feature == 0x0A: - # Industries -> production action2 - act2 = action2production.make_empty_production_action2(pos) - elif feature in (0x07, 0x09, 0x0F, 0x11, 0x14): - # Tile layout action2 - act2 = action2layout.make_empty_layout_action2(feature, pos) - else: - # Normal action2 - act1_actions, act1_index = action1.make_cb_failure_action1(feature) - action_list.extend(act1_actions) - act2 = action2real.make_simple_real_action2( - feature, "@CB_FAILED_REAL{:02X}".format(feature), pos, act1_index - ) - action_list.append(act2) - - # Create varaction2, to choose between returning graphics and 0, depending on CB - varact2parser = Varaction2Parser(feature) - varact2parser.parse_expr( - expression.Variable(expression.ConstantNumeric(0x0C), mask=expression.ConstantNumeric(0xFFFF)) - ) - - varaction2 = Action2Var(feature, "@CB_FAILED{:02X}".format(feature), pos, 0x89) - varaction2.var_list = varact2parser.var_list - - varaction2.ranges.append( - VarAction2Range( - expression.ConstantNumeric(0), - expression.ConstantNumeric(0), - expression.ConstantNumeric(0), - "graphics callback -> return 0", - ) - ) - varaction2.default_result = expression.SpriteGroupRef(expression.Identifier(act2.name), [], None, act2) - varaction2.default_comment = "Non-graphics callback, return graphics result" - action2.add_ref(varaction2.default_result, varaction2) - - action_list.append(varaction2) - failed_cb_results[feature] = varaction2 - - ref = expression.SpriteGroupRef(expression.Identifier(varaction2.name), [], None, varaction2) - action2.add_ref(ref, parent_action) - return ref - - def parse_sg_ref_result(result, action_list, parent_action, var_range): """ Parse a result that is a sprite group reference. @@ -1013,8 +939,8 @@ def parse_sg_ref_result(result, action_list, parent_action, var_range): @return: Result to use in the calling varaction2 @rtype: L{SpriteGroupRef} """ - if result.name.value == "CB_FAILED": - return get_failed_cb_result(parent_action.feature, action_list, parent_action, result.pos) + if result.name.value == "" or result.name.value == "CB_FAILED": + return result target = action2.resolve_spritegroup(result.name) if not result.act2 else None @@ -1210,19 +1136,7 @@ def parse_varaction2(switch_block): x is not None and x.value is None for x in [r.result for r in switch_block.body.ranges] + [switch_block.body.default] ): - # Computed result is returned in at least one result - if len(switch_block.body.ranges) == 0: - # There is only a default, which is 'return computed result', so we're fine - none_result = expression.ConstantNumeric(0) # Return value does not matter - else: - # Add an extra action to return the computed value - extra_actions, none_result = create_return_action( - expression.Variable(expression.ConstantNumeric(0x1C)), - feature, - switch_block.name.value + "@return", - 0x89, - ) - action_list.extend(extra_actions) + none_result = expression.SpriteGroupRef(expression.StringLiteral("", 0), [], 0) used_ranges = [] for r in switch_block.body.ranges: diff --git a/nml/expression/spritegroup_ref.py b/nml/expression/spritegroup_ref.py index 834726f92..4ced025b1 100644 --- a/nml/expression/spritegroup_ref.py +++ b/nml/expression/spritegroup_ref.py @@ -70,8 +70,10 @@ def get_action2_id(self, feature): """ if self.act2 is not None: return self.act2.id + if self.name.value == "": + return 0x7FFE if self.name.value == "CB_FAILED": - return 0 # 0 serves as a failed CB result because it is never used + return 0x7FFF try: spritegroup = action2.resolve_spritegroup(self.name) except generic.ScriptError: diff --git a/regression/expected/006_vehicle.grf b/regression/expected/006_vehicle.grf index 4000e1f9b81bcf337e6e1a2720c3b0497666165a..c2c84b56dd3fb0cc2ddbf6a26e02c4c0aa56b9d5 100644 GIT binary patch delta 108 zcmdmL(rqHjz~CO_*2K#t#g)Uvz`(!)#Q&u>ie6{r5CJin82?U|W0Ela+bN|0 return 0 -\wx00FD // Non-graphics callback, return graphics result - // Name: @return_action_0 -24 * 20 02 01 FC 89 +22 * 20 02 01 FD 89 1A 20 \dx00000008 \2- 1C 00 \dxFFFFFFFF \b0 \wx8000 // Return computed value // Name: @action3_1 -25 * 38 02 01 FC 89 +23 * 38 02 01 FD 89 1A 20 \dx00000000 \2sto 1A 20 \dx00000080 \2r 7E FF 00 \dxFFFFFFFF // switch_length(0) \b1 -\wx00FD \dx0000FFFF \dx0000FFFF // @CB_FAILED01; -\wx00FC // return (8 - var[0x1C, 0, -1]) +\wx7FFF \dx0000FFFF \dx0000FFFF // CB_FAILED; +\wx00FD // return (8 - var[0x1C, 0, -1]) // Name: @action3_0 -26 * 23 02 01 FC 89 +24 * 23 02 01 FD 89 10 00 \dx000000FF \b1 -\wx00FC \dx00000023 \dx00000023 // @action3_1; +\wx00FD \dx00000023 \dx00000023 // @action3_1; \wx00FE // foster_express_set; // Name: @action3_2 -27 * 23 02 01 FE 89 +25 * 23 02 01 FE 89 0C 00 \dx0000FFFF \b1 -\wx00FC \dx00000036 \dx00000036 // @action3_0; +\wx00FD \dx00000036 \dx00000036 // @action3_0; \wx00FE // foster_express_set; -28 * 9 03 01 01 FF \wx0059 \b0 +26 * 9 03 01 01 FF \wx0059 \b0 \wx00FE // @action3_2; diff --git a/regression/expected/013_train_callback.grf b/regression/expected/013_train_callback.grf index fd8c1f115f339d152e8aecfd226eca19c0dacfca..5e5b8f3293d2669f71fd9d86639c4d4d269c3c14 100644 GIT binary patch delta 154 zcmX?TJKa{4fx$hV z#X$Ohy&Q!5zf($q;SK`>pA-WFBM|+s-yFlTl2PPervSr$pc1CP3?e`Zg#S&JWU~ND i@G$%b$^a#Rc7yT1$*F9rjQ=Nhvq>@j+q{fTS^@wR;3-1@ delta 196 zcmbPkd(c*tfx$hz_IkSQEUj{h{_iv|^0>d2!20kf}ZU)A` z44aKuRx*nG?-XDF8py!(k3j@Tf$;yy?^!K?5)i9^5 return 0 -\wx00FD // Non-graphics callback, return graphics result - // Name: bulk_wagon_cb_capacity_switch -51 * 83 02 00 FE 89 +49 * 83 02 00 FD 89 47 00 \dx000000FF \b7 \wx8019 \dx0000002F \dx0000002F // 47 .. 47: return 25; @@ -146,70 +134,70 @@ FF \wx8019 \dx0000001B \dx0000001B // 27 .. 27: return 25; \wx8014 \dx0000001A \dx0000001A // 26 .. 26: return 20; \wx8019 \dx00000020 \dx00000020 // 32 .. 32: return 25; -\wx00FD // No default specified -> fail callback +\wx7FFF // No default specified -> fail callback // Name: bulk_wagon_cb_weight_switch -52 * 53 02 00 FF 89 +50 * 53 02 00 FE 89 47 00 \dx000000FF \b4 \wx8012 \dx00000013 \dx00000013 // 19 .. 19: return 18; \wx8012 \dx0000000C \dx0000000C // 12 .. 12: return 18; \wx8012 \dx0000000D \dx0000000D // 13 .. 13: return 18; \wx8012 \dx0000001A \dx0000001A // 26 .. 26: return 18; -\wx00FD // No default specified -> fail callback +\wx7FFF // No default specified -> fail callback // Name: bulk_wagon_cb_name_switch -53 * 30 02 00 FD 89 +51 * 30 02 00 FF 89 1A 20 \dx0000DC00 \2sto 1A 00 \dx00000100 \b1 -\wx00FD \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return string(STR_JUST_STRING); // param[125] = (param[1] * 5000) -54 * 9 0D 7D \D* 01 FF \dx00001388 +52 * 9 0D 7D \D* 01 FF \dx00001388 // param[126] = (param[125] + 698) -55 * 9 0D 7E \D+ 7D FF \dx000002BA +53 * 9 0D 7E \D+ 7D FF \dx000002BA // param[127] = (param[126] / 1397) -56 * 9 0D 7F \D/ 7E FF \dx00000575 +54 * 9 0D 7F \D/ 7E FF \dx00000575 // param[124] = (param[2] * 12500) -57 * 9 0D 7C \D* 02 FF \dx000030D4 +55 * 9 0D 7C \D* 02 FF \dx000030D4 // param[125] = (param[124] + 6286) -58 * 9 0D 7D \D+ 7C FF \dx0000188E +56 * 9 0D 7D \D+ 7C FF \dx0000188E // param[126] = (param[125] / 12573) -59 * 9 0D 7E \D/ 7D FF \dx0000311D +57 * 9 0D 7E \D/ 7D FF \dx0000311D // param[123] = (param[3] * 8) -60 * 9 0D 7B \D* 03 FF \dx00000008 +58 * 9 0D 7B \D* 03 FF \dx00000008 // param[124] = (param[123] + 2) -61 * 9 0D 7C \D+ 7B FF \dx00000002 +59 * 9 0D 7C \D+ 7B FF \dx00000002 // param[125] = (param[124] / 5) -62 * 9 0D 7D \D/ 7C FF \dx00000005 +60 * 9 0D 7D \D/ 7C FF \dx00000005 // param[122] = (param[4] * 2965) -63 * 9 0D 7A \D* 04 FF \dx00000B95 +61 * 9 0D 7A \D* 04 FF \dx00000B95 // param[123] = (param[122] + 1105) -64 * 9 0D 7B \D+ 7A FF \dx00000451 +62 * 9 0D 7B \D+ 7A FF \dx00000451 // param[124] = (param[123] / 2211) -65 * 9 0D 7C \D/ 7B FF \dx000008A3 +63 * 9 0D 7C \D/ 7B FF \dx000008A3 -66 * 22 06 +64 * 22 06 7F 02 FF \wx000B 7E 02 FF \wx000E 7D 02 FF \wx0011 7C 02 FF \wx0014 FF -67 * 22 00 00 \b5 01 FF \wx0074 +65 * 22 00 00 \b5 01 FF \wx0074 09 \wx0024 09 \wx0000 09 \wx0000 @@ -217,17 +205,17 @@ FF 0B \wx0000 // param[127] = (param[1] & 255) -68 * 9 0D 7F \D& 01 FF \dx000000FF +66 * 9 0D 7F \D& 01 FF \dx000000FF // param[126] = (param[1] << -8) -69 * 9 0D 7E \D<< 01 FF \dxFFFFFFF8 +67 * 9 0D 7E \D<< 01 FF \dxFFFFFFF8 -70 * 12 06 +68 * 12 06 7F 01 FF \wx0053 7E 01 FF \wx0055 FF -71 * 88 00 00 \b28 01 FF \wx0074 +69 * 88 00 00 \b28 01 FF \wx0074 06 0F 28 \wx0010 1D \dx00000000 @@ -259,22 +247,22 @@ FF 24 00 25 00 -72 * 27 04 00 7F 01 FF \wx0074 "NML Test bulk wagon" 00 +70 * 27 04 00 7F 01 FF \wx0074 "NML Test bulk wagon" 00 -73 * 11 00 00 \b2 01 FF \wx0074 +71 * 11 00 00 \b2 01 FF \wx0074 1E 08 31 01 // Name: @action3_0 -74 * 33 02 00 FF 89 +72 * 33 02 00 FE 89 10 00 \dx000000FF \b2 -\wx00FE \dx00000014 \dx00000014 // bulk_wagon_cb_capacity_switch; -\wx00FF \dx00000016 \dx00000016 // bulk_wagon_cb_weight_switch; +\wx00FD \dx00000014 \dx00000014 // bulk_wagon_cb_capacity_switch; +\wx00FE \dx00000016 \dx00000016 // bulk_wagon_cb_weight_switch; \wx00FC // bulk_wagon_graphics_switch; // Name: @action3_1 -75 * 33 02 00 FB 89 +73 * 33 02 00 FB 89 10 00 \dx000000FF \b2 \wx801E \dx00000014 \dx00000014 // return 30; @@ -282,22 +270,22 @@ FF \wx00FC // bulk_wagon_graphics_switch; // Name: @action3_2 -76 * 33 02 00 FF 89 +74 * 33 02 00 FE 89 0C 00 \dx0000FFFF \b2 -\wx00FE \dx00000015 \dx00000015 // bulk_wagon_cb_capacity_switch; -\wx00FF \dx00000036 \dx00000036 // @action3_0; +\wx00FD \dx00000015 \dx00000015 // bulk_wagon_cb_capacity_switch; +\wx00FE \dx00000036 \dx00000036 // @action3_0; \wx00FC // bulk_wagon_graphics_switch; // Name: @action3_3 -77 * 33 02 00 FC 89 +75 * 33 02 00 FC 89 0C 00 \dx0000FFFF \b2 \wx00FB \dx00000036 \dx00000036 // @action3_1; -\wx00FD \dx00000161 \dx00000161 // bulk_wagon_cb_name_switch; +\wx00FF \dx00000161 \dx00000161 // bulk_wagon_cb_name_switch; \wx00FC // bulk_wagon_graphics_switch; -78 * 12 03 00 01 FF \wx0074 \b1 +76 * 12 03 00 01 FF \wx0074 \b1 FF \wx00FC // @action3_3; -\wx00FF // @action3_2; +\wx00FE // @action3_2; diff --git a/regression/expected/019_switch.grf b/regression/expected/019_switch.grf index 296c3e2a984407f474a958870de95526d6cf14f1..d384e4a7952d73a704dcdbd29e2a373844092669 100644 GIT binary patch delta 186 zcmaFMyq8&&fx$hT7f|;Ip%hz4zl2+T_6e+=e85fEl-umX}G{FlKRNP_Tx26hn1%ms7+!sP(1Ni5v} diff --git a/regression/expected/019_switch.nfo b/regression/expected/019_switch.nfo index 9cf8eecae..e337cf9f3 100644 --- a/regression/expected/019_switch.nfo +++ b/regression/expected/019_switch.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 \d13 +0 * 4 \d11 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -18,66 +18,56 @@ 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 -6 * 38 02 0A FE 89 +4 * 38 02 0A FF 89 24 60 \dxFFFFFFFF \dxFFFFF862 \dx00000001 \2psto 1A 00 \dx00000001 \b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return 0; // Name: coal_mine_subtype_switch // a : register 80 -7 * 48 02 0A FE 89 +5 * 48 02 0A FF 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); -\wx00FE \dx0000000D \dx0000000D // 13 .. 13: return_switch; +\wx00FF \dx0000000D \dx0000000D // 13 .. 13: return_switch; \wx8001 // default: return string(STR_COALMINE_MONTH_11); -8 * 11 00 0A \b2 01 FF \wx0000 +6 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -9 * 11 00 0A \b2 01 FF \wx0000 +7 * 11 00 0A \b2 01 FF \wx0000 21 40 22 03 // Name: @return_action_0 -10 * 30 02 0A FE 89 +8 * 30 02 0A FF 89 1A 20 \dx00000004 \2sto 1A 00 \dx00000080 \b1 -\wx00FE \dx00000000 \dx00000000 // coal_mine_subtype_switch -\wx00FE // coal_mine_subtype_switch +\wx00FF \dx00000000 \dx00000000 // coal_mine_subtype_switch +\wx00FF // coal_mine_subtype_switch // Name: @return_action_1 -11 * 13 02 0A FD 89 +9 * 13 02 0A FE 89 10 00 \dx00000001 \b0 \wx8000 // Return computed value // Name: @action3_0 -12 * 43 02 0A FF 89 +10 * 43 02 0A FE 89 0C 00 \dx0000FFFF \b3 -\wx00FE \dx00000037 \dx00000037 // @return_action_0; +\wx00FF \dx00000037 \dx00000037 // @return_action_0; \wx8002 \dx0000003A \dx0000003A // return string(STR_COALMINE_EXTRA_TEXT); -\wx00FD \dx0000003B \dx0000003B // return var[0x10, 0, 1] -\wx00FF // @CB_FAILED0A; +\wx00FE \dx0000003B \dx0000003B // return var[0x10, 0, 1] +\wx7FFF // CB_FAILED; -13 * 7 03 0A 01 00 \b0 -\wx00FF // @action3_0; +11 * 7 03 0A 01 00 \b0 +\wx00FE // @action3_0; diff --git a/regression/expected/026_asl.grf b/regression/expected/026_asl.grf index 8630aa03df784d85729c6165ce5fb1df4038a9f2..04ee586f9f1a22b14bd6e44c5446fe4de8aa953a 100644 GIT binary patch delta 45 zcmX@kKb4<{fx$hEFfug2 UB>yo$<^IFu{xNL6&bp5g0DpNESpWb4 diff --git a/regression/expected/026_asl.nfo b/regression/expected/026_asl.nfo index 28c3055cd..f1bae1403 100644 --- a/regression/expected/026_asl.nfo +++ b/regression/expected/026_asl.nfo @@ -146,23 +146,13 @@ F0 F1 F2 F3 F4 F5 00 00 00 00 00 00 00 00 00 FF 22 * 10 00 0F \b1 01 FF \wx0001 15 \wx0008 -// Name: @CB_FAILED_LAYOUT0F -23 * 17 02 0F FE \b0 \dx00000000 -\dx00000000 \b0 \b0 \b0 \b0 \b0 -// Name: @CB_FAILED0F -24 * 23 02 0F FE 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result - // Name: @action3_0 -25 * 23 02 0F FF 89 +23 * 23 02 0F FF 89 0C 00 \dx0000FFFF \b1 -\wx00FE \dx0000015B \dx0000015B // @CB_FAILED0F; +\wx7FFF \dx0000015B \dx0000015B // CB_FAILED; \wx00FF // layout2; -26 * 7 03 0F 01 01 \b0 +24 * 7 03 0F 01 01 \b0 \wx00FF // @action3_0; diff --git a/regression/expected/033_procedure.grf b/regression/expected/033_procedure.grf index d6ea541c2ee156493138f883a671dd5f25dc02b8..ee4e78613c43f4d1bbb87ceeef246fb6aa965e1b 100644 GIT binary patch delta 164 zcmX@eHjzz~fx$h)k@2O0^&{}|Xod}b~%8^{C$0QRvl A82|tP diff --git a/regression/expected/033_procedure.nfo b/regression/expected/033_procedure.nfo index bdf590ac7..b87291db1 100644 --- a/regression/expected/033_procedure.nfo +++ b/regression/expected/033_procedure.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 \d13 +0 * 4 \d11 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -23,20 +23,10 @@ 7D 88 20 \dxFFFFFFFF // a \2+ 7D 89 00 \dxFFFFFFFF // b \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 +\wx7FFE // Return computed value // Name: @return_action_0 -6 * 66 02 0A FD 89 +4 * 66 02 0A FE 89 1A 20 \dx00000005 \2sto 1A 20 \dx00000088 \2r 7D 86 20 \dxFFFFFFFF // a @@ -50,7 +40,7 @@ // Name: callee // a : register 86 -7 * 67 02 0A FD 89 +5 * 67 02 0A FE 89 45 30 \dx00000003 \2+ 45 38 \dx0000000F \2sto 1A 20 \dx00000087 @@ -59,11 +49,11 @@ \2* 7D 87 20 \dxFFFFFFFF \2+ 7D 86 00 \dxFFFFFFFF // a \b1 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00FD // default: return (a + dumb_add(5, a)) +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FE // default: return (a + dumb_add(5, a)) // Name: caller2 -8 * 232 02 0A FC 89 +6 * 232 02 0A FD 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -72,7 +62,7 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000001 \2sto 1A 20 \dx00000086 -\2r 7E FD 20 \dxFFFFFFFF // callee(1) +\2r 7E FE 20 \dxFFFFFFFF // callee(1) \2+ 5F 28 \dx0000FFFF \2sto 1A 20 \dx00000082 \2r 43 20 \dxFFFFFFFF @@ -96,10 +86,10 @@ B3 20 \dx00000003 \2* 7D 81 20 \dxFFFFFFFF \2* 7D 80 00 \dxFFFFFFFF \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value // Name: caller1 -9 * 145 02 0A FF 89 +7 * 145 02 0A FF 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -107,7 +97,7 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000086 -\2r 7E FD 20 \dxFFFFFFFF // callee(0) +\2r 7E FE 20 \dxFFFFFFFF // callee(0) \2sto 1A 20 \dx00000082 \2r 7D 81 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 @@ -120,23 +110,23 @@ B3 20 \dx00000003 \2* 7D 83 20 \dxFFFFFFFF \2* 7D 80 00 \dxFFFFFFFF \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value -10 * 11 00 0A \b2 01 FF \wx0000 +8 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -11 * 9 00 0A \b1 01 FF \wx0000 +9 * 9 00 0A \b1 01 FF \wx0000 22 42 // Name: @action3_0 -12 * 33 02 0A FE 89 +10 * 33 02 0A FF 89 0C 00 \dx0000FFFF \b2 -\wx00FC \dx0000003B \dx0000003B // caller2; +\wx00FD \dx0000003B \dx0000003B // caller2; \wx00FF \dx0000015F \dx0000015F // caller1; -\wx00FE // @CB_FAILED0A; +\wx7FFF // CB_FAILED; -13 * 7 03 0A 01 00 \b0 -\wx00FE // @action3_0; +11 * 7 03 0A 01 00 \b0 +\wx00FF // @action3_0; diff --git a/regression/expected/035_switch_scope.grf b/regression/expected/035_switch_scope.grf index def632dd4c09ba7d219819eb8dc0365b4d40b7ac..727e8e235098a977362aab4dc981fb9cf3f2971b 100644 GIT binary patch delta 65 zcmX@aI)PP`fx$hyv*LgglVF&T<7u!DHaoQyycri1|iw09H8 diff --git a/regression/expected/035_switch_scope.nfo b/regression/expected/035_switch_scope.nfo index 941d467bf..d55faddc3 100644 --- a/regression/expected/035_switch_scope.nfo +++ b/regression/expected/035_switch_scope.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 \d20 +0 * 4 \d18 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -119,26 +119,16 @@ 16 * 9 00 09 \b1 01 FF \wx0000 0E 62 -// Name: @CB_FAILED_LAYOUT09 -17 * 17 02 09 FF \b0 \dx00000000 -\dx00000000 \b0 \b0 \b0 \b0 \b0 -// Name: @CB_FAILED09 -18 * 23 02 09 FF 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FF // Non-graphics callback, return graphics result - // Name: @action3_0 -19 * 53 02 09 FF 89 +17 * 53 02 09 FC 89 0C 00 \dx0000FFFF \b4 \wx00FB \dx00000025 \dx00000025 // var2; \wx00FD \dx00000027 \dx00000027 // var1; \wx00FE \dx00000030 \dx00000030 // random1; \wx00FC \dx0000003C \dx0000003C // random2; -\wx00FF // @CB_FAILED09; +\wx7FFF // CB_FAILED; -20 * 7 03 09 01 00 \b0 -\wx00FF // @action3_0; +18 * 7 03 09 01 00 \b0 +\wx00FC // @action3_0; diff --git a/regression/expected/036_procedure_scope.grf b/regression/expected/036_procedure_scope.grf index 8baad11d7627c0aec7247b4198fff7a70866aa3c..ce623f2adefe7e6b583893a6060d5f225d7fe423 100644 GIT binary patch delta 253 zcmXX=F$w}P5Zok+M^La(5ka)FP+xF1VxgVFVShh3{D4NRJUa=Ne!+j}8w6VmpK!Nv z;<+%xBr~(@E#OL%Xc5g1HQmu4MMNdQ)z8iQwC$DDF5NkD7~zb-m!I;!1%}D#_Sp9( zZPQay+mO$mk8m%G|DGh{j2-(SFG>xT*%4 q&AA9L0xcV)}krH|O;N7*TiOC)Pye56)4uc9Gx^CpHOH5(BX zI;!mac51%Fx|z`fU{{J?s&rarA~`04ke@Thn$G65DD$5xC^X3;?sWrE1ONa4 diff --git a/regression/expected/036_procedure_scope.nfo b/regression/expected/036_procedure_scope.nfo index 19cb15bd5..4446b04f6 100644 --- a/regression/expected/036_procedure_scope.nfo +++ b/regression/expected/036_procedure_scope.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 \d18 +0 * 4 \d16 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -37,39 +37,29 @@ \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 -8 * 24 02 0A FF 89 +6 * 24 02 0A FF 89 7E FF 00 \dxFFFFFFFF // @ternary_action_0 \b1 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8005 // default: return 5; // Name: dumb_add // a : register 88 // b : register 89 -9 * 22 02 0A FD 89 +7 * 22 02 0A FE 89 7D 88 20 \dxFFFFFFFF // a \2+ 7D 89 00 \dxFFFFFFFF // b \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value // Name: @return_action_0 -10 * 66 02 0A FC 8A +8 * 66 02 0A FD 8A 1A 20 \dx00000005 \2sto 1A 20 \dx00000088 \2r 7D 86 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000089 -\2r 7E FD 20 \dxFFFFFFFF // dumb_add(5, a) +\2r 7E FE 20 \dxFFFFFFFF // dumb_add(5, a) \2sto 1A 20 \dx00000087 \2r 7D 86 20 \dxFFFFFFFF // a \2+ 7D 87 00 \dxFFFFFFFF @@ -77,12 +67,12 @@ \wx8000 // Return computed value // Name: @return_action_1 -11 * 66 02 0A FB 8A +9 * 66 02 0A FC 8A 1A 20 \dx00000006 \2sto 1A 20 \dx00000088 \2r 7D 86 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000089 -\2r 7E FD 20 \dxFFFFFFFF // dumb_add(6, a) +\2r 7E FE 20 \dxFFFFFFFF // dumb_add(6, a) \2sto 1A 20 \dx00000087 \2r 7D 86 20 \dxFFFFFFFF // a \2+ 7D 87 00 \dxFFFFFFFF @@ -91,7 +81,7 @@ // Name: callee // a : register 86 -12 * 110 02 0A FB 8A +10 * 110 02 0A FC 8A 92 22 \dx00000001 \2* 1A 20 \dx00000004 \2sto 1A 20 \dx00000087 @@ -106,11 +96,11 @@ \2* 7D 88 20 \dxFFFFFFFF \2+ 7D 86 00 \dxFFFFFFFF // a \b1 -\wx00FC \dx00000000 \dx00000005 // 0 .. 5: return (a + dumb_add(5, a)) -\wx00FB // default: return (a + dumb_add(6, a)) +\wx00FD \dx00000000 \dx00000005 // 0 .. 5: return (a + dumb_add(5, a)) +\wx00FC // default: return (a + dumb_add(6, a)) // Name: caller2 -13 * 232 02 0A FC 89 +11 * 232 02 0A FD 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -119,7 +109,7 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000001 \2sto 1A 20 \dx00000086 -\2r 7E FB 20 \dxFFFFFFFF // callee(1) +\2r 7E FC 20 \dxFFFFFFFF // callee(1) \2+ 5F 28 \dx0000FFFF \2sto 1A 20 \dx00000082 \2r 43 20 \dxFFFFFFFF @@ -131,22 +121,22 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000088 \2r 46 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FD 20 \dxFFFFFFFF // dumb_add(var[0x45, 28, 15], var[0x46, 0, -1]) +\2r 7E FE 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 FD 20 \dxFFFFFFFF // dumb_add(1, dumb_add(var[0x45, 28, 15], var[0x46, 0, -1])) +\2r 7E FE 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 \2* 7D 80 00 \dxFFFFFFFF \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value // Name: caller1 -14 * 145 02 0A FD 89 +12 * 145 02 0A FE 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -154,38 +144,38 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000086 -\2r 7E FB 20 \dxFFFFFFFF // callee(0) +\2r 7E FC 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 FD 20 \dxFFFFFFFF // dumb_add(var[0x5F, 8, 65535], callee(0)) +\2r 7E FE 20 \dxFFFFFFFF // dumb_add(var[0x5F, 8, 65535], callee(0)) \2sto 1A 20 \dx00000083 \2r 45 3C \dx0000000F \2+ 46 20 \dxFFFFFFFF \2* 7D 83 20 \dxFFFFFFFF \2* 7D 80 00 \dxFFFFFFFF \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value -15 * 11 00 0A \b2 01 FF \wx0000 +13 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -16 * 11 00 0A \b2 01 FF \wx0000 +14 * 11 00 0A \b2 01 FF \wx0000 21 01 22 42 // Name: @action3_0 -17 * 43 02 0A FE 89 +15 * 43 02 0A FE 89 0C 00 \dx0000FFFF \b3 \wx00FF \dx00000022 \dx00000022 // ternary_optimisation; -\wx00FC \dx0000003B \dx0000003B // caller2; -\wx00FD \dx0000015F \dx0000015F // caller1; -\wx00FE // @CB_FAILED0A; +\wx00FD \dx0000003B \dx0000003B // caller2; +\wx00FE \dx0000015F \dx0000015F // caller1; +\wx7FFF // CB_FAILED; -18 * 7 03 0A 01 00 \b0 +16 * 7 03 0A 01 00 \b0 \wx00FE // @action3_0; diff --git a/regression/expected/038_optimised_scope.grf b/regression/expected/038_optimised_scope.grf index 7da04a0f2030f3b3894536d042fd9bf67fe22e78..d9eccb18b1b8216405903dcf0ef601629b16d830 100644 GIT binary patch delta 171 zcmcc3x{Otnfx$hA9)jvoQJRoUi29OPm|Nk)j1#%$(0Nz_GQUCw| delta 271 zcmYjLI|{-;5Ph>Tf+2!}K~15BrPzr#@Kbw+T*Au5E}f7&*n0`VGkBC_v%U#N9e6W4 z@4cCwTlfkSV1L|Q`cWD^4S){er}yL}2DZ4$TFXP`TiBjTfQZj9J9M=Z2$@DOa3bU| zR)Jj}!>b)uSq+C`XwtK5EoDB?g^(H}7KOu-nd8-GJgC7F8+fevQdHP5E582ry8w1U UUh(snfBtx)QozGA!f{s{Z{eUgdH?_b diff --git a/regression/expected/038_optimised_scope.nfo b/regression/expected/038_optimised_scope.nfo index ac0aa6939..1148d69d5 100644 --- a/regression/expected/038_optimised_scope.nfo +++ b/regression/expected/038_optimised_scope.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 \d25 +0 * 4 \d22 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -71,7 +71,7 @@ FF \2+ 1A 20 \dx00000000 // param[127] \2+ 43 18 \dx0000000F \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value // Name: color_override 14 * 23 02 00 FF 8A @@ -86,7 +86,7 @@ C6 00 \dx0000FFFF 7D 80 20 \dxFFFFFFFF // cap \2+ BA 00 \dx0000FFFF \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value // Name: mixed_scope_capacity 16 * 28 02 00 FE 8A @@ -94,58 +94,44 @@ BA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 \2r 7E FE 00 \dxFFFFFFFF // scope_capacity(var[0xBA, 0, 65535]) \b0 -\wx8000 // Return computed value +\wx7FFE // Return computed value 17 * 9 00 00 \b1 01 FF \wx0064 1E 48 -18 * 6 01 00 \b1 FF \wx0000 - -// Name: @CB_FAILED_REAL00 -19 * 9 02 00 FD \b1 \b1 -\w0 -\w0 - -// Name: @CB_FAILED00 -20 * 23 02 00 FD 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FD // Non-graphics callback, return graphics result - // Name: @action3_0 -21 * 23 02 00 FC 89 +18 * 23 02 00 FD 89 10 00 \dx000000FF \b1 \wx00FE \dx00000014 \dx00000014 // mixed_scope_capacity; -\wx00FD // @CB_FAILED00; +\wx7FFF // CB_FAILED; // Name: @action3_1 -22 * 23 02 00 FB 89 +19 * 23 02 00 FC 89 10 00 \dx000000FF \b1 \wx00FE \dx00000014 \dx00000014 // mixed_scope_capacity; -\wx00FD // @CB_FAILED00; +\wx7FFF // CB_FAILED; // Name: @action3_2 -23 * 43 02 00 FC 89 +20 * 43 02 00 FD 89 0C 00 \dx0000FFFF \b3 \wx00FE \dx00000015 \dx00000015 // mixed_scope_capacity; \wx00FF \dx0000002D \dx0000002D // color_override; -\wx00FC \dx00000036 \dx00000036 // @action3_0; -\wx00FD // @CB_FAILED00; +\wx00FD \dx00000036 \dx00000036 // @action3_0; +\wx7FFF // CB_FAILED; // Name: @action3_3 -24 * 43 02 00 FD 89 +21 * 43 02 00 FC 89 0C 00 \dx0000FFFF \b3 \wx8000 \dx00000023 \dx00000023 // return string(STR_REGRESSION_DESC); \wx00FF \dx0000002D \dx0000002D // color_override; -\wx00FB \dx00000036 \dx00000036 // @action3_1; -\wx00FD // @CB_FAILED00; +\wx00FC \dx00000036 \dx00000036 // @action3_1; +\wx7FFF // CB_FAILED; -25 * 12 03 00 01 FF \wx0064 \b1 -FF \wx00FD // @action3_3; -\wx00FC // @action3_2; +22 * 12 03 00 01 FF \wx0064 \b1 +FF \wx00FC // @action3_3; +\wx00FD // @action3_2; diff --git a/regression/expected/039_storage.grf b/regression/expected/039_storage.grf index 8aa902739de8f0ed7151dc030603fe8b80a0ddf2..135533b58686c4e35d1576cec08884525342c35e 100644 GIT binary patch delta 132 zcmbQm{EA7Gfx$hhWaa`Y{|{CSA^@c08)pCj delta 180 zcmaFGG>ci3fx$hfq{Vqi2rj<6fL*l2eFvA{sSpE5C^hAVx2q;|A7*W z3=J@;{|pHbxqlO<1epS5prAnwD%@Gapzt3E7^D>!ev3#c672mqW3A~gU2 diff --git a/regression/expected/039_storage.nfo b/regression/expected/039_storage.nfo index 75d28b6e7..802c879f9 100644 --- a/regression/expected/039_storage.nfo +++ b/regression/expected/039_storage.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 \d10 +0 * 4 \d8 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -16,18 +16,8 @@ 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 -5 * 96 02 0A FE 8A +3 * 96 02 0A FF 8A 1A 20 \dxFFFFFFFF \2sto 1A 20 \dx00000100 \2r 1A 20 \dx44495247 @@ -40,32 +30,32 @@ \2+ 7D 80 20 \dxFFFFFFFF \2psto 1A 00 \dx00000000 \b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return 0; // Name: switch_storage1 -6 * 38 02 0A FE 89 +4 * 38 02 0A FF 89 7C 00 20 \dxFFFFFFFF \2+ 1A 20 \dx00000001 \2psto 1A 00 \dx00000000 \b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00FE // default: switch_storage2; +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FF // default: switch_storage2; -7 * 11 00 0A \b2 01 FF \wx0000 +5 * 11 00 0A \b2 01 FF \wx0000 08 00 09 00 -8 * 9 00 0A \b1 01 FF \wx0000 +6 * 9 00 0A \b1 01 FF \wx0000 21 20 // Name: @action3_0 -9 * 23 02 0A FF 89 +7 * 23 02 0A FF 89 0C 00 \dx0000FFFF \b1 -\wx00FE \dx00000035 \dx00000035 // switch_storage1; -\wx00FF // @CB_FAILED0A; +\wx00FF \dx00000035 \dx00000035 // switch_storage1; +\wx7FFF // CB_FAILED; -10 * 7 03 0A 01 00 \b0 +8 * 7 03 0A 01 00 \b0 \wx00FF // @action3_0; diff --git a/regression/expected/040_station.grf b/regression/expected/040_station.grf index 34da80f9d4aa16894ed9830c69ee81a6379ee08f..8699d5717c9112440683a4fe89edad0152864a39 100644 GIT binary patch delta 73 zcmbQu^_f$Yfx$h5Qy4q`H~{9s^YU=WA0J9!xX|7QS- lGyny_;0J>ykOrxn?8&0S|AT=O#ARk-{0~(1V{#2kIRIfp7bXAz diff --git a/regression/expected/040_station.nfo b/regression/expected/040_station.nfo index 132205aab..24eb7c663 100644 --- a/regression/expected/040_station.nfo +++ b/regression/expected/040_station.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 \d35 +0 * 4 \d33 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000000 @@ -201,27 +201,15 @@ FF \wx00F9 // @action3_3; 31 * 11 00 04 \b1 01 FF \wx0100 0A FF \wx00FF -// Name: @CB_FAILED_REAL04 -32 * 7 02 04 F8 \b0 \b1 - -\w0 - -// Name: @CB_FAILED04 -33 * 23 02 04 F8 89 -0C 00 \dx0000FFFF -\b1 -\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00F8 // Non-graphics callback, return graphics result - // Name: @action3_7 -34 * 41 02 04 F8 89 +32 * 41 02 04 FE 89 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id FF \2r 10 00 \dx000000FF \b2 \wx00FF \dx00000001 \dx00000001 // station_spriteset; \wx00FE \dx00000003 \dx00000003 // station_spriteset2; -\wx00F8 // @CB_FAILED04; +\wx7FFF // CB_FAILED; -35 * 9 03 04 01 FF \wx0100 \b0 -\wx00F8 // @action3_7; +33 * 9 03 04 01 FF \wx0100 \b0 +\wx00FE // @action3_7; diff --git a/regression/expected/042_badges.grf b/regression/expected/042_badges.grf index e58f4afcb71b05b3a2460f02974989ad52fb6ab8..9ba0d16fa098b8ee437b786783b1d616c5e3512c 100644 GIT binary patch delta 115 zcmZqVIKwW=z~CO_*2K#t#bw9Dz`(!)#Q#M%ipnr*ii4O;4F5ZM82H2)pu8MYGNZueCZ>8u0DG|*!T return 0 -\wx00FE // Non-graphics callback, return graphics result - // Name: @action3_0 -10 * 23 02 00 FE 89 +7 * 23 02 00 FF 89 0C 00 \dx0000FFFF \b1 \wx00FF \dx0000001D \dx0000001D // sw_can_attach_wagon; -\wx00FE // @CB_FAILED00; +\wx7FFF // CB_FAILED; -11 * 9 03 00 01 FF \wx0008 \b0 -\wx00FE // @action3_0; +8 * 9 03 00 01 FF \wx0008 \b0 +\wx00FF // @action3_0; -12 * 14 00 01 \b1 01 FF \wx0000 +9 * 14 00 01 \b1 01 FF \wx0000 2A \wx0002 \wx0001 \wx0003 -13 * 14 00 15 \b1 01 FF \wx0000 +10 * 14 00 15 \b1 01 FF \wx0000 08 "power" 00 -14 * 13 04 15 7F 01 FF \wx0000 "Power" 00 +11 * 13 04 15 7F 01 FF \wx0000 "Power" 00 -15 * 20 00 15 \b1 01 FF \wx0001 +12 * 20 00 15 \b1 01 FF \wx0001 08 "power/steam" 00 -16 * 13 04 15 7F 01 FF \wx0001 "Steam" 00 +13 * 13 04 15 7F 01 FF \wx0001 "Steam" 00 -17 * 6 01 15 \b1 FF \wx0001 +14 * 6 01 15 \b1 FF \wx0001 -18 opengfx_generic_trams1.png 32bpp 96 56 28 15 -14 -8 normal +15 opengfx_generic_trams1.png 32bpp 96 56 28 15 -14 -8 normal // Name: sprite_steam - feature 15 -19 * 7 02 15 FE \b1 \b0 +16 * 7 02 15 FF \b1 \b0 \w0 -20 * 7 03 15 01 01 \b0 -\wx00FE // sprite_steam; +17 * 7 03 15 01 01 \b0 +\wx00FF // sprite_steam; -21 * 21 00 15 \b1 01 FF \wx0002 +18 * 21 00 15 \b1 01 FF \wx0002 08 "power/diesel" 00 -22 * 14 04 15 7F 01 FF \wx0002 "Diesel" 00 +19 * 14 04 15 7F 01 FF \wx0002 "Diesel" 00 -23 * 23 00 15 \b1 01 FF \wx0003 +20 * 23 00 15 \b1 01 FF \wx0003 08 "power/electric" 00 -24 * 16 04 15 7F 01 FF \wx0003 "Electric" 00 +21 * 16 04 15 7F 01 FF \wx0003 "Electric" 00 diff --git a/regression/expected/example_industry.grf b/regression/expected/example_industry.grf index 9b9474a9eefdb5df6593ade7dd0ee3517088892b..a8e4c834e6a894fa7230eaa91251af46c657379b 100644 GIT binary patch delta 106 zcmZo?zs@Ggz~CO_*2K#t#pTM(z`(!)#Q#M$iW)LW$%B|oT>m<=SQY*Q0iP5D10xXq mub(`DDMaIcy&_Bj55xce3=B*_3pR+9Eby1AhAv!hX4N= z7#JBEU{e1WceH8TMXfP%jaRzMaA0~Oz4 Gss;eXh$AKd diff --git a/regression/expected/example_industry.nfo b/regression/expected/example_industry.nfo index 7793e113e..7f8209f4b 100644 --- a/regression/expected/example_industry.nfo +++ b/regression/expected/example_industry.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 \d22 +0 * 4 \d20 1 * 54 14 "C" "INFO" "B" "VRSN" \w4 \dx00000001 @@ -65,25 +65,15 @@ \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 -12 * 31 02 0A FD 89 +10 * 31 02 0A FE 89 6A 05 20 \dxFFFFFFFF \2sto 1A 00 \dx00000100 \b1 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return string(STR_INDUSTRY_EXTRA_TEXT); -13 * 27 00 0A \b6 01 FF \wx0000 +11 * 27 00 0A \b6 01 FF \wx0000 08 06 09 06 25 02 @@ -93,49 +83,49 @@ 27 02 00 00 28 \b0 \b0 -14 * 11 00 0A \b2 01 FF \wx0000 +12 * 11 00 0A \b2 01 FF \wx0000 21 02 22 01 // Name: @action3_0 -15 * 23 02 0A FF 89 +13 * 23 02 0A FF 89 18 00 \dx000000FF \b1 \wx00FF \dx00000000 \dx00000000 // factory_production_switch; -\wx00FE // @CB_FAILED0A; +\wx7FFF // CB_FAILED; // Name: @action3_1 -16 * 33 02 0A FE 89 +14 * 33 02 0A FE 89 0C 00 \dx0000FFFF \b2 \wx00FF \dx00000000 \dx00000000 // @action3_0; -\wx00FD \dx0000003A \dx0000003A // extra_text_switch; -\wx00FE // @CB_FAILED0A; +\wx00FE \dx0000003A \dx0000003A // extra_text_switch; +\wx7FFF // CB_FAILED; -17 * 7 03 0A 01 00 \b0 +15 * 7 03 0A 01 00 \b0 \wx00FE // @action3_1; -18 * 13 00 09 \b3 01 FF \wx0000 +16 * 13 00 09 \b3 01 FF \wx0000 08 27 09 27 12 02 -19 * 13 00 09 \b3 01 FF \wx0001 +17 * 13 00 09 \b3 01 FF \wx0001 08 28 09 28 12 02 -20 * 13 00 09 \b3 01 FF \wx0002 +18 * 13 00 09 \b3 01 FF \wx0002 08 29 09 29 12 02 -21 * 13 00 09 \b3 01 FF \wx0003 +19 * 13 00 09 \b3 01 FF \wx0003 08 2A 09 2A 12 02 -22 * 26 00 0A \b6 01 FF \wx0001 +20 * 26 00 0A \b6 01 FF \wx0001 08 09 09 09 25 03 diff --git a/regression/expected/example_object.grf b/regression/expected/example_object.grf index afa9017793feb0d6d281ac8dfe3bc1bbf7fe7686..757993fc82928c3db4e3f489676261b997da72b0 100644 GIT binary patch delta 80 zcmdmP-fAw&z~CO_*2K#t#kHE1fq{Vqi2ti@6y;~;xW))%GV%Z09LIc|k?DW^WOY_E e5Eai_F7S_m3#5>lpOJy_|9^&mo1d{>6a@fEOc&z- delta 130 zcmZoQ-)=6-z~CO_*2K#t#dVjJfq{Vqi2ti^6y;~O5(F`s`2PVZBp?oCgG4)d82 return 0 -\wx00FE // Non-graphics callback, return graphics result - // Name: company_land_terrain_switch -34 * 470 02 0F FD 89 +32 * 470 02 0F FE 89 41 28 \dx0000001F \2cmp 1A 20 \dx0000001E \2& 1A 20 \dx00000001 @@ -148,21 +138,21 @@ \2+ 7D 8A 20 \dxFFFFFFFF \2sto 1A 00 \dx00000001 \b1 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx00FF // default: company_land_layout; // Name: company_land_purchase_switch -35 * 51 02 0F FF 89 +33 * 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 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx00FF // default: company_land_layout; -36 * 43 00 0F \b12 01 FF \wx0000 +34 * 43 00 0F \b12 01 FF \wx0000 08 "INFR" 09 \wxD000 0A \wxD001 @@ -176,19 +166,19 @@ 16 00 17 01 -37 * 10 00 0F \b1 01 FF \wx0000 +35 * 10 00 0F \b1 01 FF \wx0000 15 \wx0011 // Name: @action3_0 -38 * 43 02 0F FF 89 +36 * 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); -\wx00FD // company_land_terrain_switch; +\wx00FE // company_land_terrain_switch; -39 * 10 03 0F 01 00 \b1 +37 * 10 03 0F 01 00 \b1 FF \wx00FF // @action3_0; -\wx00FD // company_land_terrain_switch; +\wx00FE // company_land_terrain_switch; diff --git a/regression/expected/example_train.grf b/regression/expected/example_train.grf index d94558e78ba4834e545aeba1147c22aa338aaa84..78218cf3a5691081ab32d6d2d2effa4f30e28517 100644 GIT binary patch delta 631 zcmYL`ziSjx5XWaUF?*Z+5y%hq;(3vPQDk$c5K~wP7K&F`$TbE;A`vd}SEDK2BT8UF zQJG2*QYdyQF&x36#bZqeNe ziD(Ge^{=CkZ)}7@8skzgo{p1H(OT_%@8LGLrHIK-`05;WUq9fk}Jv6EnJlj(5$xfxZtqI<2A6ki9wzg>28Rl)Y)*kt<%rZF%d@ zI1^dH$b0WZY?2o}II@;)ti}{WH}jTcEcJ41k4BMEcF2b+ZPGzXm!_afhssdJ&>5)G zr>ju7@8r{lKWq-Bt;jjQ%3ZnRFQn$?;KxfnI9(dUHlf;&aomOqZg>LN7f->v7 z5(F2Du3SiVE?f%!1#u&SQo4Fclcrye_r6T*gLAm=oOze??!2|?$LauZ^~ROek{h_+ zd;mE?`t;Mld#7B`vIi-V6d1~ONfBuZ5MotzrTp1BM|j(CsDR@t^kA3w3S+dxp*u|5 zd{MZ~ciiZFJE=oXgW7u1E+@`fZ*{#_FS_3EB=cJQMS3)A-(8<3Zi$_R+a$^(-`Po5 zN}pi#Sy_C^(BS@JM0K7ij<1*`2py4WMAB>i_(kgUE9y8btY~3SSkbii*BKa`5LWDCMiOeECT|okQ;RF5vo= return 0 -\wx00FF // Non-graphics callback, return graphics result - // Name: sw_icm_graphics -57 * 51 02 00 FD 89 +55 * 51 02 00 FD 89 40 80 \dx000000FF \dx00000000 \dx00000004 \b3 \wx00FE \dx00000000 \dx00000000 // 0 .. 0: sw_icm_graphics_front; \wx00FC \dx00000001 \dx00000002 // 1 .. 2: sw_icm_graphics_middle; \wx00FD \dx00000003 \dx00000003 // 3 .. 3: sw_icm_graphics_rear; -\wx00FF // default: @CB_FAILED00; +\wx7FFF // default: CB_FAILED; // Name: sw_icm_cargo_subtype_text -58 * 33 02 00 FC 89 +56 * 33 02 00 FC 89 F2 00 \dx000000FF \b2 \wx8000 \dx00000000 \dx00000000 // 0 .. 0: return string(STR_ICM_SUBTYPE_3_PART); @@ -181,14 +169,14 @@ F2 00 \dx000000FF \wx8400 // default: return 1024; // param[127] = param[17] -59 * 9 0D 7F \D= 11 FE \dx0000FFFF +57 * 9 0D 7F \D= 11 FE \dx0000FFFF -60 * 7 06 +58 * 7 06 7F 04 FF \wx001B FF // Name: @return_action_0 -61 * 34 02 00 FE 89 +59 * 34 02 00 FE 89 43 38 \dx0000000F \2* 1A 20 \dx00000010 \2+ 1A 20 \dx00000003 @@ -197,61 +185,61 @@ FF \wx8000 // Return computed value // param[124] = param[17] -62 * 9 0D 7C \D= 11 FE \dx0000FFFF +60 * 9 0D 7C \D= 11 FE \dx0000FFFF // param[125] = (param[124] + 16384) -63 * 9 0D 7D \D+ 7C FF \dx00004000 +61 * 9 0D 7D \D+ 7C FF \dx00004000 // param[126] = (param[125] | 32768) -64 * 9 0D 7E \D| 7D FF \dx00008000 +62 * 9 0D 7E \D| 7D FF \dx00008000 // param[123] = param[17] -65 * 9 0D 7B \D= 11 FE \dx0000FFFF +63 * 9 0D 7B \D= 11 FE \dx0000FFFF // param[124] = (param[123] + 3) -66 * 9 0D 7C \D+ 7B FF \dx00000003 +64 * 9 0D 7C \D+ 7B FF \dx00000003 // param[125] = (param[124] | 32768) -67 * 9 0D 7D \D| 7C FF \dx00008000 +65 * 9 0D 7D \D| 7C FF \dx00008000 -68 * 17 06 +66 * 17 06 00 04 FF \wx0006 7E 02 FF \wx0015 7D 02 FF \wx001F FF // Name: sw_icm_colour_mapping -69 * 43 02 00 FE 89 +67 * 43 02 00 FE 89 1A 00 \dx00000000 // param[0] \b3 \wx00FE \dx00000000 \dx00000000 // 0 .. 0: return (((var[0x43, 24, 15] * 16) + 3) + base_sprite_2cc) \wx8000 \dx00000001 \dx00000001 // 1 .. 1: return param[126]; \wx8000 \dx00000002 \dx00000002 // 2 .. 2: return param[125]; -\wx00FF // default: @CB_FAILED00; +\wx7FFF // default: CB_FAILED; // Name: sw_icm_start_stop -70 * 31 02 00 FB 89 +68 * 31 02 00 FF 89 40 50 \dx000000FF \dx00000001 \dx00000001 \b1 \wx8400 \dx00000001 \dx00000010 // 1 .. 16: return 1024; \wx8002 // default: return string(STR_ICM_CANNOT_START); // Name: sw_icm_articulated_part -71 * 23 02 00 FA 89 +69 * 23 02 00 FB 89 10 00 \dxFFFFFFFF \b1 \wx8074 \dx00000001 \dx00000003 // 1 .. 3: return 116; \wxFFFF // default: return 32767; // Name: sw_icm_can_attach_wagon -72 * 23 02 00 F9 89 +70 * 23 02 00 FA 89 C6 00 \dx0000FFFF \b1 \wx8401 \dx00000074 \dx00000074 // 116 .. 116: return 1025; \wx8003 // default: return string(STR_ICM_CANNOT_ATTACH_OTHER); // Name: sw_icm_length_3_part_vehicle -73 * 41 02 00 F8 89 +71 * 41 02 00 F9 89 40 80 \dx000000FF \dx00000000 \dx00000004 \b2 \wx8001 \dx00000001 \dx00000001 // 1 .. 1: return 1; @@ -259,43 +247,43 @@ C6 00 \dx0000FFFF \wx8008 // default: return 8; // Name: sw_icm_length -74 * 23 02 00 F8 89 +72 * 23 02 00 F9 89 F2 00 \dx000000FF \b1 -\wx00F8 \dx00000000 \dx00000000 // 0 .. 0: sw_icm_length_3_part_vehicle; +\wx00F9 \dx00000000 \dx00000000 // 0 .. 0: sw_icm_length_3_part_vehicle; \wx8008 // default: return 8; // Name: sw_icm_power -75 * 23 02 00 F7 89 +73 * 23 02 00 F8 89 F2 00 \dx000000FF \b1 \wx8699 \dx00000000 \dx00000000 // 0 .. 0: return 1689; \wx89E6 // default: return 2534; // Name: sw_icm_weight -76 * 23 02 00 F6 89 +74 * 23 02 00 F7 89 F2 00 \dx000000FF \b1 \wx8090 \dx00000000 \dx00000000 // 0 .. 0: return 144; \wx80C0 // default: return 192; // Name: sw_icm_te -77 * 23 02 00 F5 89 +75 * 23 02 00 F6 89 F2 00 \dx000000FF \b1 \wx8019 \dx00000000 \dx00000000 // 0 .. 0: return 25; \wx801C // default: return 28; // param[142] = 2 -78 * 9 0D 8E \D= FF 00 \dx00000002 +76 * 9 0D 8E \D= FF 00 \dx00000002 // param[158] = (param[158] | 8) -79 * 9 0D 9E \D| 9E FF \dx00000008 +77 * 9 0D 9E \D| 9E FF \dx00000008 -80 * 9 00 08 \b1 01 FF \wx002C +78 * 9 00 08 \b1 01 FF \wx002C 08 0A -81 * 104 00 00 \b37 01 FF \wx0074 +79 * 104 00 00 \b37 01 FF \wx0074 06 07 2A \dx000B0D34 04 FF @@ -334,24 +322,24 @@ F2 00 \dx000000FF 23 00 25 00 -82 * 33 04 00 7F 01 FF \wx0074 "ICM 'Koploper' (Electric)" 00 +80 * 33 04 00 7F 01 FF \wx0074 "ICM 'Koploper' (Electric)" 00 -83 * 35 04 00 1F 01 FF \wx0074 "ICM 'Koploper' (Electrisch)" 00 +81 * 35 04 00 1F 01 FF \wx0074 "ICM 'Koploper' (Electrisch)" 00 -84 * 12 01 00 00 FF \wx0006 FF \wx0001 FF \wx0001 +82 * 12 01 00 00 FF \wx0006 FF \wx0001 FF \wx0001 -85 icm.png 8bpp 1 161 53 14 -25 -10 normal +83 icm.png 8bpp 1 161 53 14 -25 -10 normal // Name: set_icm_purchase - feature 00 -86 * 9 02 00 F4 \b1 \b1 +84 * 9 02 00 F5 \b1 \b1 \w6 \w6 -87 * 9 00 00 \b1 01 FF \wx0074 +85 * 9 00 00 \b1 01 FF \wx0074 1E 79 // Name: @return_action_0 -88 * 41 02 00 F3 89 +86 * 41 02 00 F4 89 F2 20 \dx000000FF \2cmp 1A 20 \dx00000001 \2& 1A 20 \dx00000001 @@ -361,7 +349,7 @@ F2 20 \dx000000FF \wx8000 // Return computed value // Name: @return_action_1 -89 * 35 02 00 F2 89 +87 * 35 02 00 F3 89 F2 60 \dx000000FF \dx00000003 \dx00000001 \2* 1A 20 \dx00000024 \2/ 1A 00 \dx00000004 @@ -369,33 +357,33 @@ F2 60 \dx000000FF \dx00000003 \dx00000001 \wx8000 // Return computed value // Name: @return_action_2 -90 * 20 02 00 F1 89 +88 * 20 02 00 F2 89 1A 20 \dx00000008 \2- 1C 00 \dxFFFFFFFF \b0 \wx8000 // Return computed value // Name: @action3_1 -91 * 24 02 00 F1 89 -7E F8 00 \dxFFFFFFFF // sw_icm_length +89 * 24 02 00 F2 89 +7E F9 00 \dxFFFFFFFF // sw_icm_length \b1 -\wx00FF \dx0000FFFF \dx0000FFFF // @CB_FAILED00; -\wx00F1 // return (8 - var[0x1C, 0, -1]) +\wx7FFF \dx0000FFFF \dx0000FFFF // CB_FAILED; +\wx00F2 // return (8 - var[0x1C, 0, -1]) // Name: @action3_0 -92 * 73 02 00 F1 89 +90 * 73 02 00 F2 89 10 00 \dx000000FF \b6 -\wx00F7 \dx0000000B \dx0000000B // sw_icm_power; -\wx00F3 \dx0000000D \dx0000000D // return ((var[0xF2, 0, 255] == 1) ? 150 : 100) -\wx00F2 \dx00000014 \dx00000014 // return (((var[0xF2, 0, 255] + 3) * 36) / 4) -\wx00F6 \dx00000016 \dx00000016 // sw_icm_weight; -\wx00F5 \dx0000001F \dx0000001F // sw_icm_te; -\wx00F1 \dx00000021 \dx00000021 // @action3_1; +\wx00F8 \dx0000000B \dx0000000B // sw_icm_power; +\wx00F4 \dx0000000D \dx0000000D // return ((var[0xF2, 0, 255] == 1) ? 150 : 100) +\wx00F3 \dx00000014 \dx00000014 // return (((var[0xF2, 0, 255] + 3) * 36) / 4) +\wx00F7 \dx00000016 \dx00000016 // sw_icm_weight; +\wx00F6 \dx0000001F \dx0000001F // sw_icm_te; +\wx00F2 \dx00000021 \dx00000021 // @action3_1; \wx00FD // sw_icm_graphics; // Name: @action3_2 -93 * 63 02 00 F5 89 +91 * 63 02 00 F6 89 10 00 \dx000000FF \b5 \wx8699 \dx0000000B \dx0000000B // return 1689; @@ -406,7 +394,7 @@ F2 60 \dx000000FF \dx00000003 \dx00000001 \wx00FD // sw_icm_graphics; // Name: @return_action_3 -94 * 49 02 00 F6 89 +92 * 49 02 00 F7 89 40 A0 \dx000000FF \dx00000000 \dx00000004 \2cmp 1A 20 \dx00000000 \2& 1A 20 \dx00000001 @@ -416,7 +404,7 @@ F2 60 \dx000000FF \dx00000003 \dx00000001 \wx8000 // Return computed value // Name: @return_action_4 -95 * 35 02 00 F2 89 +93 * 35 02 00 F3 89 F2 60 \dx000000FF \dx00000003 \dx00000001 \2* 1A 20 \dx00000024 \2/ 1A 00 \dx00000004 @@ -424,94 +412,94 @@ F2 60 \dx000000FF \dx00000003 \dx00000001 \wx8000 // Return computed value // Name: @action3_3 -96 * 93 02 00 F1 89 +94 * 93 02 00 F2 89 0C 00 \dx0000FFFF \b8 -\wx00F6 \dx00000010 \dx00000010 // return ((((var[0x40, 0, 255] + 0) % 4) == 0) ? 186 : 200) -\wx00F2 \dx00000015 \dx00000015 // return (((var[0xF2, 0, 255] + 3) * 36) / 4) -\wx00FA \dx00000016 \dx00000016 // sw_icm_articulated_part; +\wx00F7 \dx00000010 \dx00000010 // return ((((var[0x40, 0, 255] + 0) % 4) == 0) ? 186 : 200) +\wx00F3 \dx00000015 \dx00000015 // return (((var[0xF2, 0, 255] + 3) * 36) / 4) +\wx00FB \dx00000016 \dx00000016 // sw_icm_articulated_part; \wx00FC \dx00000019 \dx00000019 // sw_icm_cargo_subtype_text; -\wx00F9 \dx0000001D \dx0000001D // sw_icm_can_attach_wagon; +\wx00FA \dx0000001D \dx0000001D // sw_icm_can_attach_wagon; \wx00FE \dx0000002D \dx0000002D // sw_icm_colour_mapping; -\wx00FB \dx00000031 \dx00000031 // sw_icm_start_stop; -\wx00F1 \dx00000036 \dx00000036 // @action3_0; +\wx00FF \dx00000031 \dx00000031 // sw_icm_start_stop; +\wx00F2 \dx00000036 \dx00000036 // @action3_0; \wx00FD // sw_icm_graphics; // Name: @action3_4 -97 * 63 02 00 FD 89 +95 * 63 02 00 FD 89 0C 00 \dx0000FFFF \b5 -\wx00F4 \dx00000000 \dx00000000 // set_icm_purchase; -\wx00FA \dx00000016 \dx00000016 // sw_icm_articulated_part; +\wx00F5 \dx00000000 \dx00000000 // set_icm_purchase; +\wx00FB \dx00000016 \dx00000016 // sw_icm_articulated_part; \wx8004 \dx00000023 \dx00000023 // return string(STR_ICM_ADDITIONAL_TEXT); \wx00FE \dx0000002D \dx0000002D // sw_icm_colour_mapping; -\wx00F5 \dx00000036 \dx00000036 // @action3_2; +\wx00F6 \dx00000036 \dx00000036 // @action3_2; \wx00FD // sw_icm_graphics; -98 * 12 03 00 01 FF \wx0074 \b1 +96 * 12 03 00 01 FF \wx0074 \b1 FF \wx00FD // @action3_4; -\wx00F1 // @action3_3; +\wx00F2 // @action3_3; // param[126] = param[161] -99 * 5 0D 7E \D= A1 00 +97 * 5 0D 7E \D= A1 00 // param[127] = (302012601 - param[126]) -100 * 9 0D 7F \D- FF 7E \dx120058B9 +98 * 9 0D 7F \D- FF 7E \dx120058B9 // param[127] = (param[127] << -31) -101 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 +99 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 -102 * 9 07 7F 04 \7= \dx00000000 01 +100 * 9 07 7F 04 \7= \dx00000000 01 -103 * 10 00 00 \b1 01 FF \wx0074 +101 * 10 00 00 \b1 01 FF \wx0074 2B \wx00B9 -104 * 12 01 00 00 FF \wx0007 FF \wx0002 FF \wx0004 +102 * 12 01 00 00 FF \wx0007 FF \wx0002 FF \wx0004 -105 cargo_wagons.png 8bpp 1 1 8 24 -3 -12 normal -106 cargo_wagons.png 8bpp 10 1 22 20 -14 -12 normal -107 cargo_wagons.png 8bpp 33 1 32 16 -16 -12 normal -108 cargo_wagons.png 8bpp 66 1 22 20 -6 -12 normal +103 cargo_wagons.png 8bpp 1 1 8 24 -3 -12 normal +104 cargo_wagons.png 8bpp 10 1 22 20 -14 -12 normal +105 cargo_wagons.png 8bpp 33 1 32 16 -16 -12 normal +106 cargo_wagons.png 8bpp 66 1 22 20 -6 -12 normal -109 cargo_wagons.png 8bpp 1 33 8 24 -3 -12 normal -110 cargo_wagons.png 8bpp 10 33 22 20 -14 -12 normal -111 cargo_wagons.png 8bpp 33 33 32 16 -16 -12 normal -112 cargo_wagons.png 8bpp 66 33 22 20 -6 -12 normal +107 cargo_wagons.png 8bpp 1 33 8 24 -3 -12 normal +108 cargo_wagons.png 8bpp 10 33 22 20 -14 -12 normal +109 cargo_wagons.png 8bpp 33 33 32 16 -16 -12 normal +110 cargo_wagons.png 8bpp 66 33 22 20 -6 -12 normal // Name: set_cargo_wagon - feature 00 -113 * 9 02 00 F1 \b1 \b1 +111 * 9 02 00 F2 \b1 \b1 \w7 \w7 // Name: cargo_wagon_switch_vehicle -114 * 30 02 00 F1 89 +112 * 30 02 00 F2 89 1A 20 \dx80000000 \2sto 1A 00 \dx00000100 \b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00F1 // default: set_cargo_wagon; +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00F2 // default: set_cargo_wagon; // Name: set_cargo_wagon_load - feature 00 -115 * 9 02 00 FD \b1 \b1 +113 * 9 02 00 FD \b1 \b1 \w8 \w8 // Name: cargo_wagon_switch_load -116 * 30 02 00 FD 89 +114 * 30 02 00 FD 89 1A 20 \dx00000000 \2sto 1A 00 \dx00000100 \b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx00FD // default: set_cargo_wagon_load; // Name: cargo_wagon_switch_graphics -117 * 23 02 00 FD 89 +115 * 23 02 00 FD 89 10 08 \dx000000FF \b1 -\wx00F1 \dx00000000 \dx00000000 // 0 .. 0: cargo_wagon_switch_vehicle; +\wx00F2 \dx00000000 \dx00000000 // 0 .. 0: cargo_wagon_switch_vehicle; \wx00FD // default: cargo_wagon_switch_load; -118 * 37 00 00 \b11 01 FF \wx0075 +116 * 37 00 00 \b11 01 FF \wx0075 06 0F 2A \dx000A96C9 04 FF @@ -524,9 +512,9 @@ FF \wx00FD // @action3_4; 24 00 0B \wx0000 -119 * 19 04 00 7F 01 FF \wx0075 "Cargo Wagon" 00 +117 * 19 04 00 7F 01 FF \wx0075 "Cargo Wagon" 00 -120 * 12 03 00 01 FF \wx0075 \b1 +118 * 12 03 00 01 FF \wx0075 \b1 FF \wx00FD // cargo_wagon_switch_graphics; \wx00FD // cargo_wagon_switch_graphics;