diff --git a/nml/actions/action0.py b/nml/actions/action0.py index ac801144..b7072e60 100644 --- a/nml/actions/action0.py +++ b/nml/actions/action0.py @@ -398,8 +398,7 @@ def write(self, file): file.print_bytex(0) file.print_bytex(self.feature) file.print_byte(len(self.prop_list)) - file.print_bytex(self.num_ids) - file.print_bytex(0xFF) + file.print_wordx(self.num_ids) file.print_wordx(self.id) file.newline() for prop in self.prop_list: @@ -1080,7 +1079,7 @@ def parse_sort_block(feature, vehid_list): idx = len(vehid_list) - 1 while idx >= 0: cur = vehid_list[idx] - prop = Action0Property(prop_num[feature], [last], 3) + prop = Action0Property(prop_num[feature], [last], 2) action_list.append(Action0(feature, cur.value)) action_list[-1].prop_list.append(prop) last = cur @@ -1214,5 +1213,5 @@ def get_layout_action0(feature, id, layouts): def get_copy_layout_action0(feature, id, source_id): act0, offset = create_action0(feature, id, None, None) act0.num_ids = 1 - act0.prop_list.append(Action0Property(0x0A, source_id, 1 if source_id.value < 0xFF else 3)) + act0.prop_list.append(Action0Property(0x0A, source_id, 2)) return [act0] diff --git a/nml/actions/action0properties.py b/nml/actions/action0properties.py index 5d931858..6cc04a76 100644 --- a/nml/actions/action0properties.py +++ b/nml/actions/action0properties.py @@ -305,22 +305,17 @@ class VariableListProp(BaseAction0Property): Property value that is a variable-length list of variable sized values, the list length is written before the data. """ - def __init__(self, prop_num, data, size, extended): + def __init__(self, prop_num, data, size): # data is a list, each element belongs to an item ID # Each element in the list is a list of cargo types self.prop_num = prop_num self.data = data self.size = size - self.extended = extended def write(self, file): file.print_bytex(self.prop_num) for elem in self.data: - if self.extended: - file.print_bytex(0xFF) - file.print_word(len(elem)) - else: - file.print_byte(len(elem)) + file.print_word(len(elem)) for i, val in enumerate(elem): if i % 8 == 0: file.newline() @@ -330,13 +325,17 @@ def write(self, file): def get_size(self): total_len = 1 # Prop number for elem in self.data: - # For each item ID to set, make space for all values + 3 or 1 for the length - total_len += len(elem) * self.size + (3 if self.extended else 1) + # For each item ID to set, make space for all values + 2 for the length + total_len += len(elem) * self.size + 2 return total_len -def VariableByteListProp(prop_num, data, extended=False): - return VariableListProp(prop_num, data, 1, extended) +def VariableByteListProp(prop_num, data): + return VariableListProp(prop_num, data, 1) + + +def VariableWordListProp(prop_num, data): + return VariableListProp(prop_num, data, 2) def ctt_list(prop_num, *values): @@ -346,17 +345,13 @@ def ctt_list(prop_num, *values): if not isinstance(value, Array): raise generic.ScriptError("Value of cargolist property must be an array", value.pos) return [ - VariableByteListProp( + VariableWordListProp( prop_num, [[ctype.reduce_constant().value for ctype in single_item_array.values] for single_item_array in values], ) ] -def VariableWordListProp(num_prop, data, extended=False): - return VariableListProp(num_prop, data, 2, extended) - - def accepted_cargos(prop_num, *values): # values may have multiple entries, if more than one item ID is set (e.g. multitile houses) # Each value is an expression.Array of cargo types and amount arrays @@ -419,7 +414,7 @@ def prop_test(value): # fmt: off properties[0x00] = { **general_veh_props, - "track_type": {"size": 1, "num": 0x05}, + "track_type": {"size": 2, "num": 0x05}, "ai_special_flag": {"size": 1, "num": 0x08}, "speed": { "size": 2, @@ -437,7 +432,7 @@ def prop_test(value): "sprite_id": {"size": 1, "num": 0x12}, "dual_headed": {"size": 1, "num": 0x13}, "cargo_capacity": {"size": 1, "num": 0x14}, - "default_cargo_type": {"size": 1, "num": 0x15}, + "default_cargo_type": {"size": 2, "num": 0x15}, "weight": two_byte_property( 0x16, 0x24, @@ -510,8 +505,8 @@ def prop15_test(value): # fmt: off properties[0x01] = { **general_veh_props, - "road_type": {"size": 1, "num": 0x05}, - "tram_type": {"size": 1, "num": 0x05}, + "road_type": {"size": 2, "num": 0x05}, + "tram_type": {"size": 2, "num": 0x05}, "speed": roadveh_speed_prop( { "unit_type": "speed", @@ -524,9 +519,9 @@ def prop15_test(value): # 0B -0D don"t exist "sprite_id": {"size": 1, "num": 0x0E}, "cargo_capacity": {"size": 1, "num": 0x0F}, - "default_cargo_type": {"size": 1, "num": 0x10}, + "default_cargo_type": {"size": 2, "num": 0x10}, "cost_factor": {"size": 1, "num": 0x11}, - "sound_effect": {"size": 1, "num": 0x12}, + "sound_effect": {"size": 2, "num": 0x12}, "power": {"size": 1, "num": 0x13, "unit_type": "power", "unit_conversion": (1, 10)}, "weight": {"size": 1, "num": 0x14, "unit_type": "weight", "unit_conversion": 4}, # 15 is set together with 08 (see above) @@ -605,11 +600,11 @@ def prop23_test(value): "adjust_value": lambda val, unit: ottd_display_speed(val, 1, 2, unit), } ), - "default_cargo_type": {"size": 1, "num": 0x0C}, + "default_cargo_type": {"size": 2, "num": 0x0C}, "cargo_capacity": {"size": 2, "num": 0x0D}, # 0E does not exist "running_cost_factor": {"size": 1, "num": 0x0F}, - "sound_effect": {"size": 1, "num": 0x10}, + "sound_effect": {"size": 2, "num": 0x10}, # 11 (refittable cargo types) is removed, it is zeroed when setting a different refit property # 12 (callback flags) is not set by user "refit_cost": {"size": 1, "num": 0x13}, @@ -685,7 +680,7 @@ def aircraft_is_large(value): "passenger_capacity": {"size": 2, "num": 0x0F}, # 10 does not exist "mail_capacity": {"size": 1, "num": 0x11}, - "sound_effect": {"size": 1, "num": 0x12}, + "sound_effect": {"size": 2, "num": 0x12}, # 13 (refittable cargo types) is removed, it is zeroed when setting a different refit property # 14 (callback flags) is not set by user "refit_cost": {"size": 1, "num": 0x15}, @@ -763,7 +758,7 @@ def get_size(self): def station_layouts(value): if isinstance(value, ConstantNumeric): - return [Action0Property(0x0F, value, 1 if value.value < 0xFF else 3)] + return [Action0Property(0x0F, value, 2)] if not isinstance(value, Array) or len(value.values) == 0: raise generic.ScriptError("station_layouts must be an array of layouts, or the ID of a station", value.pos) layouts = {} @@ -799,7 +794,7 @@ def station_tile_flags(value): if not isinstance(value, Array) or len(value.values) % 2 != 0: raise generic.ScriptError("Flag list must be an array of even length", value.pos) if len(value.values) > 8: - return [VariableByteListProp(0x1E, [[flags.reduce_constant().value for flags in value.values]], True)] + return [VariableByteListProp(0x1E, [[flags.reduce_constant().value for flags in value.values]])] pylons = 0 wires = 0 blocked = 0 @@ -1128,13 +1123,13 @@ def __init__(self, sound_list): def write(self, file): file.print_bytex(0x15) - file.print_byte(len(self.sound_list)) + file.print_word(len(self.sound_list)) for sound in self.sound_list: - sound.write(file, 1) + sound.write(file, 2) file.newline() def get_size(self): - return len(self.sound_list) + 2 + return len(self.sound_list) + 3 def random_sounds(value): @@ -1282,8 +1277,8 @@ def check_accept(acp): has_inpmult = True return [ - VariableByteListProp(0x25, [output_cargos]), - VariableByteListProp(0x26, [input_cargos]), + VariableWordListProp(0x25, [output_cargos]), + VariableWordListProp(0x26, [input_cargos]), VariableByteListProp(0x27, [prod_multipliers]), IndustryInputMultiplierProp(0x28, input_multipliers if has_inpmult else []), ] @@ -1502,14 +1497,14 @@ def __init__(self, prop_num, labels): def write(self, file): file.print_bytex(self.prop_num) - file.print_byte(len(self.labels)) + file.print_word(len(self.labels)) for label in self.labels: parse_string_to_dword(label) # Error if the wrong length or not ASCII label.write(file, 4) file.newline() def get_size(self): - return len(self.labels) * 4 + 2 + return len(self.labels) * 4 + 3 def label_list(value, prop_num, description): diff --git a/nml/actions/action1.py b/nml/actions/action1.py index 46e09b4d..d0961080 100644 --- a/nml/actions/action1.py +++ b/nml/actions/action1.py @@ -42,22 +42,22 @@ def __init__(self, feature, first_set, num_sets, num_ent): def write(self, file): if self.first_set == 0 and self.num_sets < 256: # * 01 - file.start_sprite(6) + file.start_sprite(5) file.print_bytex(1) file.print_bytex(self.feature) file.print_byte(self.num_sets) - file.print_varx(self.num_ent, 3) + file.print_wordx(self.num_ent) file.newline() file.end_sprite() else: # * 01 00 - file.start_sprite(12) + file.start_sprite(9) file.print_bytex(1) file.print_bytex(self.feature) file.print_bytex(0) - file.print_varx(self.first_set, 3) - file.print_varx(self.num_sets, 3) - file.print_varx(self.num_ent, 3) + file.print_wordx(self.first_set) + file.print_wordx(self.num_sets) + file.print_wordx(self.num_ent) file.newline() file.end_sprite() diff --git a/nml/actions/action10.py b/nml/actions/action10.py index b2db02e6..820ec081 100644 --- a/nml/actions/action10.py +++ b/nml/actions/action10.py @@ -19,11 +19,12 @@ class Action10(base_action.BaseAction): def __init__(self, label): self.label = label + assert self.label >= 0x8000 and self.label <= 0xFFFF def write(self, file): - file.start_sprite(2) + file.start_sprite(3) file.print_bytex(0x10) - file.print_bytex(self.label) + file.print_wordx(self.label) file.newline() file.end_sprite() diff --git a/nml/actions/action12.py b/nml/actions/action12.py index 65e10ada..f14c8858 100644 --- a/nml/actions/action12.py +++ b/nml/actions/action12.py @@ -24,15 +24,15 @@ def __init__(self, sets): def write(self, file): # * 12 ( ){n} - size = 2 + 4 * len(self.sets) + size = 3 + 7 * len(self.sets) file.start_sprite(size) file.print_bytex(0x12) - file.print_byte(len(self.sets)) + file.print_word(len(self.sets)) file.newline() for font_size, num_char, base_char in self.sets: font_size.write(file, 1) - file.print_byte(num_char) - file.print_word(base_char) + file.print_word(num_char) + file.print_dword(base_char) file.newline() file.end_sprite() @@ -58,17 +58,17 @@ def parse_action12(font_glyphs): raise generic.ScriptError( "Invalid value for parameter 'font_size' in font_glyph, valid values are 0, 1, 2", font_size.pos ) - if not (0 <= base_char.value <= 0xFFFF): + if not (0 <= base_char.value <= 0x1FFFFF): raise generic.ScriptError( - "Invalid value for parameter 'base_char' in font_glyph, valid values are 0-0xFFFF", base_char.pos + "Invalid value for parameter 'base_char' in font_glyph, valid values are 0-0x1FFFFF", base_char.pos ) real_sprite_list = real_sprite.parse_sprite_data(font_glyphs) char = base_char.value last_char = char + len(real_sprite_list) - if last_char > 0xFFFF: + if last_char > 0x1FFFFF: raise generic.ScriptError( - "Character numbers in font_glyph block exceed the allowed range (0-0xFFFF)", font_glyphs.pos + "Character numbers in font_glyph block exceed the allowed range (0-0x1FFFFF)", font_glyphs.pos ) sets = [] diff --git a/nml/actions/action2.py b/nml/actions/action2.py index 38fcecde..a90d34af 100644 --- a/nml/actions/action2.py +++ b/nml/actions/action2.py @@ -17,7 +17,7 @@ from nml.actions import base_action from nml.ast import base_statement, general -total_action2_ids = 0x100 +total_action2_ids = 0x8000 free_action2_ids = list(range(0, total_action2_ids)) """ @@ -122,10 +122,10 @@ def write_sprite_start(self, file, size, extra_comment=None): if extra_comment: for c in extra_comment: file.comment(c) - file.start_sprite(size + 3) + file.start_sprite(size + 4) file.print_bytex(2) file.print_bytex(self.feature) - file.print_bytex(self.id) + file.print_wordx(self.id) def skip_action7(self): return False diff --git a/nml/actions/action2production.py b/nml/actions/action2production.py index 07f7388a..8864cf2a 100644 --- a/nml/actions/action2production.py +++ b/nml/actions/action2production.py @@ -67,16 +67,16 @@ def write(self, file): file.print_varx(val, cargo_size) file.print_bytex(values[-1]) elif self.version == 2: - size = 4 + 2 * (len(self.sub_in) + len(self.add_out)) + size = 4 + 3 * (len(self.sub_in) + len(self.add_out)) action2.Action2.write_sprite_start(self, file, size) file.print_bytex(self.version) file.print_byte(len(self.sub_in)) for cargoindex, value in self.sub_in: - file.print_bytex(cargoindex) + file.print_wordx(cargoindex) file.print_bytex(value.parameter) file.print_byte(len(self.add_out)) for cargoindex, value in self.add_out: - file.print_bytex(cargoindex) + file.print_wordx(cargoindex) file.print_bytex(value.parameter) file.print_bytex(self.again.parameter) file.newline() diff --git a/nml/actions/action2random.py b/nml/actions/action2random.py index dc1b7815..76b8456e 100644 --- a/nml/actions/action2random.py +++ b/nml/actions/action2random.py @@ -37,14 +37,14 @@ def prepare_output(self, sprite_num): def write(self, file): # [] - size = 4 + 2 * self.nrand + (self.count is not None) + size = 5 + 2 * self.nrand + (self.count is not None) action2.Action2.write_sprite_start(self, file, size) file.print_bytex(self.type_byte) if self.count is not None: file.print_bytex(self.count) file.print_bytex(self.triggers) file.print_byte(self.randbit) - file.print_bytex(self.nrand) + file.print_wordx(self.nrand) file.newline() for choice in self.choices: diff --git a/nml/actions/action2var.py b/nml/actions/action2var.py index df4c1a4c..90e5d360 100644 --- a/nml/actions/action2var.py +++ b/nml/actions/action2var.py @@ -88,9 +88,9 @@ def prepare_output(self, sprite_num): self.default_result = self.default_result.value | 0x8000 def write(self, file): - # type_byte, num_ranges, default_result = 4 + # type_byte, num_ranges, default_result = 5 # 2 bytes for the result, 8 bytes for the min/max range. - size = 4 + (2 + 8) * len(self.ranges) + size = 5 + (2 + 8) * len(self.ranges) for var in self.var_list: if isinstance(var, nmlop.Operator): size += 1 @@ -107,12 +107,12 @@ def write(self, file): else: var.write(file, 4) file.newline(var.comment) - file.print_byte(len(self.ranges)) + file.print_word(len(self.ranges)) file.newline() for r in self.ranges: file.print_wordx(r.result) - file.print_varx(r.min.value, 4) - file.print_varx(r.max.value, 4) + file.print_dwordx(r.min.value) + file.print_dwordx(r.max.value) file.newline(r.comment) file.print_wordx(self.default_result) file.comment(self.default_comment) @@ -149,11 +149,12 @@ class VarAction2Var: @type comment: C{basestr} """ - def __init__(self, var_num, shift, mask, parameter=None, comment=""): + def __init__(self, var_num, shift, mask, parameter=None, procedure=None, comment=""): self.var_num = var_num self.shift = shift self.mask = mask self.parameter = parameter + self.procedure = procedure self.add = None self.div = None self.mod = None @@ -161,8 +162,10 @@ def __init__(self, var_num, shift, mask, parameter=None, comment=""): def write(self, file, size): file.print_bytex(self.var_num) - if self.parameter is not None: - file.print_bytex(self.parameter) + if self.procedure is not None: + file.print_wordx(self.procedure) + elif self.parameter is not None: + file.print_dwordx(self.parameter) if self.mod is not None: self.shift |= 0x80 elif self.add is not None or self.div is not None: @@ -180,10 +183,12 @@ def write(self, file, size): file.print_varx(1, size) def get_size(self): - # var number (1) [+ parameter (1)] + shift num (1) + and mask (4) [+ add (4) + div/mod (4)] + # var number (1) [+ procedure [2]|+ parameter (4)] + shift num (1) + and mask (4) [+ add (4) + div/mod (4)] size = 6 - if self.parameter is not None: - size += 1 + if self.procedure is not None: + size += 2 + elif self.parameter is not None: + size += 4 if self.add is not None or self.div is not None or self.mod is not None: size += 8 return size @@ -208,10 +213,10 @@ def __init__(self, sg_ref): self.sg_ref = sg_ref def resolve_parameter(self, feature): - self.parameter = self.sg_ref.get_action2_id(feature) + self.procedure = self.sg_ref.get_action2_id(feature) def get_size(self): - return 7 + return 8 def write(self, file, size): self.mask = get_mask(size) @@ -255,7 +260,7 @@ def write(self, file, size): VarAction2Var.write(self, file, size) def get_size(self): - return 7 + return 10 def reduce(self, id_dicts=None, unknown_id_fatal=True): return self @@ -300,7 +305,7 @@ def write(self, file, size): VarAction2Var.write(self, file, size) def get_size(self): - return 7 + return 10 def reduce(self, id_dicts=None, unknown_id_fatal=True): return self @@ -550,7 +555,7 @@ def parse_variable(self, expr): offset = 2 param = None else: - offset = 3 + offset = 6 param = expr.param.value mask = self.parse_expr_to_constant(expr.mask, offset) @@ -858,7 +863,7 @@ def create_ternary_action(guard, expr_true, expr_false, action_list, feature, va for mod in parser.mods: act6.modify_bytes(mod.param, mod.size, mod.offset + offset) varaction2.var_list = parser.var_list - offset += parser.var_list_size + 1 # +1 for the byte num-ranges + offset += parser.var_list_size + 2 # +2 for the word num-ranges for proc in parser.proc_call_list: action2.add_ref(proc, varaction2, True) @@ -903,7 +908,7 @@ def create_return_action(expr, feature, name, var_range): action_list = varact2parser.extra_actions extra_act6 = action6.Action6() for mod in varact2parser.mods: - extra_act6.modify_bytes(mod.param, mod.size, mod.offset + 4) + extra_act6.modify_bytes(mod.param, mod.size, mod.offset + 5) if len(extra_act6.modifications) > 0: action_list.append(extra_act6) @@ -1184,7 +1189,7 @@ def parse_varaction2(switch_block): expr = reduce_varaction2_expr(switch_block.expr, var_scope) - offset = 4 # first var + offset = 5 # first var parser = Varaction2Parser(feature, switch_block.var_range) parser.parse_expr(expr) @@ -1192,7 +1197,7 @@ def parse_varaction2(switch_block): for mod in parser.mods: act6.modify_bytes(mod.param, mod.size, mod.offset + offset) varaction2.var_list = parser.var_list - offset += parser.var_list_size + 1 # +1 for the byte num-ranges + offset += parser.var_list_size + 2 # +2 for the word num-ranges for proc in parser.proc_call_list: action2.add_ref(proc, varaction2, True) diff --git a/nml/actions/action3.py b/nml/actions/action3.py index c19095ef..bb90013b 100644 --- a/nml/actions/action3.py +++ b/nml/actions/action3.py @@ -73,18 +73,16 @@ def map_cid(cid): self.def_cid = map_cid(self.def_cid) def write(self, file): - size = 7 + 3 * len(self.cid_mappings) - if self.feature <= 3 or self.id >= 0xFF: - size += 2 # Vehicles or IDs >= 255 use extended byte + size = 10 + 4 * len(self.cid_mappings) file.start_sprite(size) file.print_bytex(3) file.print_bytex(self.feature) - file.print_bytex(1 if not self.is_livery_override else 0x81) # a single id - file.print_varx(self.id, 3 if self.feature <= 3 or self.id >= 0xFF else 1) - file.print_byte(len(self.cid_mappings)) + file.print_wordx(1 if not self.is_livery_override else 0x8001) # a single id + file.print_wordx(self.id) + file.print_word(len(self.cid_mappings)) file.newline() for cargo, cid, comment in self.cid_mappings: - file.print_bytex(cargo) + file.print_wordx(cargo) file.print_wordx(cid) file.newline(comment) file.print_wordx(self.def_cid) @@ -238,9 +236,8 @@ def create_cb_choice_varaction2(feature, expr, mapping, default, pos): def create_action3(feature, id, action_list, act6, is_livery_override): - # Vehicles use an extended byte - size = 2 if feature <= 3 else 1 - offset = 4 if feature <= 3 else 3 + size = 2 + offset = 5 id, offset = actionD.write_action_value(id, action_list, act6, offset, size) return Action3(feature, id.value, is_livery_override) diff --git a/nml/actions/action4.py b/nml/actions/action4.py index 77c65e06..20d46f4e 100644 --- a/nml/actions/action4.py +++ b/nml/actions/action4.py @@ -28,9 +28,6 @@ class Action4(base_action.BaseAction): @ivar lang: Language ID of the text (set as ##grflangid in the .lng file, 0x7F for default) @type lang: C{int} - @ivar size: Size of the id, may be 1 (byte), 2 (word) or 3 (ext. byte) - @type size: C{int} - @ivar id: ID of the first string to write @type id: C{int} @@ -38,28 +35,27 @@ class Action4(base_action.BaseAction): @type texts: C{list} of C{str} """ - def __init__(self, feature, lang, size, id, texts): + def __init__(self, feature, lang, generic, id, texts): self.feature = feature self.lang = lang - self.size = size + self.generic = generic self.id = id self.texts = texts def prepare_output(self, sprite_num): - # To indicate a word value, bit 7 of the lang ID must be set - if self.size == 2: + if self.generic: self.lang = self.lang | 0x80 def write(self, file): - size = 4 + self.size + size = 7 for text in self.texts: size += grfstrings.get_string_size(text) file.start_sprite(size) file.print_bytex(4) file.print_bytex(self.feature) file.print_bytex(self.lang) - file.print_bytex(len(self.texts)) - file.print_varx(self.id, self.size) + file.print_wordx(len(self.texts)) + file.print_wordx(self.id) for text in self.texts: file.print_string(text) file.newline() @@ -134,8 +130,13 @@ def get_global_string_actions(): for text in texts: str_lang, str_id, str_text, feature = text # If possible, append strings to the last action 4 instead of creating a new one - if str_lang != last_lang or str_id - 1 != last_id or feature != last_feature or len(actions[-1].texts) == 0xFF: - actions.append(Action4(feature, str_lang, 2, str_id, [str_text])) + if ( + str_lang != last_lang + or str_id - 1 != last_id + or feature != last_feature + or len(actions[-1].texts) == 0xFFFF + ): + actions.append(Action4(feature, str_lang, True, str_id, [str_text])) else: actions[-1].texts.append(str_text) last_lang = str_lang @@ -174,7 +175,7 @@ def get_string_action4s(feature, string_range, string, id=None): mod = None if string_range is not None: - size = 2 + generic = True if string_ranges[string_range]["random_id"]: # ID is allocated randomly, we will output the actions later write_action4s = False @@ -199,7 +200,7 @@ def get_string_action4s(feature, string_range, string, id=None): else: # Not a string range, so we must have an id assert id is not None - size = 3 if feature <= 3 else 1 + generic = False if isinstance(id, expression.ConstantNumeric): id_val = id.value else: @@ -207,7 +208,7 @@ def get_string_action4s(feature, string_range, string, id=None): tmp_param, tmp_param_actions = actionD.get_tmp_parameter(id) actions.extend(tmp_param_actions) # Apply ID via action4 later - mod = (tmp_param, 2 if feature <= 3 else 1, 5 if feature <= 3 else 4) + mod = (tmp_param, 2, 5) if write_action4s: strings = [ @@ -221,7 +222,7 @@ def get_string_action4s(feature, string_range, string, id=None): act6 = action6.Action6() act6.modify_bytes(*mod) actions.append(act6) - actions.append(Action4(feature, lang_id, size, id_val, [text])) + actions.append(Action4(feature, lang_id, generic, id_val, [text])) action6.free_parameters.restore() diff --git a/nml/actions/action5.py b/nml/actions/action5.py index 3c9388be..1c9e9bca 100644 --- a/nml/actions/action5.py +++ b/nml/actions/action5.py @@ -29,14 +29,12 @@ def prepare_output(self, sprite_num): def write(self, file): # * 05 [] - size = 5 if self.offset is None else 8 + size = 4 if self.offset is None else 6 file.start_sprite(size) file.print_bytex(0x05) file.print_bytex(self.type) - file.print_bytex(0xFF) file.print_word(self.num_sprites) if self.offset is not None: - file.print_bytex(0xFF) file.print_word(self.offset) file.newline() file.end_sprite() diff --git a/nml/actions/action6.py b/nml/actions/action6.py index 0f23a075..6a8671f5 100644 --- a/nml/actions/action6.py +++ b/nml/actions/action6.py @@ -43,14 +43,13 @@ def modify_bytes(self, param, num_bytes, offset): self.modifications.append((param, num_bytes, offset)) def write(self, file): - size = 2 + 5 * len(self.modifications) + size = 2 + 4 * len(self.modifications) file.start_sprite(size) file.print_bytex(6) file.newline() for mod in self.modifications: file.print_bytex(mod[0]) file.print_bytex(mod[1]) - file.print_bytex(0xFF) file.print_wordx(mod[2]) file.newline() file.print_bytex(0xFF) diff --git a/nml/actions/action7.py b/nml/actions/action7.py index c7a4da22..e47b7cb0 100644 --- a/nml/actions/action7.py +++ b/nml/actions/action7.py @@ -17,7 +17,7 @@ from nml.actions import action6, action10, actionD, base_action free_labels = free_number_list.FreeNumberList( - list(range(0xFF, 0x0F, -1)), + list(range(0xFFFF, 0x7FFF, -1)), "No label available to use for large if-blocks and loops.", "No unique label available to use for large if-blocks and loops.", ) @@ -38,7 +38,6 @@ def print_stats(): class SkipAction(base_action.BaseAction): def __init__(self, action_type, var, varsize, condtype, value, label): self.action_type = action_type - self.label = label self.var = var self.varsize = varsize self.condtype = condtype @@ -48,7 +47,7 @@ def __init__(self, action_type, var, varsize, condtype, value, label): assert self.varsize == 1 def write(self, file): - size = 5 + self.varsize + size = 6 + self.varsize file.start_sprite(size) file.print_bytex(self.action_type) file.print_bytex(self.var) @@ -60,7 +59,7 @@ def write(self, file): file.print_dwordx(self.value >> 32) else: file.print_varx(self.value, self.varsize) - file.print_bytex(self.label) + file.print_wordx(self.label) file.newline() file.end_sprite() diff --git a/nml/actions/action8.py b/nml/actions/action8.py index 6e039e87..710c36d7 100644 --- a/nml/actions/action8.py +++ b/nml/actions/action8.py @@ -30,7 +30,7 @@ def write(self, file): file.start_sprite(size) file.print_bytex(8) # Write the grf version - file.print_bytex(8) + file.print_bytex(9) file.print_string(self.grfid.value, False, True) file.print_string(name) file.print_string(desc) diff --git a/nml/actions/actionA.py b/nml/actions/actionA.py index 6798a27c..5be25bea 100644 --- a/nml/actions/actionA.py +++ b/nml/actions/actionA.py @@ -30,12 +30,12 @@ def __init__(self, sets): def write(self, file): # * 0A [ ]+ - size = 2 + 3 * len(self.sets) + size = 3 + 4 * len(self.sets) file.start_sprite(size) file.print_bytex(0x0A) - file.print_byte(len(self.sets)) + file.print_word(len(self.sets)) for num, first in self.sets: - file.print_byte(num) + file.print_word(num) file.print_word(first) file.newline() file.end_sprite() @@ -55,13 +55,13 @@ def parse_actionA(replaces): real_sprite_list = real_sprite.parse_sprite_data(replaces) block_list = [] total_sprites = len(real_sprite_list) - offset = 2 # Skip 0A and + offset = 3 # Skip 0A and sprite_offset = 0 # Number of sprites already covered by previous [ ]-pairs while total_sprites > 0: - this_block = min(total_sprites, 255) # number of sprites in this block + this_block = min(total_sprites, 65535) # number of sprites in this block total_sprites -= this_block - offset += 1 # Skip + offset += 2 # Skip first_sprite = replaces.start_id # number of first sprite if sprite_offset != 0: diff --git a/nml/actions/actionE.py b/nml/actions/actionE.py index 1c28956d..59cb8b56 100644 --- a/nml/actions/actionE.py +++ b/nml/actions/actionE.py @@ -21,10 +21,10 @@ def __init__(self, grfid_list): self.grfid_list = grfid_list def write(self, file): - size = 2 + 4 * len(self.grfid_list) + size = 3 + 4 * len(self.grfid_list) file.start_sprite(size) file.print_bytex(0x0E) - file.print_byte(len(self.grfid_list)) + file.print_word(len(self.grfid_list)) for grfid in self.grfid_list: file.newline() file.print_dwordx(grfid) diff --git a/nml/output_base.py b/nml/output_base.py index 27e51ad3..8308e427 100644 --- a/nml/output_base.py +++ b/nml/output_base.py @@ -192,16 +192,13 @@ def print_varx(self, value, size): @param value: Value to output. @type value: C{int} - @param size: Size of the output (1..4), 3 means extended byte. + @param size: Size of the output (1, 2, 4). @type size: C{int} """ if size == 1: self.print_bytex(value) elif size == 2: self.print_wordx(value) - elif size == 3: - self.print_bytex(0xFF) - self.print_wordx(value) elif size == 4: self.print_dwordx(value) else: diff --git a/regression/expected/001_action8.grf b/regression/expected/001_action8.grf index c183e0c5..38845df3 100644 Binary files a/regression/expected/001_action8.grf and b/regression/expected/001_action8.grf differ diff --git a/regression/expected/001_action8.nfo b/regression/expected/001_action8.nfo index 4b69342b..71680ec0 100644 --- a/regression/expected/001_action8.nfo +++ b/regression/expected/001_action8.nfo @@ -15,4 +15,4 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\1" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\1" "NML regression test" 00 "A test newgrf testing NML" 00 diff --git a/regression/expected/002_sounds.grf b/regression/expected/002_sounds.grf index 652e7784..13bfda3b 100644 Binary files a/regression/expected/002_sounds.grf and b/regression/expected/002_sounds.grf differ diff --git a/regression/expected/002_sounds.nfo b/regression/expected/002_sounds.nfo index 6a47d89b..38a110e1 100644 --- a/regression/expected/002_sounds.nfo +++ b/regression/expected/002_sounds.nfo @@ -28,9 +28,9 @@ 8 * 8 FE 00 \dx78563412 \wx0003 9 ** beef.wav 10 * 8 FE 00 \dx78563412 \wx0003 -11 * 9 00 0C \b1 01 FF \wx0049 +11 * 9 00 0C \b1 \wx0001 \wx0049 08 66 -12 * 10 00 0C \b1 02 FF \wx004B +12 * 10 00 0C \b1 \wx0002 \wx004B 08 4C 33 diff --git a/regression/expected/003_assignment.grf b/regression/expected/003_assignment.grf index 52f11c2a..a2ccffbb 100644 Binary files a/regression/expected/003_assignment.grf and b/regression/expected/003_assignment.grf differ diff --git a/regression/expected/003_assignment.nfo b/regression/expected/003_assignment.nfo index f56944c4..d265e946 100644 --- a/regression/expected/003_assignment.nfo +++ b/regression/expected/003_assignment.nfo @@ -32,15 +32,15 @@ // param[127] = param[3] 8 * 5 0D 7F \D= 03 00 -9 * 7 06 -7F 01 FF \wx0003 +9 * 6 06 +7F 01 \wx0003 FF // param[7] = param[0] 10 * 5 0D 07 \D= 00 00 -11 * 7 06 -00 01 FF \wx0001 +11 * 6 06 +00 01 \wx0001 FF // param[0] = 5 @@ -49,9 +49,9 @@ FF // param[127] = param[3] 13 * 5 0D 7F \D= 03 00 -14 * 12 06 -00 01 FF \wx0001 -7F 01 FF \wx0003 +14 * 10 06 +00 01 \wx0001 +7F 01 \wx0003 FF // param[0] = param[0] diff --git a/regression/expected/004_deactivate.grf b/regression/expected/004_deactivate.grf index 3a67966a..f02a955c 100644 Binary files a/regression/expected/004_deactivate.grf and b/regression/expected/004_deactivate.grf differ diff --git a/regression/expected/004_deactivate.nfo b/regression/expected/004_deactivate.nfo index 356f1992..97de1fea 100644 --- a/regression/expected/004_deactivate.nfo +++ b/regression/expected/004_deactivate.nfo @@ -5,10 +5,10 @@ // 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 * 6 0E \b1 +0 * 7 0E \w1 \dx44434241 -1 * 10 0E \b2 +1 * 11 0E \w2 \dx04030201 \dx48474645 diff --git a/regression/expected/005_error.grf b/regression/expected/005_error.grf index 83e0f4e4..69760f28 100644 Binary files a/regression/expected/005_error.grf and b/regression/expected/005_error.grf differ diff --git a/regression/expected/005_error.nfo b/regression/expected/005_error.nfo index 329e6846..40267a6e 100644 --- a/regression/expected/005_error.nfo +++ b/regression/expected/005_error.nfo @@ -31,7 +31,7 @@ // param[127] = (param[127] << -31) 9 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 -10 * 9 09 7F 04 \7= \dx00000000 02 +10 * 10 09 7F 04 \7= \dx00000000 \wx0002 11 * 61 0B 03 1F 06 "De wissels zijn bevroren, onze excuses voor het ongemak." 00 @@ -46,7 +46,7 @@ // param[127] = (param[127] << -31) 15 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 -16 * 9 09 7F 04 \7= \dx00000000 02 +16 * 10 09 7F 04 \7= \dx00000000 \wx0002 17 * 61 0B 03 1F 06 "De wissels zijn bevroren, onze excuses voor het ongemak." 00 @@ -61,7 +61,7 @@ // param[127] = (param[127] << -31) 21 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 -22 * 9 09 7F 04 \7= \dx00000000 02 +22 * 10 09 7F 04 \7= \dx00000000 \wx0002 23 * 61 0B 03 1F 06 "De wissels zijn bevroren, onze excuses voor het ongemak." 00 diff --git a/regression/expected/006_vehicle.grf b/regression/expected/006_vehicle.grf index 4000e1f9..8023ee1c 100644 Binary files a/regression/expected/006_vehicle.grf and b/regression/expected/006_vehicle.grf differ diff --git a/regression/expected/006_vehicle.nfo b/regression/expected/006_vehicle.nfo index 8c6e4b9f..c5f10e42 100644 --- a/regression/expected/006_vehicle.nfo +++ b/regression/expected/006_vehicle.nfo @@ -15,9 +15,9 @@ "B" "BLTR" \w1 "3" 00 00 -2 * 52 08 08 "NML\6" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 32 00 08 \b1 06 FF \wx0000 -09 "PASS" "MAIL" "GOOD" "IORE" "GOLD" +2 * 52 08 09 "NML\6" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 33 00 08 \b1 \wx0006 \wx0000 +\wx0009 "PASS" "MAIL" "GOOD" "IORE" "GOLD" "FOOD" // param[0] = 9 @@ -25,10 +25,10 @@ // Name: switch_length // d : register 80 -5 * 31 02 01 FF 89 -7D 80 20 \dxFFFFFFFF // d +5 * 36 02 01 \wx7FFF 89 +7D \dx00000080 20 \dxFFFFFFFF // d \2+ 40 00 \dx000000FF -\b1 +\w1 \wx8005 \dx00000001 \dx00000001 // 1 .. 1: return 5; \wx8006 // default: return 6; @@ -38,11 +38,11 @@ // param[127] = (param[126] + 5) 7 * 9 0D 7F \D+ 7E FF \dx00000005 -8 * 7 06 -7F 01 FF \wx002C +8 * 6 06 +7F 01 \wx002C FF -9 * 63 00 01 \b21 01 FF \wx0059 +9 * 63 00 01 \b21 \wx0001 \wx0059 06 03 04 28 03 1E @@ -65,11 +65,11 @@ FF 16 \dx00000000 1C 01 -10 * 27 04 01 7F 01 FF \wx0059 "Foster Express Tram" 00 +10 * 27 04 01 7F \wx0001 \wx0059 "Foster Express Tram" 00 -11 * 23 04 01 1F 01 FF \wx0059 "Foster Sneltram" 00 +11 * 23 04 01 1F \wx0001 \wx0059 "Foster Sneltram" 00 -12 * 6 01 01 \b1 FF \wx0008 +12 * 5 01 01 \b1 \wx0008 13 opengfx_generic_trams1.pcx 8bpp 48 56 8 18 -3 -10 normal | opengfx_generic_trams1.png 32bpp 48 56 8 18 -3 -10 normal @@ -105,52 +105,52 @@ FF | opengfx_generic_trams1.pcx 8bpp 272 56 20 19 -6 -7 zi2 // Name: foster_express_set - feature 01 -21 * 9 02 01 FE \b1 \b1 +21 * 10 02 01 \wx7FFE \b1 \b1 \w0 \w0 // Name: @CB_FAILED_REAL01 -22 * 9 02 01 FD \b1 \b1 +22 * 10 02 01 \wx7FFD \b1 \b1 \w0 \w0 // Name: @CB_FAILED01 -23 * 23 02 01 FD 89 +23 * 25 02 01 \wx7FFD 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FD // Non-graphics callback, return graphics result +\wx7FFD // Non-graphics callback, return graphics result // Name: @return_action_0 -24 * 20 02 01 FC 89 +24 * 22 02 01 \wx7FFC 89 1A 20 \dx00000008 \2- 1C 00 \dxFFFFFFFF -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_1 -25 * 38 02 01 FC 89 +25 * 41 02 01 \wx7FFC 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]) +\2r 7E \wx7FFF 00 \dxFFFFFFFF // switch_length(0) +\w1 +\wx7FFD \dx0000FFFF \dx0000FFFF // @CB_FAILED01; +\wx7FFC // return (8 - var[0x1C, 0, -1]) // Name: @action3_0 -26 * 23 02 01 FC 89 +26 * 25 02 01 \wx7FFC 89 10 00 \dx000000FF -\b1 -\wx00FC \dx00000023 \dx00000023 // @action3_1; -\wx00FE // foster_express_set; +\w1 +\wx7FFC \dx00000023 \dx00000023 // @action3_1; +\wx7FFE // foster_express_set; // Name: @action3_2 -27 * 23 02 01 FE 89 +27 * 25 02 01 \wx7FFE 89 0C 00 \dx0000FFFF -\b1 -\wx00FC \dx00000036 \dx00000036 // @action3_0; -\wx00FE // foster_express_set; +\w1 +\wx7FFC \dx00000036 \dx00000036 // @action3_0; +\wx7FFE // foster_express_set; -28 * 9 03 01 01 FF \wx0059 \b0 -\wx00FE // @action3_2; +28 * 10 03 01 \wx0001 \wx0059 \w0 +\wx7FFE // @action3_2; diff --git a/regression/expected/007_townnames.grf b/regression/expected/007_townnames.grf index 24be739c..50df6a6d 100644 Binary files a/regression/expected/007_townnames.grf and b/regression/expected/007_townnames.grf differ diff --git a/regression/expected/007_townnames.nfo b/regression/expected/007_townnames.nfo index 52f8a916..aa820078 100644 --- a/regression/expected/007_townnames.nfo +++ b/regression/expected/007_townnames.nfo @@ -15,7 +15,7 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\7" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\7" "NML regression test" 00 "A test newgrf testing NML" 00 3 * 52 0F 00 // A 02 04 00 05 0A "small" 00 0A "medium" 00 diff --git a/regression/expected/008_railtypes.grf b/regression/expected/008_railtypes.grf index 11253794..23551c2f 100644 Binary files a/regression/expected/008_railtypes.grf and b/regression/expected/008_railtypes.grf differ diff --git a/regression/expected/008_railtypes.nfo b/regression/expected/008_railtypes.nfo index 6d36ab78..1fcb44a7 100644 --- a/regression/expected/008_railtypes.nfo +++ b/regression/expected/008_railtypes.nfo @@ -5,8 +5,8 @@ // 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 * 21 00 10 \b3 01 FF \wx0000 +0 * 22 00 10 \b3 \wx0001 \wx0000 08 "RAIL" 14 \wx0028 -0E \b1 "ELRL" +0E \w1 "ELRL" diff --git a/regression/expected/009_replace.grf b/regression/expected/009_replace.grf index 18525efb..e9b0d210 100644 Binary files a/regression/expected/009_replace.grf and b/regression/expected/009_replace.grf differ diff --git a/regression/expected/009_replace.nfo b/regression/expected/009_replace.nfo index b0e4a8d7..d3dc9385 100644 --- a/regression/expected/009_replace.nfo +++ b/regression/expected/009_replace.nfo @@ -15,13 +15,13 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\9" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 5 0A \b1 \b2 \w3092 +2 * 52 08 09 "NML\9" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 7 0A \w1 \w2 \w3092 4 opengfx_generic_trams1.pcx 8bpp 48 56 8 18 -3 -10 normal 5 opengfx_generic_trams1.pcx 8bpp 48 56 8 18 -3 4 normal -6 * 8 05 89 FF \w6 FF \w0 +6 * 6 05 89 \w6 \w0 7 oneway.png 8bpp 18 8 24 16 -12 -8 normal 8 oneway.png 8bpp 50 8 24 16 -12 -8 normal diff --git a/regression/expected/010_liveryoverride.grf b/regression/expected/010_liveryoverride.grf index 48ea9ae5..6f48204c 100644 Binary files a/regression/expected/010_liveryoverride.grf and b/regression/expected/010_liveryoverride.grf differ diff --git a/regression/expected/010_liveryoverride.nfo b/regression/expected/010_liveryoverride.nfo index 1b7959bc..663cc5a2 100644 --- a/regression/expected/010_liveryoverride.nfo +++ b/regression/expected/010_liveryoverride.nfo @@ -15,8 +15,8 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\10" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 6 01 00 \b3 FF \wx0008 +2 * 52 08 09 "NML\10" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 5 01 00 \b3 \wx0008 4 opengfx_trains_start.pcx 8bpp 142 112 8 22 -3 -10 normal 5 opengfx_trains_start.pcx 8bpp 158 112 21 15 -14 -7 normal @@ -46,31 +46,31 @@ 27 opengfx_trains_start.pcx 8bpp 366 139 20 16 -6 -7 normal // Name: turbotrain_engine_group - feature 00 -28 * 9 02 00 FF \b1 \b1 +28 * 10 02 00 \wx7FFF \b1 \b1 \w0 \w0 // Name: normal_passenger_group - feature 00 -29 * 9 02 00 FE \b1 \b1 +29 * 10 02 00 \wx7FFE \b1 \b1 \w1 \w1 // Name: turbotrain_passenger_group - feature 00 -30 * 9 02 00 FD \b1 \b1 +30 * 10 02 00 \wx7FFD \b1 \b1 \w2 \w2 -31 * 11 00 00 \b2 01 FF \wx0014 +31 * 11 00 00 \b2 \wx0001 \wx0014 12 FD 27 04 -32 * 9 03 00 01 FF \wx0014 \b0 -\wx00FF // turbotrain_engine_group; +32 * 10 03 00 \wx0001 \wx0014 \w0 +\wx7FFF // turbotrain_engine_group; -33 * 9 03 00 81 FF \wx001B \b0 -\wx00FD // turbotrain_passenger_group; +33 * 10 03 00 \wx8001 \wx001B \w0 +\wx7FFD // turbotrain_passenger_group; -34 * 27 00 00 \b6 01 FF \wx001B +34 * 27 00 00 \b6 \wx0001 \wx001B 12 FD 27 04 28 \wx0001 @@ -78,6 +78,6 @@ 29 \wx0000 1D \dx00000000 -35 * 9 03 00 01 FF \wx001B \b0 -\wx00FE // normal_passenger_group; +35 * 10 03 00 \wx0001 \wx001B \w0 +\wx7FFE // normal_passenger_group; diff --git a/regression/expected/011_snowline.grf b/regression/expected/011_snowline.grf index 7ee9876d..01d5650a 100644 Binary files a/regression/expected/011_snowline.grf and b/regression/expected/011_snowline.grf differ diff --git a/regression/expected/011_snowline.nfo b/regression/expected/011_snowline.nfo index ddd99447..19105286 100644 --- a/regression/expected/011_snowline.nfo +++ b/regression/expected/011_snowline.nfo @@ -15,8 +15,8 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\11" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 392 00 08 \b1 01 FF \wx0000 +2 * 52 08 09 "NML\11" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 392 00 08 \b1 \wx0001 \wx0000 10 06 06 06 05 05 05 05 05 04 04 04 04 04 04 03 03 diff --git a/regression/expected/012_basecost.grf b/regression/expected/012_basecost.grf index 1f5d131f..f1f58e23 100644 Binary files a/regression/expected/012_basecost.grf and b/regression/expected/012_basecost.grf differ diff --git a/regression/expected/012_basecost.nfo b/regression/expected/012_basecost.nfo index 49f41a79..6ac4ee42 100644 --- a/regression/expected/012_basecost.nfo +++ b/regression/expected/012_basecost.nfo @@ -15,45 +15,45 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\12" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\12" "NML regression test" 00 "A test newgrf testing NML" 00 // param[127] = (param[2] + 8) 3 * 9 0D 7F \D+ 02 FF \dx00000008 -4 * 7 06 -7F 01 FF \wx0008 +4 * 6 06 +7F 01 \wx0008 FF -5 * 9 00 08 \b1 01 FF \wx0001 +5 * 9 00 08 \b1 \wx0001 \wx0001 08 00 -6 * 14 00 08 \b1 06 FF \wx002A +6 * 14 00 08 \b1 \wx0006 \wx002A 08 06 06 06 06 06 06 -7 * 13 00 08 \b1 05 FF \wx0042 +7 * 13 00 08 \b1 \wx0005 \wx0042 08 06 06 06 06 06 // param[126] = (param[1] + 9) 8 * 9 0D 7E \D+ 01 FF \dx00000009 -9 * 27 06 -7E 01 FF \wx0008 -7E 01 FF \wx0009 -7E 01 FF \wx000A -7E 01 FF \wx000B -7E 01 FF \wx000C +9 * 22 06 +7E 01 \wx0008 +7E 01 \wx0009 +7E 01 \wx000A +7E 01 \wx000B +7E 01 \wx000C FF -10 * 13 00 08 \b1 05 FF \wx000F +10 * 13 00 08 \b1 \wx0005 \wx000F 08 00 00 00 00 00 -11 * 9 00 08 \b1 01 FF \wx0034 +11 * 9 00 08 \b1 \wx0001 \wx0034 08 15 // param[124] = param[11] 12 * 5 0D 7C \D= 0B 00 -13 * 7 06 -7C 01 FF \wx0003 +13 * 6 06 +7C 01 \wx0003 FF // param[125] = param[0] @@ -62,8 +62,8 @@ FF // param[122] = (param[11] + 1) 15 * 9 0D 7A \D+ 0B FF \dx00000001 -16 * 7 06 -7A 01 FF \wx0003 +16 * 6 06 +7A 01 \wx0003 FF // param[123] = param[0] @@ -72,11 +72,11 @@ FF // param[124] = (param[123] + 8) 18 * 9 0D 7C \D+ 7B FF \dx00000008 -19 * 12 06 -7D 02 FF \wx0005 -7C 01 FF \wx0008 +19 * 10 06 +7D 02 \wx0005 +7C 01 \wx0008 FF -20 * 9 00 08 \b1 01 FF \wx0000 +20 * 9 00 08 \b1 \wx0001 \wx0000 08 00 diff --git a/regression/expected/013_train_callback.grf b/regression/expected/013_train_callback.grf index d1daeed3..e6b23e3f 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 96ffa9ae..4c365eec 100644 --- a/regression/expected/013_train_callback.nfo +++ b/regression/expected/013_train_callback.nfo @@ -15,13 +15,13 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\13" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 8 04 00 FF 01 \wxD000 "\80" 00 +2 * 52 08 09 "NML\13" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 9 04 00 FF \wx0001 \wxD000 "\80" 00 -4 * 26 04 00 FF 01 \wxDC00 "NML Test bulk wagon" 00 +4 * 27 04 00 FF \wx0001 \wxDC00 "NML Test bulk wagon" 00 -5 * 208 00 08 \b1 32 FF \wx0000 -09 "WDPR" "SCRP" "CMNT" "WOOD" "LVST" +5 * 209 00 08 \b1 \wx0032 \wx0000 +\wx0009 "WDPR" "SCRP" "CMNT" "WOOD" "LVST" "STEL" "VEHI" "BRCK" "WOOL" "BUBL" "TOYS" "FZDR" "FRUT" "FRVG" "FOOD" "OIL_" "GOOD" "WATR" "MILK" "COAL" @@ -32,10 +32,10 @@ "MAIL" "BATT" "SWET" "RUBR" "FMSP" "ENSP" "MNSP" "FICR" "PLAS" "PLST" -6 * 28 00 08 \b1 05 FF \wx0000 -12 "RAIL" "ELRL" "MONO" "MGLV" "TRPD" +6 * 29 00 08 \b1 \wx0005 \wx0000 +\wx0012 "RAIL" "ELRL" "MONO" "MGLV" "TRPD" -7 * 6 01 00 \b8 FF \wx0004 +7 * 5 01 00 \b8 \wx0004 8 temperate_railwagons.png 8bpp 0 25 8 24 -3 -12 normal 9 temperate_railwagons.png 8bpp 16 25 22 17 -14 -9 normal @@ -78,67 +78,67 @@ 39 temperate_railwagons.png 8bpp 96 275 22 17 -6 -9 normal // Name: bulk_wagon_coal_default_group - feature 00 -40 * 13 02 00 FF \b2 \b2 +40 * 14 02 00 \wx7FFF \b2 \b2 \w0 \w1 \w0 \w1 // Name: bulk_wagon_coal_arctic_group - feature 00 -41 * 13 02 00 FE \b2 \b2 +41 * 14 02 00 \wx7FFE \b2 \b2 \w2 \w3 \w2 \w3 // Name: bulk_wagon_coal2_group - feature 00 -42 * 13 02 00 FD \b2 \b2 +42 * 14 02 00 \wx7FFD \b2 \b2 \w4 \w5 \w4 \w5 // Name: bulk_wagon_grain_group - feature 00 -43 * 13 02 00 FC \b2 \b2 +43 * 14 02 00 \wx7FFC \b2 \b2 \w6 \w7 \w6 \w7 // Name: bulk_wagon_coal_default_switch -44 * 15 02 00 FD 80 02 \b0 04 -\wx00FF \wx00FF \wx00FF // (2/3) -> (3/4): bulk_wagon_coal_default_group; -\wx00FD // (1/3) -> (1/4): bulk_wagon_coal2_group; +44 * 17 02 00 \wx7FFD 80 02 \b0 \wx0004 +\wx7FFF \wx7FFF \wx7FFF // (2/3) -> (3/4): bulk_wagon_coal_default_group; +\wx7FFD // (1/3) -> (1/4): bulk_wagon_coal2_group; // param[127] = (param[131] & 255) 45 * 9 0D 7F \D& 83 FF \dx000000FF -46 * 7 06 -7F 04 FF \wx0006 +46 * 6 06 +7F 04 \wx0007 FF // Name: bulk_wagon_coal_climate_switch -47 * 23 02 00 FD 89 +47 * 25 02 00 \wx7FFD 89 1A 00 \dx00000000 // param[127] -\b1 -\wx00FE \dx00000001 \dx00000001 // 1 .. 1: bulk_wagon_coal_arctic_group; -\wx00FD // default: bulk_wagon_coal_default_switch; +\w1 +\wx7FFE \dx00000001 \dx00000001 // 1 .. 1: bulk_wagon_coal_arctic_group; +\wx7FFD // default: bulk_wagon_coal_default_switch; // Name: bulk_wagon_graphics_switch -48 * 23 02 00 FC 89 +48 * 25 02 00 \wx7FFC 89 47 00 \dx000000FF -\b1 -\wx00FD \dx00000013 \dx00000013 // 19 .. 19: bulk_wagon_coal_climate_switch; -\wx00FC // default: bulk_wagon_grain_group; +\w1 +\wx7FFD \dx00000013 \dx00000013 // 19 .. 19: bulk_wagon_coal_climate_switch; +\wx7FFC // default: bulk_wagon_grain_group; // Name: @CB_FAILED_REAL00 -49 * 9 02 00 FD \b1 \b1 +49 * 10 02 00 \wx7FFD \b1 \b1 \w0 \w0 // Name: @CB_FAILED00 -50 * 23 02 00 FD 89 +50 * 25 02 00 \wx7FFD 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FD // Non-graphics callback, return graphics result +\wx7FFD // Non-graphics callback, return graphics result // Name: bulk_wagon_cb_capacity_switch -51 * 83 02 00 FE 89 +51 * 85 02 00 \wx7FFE 89 47 00 \dx000000FF -\b7 +\w7 \wx8019 \dx0000002F \dx0000002F // 47 .. 47: return 25; \wx8014 \dx0000000C \dx0000000C // 12 .. 12: return 20; \wx8014 \dx0000000D \dx0000000D // 13 .. 13: return 20; @@ -146,24 +146,24 @@ 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 +\wx7FFD // No default specified -> fail callback // Name: bulk_wagon_cb_weight_switch -52 * 53 02 00 FF 89 +52 * 55 02 00 \wx7FFF 89 47 00 \dx000000FF -\b4 +\w4 \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 +\wx7FFD // No default specified -> fail callback // Name: bulk_wagon_cb_name_switch -53 * 30 02 00 FD 89 +53 * 32 02 00 \wx7FFD 89 1A 20 \dx0000DC00 \2sto 1A 00 \dx00000100 -\b1 -\wx00FD \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\w1 +\wx7FFD \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return string(STR_JUST_STRING); // param[125] = (param[1] * 5000) @@ -202,14 +202,14 @@ FF // param[124] = (param[123] / 2211) 65 * 9 0D 7C \D/ 7B FF \dx000008A3 -66 * 22 06 -7F 02 FF \wx000B -7E 02 FF \wx000E -7D 02 FF \wx0011 -7C 02 FF \wx0014 +66 * 18 06 +7F 02 \wx000B +7E 02 \wx000E +7D 02 \wx0011 +7C 02 \wx0014 FF -67 * 22 00 00 \b5 01 FF \wx0074 +67 * 22 00 00 \b5 \wx0001 \wx0074 09 \wx0024 09 \wx0000 09 \wx0000 @@ -222,21 +222,21 @@ FF // param[126] = (param[1] << -8) 69 * 9 0D 7E \D<< 01 FF \dxFFFFFFF8 -70 * 12 06 -7F 01 FF \wx004D -7E 01 FF \wx004F +70 * 10 06 +7F 01 \wx0054 +7E 01 \wx0056 FF -71 * 82 00 00 \b26 01 FF \wx0074 +71 * 89 00 00 \b26 \wx0001 \wx0074 06 0F 28 \wx0010 1D \dx00000000 29 \wx01CB 1D \dx00000000 -2C \b4 -00 01 0C 0D +2C \w4 +\wx0000 \wx0001 \wx000C \wx000D 1D \dx00000000 -15 13 +15 \wx0013 12 FD 2A \dx000A7A40 04 FF @@ -248,7 +248,7 @@ FF 0D 05 09 \wx0000 1C 28 -05 00 +05 \wx0000 0B \wx0000 0E \dx00004C30 14 1E @@ -256,45 +256,45 @@ FF 24 00 25 00 -72 * 27 04 00 7F 01 FF \wx0074 "NML Test bulk wagon" 00 +72 * 27 04 00 7F \wx0001 \wx0074 "NML Test bulk wagon" 00 -73 * 11 00 00 \b2 01 FF \wx0074 +73 * 11 00 00 \b2 \wx0001 \wx0074 1E 08 31 01 // Name: @action3_0 -74 * 33 02 00 FF 89 +74 * 35 02 00 \wx7FFF 89 10 00 \dx000000FF -\b2 -\wx00FE \dx00000014 \dx00000014 // bulk_wagon_cb_capacity_switch; -\wx00FF \dx00000016 \dx00000016 // bulk_wagon_cb_weight_switch; -\wx00FC // bulk_wagon_graphics_switch; +\w2 +\wx7FFE \dx00000014 \dx00000014 // bulk_wagon_cb_capacity_switch; +\wx7FFF \dx00000016 \dx00000016 // bulk_wagon_cb_weight_switch; +\wx7FFC // bulk_wagon_graphics_switch; // Name: @action3_1 -75 * 33 02 00 FB 89 +75 * 35 02 00 \wx7FFB 89 10 00 \dx000000FF -\b2 +\w2 \wx801E \dx00000014 \dx00000014 // return 30; \wx8019 \dx00000016 \dx00000016 // return 25; -\wx00FC // bulk_wagon_graphics_switch; +\wx7FFC // bulk_wagon_graphics_switch; // Name: @action3_2 -76 * 33 02 00 FF 89 +76 * 35 02 00 \wx7FFF 89 0C 00 \dx0000FFFF -\b2 -\wx00FE \dx00000015 \dx00000015 // bulk_wagon_cb_capacity_switch; -\wx00FF \dx00000036 \dx00000036 // @action3_0; -\wx00FC // bulk_wagon_graphics_switch; +\w2 +\wx7FFE \dx00000015 \dx00000015 // bulk_wagon_cb_capacity_switch; +\wx7FFF \dx00000036 \dx00000036 // @action3_0; +\wx7FFC // bulk_wagon_graphics_switch; // Name: @action3_3 -77 * 33 02 00 FC 89 +77 * 35 02 00 \wx7FFC 89 0C 00 \dx0000FFFF -\b2 -\wx00FB \dx00000036 \dx00000036 // @action3_1; -\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; -\wx00FF // @action3_2; +\w2 +\wx7FFB \dx00000036 \dx00000036 // @action3_1; +\wx7FFD \dx00000161 \dx00000161 // bulk_wagon_cb_name_switch; +\wx7FFC // bulk_wagon_graphics_switch; + +78 * 14 03 00 \wx0001 \wx0074 \w1 +\wx00FF \wx7FFC // @action3_3; +\wx7FFF // @action3_2; diff --git a/regression/expected/014_read_special_param.grf b/regression/expected/014_read_special_param.grf index b9db74ca..b23e42f1 100644 Binary files a/regression/expected/014_read_special_param.grf and b/regression/expected/014_read_special_param.grf differ diff --git a/regression/expected/014_read_special_param.nfo b/regression/expected/014_read_special_param.nfo index 8eebd544..fc24f886 100644 --- a/regression/expected/014_read_special_param.nfo +++ b/regression/expected/014_read_special_param.nfo @@ -34,14 +34,14 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\14" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\14" "NML regression test" 00 "A test newgrf testing NML" 00 // param[16] = param[0] 3 * 5 0D 10 \D= 00 00 // param[17] = 0 4 * 9 0D 11 \D= FF 00 \dx00000000 -5 * 6 09 01 01 \70 00 01 +5 * 7 09 01 01 \70 00 \wx0001 // param[17] = 1 6 * 9 0D 11 \D= FF 00 \dx00000001 @@ -49,7 +49,7 @@ // param[18] = 0 7 * 9 0D 12 \D= FF 00 \dx00000000 -8 * 6 09 01 01 \70 02 01 +8 * 7 09 01 01 \70 02 \wx0001 // param[18] = 1 9 * 9 0D 12 \D= FF 00 \dx00000001 @@ -63,7 +63,7 @@ // param[20] = 0 12 * 9 0D 14 \D= FF 00 \dx00000000 -13 * 6 09 9E 01 \70 03 01 +13 * 7 09 9E 01 \70 03 \wx0001 // param[20] = 1 14 * 9 0D 14 \D= FF 00 \dx00000001 diff --git a/regression/expected/015_basic_object.grf b/regression/expected/015_basic_object.grf index 13b2a086..28160c5d 100644 Binary files a/regression/expected/015_basic_object.grf and b/regression/expected/015_basic_object.grf differ diff --git a/regression/expected/015_basic_object.nfo b/regression/expected/015_basic_object.nfo index 120c651a..42e65632 100644 --- a/regression/expected/015_basic_object.nfo +++ b/regression/expected/015_basic_object.nfo @@ -15,14 +15,14 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\15" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 33 04 0F FF 02 \wxD000 "Miscellaneous" 00 "Basic object" 00 +2 * 52 08 09 "NML\15" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 34 04 0F FF \wx0002 \wxD000 "Miscellaneous" 00 "Basic object" 00 // Name: obj_basic_tile - feature 0F -4 * 18 02 0F FF \b1 \dx0000058C +4 * 19 02 0F \wx7FFF \b1 \dx0000058C \dx03078A48 \b0 \b0 \b0 \b16 \b16 \b30 -5 * 41 00 0F \b11 01 FF \wx0000 +5 * 41 00 0F \b11 \wx0001 \wx0000 08 "MISC" 09 \wxD000 0A \wxD001 @@ -35,6 +35,6 @@ 10 \wx0800 16 04 -6 * 7 03 0F 01 00 \b0 -\wx00FF // obj_basic_tile; +6 * 10 03 0F \wx0001 \wx0000 \w0 +\wx7FFF // obj_basic_tile; diff --git a/regression/expected/016_basic_airporttiles.grf b/regression/expected/016_basic_airporttiles.grf index ffd9c1a1..3b87e76a 100644 Binary files a/regression/expected/016_basic_airporttiles.grf and b/regression/expected/016_basic_airporttiles.grf differ diff --git a/regression/expected/016_basic_airporttiles.nfo b/regression/expected/016_basic_airporttiles.nfo index 110161e5..c69e26d8 100644 --- a/regression/expected/016_basic_airporttiles.nfo +++ b/regression/expected/016_basic_airporttiles.nfo @@ -5,20 +5,20 @@ // 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 * 6 01 11 \b1 FF \wx0001 +0 * 5 01 11 \b1 \wx0001 1 opengfx_trains_start.pcx 8bpp 142 112 8 22 -3 -10 normal // Name: small_airport_tiles_graphics - feature 11 -2 * 15 02 11 FF \b1 \dx00000F8D +2 * 16 02 11 \wx7FFF \b1 \dx00000F8D \dxC0000000 \b0 \b0 80 -3 * 16 00 11 \b4 01 FF \wx0000 +3 * 16 00 11 \b4 \wx0001 \wx0000 08 00 0F \wx0103 10 01 11 01 -4 * 7 03 11 01 00 \b0 -\wx00FF // small_airport_tiles_graphics; +4 * 10 03 11 \wx0001 \wx0000 \w0 +\wx7FFF // small_airport_tiles_graphics; diff --git a/regression/expected/017_articulated_tram.grf b/regression/expected/017_articulated_tram.grf index 27508713..31da1976 100644 Binary files a/regression/expected/017_articulated_tram.grf and b/regression/expected/017_articulated_tram.grf differ diff --git a/regression/expected/017_articulated_tram.nfo b/regression/expected/017_articulated_tram.nfo index 05dc5330..ff3d43b4 100644 --- a/regression/expected/017_articulated_tram.nfo +++ b/regression/expected/017_articulated_tram.nfo @@ -15,15 +15,15 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\17" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\17" "NML regression test" 00 "A test newgrf testing NML" 00 // Name: foster_express_articulated_parts -3 * 23 02 01 FF 89 +3 * 25 02 01 \wx7FFF 89 10 00 \dxFFFFFFFF -\b1 +\w1 \wx8058 \dx00000001 \dx00000003 // 1 .. 3: return 88; \wx80FF // default: return 255; -4 * 74 00 01 \b25 01 FF \wx0058 +4 * 76 00 01 \b25 \wx0001 \wx0058 06 0F 04 28 03 1E @@ -45,14 +45,14 @@ 16 \dx00000000 1E \wx0000 16 \dx00000000 -24 \b0 +24 \w0 16 \dx00000000 -10 FF +10 \wx00FF 1C 01 -5 * 25 04 01 7F 01 FF \wx0058 "Foster Turbo Tram" 00 +5 * 25 04 01 7F \wx0001 \wx0058 "Foster Turbo Tram" 00 -6 * 6 01 01 \b1 FF \wx0008 +6 * 5 01 01 \b1 \wx0008 7 tram_foster_express.png 8bpp 48 1 8 18 -3 -10 normal 8 tram_foster_express.png 8bpp 64 1 20 18 -14 -5 normal @@ -64,20 +64,20 @@ 14 tram_foster_express.png 8bpp 272 1 20 18 -6 -7 normal // Name: foster_express_set - feature 01 -15 * 9 02 01 FE \b1 \b1 +15 * 10 02 01 \wx7FFE \b1 \b1 \w0 \w0 -16 * 9 00 01 \b1 01 FF \wx0058 +16 * 9 00 01 \b1 \wx0001 \wx0058 17 10 // Name: @action3_0 -17 * 23 02 01 FE 89 +17 * 25 02 01 \wx7FFE 89 0C 00 \dx0000FFFF -\b1 -\wx00FF \dx00000016 \dx00000016 // foster_express_articulated_parts; -\wx00FE // foster_express_set; +\w1 +\wx7FFF \dx00000016 \dx00000016 // foster_express_articulated_parts; +\wx7FFE // foster_express_set; -18 * 9 03 01 01 FF \wx0058 \b0 -\wx00FE // @action3_0; +18 * 10 03 01 \wx0001 \wx0058 \w0 +\wx7FFE // @action3_0; diff --git a/regression/expected/018_airport_tile.grf b/regression/expected/018_airport_tile.grf index 8b8a421e..2658b7a3 100644 Binary files a/regression/expected/018_airport_tile.grf and b/regression/expected/018_airport_tile.grf differ diff --git a/regression/expected/018_airport_tile.nfo b/regression/expected/018_airport_tile.nfo index b339d7bd..d78a0fb1 100644 --- a/regression/expected/018_airport_tile.nfo +++ b/regression/expected/018_airport_tile.nfo @@ -15,21 +15,21 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\18" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\18" "NML regression test" 00 "A test newgrf testing NML" 00 // param[127] = 2664 3 * 9 0D 7F \D= FF 00 \dx00000A68 // param[126] = (param[127] + 52576256) 4 * 9 0D 7E \D+ 7F FF \dx03224000 -5 * 7 06 -7E 04 FF \wx0008 +5 * 6 06 +7E 04 \wx0008 FF // Name: dirt_runway_sw_snow - feature 11 -6 * 18 02 11 FF \b1 \dx00000000 +6 * 19 02 11 \wx7FFF \b1 \dx00000000 \dx00000000 \b0 \b15 \b0 \b16 \b1 \b6 -7 * 7 03 11 01 00 \b0 -\wx00FF // dirt_runway_sw_snow; +7 * 10 03 11 \wx0001 \wx0000 \w0 +\wx7FFF // dirt_runway_sw_snow; diff --git a/regression/expected/019_switch.grf b/regression/expected/019_switch.grf index 296c3e2a..df9efa35 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 9cf8eeca..113a41e9 100644 --- a/regression/expected/019_switch.nfo +++ b/regression/expected/019_switch.nfo @@ -15,69 +15,69 @@ "B" "BLTR" \w1 "8" 00 00 -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 +2 * 52 08 09 "NML\19" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 52 04 00 FF \wx0003 \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 +4 * 16 02 0A \wx7FFF 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 // Name: @CB_FAILED0A -5 * 23 02 0A FF 89 +5 * 25 02 0A \wx7FFF 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FF // Non-graphics callback, return graphics result +\wx7FFF // Non-graphics callback, return graphics result // Name: return_switch -6 * 38 02 0A FE 89 +6 * 40 02 0A \wx7FFE 89 24 60 \dxFFFFFFFF \dxFFFFF862 \dx00000001 \2psto 1A 00 \dx00000001 -\b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\w1 +\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 -7D 80 20 \dxFFFFFFFF // a +7 * 53 02 0A \wx7FFE 89 +7D \dx00000080 20 \dxFFFFFFFF // a \2psto 1A 20 \dx00000000 \2r 02 00 \dx000000FF -\b2 +\w2 \wx8000 \dx00000000 \dx0000000A // 0 .. 10: return string(STR_COALMINE_MONTH_0_10); -\wx00FE \dx0000000D \dx0000000D // 13 .. 13: return_switch; +\wx7FFE \dx0000000D \dx0000000D // 13 .. 13: return_switch; \wx8001 // default: return string(STR_COALMINE_MONTH_11); -8 * 11 00 0A \b2 01 FF \wx0000 +8 * 11 00 0A \b2 \wx0001 \wx0000 08 00 09 00 -9 * 11 00 0A \b2 01 FF \wx0000 +9 * 11 00 0A \b2 \wx0001 \wx0000 21 40 22 03 // Name: @return_action_0 -10 * 30 02 0A FE 89 +10 * 32 02 0A \wx7FFE 89 1A 20 \dx00000004 \2sto 1A 00 \dx00000080 -\b1 -\wx00FE \dx00000000 \dx00000000 // coal_mine_subtype_switch -\wx00FE // coal_mine_subtype_switch +\w1 +\wx7FFE \dx00000000 \dx00000000 // coal_mine_subtype_switch +\wx7FFE // coal_mine_subtype_switch // Name: @return_action_1 -11 * 13 02 0A FD 89 +11 * 15 02 0A \wx7FFD 89 10 00 \dx00000001 -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_0 -12 * 43 02 0A FF 89 +12 * 45 02 0A \wx7FFF 89 0C 00 \dx0000FFFF -\b3 -\wx00FE \dx00000037 \dx00000037 // @return_action_0; +\w3 +\wx7FFE \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; +\wx7FFD \dx0000003B \dx0000003B // return var[0x10, 0, 1] +\wx7FFF // @CB_FAILED0A; -13 * 7 03 0A 01 00 \b0 -\wx00FF // @action3_0; +13 * 10 03 0A \wx0001 \wx0000 \w0 +\wx7FFF // @action3_0; diff --git a/regression/expected/020_recolour.grf b/regression/expected/020_recolour.grf index 20c9e0df..4f8f72bd 100644 Binary files a/regression/expected/020_recolour.grf and b/regression/expected/020_recolour.grf differ diff --git a/regression/expected/020_recolour.nfo b/regression/expected/020_recolour.nfo index 53020982..140fd332 100644 --- a/regression/expected/020_recolour.nfo +++ b/regression/expected/020_recolour.nfo @@ -15,15 +15,15 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\20" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\20" "NML regression test" 00 "A test newgrf testing NML" 00 // param[3] = param[\DR] 3 * 9 0D 03 \D= \DR FE \dx000308FF -4 * 7 06 -03 02 FF \wx0003 +4 * 6 06 +03 02 \wx0005 FF -5 * 5 0A \b1 \b3 \w0 +5 * 7 0A \w1 \w3 \w0 6 * 257 00 00 00 00 00 00 00 00 00 00 00 0A 0B 0C 0D 0E 0F @@ -77,7 +77,7 @@ D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 00 00 00 00 00 00 00 00 00 FF -9 * 6 01 01 \b1 FF \wx0008 +9 * 5 01 01 \b1 \wx0008 10 opengfx_generic_trams1.pcx 8bpp 48 56 8 18 -3 -10 normal 11 opengfx_generic_trams1.pcx 8bpp 64 56 20 19 -14 -5 normal @@ -89,10 +89,10 @@ F0 F1 F2 F3 F4 F5 00 00 00 00 00 00 00 00 00 FF 17 opengfx_generic_trams1.pcx 8bpp 272 56 20 19 -6 -7 normal // Name: foster_express_group - feature 01 -18 * 9 02 01 FF \b1 \b1 +18 * 10 02 01 \wx7FFF \b1 \b1 \w0 \w0 -19 * 9 03 01 01 FF \wx0058 \b0 -\wx00FF // foster_express_group; +19 * 10 03 01 \wx0001 \wx0058 \w0 +\wx7FFF // foster_express_group; diff --git a/regression/expected/021_grf_parameter.grf b/regression/expected/021_grf_parameter.grf index e04d90f7..447164c0 100644 Binary files a/regression/expected/021_grf_parameter.grf and b/regression/expected/021_grf_parameter.grf differ diff --git a/regression/expected/021_grf_parameter.nfo b/regression/expected/021_grf_parameter.nfo index 6dad26ef..7452baa8 100644 --- a/regression/expected/021_grf_parameter.nfo +++ b/regression/expected/021_grf_parameter.nfo @@ -46,7 +46,7 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\21" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\21" "NML regression test" 00 "A test newgrf testing NML" 00 // param[10] = param[1] 3 * 5 0D 0A \D= 01 00 diff --git a/regression/expected/022_disable_item.grf b/regression/expected/022_disable_item.grf index 7a5051b2..5b04e032 100644 Binary files a/regression/expected/022_disable_item.grf and b/regression/expected/022_disable_item.grf differ diff --git a/regression/expected/022_disable_item.nfo b/regression/expected/022_disable_item.nfo index fd9080da..d9a94ea4 100644 --- a/regression/expected/022_disable_item.nfo +++ b/regression/expected/022_disable_item.nfo @@ -15,14 +15,14 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\22" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 124 00 00 \b1 74 FF \wx0000 +2 * 52 08 09 "NML\22" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 124 00 00 \b1 \wx0074 \wx0000 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -4 * 9 00 0A \b1 01 FF \wx000C +4 * 9 00 0A \b1 \wx0001 \wx000C 08 FF -5 * 24 00 0B \b2 03 FF \wx000A +5 * 24 00 0B \b2 \wx0003 \wx000A 08 FF FF FF 17 \dx00000000 \dx00000000 \dx00000000 diff --git a/regression/expected/023_engine_override.grf b/regression/expected/023_engine_override.grf index f379a522..fed51e5a 100644 Binary files a/regression/expected/023_engine_override.grf and b/regression/expected/023_engine_override.grf differ diff --git a/regression/expected/023_engine_override.nfo b/regression/expected/023_engine_override.nfo index 2ad2df84..388191ab 100644 --- a/regression/expected/023_engine_override.nfo +++ b/regression/expected/023_engine_override.nfo @@ -15,10 +15,10 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\23" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 16 00 08 \b1 01 FF \wx0000 +2 * 52 08 09 "NML\23" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 16 00 08 \b1 \wx0001 \wx0000 11 \dx74736574 \dx44434241 -4 * 16 00 08 \b1 01 FF \wx0000 +4 * 16 00 08 \b1 \wx0001 \wx0000 11 \dx234C4D4E \dx78563412 diff --git a/regression/expected/024_conditional.grf b/regression/expected/024_conditional.grf index 175573c5..a59a264e 100644 Binary files a/regression/expected/024_conditional.grf and b/regression/expected/024_conditional.grf differ diff --git a/regression/expected/024_conditional.nfo b/regression/expected/024_conditional.nfo index a15f83bc..03c5a02f 100644 --- a/regression/expected/024_conditional.nfo +++ b/regression/expected/024_conditional.nfo @@ -8,7 +8,7 @@ // param[127] = param[0] 0 * 5 0D 7F \D= 00 00 -1 * 9 09 7F 04 \7= \dx00000000 01 +1 * 10 09 7F 04 \7= \dx00000000 \wx0001 // param[1] = 1 2 * 9 0D 01 \D= FF 00 \dx00000001 diff --git a/regression/expected/025_loop.grf b/regression/expected/025_loop.grf index 55cb43b9..8dacbd8a 100644 Binary files a/regression/expected/025_loop.grf and b/regression/expected/025_loop.grf differ diff --git a/regression/expected/025_loop.nfo b/regression/expected/025_loop.nfo index ddf2088d..232f67fa 100644 --- a/regression/expected/025_loop.nfo +++ b/regression/expected/025_loop.nfo @@ -8,7 +8,7 @@ // param[127] = 0 0 * 9 0D 7F \D= FF 00 \dx00000000 -1 * 2 10 10 +1 * 3 10 \wx8000 // param[126] = (param[127] - 5) 2 * 9 0D 7E \D- 7F FF \dx00000005 @@ -16,10 +16,10 @@ // param[126] = (param[126] << -31) 3 * 9 0D 7E \Du<< 7E FF \dxFFFFFFE1 -4 * 9 09 7E 04 \7= \dx00000000 02 +4 * 10 09 7E 04 \7= \dx00000000 \wx0002 // param[127] = (param[127] + 1) 5 * 9 0D 7F \D+ 7F FF \dx00000001 -6 * 6 09 9A 01 \71 00 10 +6 * 7 09 9A 01 \71 00 \wx8000 diff --git a/regression/expected/026_asl.grf b/regression/expected/026_asl.grf index 8630aa03..af2f87db 100644 Binary files a/regression/expected/026_asl.grf and b/regression/expected/026_asl.grf differ diff --git a/regression/expected/026_asl.nfo b/regression/expected/026_asl.nfo index 28c3055c..9c9b2ec7 100644 --- a/regression/expected/026_asl.nfo +++ b/regression/expected/026_asl.nfo @@ -6,21 +6,21 @@ // Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags // Name: layout1 - feature 11 -0 * 23 02 11 FF \b65 \dx00000000 \wx0000 +0 * 24 02 11 \wx7FFF \b65 \dx00000000 \wx0000 \dx00000000 \wx0002 \b0 \b0 \b0 \b16 \b16 \b16 80 // Name: layout1@registers - feature 11 -1 * 38 02 11 FF 89 +1 * 40 02 11 \wx7FFF 89 44 60 \dx000000FF \dx00000A68 \dx00000001 \2sto 1A 00 \dx00000080 -\b1 -\wx00FF \dx00000000 \dx00000000 -\wx00FF // +\w1 +\wx7FFF \dx00000000 \dx00000000 +\wx7FFF // -2 * 7 03 11 01 00 \b0 -\wx00FF // layout1; +2 * 10 03 11 \wx0001 \wx0000 \w0 +\wx7FFF // layout1; -3 * 6 01 0F \b2 FF \wx0003 +3 * 5 01 0F \b2 \wx0003 4 opengfx_generic_trams1.pcx 8bpp 64 56 20 19 -14 -5 normal 5 * 1 00 @@ -63,24 +63,24 @@ F0 F1 F2 F3 F4 F5 00 00 00 00 00 00 00 00 00 FF 9 * 1 00 // Name: layout2 - feature 0F -10 * 38 02 0F FF \b66 \dx00000000 \wx0000 +10 * 39 02 0F \wx7FFF \b66 \dx00000000 \wx0000 \dx80000000 \wx0002 \b0 \b0 \b0 \b16 \b16 \b16 80 \dx80018000 \wx000F \b0 \b0 \b0 \b16 \b16 \b16 82 81 81 // Name: layout2@registers - feature 0F -11 * 66 02 0F FF 89 +11 * 71 02 0F \wx7FFF 89 43 20 \dx000000FF \2sto 1A 20 \dx00000080 \2r 1A 20 \dx00000001 \2sto 1A 20 \dx00000081 -\2r 62 00 29 \dx00000001 +\2r 62 \dx00000000 29 \dx00000001 \2^ 1A 20 \dx00000001 \2sto 1A 00 \dx00000082 -\b1 -\wx00FF \dx00000000 \dx00000000 -\wx00FF // +\w1 +\wx7FFF \dx00000000 \dx00000000 +\wx7FFF // -12 * 6 01 11 \b2 FF \wx0003 +12 * 5 01 11 \b2 \wx0003 13 opengfx_generic_trams1.pcx 8bpp 64 56 20 19 -14 -5 normal 14 * 1 00 @@ -123,46 +123,46 @@ F0 F1 F2 F3 F4 F5 00 00 00 00 00 00 00 00 00 FF 18 * 1 00 // Name: layout2 - feature 11 -19 * 38 02 11 FE \b66 \dx00000000 \wx0000 +19 * 39 02 11 \wx7FFE \b66 \dx00000000 \wx0000 \dx80000000 \wx0002 \b0 \b0 \b0 \b16 \b16 \b16 80 \dx80018000 \wx000F \b0 \b0 \b0 \b16 \b16 \b16 82 81 81 // Name: layout2@registers - feature 11 -20 * 66 02 11 FE 89 +20 * 71 02 11 \wx7FFE 89 44 20 \dx000000FF \2sto 1A 20 \dx00000080 \2r 1A 20 \dx00000001 \2sto 1A 20 \dx00000081 -\2r 60 00 29 \dx00000001 +\2r 60 \dx00000000 29 \dx00000001 \2^ 1A 20 \dx00000001 \2sto 1A 00 \dx00000082 -\b1 -\wx00FE \dx00000000 \dx00000000 -\wx00FE // +\w1 +\wx7FFE \dx00000000 \dx00000000 +\wx7FFE // -21 * 7 03 11 01 01 \b0 -\wx00FE // layout2; +21 * 10 03 11 \wx0001 \wx0001 \w0 +\wx7FFE // layout2; -22 * 10 00 0F \b1 01 FF \wx0001 +22 * 10 00 0F \b1 \wx0001 \wx0001 15 \wx0008 // Name: @CB_FAILED_LAYOUT0F -23 * 17 02 0F FE \b0 \dx00000000 +23 * 18 02 0F \wx7FFE \b0 \dx00000000 \dx00000000 \b0 \b0 \b0 \b0 \b0 // Name: @CB_FAILED0F -24 * 23 02 0F FE 89 +24 * 25 02 0F \wx7FFE 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result +\wx7FFE // Non-graphics callback, return graphics result // Name: @action3_0 -25 * 23 02 0F FF 89 +25 * 25 02 0F \wx7FFF 89 0C 00 \dx0000FFFF -\b1 -\wx00FE \dx0000015B \dx0000015B // @CB_FAILED0F; -\wx00FF // layout2; +\w1 +\wx7FFE \dx0000015B \dx0000015B // @CB_FAILED0F; +\wx7FFF // layout2; -26 * 7 03 0F 01 01 \b0 -\wx00FF // @action3_0; +26 * 10 03 0F \wx0001 \wx0001 \w0 +\wx7FFF // @action3_0; diff --git a/regression/expected/027_airport_layout.grf b/regression/expected/027_airport_layout.grf index 143b5d44..e5be0d2a 100644 Binary files a/regression/expected/027_airport_layout.grf and b/regression/expected/027_airport_layout.grf differ diff --git a/regression/expected/027_airport_layout.nfo b/regression/expected/027_airport_layout.nfo index fa8b3969..033a86ab 100644 --- a/regression/expected/027_airport_layout.nfo +++ b/regression/expected/027_airport_layout.nfo @@ -5,25 +5,25 @@ // 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 * 6 01 11 \b1 FF \wx0001 +0 * 5 01 11 \b1 \wx0001 1 * 1 00 // Name: small_airport_tile_layout - feature 11 -2 * 25 02 11 FF \b2 \dx80000000 +2 * 26 02 11 \wx7FFF \b2 \dx80000000 \dxC0008000 \b32 \b16 80 \dx80000000 \b0 \b0 \b0 \b16 \b16 \b16 -3 * 16 00 11 \b4 01 FF \wx0000 +3 * 16 00 11 \b4 \wx0001 \wx0000 08 00 0F \wx0103 10 01 11 01 -4 * 7 03 11 01 00 \b0 -\wx00FF // small_airport_tile_layout; +4 * 10 03 11 \wx0001 \wx0000 \w0 +\wx7FFF // small_airport_tile_layout; -5 * 36 00 0D \b2 01 FF \wx0000 +5 * 36 00 0D \b2 \wx0001 \wx0000 08 00 0A \b1 \d21 00 00 00 FE \wx0000 diff --git a/regression/expected/028_font.grf b/regression/expected/028_font.grf index 827fcae7..5fd53a9b 100644 Binary files a/regression/expected/028_font.grf and b/regression/expected/028_font.grf differ diff --git a/regression/expected/028_font.nfo b/regression/expected/028_font.nfo index 61ec8731..a345ed50 100644 --- a/regression/expected/028_font.nfo +++ b/regression/expected/028_font.nfo @@ -5,24 +5,24 @@ // 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 * 6 12 \b1 -00 \b4 \w123 +0 * 10 12 \w1 +00 \w4 \d123 1 font_addl.png 8bpp 10 10 5 13 0 -2 normal nocrop 2 font_addl.png 8bpp 30 10 3 13 0 -2 normal nocrop 3 font_addl.png 8bpp 50 10 5 13 0 -2 normal nocrop 4 font_addl.png 8bpp 70 10 7 13 0 -2 normal nocrop -5 * 6 12 \b1 -01 \b4 \w123 +5 * 10 12 \w1 +01 \w4 \d123 6 font_addl.png 8bpp 10 30 3 8 0 0 normal nocrop 7 font_addl.png 8bpp 30 30 1 8 0 0 normal nocrop 8 font_addl.png 8bpp 50 30 3 8 0 0 normal nocrop 9 font_addl.png 8bpp 70 30 4 8 0 0 normal nocrop -10 * 6 12 \b1 -02 \b4 \w123 +10 * 10 12 \w1 +02 \w4 \d123 11 font_addl.png 8bpp 10 40 7 21 0 -2 normal nocrop 12 font_addl.png 8bpp 30 40 2 21 0 -2 normal nocrop diff --git a/regression/expected/030_house.grf b/regression/expected/030_house.grf index 4567b02b..663911cf 100644 Binary files a/regression/expected/030_house.grf and b/regression/expected/030_house.grf differ diff --git a/regression/expected/030_house.nfo b/regression/expected/030_house.nfo index 7ea103cd..6af3b64b 100644 --- a/regression/expected/030_house.nfo +++ b/regression/expected/030_house.nfo @@ -15,19 +15,19 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\30" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 14 04 07 FF 01 \wxDC00 "Brewery" 00 +2 * 52 08 09 "NML\30" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 15 04 07 FF \wx0001 \wxDC00 "Brewery" 00 -4 * 24 00 08 \b1 04 FF \wx0000 -09 "PASS" "MAIL" "GRAI" "WHEA" +4 * 25 00 08 \b1 \wx0004 \wx0000 +\wx0009 "PASS" "MAIL" "GRAI" "WHEA" -5 * 6 01 07 \b1 FF \wx0003 +5 * 5 01 07 \b1 \wx0003 6 groundtiles.png 8bpp 10 10 64 31 -31 0 normal 7 groundtiles.png 8bpp 150 10 64 31 -31 0 normal 8 groundtiles.png 8bpp 220 10 64 31 -31 0 normal -9 * 12 01 07 00 FF \wx0001 FF \wx0001 FF \wx0006 +9 * 9 01 07 00 \wx0001 \wx0001 \wx0006 10 brewery.png 8bpp 10 60 64 91 -31 -60 normal nocrop 11 brewery.png 8bpp 80 60 64 91 -31 -60 normal nocrop @@ -39,13 +39,13 @@ // Name: brewery_sprite_layout - feature 07 // building_sprite : register 8B // with_smoke : register 8C -16 * 49 02 07 FF \b67 \dx00000F8D \wx0000 +16 * 50 02 07 \wx7FFF \b67 \dx00000F8D \wx0000 \dxC0000000 \wx0002 \b0 \b0 80 83 \dx80008001 \wx0003 \b0 \b0 \b0 \b16 \b16 \b48 86 84 \dx00000000 \wx0023 \b8 \b0 \b0 \b11 \b16 \b7 8A 87 88 // Name: brewery_sprite_layout@registers - feature 07 -17 * 362 02 07 FF 89 +17 * 388 02 07 \wx7FFF 89 43 20 \dx000000FF \2cmp 1A 20 \dx00000004 \2& 1A 20 \dx00000001 @@ -54,27 +54,27 @@ \2sto 1A 20 \dx00000081 // !guard \2r 40 20 \dx00000003 \2< 1A 20 \dx00000001 -\2* 7D 81 20 \dxFFFFFFFF +\2* 7D \dx00000081 20 \dxFFFFFFFF \2sto 1A 20 \dx00000082 -\2r 7D 80 20 \dxFFFFFFFF +\2r 7D \dx00000080 20 \dxFFFFFFFF \2* 1A 20 \dx00000002 -\2+ 7D 82 20 \dxFFFFFFFF +\2+ 7D \dx00000082 20 \dxFFFFFFFF \2sto 1A 20 \dx00000083 \2r 43 20 \dx000000FF \2cmp 1A 20 \dx00000004 \2& 1A 20 \dx00000001 \2* 1A 20 \dx00000003 -\2+ 7D 8B 20 \dxFFFFFFFF // building_sprite +\2+ 7D \dx0000008B 20 \dxFFFFFFFF // building_sprite \2sto 1A 20 \dx00000084 \2r 40 20 \dx00000003 \2cmp 1A 20 \dx00000003 \2& 1A 20 \dx00000001 \2^ 1A 20 \dx00000001 \2sto 1A 20 \dx00000085 -\2r 7D 8B 20 \dxFFFFFFFF // building_sprite +\2r 7D \dx0000008B 20 \dxFFFFFFFF // building_sprite \2cmp 1A 20 \dxFFFFFFFF \2& 1A 20 \dx00000001 -\2| 7D 85 20 \dxFFFFFFFF +\2| 7D \dx00000085 20 \dxFFFFFFFF \2^ 1A 20 \dx00000001 \2sto 1A 20 \dx00000086 \2r 46 60 \dx000000FF \dxFFFFFFFF \dx00000004 @@ -86,161 +86,161 @@ \2cmp 1A 20 \dx00000000 \2& 1A 20 \dx00000001 \2sto 1A 20 \dx00000089 -\2r 7D 8C 20 \dxFFFFFFFF // with_smoke +\2r 7D \dx0000008C 20 \dxFFFFFFFF // with_smoke \2u< 1A 20 \dx00000001 \2^ 1A 20 \dx00000001 -\2| 7D 89 20 \dxFFFFFFFF +\2| 7D \dx00000089 20 \dxFFFFFFFF \2^ 1A 20 \dx00000001 \2sto 1A 00 \dx0000008A -\b1 -\wx00FF \dx00000000 \dx00000000 -\wx00FF // +\w1 +\wx7FFF \dx00000000 \dx00000000 +\wx7FFF // // Name: @return_action_0 -18 * 44 02 07 FE 89 +18 * 46 02 07 \wx7FFE 89 1A 20 \dx00000002 \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000000 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: @return_action_1 -19 * 44 02 07 FD 89 +19 * 46 02 07 \wx7FFD 89 1A 20 \dx00000001 \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000000 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: @return_action_2 -20 * 44 02 07 FC 89 +20 * 46 02 07 \wx7FFC 89 1A 20 \dxFFFFFFFF \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000000 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: @return_action_3 -21 * 44 02 07 FB 89 +21 * 46 02 07 \wx7FFB 89 1A 20 \dx00000000 \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000001 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: brewery_layout_1 -22 * 44 02 07 FB 89 -7D FF 10 \dx000000FF -\b3 -\wx00FE \dx00000000 \dx00000000 // 0 .. 0: @return_action_0; -\wx00FD \dx00000002 \dx00000002 // 2 .. 2: @return_action_1; -\wx00FC \dx00000001 \dx00000001 // 1 .. 1: @return_action_2; -\wx00FB // default: @return_action_3; +22 * 49 02 07 \wx7FFB 89 +7D \dx000000FF 10 \dx000000FF +\w3 +\wx7FFE \dx00000000 \dx00000000 // 0 .. 0: @return_action_0; +\wx7FFD \dx00000002 \dx00000002 // 2 .. 2: @return_action_1; +\wx7FFC \dx00000001 \dx00000001 // 1 .. 1: @return_action_2; +\wx7FFB // default: @return_action_3; // Name: @return_action_0 -23 * 44 02 07 FC 89 +23 * 46 02 07 \wx7FFC 89 1A 20 \dxFFFFFFFF \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000000 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: @return_action_1 -24 * 44 02 07 FD 89 +24 * 46 02 07 \wx7FFD 89 1A 20 \dx00000000 \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000001 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: @return_action_2 -25 * 44 02 07 FE 89 +25 * 46 02 07 \wx7FFE 89 1A 20 \dx00000002 \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000000 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: @return_action_3 -26 * 44 02 07 FF 89 +26 * 46 02 07 \wx7FFF 89 1A 20 \dx00000001 \2sto 1A 20 \dx0000008B \2r 1A 20 \dx00000000 \2sto 1A 00 \dx0000008C -\b1 -\wx00FF \dx00000000 \dx00000000 // brewery_sprite_layout -\wx00FF // brewery_sprite_layout +\w1 +\wx7FFF \dx00000000 \dx00000000 // brewery_sprite_layout +\wx7FFF // brewery_sprite_layout // Name: brewery_layout_2 -27 * 44 02 07 FF 89 -7D FF 10 \dx000000FF -\b3 -\wx00FC \dx00000000 \dx00000000 // 0 .. 0: @return_action_0; -\wx00FD \dx00000002 \dx00000002 // 2 .. 2: @return_action_1; -\wx00FE \dx00000001 \dx00000001 // 1 .. 1: @return_action_2; -\wx00FF // default: @return_action_3; +27 * 49 02 07 \wx7FFF 89 +7D \dx000000FF 10 \dx000000FF +\w3 +\wx7FFC \dx00000000 \dx00000000 // 0 .. 0: @return_action_0; +\wx7FFD \dx00000002 \dx00000002 // 2 .. 2: @return_action_1; +\wx7FFE \dx00000001 \dx00000001 // 1 .. 1: @return_action_2; +\wx7FFF // default: @return_action_3; // Name: brewery_choose_layout -28 * 23 02 07 FF 89 +28 * 25 02 07 \wx7FFF 89 5F 08 \dx00000001 -\b1 -\wx00FB \dx00000000 \dx00000000 // 0 .. 0: brewery_layout_1; -\wx00FF // default: brewery_layout_2; +\w1 +\wx7FFB \dx00000000 \dx00000000 // 0 .. 0: brewery_layout_1; +\wx7FFF // default: brewery_layout_2; // Name: brewery_next_frame -29 * 23 02 07 FB 89 +29 * 25 02 07 \wx7FFB 89 46 00 \dx000000FF -\b1 +\w1 \wx80FF \dx00000000 \dx00000000 // 0 .. 0: return 255; \wx80FE // default: return 254; // Name: @return_action_0 -30 * 41 02 07 FE 89 +30 * 43 02 07 \wx7FFE 89 46 20 \dx000000FF \2cmp 1A 20 \dx00000000 \2& 1A 20 \dx00000001 \2* 1A 20 \dxFFFFFF04 // expr1 - expr2 \2+ 1A 00 \dx000000FD -\b0 +\w0 \wx8000 // Return computed value // Name: brewery_cargo_accepted -31 * 59 02 07 FE 89 +31 * 64 02 07 \wx7FFE 89 5F 28 \dx00000001 \2u< 1A 20 \dx00000001 \2* 1A 20 \dxFFFFFFFF // expr1 - expr2 \2+ 1A 20 \dx00000003 -\2cmp 7D FF 30 \dx000000FF +\2cmp 7D \dx000000FF 30 \dx000000FF \2& 1A 00 \dx00000001 -\b1 -\wx00FE \dx00000001 \dx00000001 // 1 .. 1: return ((var[0x46, 0, 255] == 0) ? 1 : 253) +\w1 +\wx7FFE \dx00000001 \dx00000001 // 1 .. 1: return ((var[0x46, 0, 255] == 0) ? 1 : 253) \wx80FD // default: return 253; // Name: brewery_check_location -32 * 23 02 07 FD 89 +32 * 25 02 07 \wx7FFD 89 44 00 \dx000000FF -\b1 +\w1 \wx8001 \dx00000000 \dx00000000 // 0 .. 0: return 1; \wx8000 // default: return 0; // param[126] = 0 33 * 9 0D 7E \D= FF 00 \dx00000000 -34 * 9 09 00 04 \7c \dx49415247 01 +34 * 10 09 00 04 \7c \dx49415247 \wx0001 // param[126] = 1 35 * 9 0D 7E \D= FF 00 \dx00000001 @@ -248,7 +248,7 @@ // param[125] = 0 36 * 9 0D 7D \D= FF 00 \dx00000000 -37 * 9 09 00 04 \7c \dx41454857 01 +37 * 10 09 00 04 \7c \dx41454857 \wx0001 // param[125] = 1 38 * 9 0D 7D \D= FF 00 \dx00000001 @@ -256,22 +256,22 @@ // param[127] = (param[126] | param[125]) 39 * 5 0D 7F \D| 7E 7D -40 * 9 07 7F 04 \7= \dx00000000 02 +40 * 10 07 7F 04 \7= \dx00000000 \wx0002 -41 * 183 00 07 \b20 04 FF \wx0000 +41 * 199 00 07 \b20 \wx0004 \wx0000 08 28 29 2A 2B 12 \wxDC00 \wxDC00 \wxDC00 \wxDC00 09 30 20 20 20 19 00 00 00 00 0B 64 00 00 00 0C 19 00 00 00 -23 \b4 +23 \w4 \wx0802 \wx0803 \wx0200 \wx0101 -\b4 +\w4 \wx0802 \wx0803 \wx0200 \wx0101 -\b4 +\w4 \wx0802 \wx0803 \wx0200 \wx0101 -\b4 +\w4 \wx0802 \wx0803 \wx0200 \wx0101 10 \wx00C8 \wx00C8 \wx00C8 \wx00C8 11 FA FA FA FA @@ -285,85 +285,85 @@ 16 00 00 00 00 1A 94 94 94 94 1B 02 02 02 02 -20 \b2 -02 03 -\b2 -02 03 -\b2 -02 03 -\b2 -02 03 - -42 * 9 00 07 \b1 01 FF \wx0000 +20 \w2 +\wx0002 \wx0003 +\w2 +\wx0002 \wx0003 +\w2 +\wx0002 \wx0003 +\w2 +\wx0002 \wx0003 + +42 * 9 00 07 \b1 \wx0001 \wx0000 14 03 // Name: @action3_0 -43 * 57 02 07 FD 89 +43 * 59 02 07 \wx7FFD 89 1A 20 \dx00000000 \2sto 1A 20 \dx000000FF \2r 0C 00 \dx0000FFFF -\b3 -\wx00FD \dx00000017 \dx00000017 // brewery_check_location; -\wx00FB \dx0000001A \dx0000001A // brewery_next_frame; -\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted; -\wx00FF // brewery_choose_layout; +\w3 +\wx7FFD \dx00000017 \dx00000017 // brewery_check_location; +\wx7FFB \dx0000001A \dx0000001A // brewery_next_frame; +\wx7FFE \dx00000148 \dx00000148 // brewery_cargo_accepted; +\wx7FFF // brewery_choose_layout; -44 * 9 07 7F 04 \7= \dx00000000 02 +44 * 10 07 7F 04 \7= \dx00000000 \wx0002 -45 * 7 03 07 01 00 \b0 -\wx00FD // @action3_0; +45 * 10 03 07 \wx0001 \wx0000 \w0 +\wx7FFD // @action3_0; -46 * 9 00 07 \b1 01 FF \wx0001 +46 * 9 00 07 \b1 \wx0001 \wx0001 14 02 // Name: @action3_1 -47 * 47 02 07 FD 89 +47 * 49 02 07 \wx7FFD 89 1A 20 \dx00010100 \2sto 1A 20 \dx000000FF \2r 0C 00 \dx0000FFFF -\b2 -\wx00FB \dx0000001A \dx0000001A // brewery_next_frame; -\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted; -\wx00FF // brewery_choose_layout; +\w2 +\wx7FFB \dx0000001A \dx0000001A // brewery_next_frame; +\wx7FFE \dx00000148 \dx00000148 // brewery_cargo_accepted; +\wx7FFF // brewery_choose_layout; -48 * 9 07 7F 04 \7= \dx00000000 02 +48 * 10 07 7F 04 \7= \dx00000000 \wx0002 -49 * 7 03 07 01 01 \b0 -\wx00FD // @action3_1; +49 * 10 03 07 \wx0001 \wx0001 \w0 +\wx7FFD // @action3_1; -50 * 9 00 07 \b1 01 FF \wx0002 +50 * 9 00 07 \b1 \wx0001 \wx0002 14 02 // Name: @action3_2 -51 * 47 02 07 FD 89 +51 * 49 02 07 \wx7FFD 89 1A 20 \dx00020001 \2sto 1A 20 \dx000000FF \2r 0C 00 \dx0000FFFF -\b2 -\wx00FB \dx0000001A \dx0000001A // brewery_next_frame; -\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted; -\wx00FF // brewery_choose_layout; +\w2 +\wx7FFB \dx0000001A \dx0000001A // brewery_next_frame; +\wx7FFE \dx00000148 \dx00000148 // brewery_cargo_accepted; +\wx7FFF // brewery_choose_layout; -52 * 9 07 7F 04 \7= \dx00000000 02 +52 * 10 07 7F 04 \7= \dx00000000 \wx0002 -53 * 7 03 07 01 02 \b0 -\wx00FD // @action3_2; +53 * 10 03 07 \wx0001 \wx0002 \w0 +\wx7FFD // @action3_2; -54 * 9 00 07 \b1 01 FF \wx0003 +54 * 9 00 07 \b1 \wx0001 \wx0003 14 02 // Name: @action3_3 -55 * 47 02 07 FF 89 +55 * 49 02 07 \wx7FFF 89 1A 20 \dx00030101 \2sto 1A 20 \dx000000FF \2r 0C 00 \dx0000FFFF -\b2 -\wx00FB \dx0000001A \dx0000001A // brewery_next_frame; -\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted; -\wx00FF // brewery_choose_layout; +\w2 +\wx7FFB \dx0000001A \dx0000001A // brewery_next_frame; +\wx7FFE \dx00000148 \dx00000148 // brewery_cargo_accepted; +\wx7FFF // brewery_choose_layout; -56 * 9 07 7F 04 \7= \dx00000000 01 +56 * 10 07 7F 04 \7= \dx00000000 \wx0001 -57 * 7 03 07 01 03 \b0 -\wx00FF // @action3_3; +57 * 10 03 07 \wx0001 \wx0003 \w0 +\wx7FFF // @action3_3; diff --git a/regression/expected/031_aircraft.grf b/regression/expected/031_aircraft.grf index 413dba2b..1a226910 100644 Binary files a/regression/expected/031_aircraft.grf and b/regression/expected/031_aircraft.grf differ diff --git a/regression/expected/031_aircraft.nfo b/regression/expected/031_aircraft.nfo index a5d9bb22..ce75a723 100644 --- a/regression/expected/031_aircraft.nfo +++ b/regression/expected/031_aircraft.nfo @@ -15,8 +15,8 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\30" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 26 00 03 \b7 01 FF \wx0014 +2 * 52 08 09 "NML\30" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 26 00 03 \b7 \wx0001 \wx0014 1A \dx000B0612 04 1E 03 1E @@ -25,5 +25,5 @@ 1F \wx0400 0F \wx0115 -4 * 23 04 03 7F 01 FF \wx0014 "Test plane 0x14" 00 +4 * 23 04 03 7F \wx0001 \wx0014 "Test plane 0x14" 00 diff --git a/regression/expected/032_simple_house.grf b/regression/expected/032_simple_house.grf index 5f16d80d..29157301 100644 Binary files a/regression/expected/032_simple_house.grf and b/regression/expected/032_simple_house.grf differ diff --git a/regression/expected/032_simple_house.nfo b/regression/expected/032_simple_house.nfo index 1ef8e775..f9b95a7b 100644 --- a/regression/expected/032_simple_house.nfo +++ b/regression/expected/032_simple_house.nfo @@ -15,40 +15,40 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\32" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 20 04 07 FF 01 \wxDC00 "Example house" 00 +2 * 52 08 09 "NML\32" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 21 04 07 FF \wx0001 \wxDC00 "Example house" 00 -4 * 6 01 07 \b1 FF \wx0001 +4 * 5 01 07 \b1 \wx0001 5 nlhs.png 8bpp 98 8 44 36 -22 0 normal nocrop // Name: spritelayout_townhouse - feature 07 -6 * 23 02 07 FF \b65 \dx00000F8D \wx0000 +6 * 24 02 07 \wx7FFF \b65 \dx00000F8D \wx0000 \dx80008000 \wx0001 \b4 \b2 \b0 \b8 \b16 \b27 80 // Name: spritelayout_townhouse@registers - feature 07 -7 * 30 02 07 FF 89 +7 * 32 02 07 \wx7FFF 89 1A 20 \dx00000001 \2sto 1A 00 \dx00000080 -\b1 -\wx00FF \dx00000000 \dx00000000 -\wx00FF // +\w1 +\wx7FFF \dx00000000 \dx00000000 +\wx7FFF // -8 * 16 00 07 \b4 01 FF \wx0000 +8 * 16 00 07 \b4 \wx0001 \wx0000 08 02 15 02 18 A0 12 \wxDC00 // Name: @action3_0 -9 * 37 02 07 FF 89 +9 * 39 02 07 \wx7FFF 89 1A 20 \dx00000000 \2sto 1A 20 \dx000000FF \2r 0C 00 \dx0000FFFF -\b1 -\wx00FF \dx00000000 \dx00000000 // spritelayout_townhouse; -\wx00FF // spritelayout_townhouse; +\w1 +\wx7FFF \dx00000000 \dx00000000 // spritelayout_townhouse; +\wx7FFF // spritelayout_townhouse; -10 * 7 03 07 01 00 \b0 -\wx00FF // @action3_0; +10 * 10 03 07 \wx0001 \wx0000 \w0 +\wx7FFF // @action3_0; diff --git a/regression/expected/033_procedure.grf b/regression/expected/033_procedure.grf index d6ea541c..e621efb5 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 bdf590ac..c9675dcb 100644 --- a/regression/expected/033_procedure.nfo +++ b/regression/expected/033_procedure.nfo @@ -15,55 +15,55 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\33" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\33" "NML regression test" 00 "A test newgrf testing NML" 00 // Name: dumb_add // a : register 88 // b : register 89 -3 * 22 02 0A FF 89 -7D 88 20 \dxFFFFFFFF // a -\2+ 7D 89 00 \dxFFFFFFFF // b -\b0 +3 * 30 02 0A \wx7FFF 89 +7D \dx00000088 20 \dxFFFFFFFF // a +\2+ 7D \dx00000089 00 \dxFFFFFFFF // b +\w0 \wx8000 // Return computed value // Name: @CB_FAILED_PROD -4 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 +4 * 16 02 0A \wx7FFE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 // Name: @CB_FAILED0A -5 * 23 02 0A FE 89 +5 * 25 02 0A \wx7FFE 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result +\wx7FFE // Non-graphics callback, return graphics result // Name: @return_action_0 -6 * 66 02 0A FD 89 +6 * 78 02 0A \wx7FFD 89 1A 20 \dx00000005 \2sto 1A 20 \dx00000088 -\2r 7D 86 20 \dxFFFFFFFF // a +\2r 7D \dx00000086 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000089 -\2r 7E FF 20 \dxFFFFFFFF // dumb_add(5, a) +\2r 7E \wx7FFF 20 \dxFFFFFFFF // dumb_add(5, a) \2sto 1A 20 \dx00000087 -\2r 7D 86 20 \dxFFFFFFFF // a -\2+ 7D 87 00 \dxFFFFFFFF -\b0 +\2r 7D \dx00000086 20 \dxFFFFFFFF // a +\2+ 7D \dx00000087 00 \dxFFFFFFFF +\w0 \wx8000 // Return computed value // Name: callee // a : register 86 -7 * 67 02 0A FD 89 +7 * 75 02 0A \wx7FFD 89 45 30 \dx00000003 \2+ 45 38 \dx0000000F \2sto 1A 20 \dx00000087 \2r 43 20 \dxFFFFFFFF \2+ 44 20 \dx000000FF -\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)) +\2* 7D \dx00000087 20 \dxFFFFFFFF +\2+ 7D \dx00000086 00 \dxFFFFFFFF // a +\w1 +\wx7FFE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFD // default: return (a + dumb_add(5, a)) // Name: caller2 -8 * 232 02 0A FC 89 +8 * 255 02 0A \wx7FFC 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -72,7 +72,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 \wx7FFD 20 \dxFFFFFFFF // callee(1) \2+ 5F 28 \dx0000FFFF \2sto 1A 20 \dx00000082 \2r 43 20 \dxFFFFFFFF @@ -84,22 +84,22 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000088 \2r 46 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FF 20 \dxFFFFFFFF // dumb_add(var[0x45, 28, 15], var[0x46, 0, -1]) +\2r 7E \wx7FFF 20 \dxFFFFFFFF // dumb_add(var[0x45, 28, 15], var[0x46, 0, -1]) \2sto 1A 20 \dx00000085 -\2r 7D 84 20 \dxFFFFFFFF +\2r 7D \dx00000084 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 -\2r 7D 85 20 \dxFFFFFFFF +\2r 7D \dx00000085 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FF 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 +\2r 7E \wx7FFF 20 \dxFFFFFFFF // dumb_add(1, dumb_add(var[0x45, 28, 15], var[0x46, 0, -1])) +\2* 7D \dx00000083 20 \dxFFFFFFFF +\2* 7D \dx00000082 20 \dxFFFFFFFF +\2* 7D \dx00000081 20 \dxFFFFFFFF +\2* 7D \dx00000080 00 \dxFFFFFFFF +\w0 \wx8000 // Return computed value // Name: caller1 -9 * 145 02 0A FF 89 +9 * 161 02 0A \wx7FFF 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -107,36 +107,36 @@ B3 20 \dx00000003 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000086 -\2r 7E FD 20 \dxFFFFFFFF // callee(0) +\2r 7E \wx7FFD 20 \dxFFFFFFFF // callee(0) \2sto 1A 20 \dx00000082 -\2r 7D 81 20 \dxFFFFFFFF +\2r 7D \dx00000081 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 -\2r 7D 82 20 \dxFFFFFFFF +\2r 7D \dx00000082 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FF 20 \dxFFFFFFFF // dumb_add(var[0x5F, 8, 65535], callee(0)) +\2r 7E \wx7FFF 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 +\2* 7D \dx00000083 20 \dxFFFFFFFF +\2* 7D \dx00000080 00 \dxFFFFFFFF +\w0 \wx8000 // Return computed value -10 * 11 00 0A \b2 01 FF \wx0000 +10 * 11 00 0A \b2 \wx0001 \wx0000 08 00 09 00 -11 * 9 00 0A \b1 01 FF \wx0000 +11 * 9 00 0A \b1 \wx0001 \wx0000 22 42 // Name: @action3_0 -12 * 33 02 0A FE 89 +12 * 35 02 0A \wx7FFE 89 0C 00 \dx0000FFFF -\b2 -\wx00FC \dx0000003B \dx0000003B // caller2; -\wx00FF \dx0000015F \dx0000015F // caller1; -\wx00FE // @CB_FAILED0A; +\w2 +\wx7FFC \dx0000003B \dx0000003B // caller2; +\wx7FFF \dx0000015F \dx0000015F // caller1; +\wx7FFE // @CB_FAILED0A; -13 * 7 03 0A 01 00 \b0 -\wx00FE // @action3_0; +13 * 10 03 0A \wx0001 \wx0000 \w0 +\wx7FFE // @action3_0; diff --git a/regression/expected/034_roadtypes.grf b/regression/expected/034_roadtypes.grf index 103fbb00..fa2f8cb1 100644 Binary files a/regression/expected/034_roadtypes.grf and b/regression/expected/034_roadtypes.grf differ diff --git a/regression/expected/034_roadtypes.nfo b/regression/expected/034_roadtypes.nfo index e2314b09..b9005630 100644 --- a/regression/expected/034_roadtypes.nfo +++ b/regression/expected/034_roadtypes.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 * 15 00 12 \b2 01 FF \wx0000 +0 * 15 00 12 \b2 \wx0001 \wx0000 08 "ROAD" 14 \wx0104 diff --git a/regression/expected/035_switch_scope.grf b/regression/expected/035_switch_scope.grf index def632dd..05d17cf8 100644 Binary files a/regression/expected/035_switch_scope.grf and b/regression/expected/035_switch_scope.grf differ diff --git a/regression/expected/035_switch_scope.nfo b/regression/expected/035_switch_scope.nfo index 941d467b..c1c97566 100644 --- a/regression/expected/035_switch_scope.nfo +++ b/regression/expected/035_switch_scope.nfo @@ -15,130 +15,130 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\35" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\35" "NML regression test" 00 "A test newgrf testing NML" 00 // Name: @return_action_0 -3 * 34 02 09 FF 89 +3 * 36 02 09 \wx7FFF 89 43 20 \dx000000FF \2cmp 1A 20 \dx00000002 \2< 1A 20 \dx00000001 \2^ 1A 00 \dx00000001 -\b0 +\w0 \wx8000 // Return computed value // Name: @return_action_1 -4 * 34 02 09 FE 89 +4 * 36 02 09 \wx7FFE 89 43 28 \dx000000FF \2cmp 1A 20 \dx00000005 \2- 1A 20 \dx00000001 \2> 1A 00 \dx00000000 -\b0 +\w0 \wx8000 // Return computed value // Name: random1 -5 * 15 02 09 FE 80 01 \b0 04 -\wx00FF \wx00FF \wx00FF // (2/3) -> (3/4): return (var[0x43, 0, 255] < 2) -\wx00FE // (1/3) -> (1/4): return (var[0x43, 8, 255] > 5) +5 * 17 02 09 \wx7FFE 80 01 \b0 \wx0004 +\wx7FFF \wx7FFF \wx7FFF // (2/3) -> (3/4): return (var[0x43, 0, 255] < 2) +\wx7FFE // (1/3) -> (1/4): return (var[0x43, 8, 255] > 5) // Name: @return_action_0 -6 * 34 02 09 FF 89 +6 * 36 02 09 \wx7FFF 89 43 20 \dx000000FF \2cmp 1A 20 \dx00000002 \2< 1A 20 \dx00000001 \2^ 1A 00 \dx00000001 -\b0 +\w0 \wx8000 // Return computed value // Name: @return_action_1 -7 * 34 02 09 FD 89 +7 * 36 02 09 \wx7FFD 89 43 28 \dx000000FF \2cmp 1A 20 \dx00000005 \2- 1A 20 \dx00000001 \2> 1A 00 \dx00000000 -\b0 +\w0 \wx8000 // Return computed value // Name: var1 -8 * 23 02 09 FD 89 +8 * 25 02 09 \wx7FFD 89 42 00 \dx00000007 -\b1 -\wx00FF \dx00000000 \dx00000000 // 0 .. 0: return (var[0x43, 0, 255] < 2) -\wx00FD // default: return (var[0x43, 8, 255] > 5) +\w1 +\wx7FFF \dx00000000 \dx00000000 // 0 .. 0: return (var[0x43, 0, 255] < 2) +\wx7FFD // default: return (var[0x43, 8, 255] > 5) // Name: @return_action_2 -9 * 34 02 09 FF 8A +9 * 36 02 09 \wx7FFF 8A 45 38 \dx0000000F \2cmp 1A 20 \dx00000002 \2< 1A 20 \dx00000001 \2^ 1A 00 \dx00000001 -\b0 +\w0 \wx8000 // Return computed value // Name: @return_action_3 -10 * 34 02 09 FC 8A +10 * 36 02 09 \wx7FFC 8A 45 3C \dx0000000F \2cmp 1A 20 \dx00000005 \2- 1A 20 \dx00000001 \2> 1A 00 \dx00000000 -\b0 +\w0 \wx8000 // Return computed value // Name: random2 -11 * 15 02 09 FC 83 01 \b0 04 -\wx00FF \wx00FF \wx00FF // (2/3) -> (3/4): return (var[0x45, 24, 15] < 2) -\wx00FC // (1/3) -> (1/4): return (var[0x45, 28, 15] > 5) +11 * 17 02 09 \wx7FFC 83 01 \b0 \wx0004 +\wx7FFF \wx7FFF \wx7FFF // (2/3) -> (3/4): return (var[0x45, 24, 15] < 2) +\wx7FFC // (1/3) -> (1/4): return (var[0x45, 28, 15] > 5) // Name: @return_action_0 -12 * 34 02 09 FF 8A +12 * 36 02 09 \wx7FFF 8A 45 38 \dx0000000F \2cmp 1A 20 \dx00000002 \2< 1A 20 \dx00000001 \2^ 1A 00 \dx00000001 -\b0 +\w0 \wx8000 // Return computed value // Name: @return_action_1 -13 * 34 02 09 FB 8A +13 * 36 02 09 \wx7FFB 8A 45 3C \dx0000000F \2cmp 1A 20 \dx00000005 \2- 1A 20 \dx00000001 \2> 1A 00 \dx00000000 -\b0 +\w0 \wx8000 // Return computed value // Name: var2 -14 * 23 02 09 FB 8A +14 * 25 02 09 \wx7FFB 8A 93 00 \dx000000FF -\b1 -\wx00FF \dx00000000 \dx00000000 // 0 .. 0: return (var[0x45, 24, 15] < 2) -\wx00FB // default: return (var[0x45, 28, 15] > 5) +\w1 +\wx7FFF \dx00000000 \dx00000000 // 0 .. 0: return (var[0x45, 24, 15] < 2) +\wx7FFB // default: return (var[0x45, 28, 15] > 5) -15 * 11 00 09 \b2 01 FF \wx0000 +15 * 11 00 09 \b2 \wx0001 \wx0000 08 00 09 00 -16 * 9 00 09 \b1 01 FF \wx0000 +16 * 9 00 09 \b1 \wx0001 \wx0000 0E 62 // Name: @CB_FAILED_LAYOUT09 -17 * 17 02 09 FF \b0 \dx00000000 +17 * 18 02 09 \wx7FFF \b0 \dx00000000 \dx00000000 \b0 \b0 \b0 \b0 \b0 // Name: @CB_FAILED09 -18 * 23 02 09 FF 89 +18 * 25 02 09 \wx7FFF 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FF // Non-graphics callback, return graphics result +\wx7FFF // Non-graphics callback, return graphics result // Name: @action3_0 -19 * 53 02 09 FF 89 +19 * 55 02 09 \wx7FFF 89 0C 00 \dx0000FFFF -\b4 -\wx00FB \dx00000025 \dx00000025 // var2; -\wx00FD \dx00000027 \dx00000027 // var1; -\wx00FE \dx00000030 \dx00000030 // random1; -\wx00FC \dx0000003C \dx0000003C // random2; -\wx00FF // @CB_FAILED09; - -20 * 7 03 09 01 00 \b0 -\wx00FF // @action3_0; +\w4 +\wx7FFB \dx00000025 \dx00000025 // var2; +\wx7FFD \dx00000027 \dx00000027 // var1; +\wx7FFE \dx00000030 \dx00000030 // random1; +\wx7FFC \dx0000003C \dx0000003C // random2; +\wx7FFF // @CB_FAILED09; + +20 * 10 03 09 \wx0001 \wx0000 \w0 +\wx7FFF // @action3_0; diff --git a/regression/expected/036_procedure_scope.grf b/regression/expected/036_procedure_scope.grf index 8baad11d..f5dd0c42 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 19cb15bd..fc030375 100644 --- a/regression/expected/036_procedure_scope.nfo +++ b/regression/expected/036_procedure_scope.nfo @@ -15,102 +15,102 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\36" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\36" "NML regression test" 00 "A test newgrf testing NML" 00 // Name: @return_action_0 -3 * 20 02 0A FF 8A +3 * 22 02 0A \wx7FFF 8A 1A 20 \dx00000000 \2sto 1A 00 \dx00000000 -\b0 +\w0 \wx8000 // Return computed value // Name: proc_call_optimisation -4 * 23 02 0A FF 8A +4 * 25 02 0A \wx7FFF 8A 82 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // 0 .. 0: return 0; -\wx00FF // default: return STORE_TEMP(0, 0) +\wx7FFF // default: return STORE_TEMP(0, 0) // Name: @ternary_action_0 -5 * 24 02 0A FF 89 -7E FF 00 \dxFFFFFFFF // proc_call_optimisation -\b1 -\wx00FF \dx00000000 \dx00000000 // proc_call_optimisation; +5 * 27 02 0A \wx7FFF 89 +7E \wx7FFF 00 \dxFFFFFFFF // proc_call_optimisation +\w1 +\wx7FFF \dx00000000 \dx00000000 // proc_call_optimisation; \wx8001 // return 1; // Name: @CB_FAILED_PROD -6 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 +6 * 16 02 0A \wx7FFE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 // Name: @CB_FAILED0A -7 * 23 02 0A FE 89 +7 * 25 02 0A \wx7FFE 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result +\wx7FFE // Non-graphics callback, return graphics result // Name: ternary_optimisation -8 * 24 02 0A FF 89 -7E FF 00 \dxFFFFFFFF // @ternary_action_0 -\b1 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +8 * 27 02 0A \wx7FFF 89 +7E \wx7FFF 00 \dxFFFFFFFF // @ternary_action_0 +\w1 +\wx7FFE \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 -7D 88 20 \dxFFFFFFFF // a -\2+ 7D 89 00 \dxFFFFFFFF // b -\b0 +9 * 30 02 0A \wx7FFD 89 +7D \dx00000088 20 \dxFFFFFFFF // a +\2+ 7D \dx00000089 00 \dxFFFFFFFF // b +\w0 \wx8000 // Return computed value // Name: @return_action_0 -10 * 66 02 0A FC 8A +10 * 78 02 0A \wx7FFC 8A 1A 20 \dx00000005 \2sto 1A 20 \dx00000088 -\2r 7D 86 20 \dxFFFFFFFF // a +\2r 7D \dx00000086 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000089 -\2r 7E FD 20 \dxFFFFFFFF // dumb_add(5, a) +\2r 7E \wx7FFD 20 \dxFFFFFFFF // dumb_add(5, a) \2sto 1A 20 \dx00000087 -\2r 7D 86 20 \dxFFFFFFFF // a -\2+ 7D 87 00 \dxFFFFFFFF -\b0 +\2r 7D \dx00000086 20 \dxFFFFFFFF // a +\2+ 7D \dx00000087 00 \dxFFFFFFFF +\w0 \wx8000 // Return computed value // Name: @return_action_1 -11 * 66 02 0A FB 8A +11 * 78 02 0A \wx7FFB 8A 1A 20 \dx00000006 \2sto 1A 20 \dx00000088 -\2r 7D 86 20 \dxFFFFFFFF // a +\2r 7D \dx00000086 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000089 -\2r 7E FD 20 \dxFFFFFFFF // dumb_add(6, a) +\2r 7E \wx7FFD 20 \dxFFFFFFFF // dumb_add(6, a) \2sto 1A 20 \dx00000087 -\2r 7D 86 20 \dxFFFFFFFF // a -\2+ 7D 87 00 \dxFFFFFFFF -\b0 +\2r 7D \dx00000086 20 \dxFFFFFFFF // a +\2+ 7D \dx00000087 00 \dxFFFFFFFF +\w0 \wx8000 // Return computed value // Name: callee // a : register 86 -12 * 110 02 0A FB 8A +12 * 121 02 0A \wx7FFB 8A 92 22 \dx00000001 \2* 1A 20 \dx00000004 \2sto 1A 20 \dx00000087 \2r B6 20 \dx0000FFFF -\2- 7D 87 20 \dxFFFFFFFF +\2- 7D \dx00000087 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 \2r 92 21 \dx00000001 \2u< 1A 20 \dx00000001 \2* 1A 20 \dx000001F3 // expr1 - expr2 \2+ 1A 20 \dx00000001 \2+ 82 20 \dx0000FFFF -\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)) +\2* 7D \dx00000088 20 \dxFFFFFFFF +\2+ 7D \dx00000086 00 \dxFFFFFFFF // a +\w1 +\wx7FFC \dx00000000 \dx00000005 // 0 .. 5: return (a + dumb_add(5, a)) +\wx7FFB // default: return (a + dumb_add(6, a)) // Name: caller2 -13 * 232 02 0A FC 89 +13 * 255 02 0A \wx7FFC 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -119,7 +119,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 \wx7FFB 20 \dxFFFFFFFF // callee(1) \2+ 5F 28 \dx0000FFFF \2sto 1A 20 \dx00000082 \2r 43 20 \dxFFFFFFFF @@ -131,22 +131,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 \wx7FFD 20 \dxFFFFFFFF // dumb_add(var[0x45, 28, 15], var[0x46, 0, -1]) \2sto 1A 20 \dx00000085 -\2r 7D 84 20 \dxFFFFFFFF +\2r 7D \dx00000084 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 -\2r 7D 85 20 \dxFFFFFFFF +\2r 7D \dx00000085 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\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 -\2* 7D 80 00 \dxFFFFFFFF -\b0 +\2r 7E \wx7FFD 20 \dxFFFFFFFF // dumb_add(1, dumb_add(var[0x45, 28, 15], var[0x46, 0, -1])) +\2* 7D \dx00000083 20 \dxFFFFFFFF +\2* 7D \dx00000082 20 \dxFFFFFFFF +\2* 7D \dx00000081 20 \dxFFFFFFFF +\2* 7D \dx00000080 00 \dxFFFFFFFF +\w0 \wx8000 // Return computed value // Name: caller1 -14 * 145 02 0A FD 89 +14 * 161 02 0A \wx7FFD 89 B3 20 \dx00000003 \2+ AA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 @@ -154,38 +154,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 \wx7FFB 20 \dxFFFFFFFF // callee(0) \2sto 1A 20 \dx00000082 -\2r 7D 81 20 \dxFFFFFFFF +\2r 7D \dx00000081 20 \dxFFFFFFFF \2sto 1A 20 \dx00000088 -\2r 7D 82 20 \dxFFFFFFFF +\2r 7D \dx00000082 20 \dxFFFFFFFF \2sto 1A 20 \dx00000089 -\2r 7E FD 20 \dxFFFFFFFF // dumb_add(var[0x5F, 8, 65535], callee(0)) +\2r 7E \wx7FFD 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 +\2* 7D \dx00000083 20 \dxFFFFFFFF +\2* 7D \dx00000080 00 \dxFFFFFFFF +\w0 \wx8000 // Return computed value -15 * 11 00 0A \b2 01 FF \wx0000 +15 * 11 00 0A \b2 \wx0001 \wx0000 08 00 09 00 -16 * 11 00 0A \b2 01 FF \wx0000 +16 * 11 00 0A \b2 \wx0001 \wx0000 21 01 22 42 // Name: @action3_0 -17 * 43 02 0A FE 89 +17 * 45 02 0A \wx7FFE 89 0C 00 \dx0000FFFF -\b3 -\wx00FF \dx00000022 \dx00000022 // ternary_optimisation; -\wx00FC \dx0000003B \dx0000003B // caller2; -\wx00FD \dx0000015F \dx0000015F // caller1; -\wx00FE // @CB_FAILED0A; - -18 * 7 03 0A 01 00 \b0 -\wx00FE // @action3_0; +\w3 +\wx7FFF \dx00000022 \dx00000022 // ternary_optimisation; +\wx7FFC \dx0000003B \dx0000003B // caller2; +\wx7FFD \dx0000015F \dx0000015F // caller1; +\wx7FFE // @CB_FAILED0A; + +18 * 10 03 0A \wx0001 \wx0000 \w0 +\wx7FFE // @action3_0; diff --git a/regression/expected/037_optimised_trigger.grf b/regression/expected/037_optimised_trigger.grf index b43da6ed..82fa901b 100644 Binary files a/regression/expected/037_optimised_trigger.grf and b/regression/expected/037_optimised_trigger.grf differ diff --git a/regression/expected/037_optimised_trigger.nfo b/regression/expected/037_optimised_trigger.nfo index bbd74510..867c62c2 100644 --- a/regression/expected/037_optimised_trigger.nfo +++ b/regression/expected/037_optimised_trigger.nfo @@ -15,21 +15,21 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\37" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\37" "NML regression test" 00 "A test newgrf testing NML" 00 // Name: trigger_only -3 * 23 02 00 FF 80 01 \b0 08 +3 * 25 02 00 \wx7FFF 80 01 \b0 \wx0008 \wx8007 \wx8007 \wx8007 \wx8007 \wx8007 \wx8007 \wx8007 \wx8007 // (8/8) -> (8/8): return 7; -4 * 9 00 00 \b1 01 FF \wx0064 +4 * 9 00 00 \b1 \wx0001 \wx0064 1E 40 // Name: @action3_0 -5 * 23 02 00 FF 89 +5 * 25 02 00 \wx7FFF 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8005 \dx0000002D \dx0000002D // return 5; -\wx00FF // trigger_only; +\wx7FFF // trigger_only; -6 * 9 03 00 01 FF \wx0064 \b0 -\wx00FF // @action3_0; +6 * 10 03 00 \wx0001 \wx0064 \w0 +\wx7FFF // @action3_0; diff --git a/regression/expected/038_optimised_scope.grf b/regression/expected/038_optimised_scope.grf index 7da04a0f..a73553b1 100644 Binary files a/regression/expected/038_optimised_scope.grf and b/regression/expected/038_optimised_scope.grf differ diff --git a/regression/expected/038_optimised_scope.nfo b/regression/expected/038_optimised_scope.nfo index ac0aa693..379206be 100644 --- a/regression/expected/038_optimised_scope.nfo +++ b/regression/expected/038_optimised_scope.nfo @@ -15,137 +15,137 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\38" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 32 04 00 FF 01 \wxD000 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\38" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 33 04 00 FF \wx0001 \wxD000 "A test newgrf testing NML" 00 // param[127] = param[17] 4 * 9 0D 7F \D= 11 FE \dx0000FFFF -5 * 7 06 -7F 04 FF \wx0014 +5 * 6 06 +7F 04 \wx0015 FF // Name: @return_action_0 -6 * 34 02 00 FF 89 +6 * 36 02 00 \wx7FFF 89 43 38 \dx0000000F \2* 1A 20 \dx00000010 \2+ 1A 20 \dx00000000 // param[127] \2+ 43 1C \dx0000000F -\b0 +\w0 \wx8000 // Return computed value // param[126] = param[17] 7 * 9 0D 7E \D= 11 FE \dx0000FFFF -8 * 7 06 -7E 04 FF \wx0014 +8 * 6 06 +7E 04 \wx0015 FF // Name: @return_action_1 -9 * 34 02 00 FE 89 +9 * 36 02 00 \wx7FFE 89 43 3C \dx0000000F \2* 1A 20 \dx00000010 \2+ 1A 20 \dx00000000 // param[126] \2+ 43 18 \dx0000000F -\b0 +\w0 \wx8000 // Return computed value // Name: color_conditional -10 * 23 02 00 FE 89 +10 * 25 02 00 \wx7FFE 89 C8 01 \dx00000001 -\b1 -\wx00FF \dx00000001 \dx00000001 // 1 .. 1: return (((var[0x43, 24, 15] * 16) + base_sprite_2cc) + var[0x43, 28, 15]) -\wx00FE // default: return (((var[0x43, 28, 15] * 16) + base_sprite_2cc) + var[0x43, 24, 15]) +\w1 +\wx7FFF \dx00000001 \dx00000001 // 1 .. 1: return (((var[0x43, 24, 15] * 16) + base_sprite_2cc) + var[0x43, 28, 15]) +\wx7FFE // default: return (((var[0x43, 28, 15] * 16) + base_sprite_2cc) + var[0x43, 24, 15]) // param[127] = param[17] 11 * 9 0D 7F \D= 11 FE \dx0000FFFF -12 * 7 06 -7F 04 FF \wx0014 +12 * 6 06 +7F 04 \wx0015 FF // Name: color_unconditional -13 * 34 02 00 FF 89 +13 * 36 02 00 \wx7FFF 89 43 3C \dx0000000F \2* 1A 20 \dx00000010 \2+ 1A 20 \dx00000000 // param[127] \2+ 43 18 \dx0000000F -\b0 +\w0 \wx8000 // Return computed value // Name: color_override -14 * 23 02 00 FF 8A +14 * 25 02 00 \wx7FFF 8A C6 00 \dx0000FFFF -\b1 -\wx00FE \dx00000BB8 \dx00000BB8 // 3000 .. 3000: color_conditional; -\wx00FF // default: color_unconditional; +\w1 +\wx7FFE \dx00000BB8 \dx00000BB8 // 3000 .. 3000: color_conditional; +\wx7FFF // default: color_unconditional; // Name: scope_capacity // cap : register 80 -15 * 21 02 00 FE 89 -7D 80 20 \dxFFFFFFFF // cap +15 * 26 02 00 \wx7FFE 89 +7D \dx00000080 20 \dxFFFFFFFF // cap \2+ BA 00 \dx0000FFFF -\b0 +\w0 \wx8000 // Return computed value // Name: mixed_scope_capacity -16 * 28 02 00 FE 8A +16 * 31 02 00 \wx7FFE 8A BA 20 \dx0000FFFF \2sto 1A 20 \dx00000080 -\2r 7E FE 00 \dxFFFFFFFF // scope_capacity(var[0xBA, 0, 65535]) -\b0 +\2r 7E \wx7FFE 00 \dxFFFFFFFF // scope_capacity(var[0xBA, 0, 65535]) +\w0 \wx8000 // Return computed value -17 * 9 00 00 \b1 01 FF \wx0064 +17 * 9 00 00 \b1 \wx0001 \wx0064 1E 48 -18 * 6 01 00 \b1 FF \wx0000 +18 * 5 01 00 \b1 \wx0000 // Name: @CB_FAILED_REAL00 -19 * 9 02 00 FD \b1 \b1 +19 * 10 02 00 \wx7FFD \b1 \b1 \w0 \w0 // Name: @CB_FAILED00 -20 * 23 02 00 FD 89 +20 * 25 02 00 \wx7FFD 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FD // Non-graphics callback, return graphics result +\wx7FFD // Non-graphics callback, return graphics result // Name: @action3_0 -21 * 23 02 00 FC 89 +21 * 25 02 00 \wx7FFC 89 10 00 \dx000000FF -\b1 -\wx00FE \dx00000014 \dx00000014 // mixed_scope_capacity; -\wx00FD // @CB_FAILED00; +\w1 +\wx7FFE \dx00000014 \dx00000014 // mixed_scope_capacity; +\wx7FFD // @CB_FAILED00; // Name: @action3_1 -22 * 23 02 00 FB 89 +22 * 25 02 00 \wx7FFB 89 10 00 \dx000000FF -\b1 -\wx00FE \dx00000014 \dx00000014 // mixed_scope_capacity; -\wx00FD // @CB_FAILED00; +\w1 +\wx7FFE \dx00000014 \dx00000014 // mixed_scope_capacity; +\wx7FFD // @CB_FAILED00; // Name: @action3_2 -23 * 43 02 00 FC 89 +23 * 45 02 00 \wx7FFC 89 0C 00 \dx0000FFFF -\b3 -\wx00FE \dx00000015 \dx00000015 // mixed_scope_capacity; -\wx00FF \dx0000002D \dx0000002D // color_override; -\wx00FC \dx00000036 \dx00000036 // @action3_0; -\wx00FD // @CB_FAILED00; +\w3 +\wx7FFE \dx00000015 \dx00000015 // mixed_scope_capacity; +\wx7FFF \dx0000002D \dx0000002D // color_override; +\wx7FFC \dx00000036 \dx00000036 // @action3_0; +\wx7FFD // @CB_FAILED00; // Name: @action3_3 -24 * 43 02 00 FD 89 +24 * 45 02 00 \wx7FFD 89 0C 00 \dx0000FFFF -\b3 +\w3 \wx8000 \dx00000023 \dx00000023 // return string(STR_REGRESSION_DESC); -\wx00FF \dx0000002D \dx0000002D // color_override; -\wx00FB \dx00000036 \dx00000036 // @action3_1; -\wx00FD // @CB_FAILED00; +\wx7FFF \dx0000002D \dx0000002D // color_override; +\wx7FFB \dx00000036 \dx00000036 // @action3_1; +\wx7FFD // @CB_FAILED00; -25 * 12 03 00 01 FF \wx0064 \b1 -FF \wx00FD // @action3_3; -\wx00FC // @action3_2; +25 * 14 03 00 \wx0001 \wx0064 \w1 +\wx00FF \wx7FFD // @action3_3; +\wx7FFC // @action3_2; diff --git a/regression/expected/039_storage.grf b/regression/expected/039_storage.grf index 8aa90273..5c4ebe94 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 75d28b6e..26b0f403 100644 --- a/regression/expected/039_storage.nfo +++ b/regression/expected/039_storage.nfo @@ -15,57 +15,57 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\39" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "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 +3 * 16 02 0A \wx7FFF 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 // Name: @CB_FAILED0A -4 * 23 02 0A FF 89 +4 * 25 02 0A \wx7FFF 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FF // Non-graphics callback, return graphics result +\wx7FFF // Non-graphics callback, return graphics result // Name: switch_storage2 -5 * 96 02 0A FE 8A +5 * 107 02 0A \wx7FFE 8A 1A 20 \dxFFFFFFFF \2sto 1A 20 \dx00000100 \2r 1A 20 \dx44495247 \2sto 1A 20 \dx00000100 -\2r 7C 01 20 \dxFFFFFFFF +\2r 7C \dx00000001 20 \dxFFFFFFFF \2sto 1A 20 \dx00000080 \2r 1A 20 \dxFFFFFFFF \2sto 1A 20 \dx00000100 -\2r 7C 00 20 \dxFFFFFFFF -\2+ 7D 80 20 \dxFFFFFFFF +\2r 7C \dx00000000 20 \dxFFFFFFFF +\2+ 7D \dx00000080 20 \dxFFFFFFFF \2psto 1A 00 \dx00000000 -\b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\w1 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return 0; // Name: switch_storage1 -6 * 38 02 0A FE 89 -7C 00 20 \dxFFFFFFFF +6 * 43 02 0A \wx7FFE 89 +7C \dx00000000 20 \dxFFFFFFFF \2+ 1A 20 \dx00000001 \2psto 1A 00 \dx00000000 -\b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00FE // default: switch_storage2; +\w1 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFE // default: switch_storage2; -7 * 11 00 0A \b2 01 FF \wx0000 +7 * 11 00 0A \b2 \wx0001 \wx0000 08 00 09 00 -8 * 9 00 0A \b1 01 FF \wx0000 +8 * 9 00 0A \b1 \wx0001 \wx0000 21 20 // Name: @action3_0 -9 * 23 02 0A FF 89 +9 * 25 02 0A \wx7FFF 89 0C 00 \dx0000FFFF -\b1 -\wx00FE \dx00000035 \dx00000035 // switch_storage1; -\wx00FF // @CB_FAILED0A; +\w1 +\wx7FFE \dx00000035 \dx00000035 // switch_storage1; +\wx7FFF // @CB_FAILED0A; -10 * 7 03 0A 01 00 \b0 -\wx00FF // @action3_0; +10 * 10 03 0A \wx0001 \wx0000 \w0 +\wx7FFF // @action3_0; diff --git a/regression/expected/040_station.grf b/regression/expected/040_station.grf index 40a8a745..854cce2c 100644 Binary files a/regression/expected/040_station.grf and b/regression/expected/040_station.grf differ diff --git a/regression/expected/040_station.nfo b/regression/expected/040_station.nfo index f0868193..e00a500f 100644 --- a/regression/expected/040_station.nfo +++ b/regression/expected/040_station.nfo @@ -15,18 +15,18 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 52 08 08 "NML\40" "NML regression test" 00 "A test newgrf testing NML" 00 -3 * 27 04 04 FF 02 \wxDC00 "Test" 00 "Basic station 2" 00 +2 * 52 08 09 "NML\40" "NML regression test" 00 "A test newgrf testing NML" 00 +3 * 28 04 04 FF \wx0002 \wxDC00 "Test" 00 "Basic station 2" 00 -4 * 16 00 08 \b1 02 FF \wx0000 -09 "COAL" "LVST" +4 * 17 00 08 \b1 \wx0002 \wx0000 +\wx0009 "COAL" "LVST" -5 * 47 00 04 \b6 01 FF \wx00FF +5 * 46 00 04 \b6 \wx0001 \wx00FF 08 "TEST" 13 18 12 \dx00000002 0C F0 -1E FF \w10 +1E \w10 00 01 02 03 04 05 06 07 02 05 0E \b1 \b1 @@ -36,11 +36,11 @@ 06 06 \b0 \b0 -6 * 11 04 04 FF 01 \wxC4FF "Test" 00 +6 * 12 04 04 FF \wx0001 \wxC4FF "Test" 00 -7 * 20 04 04 FF 01 \wxC5FF "Basic station" 00 +7 * 21 04 04 FF \wx0001 \wxC5FF "Basic station" 00 -8 * 6 01 04 \b2 FF \wx0002 +8 * 5 01 04 \b2 \wx0002 9 station.png 8bpp 1 1 5 5 -2 -2 normal 10 station.png 8bpp 7 1 5 5 -2 -2 normal @@ -49,16 +49,16 @@ 12 station.png 8bpp 8 2 3 3 -1 -1 normal // Name: station_spriteset - feature 04 -13 * 7 02 04 FF \b0 \b1 +13 * 8 02 04 \wx7FFF \b0 \b1 \w0 // Name: station_spriteset2 - feature 04 -14 * 7 02 04 FE \b0 \b1 +14 * 8 02 04 \wx7FFE \b0 \b1 \w1 -15 * 114 00 04 \b1 01 FF \wx00FF +15 * 114 00 04 \b1 \wx0001 \wx00FF 1A \b2 \b68 \dx000003F4 \wx0000 \dx0000842E \wx0000 \b0 \b0 \b0 \b16 \b5 \b2 @@ -73,151 +73,151 @@ // Name: Station Layout@registers - Id FF // a : register 80 -16 * 63 02 04 FD 89 +16 * 68 02 04 \wx7FFD 89 1A 20 \dx00000001 \2sto 1A 20 \dx00000080 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000081 -\2r 7D 80 20 \dxFFFFFFFF // a +\2r 7D \dx00000080 20 \dxFFFFFFFF // a \2sto 1A 20 \dx00000082 \2r 1A 20 \dx00000001 \2sto 1A 00 \dx00000083 -\b0 +\w0 \wx8000 // Return computed value // Name: Station Layout@prepare - Id FF -17 * 35 02 04 FC 89 +17 * 40 02 04 \wx7FFC 89 1A 20 \dx00000000 -\2sto 6B 2F 20 \dx0000FFFF +\2sto 6B \dx0000002F 20 \dx0000FFFF \2r 1A 20 \dx00000001 \2sto 1A 00 \dx00000001 -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_0 -18 * 49 02 04 FB 89 -7E FC 20 \dxFFFFFFFF // Station Layout@prepare - Id FF -\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id FF +18 * 53 02 04 \wx7FFB 89 +7E \wx7FFC 20 \dxFFFFFFFF // Station Layout@prepare - Id FF +\2r 7E \wx7FFD 20 \dxFFFFFFFF // Station Layout@registers - Id FF \2r 10 00 \dx000000FF -\b2 +\w2 \wx8000 \dx00000002 \dx00000002 // return 0; -\wx00FE \dx00000003 \dx00000003 // station_spriteset2; -\wx00FF // station_spriteset; +\wx7FFE \dx00000003 \dx00000003 // station_spriteset2; +\wx7FFF // station_spriteset; // Name: @action3_1 -19 * 49 02 04 FA 89 -7E FC 20 \dxFFFFFFFF // Station Layout@prepare - Id FF -\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id FF +19 * 53 02 04 \wx7FFA 89 +7E \wx7FFC 20 \dxFFFFFFFF // Station Layout@prepare - Id FF +\2r 7E \wx7FFD 20 \dxFFFFFFFF // Station Layout@registers - Id FF \2r 10 00 \dx000000FF -\b2 -\wx00FF \dx00000001 \dx00000001 // station_spriteset; +\w2 +\wx7FFF \dx00000001 \dx00000001 // station_spriteset; \wx8000 \dx00000002 \dx00000002 // return 0; -\wx00FE // station_spriteset2; +\wx7FFE // station_spriteset2; // Name: @action3_2 -20 * 49 02 04 FC 89 -7E FC 20 \dxFFFFFFFF // Station Layout@prepare - Id FF -\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id FF +20 * 53 02 04 \wx7FFC 89 +7E \wx7FFC 20 \dxFFFFFFFF // Station Layout@prepare - Id FF +\2r 7E \wx7FFD 20 \dxFFFFFFFF // Station Layout@registers - Id FF \2r 10 00 \dx000000FF -\b2 +\w2 \wx8000 \dx00000002 \dx00000002 // return 0; -\wx00FE \dx00000003 \dx00000003 // station_spriteset2; -\wx00FF // station_spriteset; +\wx7FFE \dx00000003 \dx00000003 // station_spriteset2; +\wx7FFF // station_spriteset; // Name: @action3_3 -21 * 55 02 04 F9 89 +21 * 58 02 04 \wx7FF9 89 1A 20 \dx00000003 \2sto 1A 20 \dx00000003 -\2r 7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id FF +\2r 7E \wx7FFD 20 \dxFFFFFFFF // Station Layout@registers - Id FF \2r 10 00 \dx000000FF -\b2 +\w2 \wx8000 \dx00000002 \dx00000002 // return 0; -\wx00FE \dx00000003 \dx00000003 // station_spriteset2; -\wx00FF // station_spriteset; +\wx7FFE \dx00000003 \dx00000003 // station_spriteset2; +\wx7FFF // station_spriteset; -22 * 9 00 04 \b1 01 FF \wx00FF +22 * 9 00 04 \b1 \wx0001 \wx00FF 0B 08 // Name: @return_action_0 -23 * 20 02 04 F8 89 +23 * 22 02 04 \wx7FF8 89 43 38 \dx0000000F \2+ 43 1C \dx0000000F -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_4 -24 * 23 02 04 F8 89 +24 * 25 02 04 \wx7FF8 89 0C 00 \dx0000FFFF -\b1 -\wx00F8 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) -\wx00FB // @action3_0; +\w1 +\wx7FF8 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) +\wx7FFB // @action3_0; // Name: @return_action_1 -25 * 20 02 04 F7 89 +25 * 22 02 04 \wx7FF7 89 43 38 \dx0000000F \2+ 43 1C \dx0000000F -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_5 -26 * 33 02 04 F7 89 +26 * 35 02 04 \wx7FF7 89 0C 00 \dx0000FFFF -\b2 -\wx00FA \dx00000000 \dx00000000 // @action3_1; -\wx00F7 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) -\wx00FB // @action3_0; +\w2 +\wx7FFA \dx00000000 \dx00000000 // @action3_1; +\wx7FF7 \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) +\wx7FFB // @action3_0; // Name: @return_action_2 -27 * 20 02 04 FA 89 +27 * 22 02 04 \wx7FFA 89 43 38 \dx0000000F \2+ 43 1C \dx0000000F -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_6 -28 * 33 02 04 FB 89 +28 * 35 02 04 \wx7FFB 89 0C 00 \dx0000FFFF -\b2 -\wx00FC \dx00000000 \dx00000000 // @action3_2; -\wx00FA \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) -\wx00FB // @action3_0; - -29 * 18 03 04 01 FF \wx00FF \b3 -00 \wx00F7 // @action3_5; -01 \wx00FB // @action3_6; -FF \wx00F9 // @action3_3; -\wx00F8 // @action3_4; - -30 * 22 00 04 \b4 01 FF \wx0100 +\w2 +\wx7FFC \dx00000000 \dx00000000 // @action3_2; +\wx7FFA \dx00000142 \dx00000142 // return (var[0x43, 24, 15] + var[0x43, 28, 15]) +\wx7FFB // @action3_0; + +29 * 22 03 04 \wx0001 \wx00FF \w3 +\wx0000 \wx7FF7 // @action3_5; +\wx0001 \wx7FFB // @action3_6; +\wx00FF \wx7FF9 // @action3_3; +\wx7FF8 // @action3_4; + +30 * 21 00 04 \b4 \wx0001 \wx0100 08 "TEST" 1D \wxDC00 1C \wxDC01 -0F FF \wx00FF +0F \wx00FF -31 * 11 00 04 \b1 01 FF \wx0100 -0A FF \wx00FF +31 * 10 00 04 \b1 \wx0001 \wx0100 +0A \wx00FF // Name: @CB_FAILED_REAL04 -32 * 7 02 04 F8 \b0 \b1 +32 * 8 02 04 \wx7FF8 \b0 \b1 \w0 // Name: @CB_FAILED04 -33 * 23 02 04 F8 89 +33 * 25 02 04 \wx7FF8 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00F8 // Non-graphics callback, return graphics result +\wx7FF8 // Non-graphics callback, return graphics result // Name: @action3_7 -34 * 41 02 04 F8 89 -7E FD 20 \dxFFFFFFFF // Station Layout@registers - Id FF +34 * 44 02 04 \wx7FF8 89 +7E \wx7FFD 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; +\w2 +\wx7FFF \dx00000001 \dx00000001 // station_spriteset; +\wx7FFE \dx00000003 \dx00000003 // station_spriteset2; +\wx7FF8 // @CB_FAILED04; -35 * 9 03 04 01 FF \wx0100 \b0 -\wx00F8 // @action3_7; +35 * 10 03 04 \wx0001 \wx0100 \w0 +\wx7FF8 // @action3_7; diff --git a/regression/expected/041_articulated_tram_32bpp.grf b/regression/expected/041_articulated_tram_32bpp.grf index 282eaa3b..da578eeb 100644 Binary files a/regression/expected/041_articulated_tram_32bpp.grf and b/regression/expected/041_articulated_tram_32bpp.grf differ diff --git a/regression/expected/041_articulated_tram_32bpp.nfo b/regression/expected/041_articulated_tram_32bpp.nfo index 4d733ccd..e35ea3c5 100644 --- a/regression/expected/041_articulated_tram_32bpp.nfo +++ b/regression/expected/041_articulated_tram_32bpp.nfo @@ -15,15 +15,15 @@ "B" "BLTR" \w1 "3" 00 00 -2 * 52 08 08 "NML\41" "NML regression test" 00 "A test newgrf testing NML" 00 +2 * 52 08 09 "NML\41" "NML regression test" 00 "A test newgrf testing NML" 00 // Name: foster_express_articulated_parts -3 * 23 02 01 FF 89 +3 * 25 02 01 \wx7FFF 89 10 00 \dxFFFFFFFF -\b1 +\w1 \wx8058 \dx00000001 \dx00000003 // 1 .. 3: return 88; \wx80FF // default: return 255; -4 * 74 00 01 \b25 01 FF \wx0058 +4 * 76 00 01 \b25 \wx0001 \wx0058 06 0F 04 28 03 1E @@ -45,14 +45,14 @@ 16 \dx00000000 1E \wx0000 16 \dx00000000 -24 \b0 +24 \w0 16 \dx00000000 -10 FF +10 \wx00FF 1C 01 -5 * 25 04 01 7F 01 FF \wx0058 "Foster Turbo Tram" 00 +5 * 25 04 01 7F \wx0001 \wx0058 "Foster Turbo Tram" 00 -6 * 6 01 01 \b1 FF \wx0008 +6 * 5 01 01 \b1 \wx0008 7 tram_foster_express.32.png 32bpp 48 1 8 18 -3 -10 normal 8 tram_foster_express.32.png 32bpp 64 1 20 18 -14 -5 normal @@ -64,20 +64,20 @@ 14 tram_foster_express.32.png 32bpp 272 1 20 18 -6 -7 normal // Name: foster_express_set - feature 01 -15 * 9 02 01 FE \b1 \b1 +15 * 10 02 01 \wx7FFE \b1 \b1 \w0 \w0 -16 * 9 00 01 \b1 01 FF \wx0058 +16 * 9 00 01 \b1 \wx0001 \wx0058 17 10 // Name: @action3_0 -17 * 23 02 01 FE 89 +17 * 25 02 01 \wx7FFE 89 0C 00 \dx0000FFFF -\b1 -\wx00FF \dx00000016 \dx00000016 // foster_express_articulated_parts; -\wx00FE // foster_express_set; +\w1 +\wx7FFF \dx00000016 \dx00000016 // foster_express_articulated_parts; +\wx7FFE // foster_express_set; -18 * 9 03 01 01 FF \wx0058 \b0 -\wx00FE // @action3_0; +18 * 10 03 01 \wx0001 \wx0058 \w0 +\wx7FFE // @action3_0; diff --git a/regression/expected/example_industry.grf b/regression/expected/example_industry.grf index 9b9474a9..3cba169f 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 adafcae6..7304b53d 100644 --- a/regression/expected/example_industry.nfo +++ b/regression/expected/example_industry.nfo @@ -15,132 +15,132 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 165 08 08 "NML\04" "NML Example NewGRF: Industry" 00 "\8ENML Example NewGRF: Industry\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML." 00 -3 * 37 04 00 FF 01 \wxD000 "\0DGoods produced this month: \90\7C" 00 +2 * 165 08 09 "NML\04" "NML Example NewGRF: Industry" 00 "\8ENML Example NewGRF: Industry\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML." 00 +3 * 38 04 00 FF \wx0001 \wxD000 "\0DGoods produced this month: \90\7C" 00 -4 * 52 00 08 \b1 0B FF \wx0000 -09 "PASS" "COAL" "MAIL" "OIL_" "LVST" +4 * 53 00 08 \b1 \wx000B \wx0000 +\wx0009 "PASS" "COAL" "MAIL" "OIL_" "LVST" "GOOD" "GRAI" "WOOD" "IORE" "STEL" "VALU" // Name: consume_all_prod -5 * 17 02 0A FF 02 \b3 01 01 08 02 06 03 \b2 09 80 05 81 82 +5 * 23 02 0A \wx7FFF 02 \b3 \wx0001 01 \wx0008 02 \wx0006 03 \b2 \wx0009 80 \wx0005 81 82 // Name: consume_all_prod@registers -6 * 82 02 0A FF 89 -7D 01 20 \dxFFFFFFFF +6 * 93 02 0A \wx7FFF 89 +7D \dx00000001 20 \dxFFFFFFFF \2/ 1A 20 \dx00000002 -\2+ 7D 02 20 \dxFFFFFFFF +\2+ 7D \dx00000002 20 \dxFFFFFFFF \2sto 1A 20 \dx00000080 -\2r 7D 03 20 \dxFFFFFFFF +\2r 7D \dx00000003 20 \dxFFFFFFFF \2* 1A 20 \dx00000002 \2sto 1A 20 \dx00000081 \2r 1A 20 \dx00000000 \2sto 1A 00 \dx00000082 -\b1 -\wx00FF \dx00000000 \dx00000000 -\wx00FF // +\w1 +\wx7FFF \dx00000000 \dx00000000 +\wx7FFF // // Name: do_nothing_prod -7 * 7 02 0A FE 02 \b0 \b0 80 +7 * 8 02 0A \wx7FFE 02 \b0 \b0 80 // Name: do_nothing_prod@registers -8 * 30 02 0A FE 89 +8 * 32 02 0A \wx7FFE 89 1A 20 \dx00000000 \2sto 1A 00 \dx00000080 -\b1 -\wx00FE \dx00000000 \dx00000000 -\wx00FE // +\w1 +\wx7FFE \dx00000000 \dx00000000 +\wx7FFE // // Name: factory_production_switch -9 * 69 02 0A FF 89 -6F 01 20 \dxFFFFFFFF +9 * 83 02 0A \wx7FFF 89 +6F \dx00000001 20 \dxFFFFFFFF \2sto 1A 20 \dx00000001 -\2r 6F 08 20 \dxFFFFFFFF +\2r 6F \dx00000008 20 \dxFFFFFFFF \2sto 1A 20 \dx00000002 -\2r 6F 06 20 \dxFFFFFFFF +\2r 6F \dx00000006 20 \dxFFFFFFFF \2sto 1A 20 \dx00000003 -\2r 6F 01 00 \dxFFFFFFFF -\b1 -\wx00FE \dx00000000 \dx00000000 // 0 .. 0: do_nothing_prod; -\wx00FF // default: consume_all_prod; +\2r 6F \dx00000001 00 \dxFFFFFFFF +\w1 +\wx7FFE \dx00000000 \dx00000000 // 0 .. 0: do_nothing_prod; +\wx7FFF // default: consume_all_prod; // Name: @CB_FAILED_PROD -10 * 15 02 0A FE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 +10 * 16 02 0A \wx7FFE 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 // Name: @CB_FAILED0A -11 * 23 02 0A FE 89 +11 * 25 02 0A \wx7FFE 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result +\wx7FFE // Non-graphics callback, return graphics result // Name: extra_text_switch -12 * 31 02 0A FD 89 -6A 05 20 \dxFFFFFFFF +12 * 36 02 0A \wx7FFD 89 +6A \dx00000005 20 \dxFFFFFFFF \2sto 1A 00 \dx00000100 -\b1 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\w1 +\wx7FFE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 \wx8000 // default: return string(STR_INDUSTRY_EXTRA_TEXT); -13 * 27 00 0A \b6 01 FF \wx0000 +13 * 35 00 0A \b6 \wx0001 \wx0000 08 06 09 06 -25 \b2 -09 05 -26 \b3 -01 08 06 -27 \b2 +25 \w2 +\wx0009 \wx0005 +26 \w3 +\wx0001 \wx0008 \wx0006 +27 \w2 00 00 28 \b0 \b0 -14 * 11 00 0A \b2 01 FF \wx0000 +14 * 11 00 0A \b2 \wx0001 \wx0000 21 02 22 01 // Name: @action3_0 -15 * 23 02 0A FF 89 +15 * 25 02 0A \wx7FFF 89 18 00 \dx000000FF -\b1 -\wx00FF \dx00000000 \dx00000000 // factory_production_switch; -\wx00FE // @CB_FAILED0A; +\w1 +\wx7FFF \dx00000000 \dx00000000 // factory_production_switch; +\wx7FFE // @CB_FAILED0A; // Name: @action3_1 -16 * 33 02 0A FE 89 +16 * 35 02 0A \wx7FFE 89 0C 00 \dx0000FFFF -\b2 -\wx00FF \dx00000000 \dx00000000 // @action3_0; -\wx00FD \dx0000003A \dx0000003A // extra_text_switch; -\wx00FE // @CB_FAILED0A; +\w2 +\wx7FFF \dx00000000 \dx00000000 // @action3_0; +\wx7FFD \dx0000003A \dx0000003A // extra_text_switch; +\wx7FFE // @CB_FAILED0A; -17 * 7 03 0A 01 00 \b0 -\wx00FE // @action3_1; +17 * 10 03 0A \wx0001 \wx0000 \w0 +\wx7FFE // @action3_1; -18 * 13 00 09 \b3 01 FF \wx0000 +18 * 13 00 09 \b3 \wx0001 \wx0000 08 27 09 27 12 02 -19 * 13 00 09 \b3 01 FF \wx0001 +19 * 13 00 09 \b3 \wx0001 \wx0001 08 28 09 28 12 02 -20 * 13 00 09 \b3 01 FF \wx0002 +20 * 13 00 09 \b3 \wx0001 \wx0002 08 29 09 29 12 02 -21 * 13 00 09 \b3 01 FF \wx0003 +21 * 13 00 09 \b3 \wx0001 \wx0003 08 2A 09 2A 12 02 -22 * 26 00 0A \b6 01 FF \wx0001 +22 * 32 00 0A \b6 \wx0001 \wx0001 08 09 09 09 -25 \b3 -04 06 07 -26 \b0 -27 \b3 +25 \w3 +\wx0004 \wx0006 \wx0007 +26 \w0 +27 \w3 08 0C 04 28 \b0 \b0 diff --git a/regression/expected/example_object.grf b/regression/expected/example_object.grf index afa90177..925143fe 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 468db217..9e2afb87 100644 --- a/regression/expected/example_object.nfo +++ b/regression/expected/example_object.nfo @@ -15,10 +15,10 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 292 08 08 "NML\01" "NML Example NewGRF: Object" 00 "\8ENML Example NewGRF: Object\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89planetmaker, \98coding by \89planetmaker.\0D\98This NewGRF defines a tile which can act as company-land replacement." 00 -3 * 34 04 0F FF 02 \wxD000 "Infrastructure" 00 "Company land" 00 +2 * 292 08 09 "NML\01" "NML Example NewGRF: Object" 00 "\8ENML Example NewGRF: Object\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89planetmaker, \98coding by \89planetmaker.\0D\98This NewGRF defines a tile which can act as company-land replacement." 00 +3 * 35 04 0F FF \wx0002 \wxD000 "Infrastructure" 00 "Company land" 00 -4 * 19 04 00 FF 01 \wxD002 "Company land" 00 +4 * 20 04 00 FF \wx0001 \wxD002 "Company land" 00 // param[126] = param[161] 5 * 5 0D 7E \D= A1 00 @@ -29,11 +29,11 @@ // param[127] = (param[127] << -31) 7 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 -8 * 9 09 7F 04 \7= \dx00000000 01 +8 * 10 09 7F 04 \7= \dx00000000 \wx0001 9 * 19 0B 03 7F 06 "1.2.0 (r22723)" 00 -10 * 6 01 0F \b1 FF \wx0013 +10 * 5 01 0F \b1 \wx0013 11 cc_grid.png 8bpp 1 1 64 31 -31 0 normal 12 cc_grid.png 8bpp 81 1 64 31 -31 0 normal @@ -56,34 +56,34 @@ 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 80 +30 * 32 02 0F \wx7FFF \b66 \dx00000000 \wx0002 80 \dxC0008000 \wx0002 \b0 \b0 80 00 \dx00000000 \wx0002 \b0 \b0 80 81 // Name: company_land_layout@registers - feature 0F -31 * 62 02 0F FF 89 -7D 00 20 \dxFFFFFFFF -\2+ 7D 01 20 \dxFFFFFFFF +31 * 76 02 0F \wx7FFF 89 +7D \dx00000000 20 \dxFFFFFFFF +\2+ 7D \dx00000001 20 \dxFFFFFFFF \2sto 1A 20 \dx00000080 -\2r 7D 00 20 \dxFFFFFFFF -\2+ 7D 01 20 \dxFFFFFFFF +\2r 7D \dx00000000 20 \dxFFFFFFFF +\2+ 7D \dx00000001 20 \dxFFFFFFFF \2sto 1A 00 \dx00000081 -\b1 -\wx00FF \dx00000000 \dx00000000 -\wx00FF // +\w1 +\wx7FFF \dx00000000 \dx00000000 +\wx7FFF // // Name: @CB_FAILED_LAYOUT0F -32 * 17 02 0F FE \b0 \dx00000000 +32 * 18 02 0F \wx7FFE \b0 \dx00000000 \dx00000000 \b0 \b0 \b0 \b0 \b0 // Name: @CB_FAILED0F -33 * 23 02 0F FE 89 +33 * 25 02 0F \wx7FFE 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FE // Non-graphics callback, return graphics result +\wx7FFE // Non-graphics callback, return graphics result // Name: company_land_terrain_switch -34 * 470 02 0F FD 89 +34 * 511 02 0F \wx7FFD 89 41 28 \dx0000001F \2cmp 1A 20 \dx0000001E \2& 1A 20 \dx00000001 @@ -112,12 +112,12 @@ \2cmp 1A 20 \dx0000000E \2^ 1A 20 \dx00000002 \2< 1A 20 \dx00000001 -\2& 7D 84 20 \dxFFFFFFFF +\2& 7D \dx00000084 20 \dxFFFFFFFF \2* 41 28 \dx0000001F -\2+ 7D 83 20 \dxFFFFFFFF -\2+ 7D 82 20 \dxFFFFFFFF -\2+ 7D 81 20 \dxFFFFFFFF -\2+ 7D 80 20 \dxFFFFFFFF +\2+ 7D \dx00000083 20 \dxFFFFFFFF +\2+ 7D \dx00000082 20 \dxFFFFFFFF +\2+ 7D \dx00000081 20 \dxFFFFFFFF +\2+ 7D \dx00000080 20 \dxFFFFFFFF \2sto 1A 20 \dx00000000 \2r 1A 20 \dx00000F8D \2sto 1A 20 \dx00000001 @@ -127,12 +127,12 @@ \2sto 1A 20 \dx00000085 // guard \2^ 1A 20 \dx00000001 \2sto 1A 20 \dx00000086 // !guard -\2r 7D 01 20 \dxFFFFFFFF -\2* 7D 86 20 \dxFFFFFFFF +\2r 7D \dx00000001 20 \dxFFFFFFFF +\2* 7D \dx00000086 20 \dxFFFFFFFF \2sto 1A 20 \dx00000087 -\2r 7D 85 20 \dxFFFFFFFF +\2r 7D \dx00000085 20 \dxFFFFFFFF \2* 1A 20 \dx000011C6 -\2+ 7D 87 20 \dxFFFFFFFF +\2+ 7D \dx00000087 20 \dxFFFFFFFF \2sto 1A 20 \dx00000001 \2r 41 20 \dx00000007 \2cmp 1A 20 \dx00000004 @@ -140,29 +140,29 @@ \2sto 1A 20 \dx00000088 // guard \2^ 1A 20 \dx00000001 \2sto 1A 20 \dx00000089 // !guard -\2r 7D 01 20 \dxFFFFFFFF -\2* 7D 89 20 \dxFFFFFFFF +\2r 7D \dx00000001 20 \dxFFFFFFFF +\2* 7D \dx00000089 20 \dxFFFFFFFF \2sto 1A 20 \dx0000008A -\2r 7D 88 20 \dxFFFFFFFF +\2r 7D \dx00000088 20 \dxFFFFFFFF \2* 1A 20 \dx000011C6 -\2+ 7D 8A 20 \dxFFFFFFFF +\2+ 7D \dx0000008A 20 \dxFFFFFFFF \2sto 1A 00 \dx00000001 -\b1 -\wx00FE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00FF // default: company_land_layout; +\w1 +\wx7FFE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF // default: company_land_layout; // Name: company_land_purchase_switch -35 * 51 02 0F FF 89 +35 * 53 02 0F \wx7FFF 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 -\wx00FF // default: company_land_layout; +\w1 +\wx7FFE \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFF // default: company_land_layout; -36 * 43 00 0F \b12 01 FF \wx0000 +36 * 43 00 0F \b12 \wx0001 \wx0000 08 "INFR" 09 \wxD000 0A \wxD001 @@ -176,19 +176,19 @@ 16 00 17 01 -37 * 10 00 0F \b1 01 FF \wx0000 +37 * 10 00 0F \b1 \wx0001 \wx0000 15 \wx0011 // Name: @action3_0 -38 * 43 02 0F FF 89 +38 * 45 02 0F \wx7FFF 89 0C 00 \dx0000FFFF -\b3 -\wx00FF \dx00000000 \dx00000000 // company_land_purchase_switch; +\w3 +\wx7FFF \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; +\wx7FFD // company_land_terrain_switch; -39 * 10 03 0F 01 00 \b1 -FF \wx00FF // @action3_0; -\wx00FD // company_land_terrain_switch; +39 * 14 03 0F \wx0001 \wx0000 \w1 +\wx00FF \wx7FFF // @action3_0; +\wx7FFD // company_land_terrain_switch; diff --git a/regression/expected/example_railtype.grf b/regression/expected/example_railtype.grf index 99139dd2..62fef49d 100644 Binary files a/regression/expected/example_railtype.grf and b/regression/expected/example_railtype.grf differ diff --git a/regression/expected/example_railtype.nfo b/regression/expected/example_railtype.nfo index 7f1d21fb..adf3f729 100644 --- a/regression/expected/example_railtype.nfo +++ b/regression/expected/example_railtype.nfo @@ -15,28 +15,28 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 293 08 08 "NML\02" "NML Example NewGRF: Railtype" 00 "\8ENML Example NewGRF: Railtype\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89Irwe, \98coding by \89planetmaker.\0D\98This NewGRF defines a graphical replacement for normal and electric rails" 00 +2 * 293 08 09 "NML\02" "NML Example NewGRF: Railtype" 00 "\8ENML Example NewGRF: Railtype\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89Irwe, \98coding by \89planetmaker.\0D\98This NewGRF defines a graphical replacement for normal and electric rails" 00 // param[127] = 0 3 * 9 0D 7F \D= FF 00 \dx00000000 // param[126] = 0 4 * 9 0D 7E \D= FF 00 \dx00000000 -5 * 9 09 88 04 \7gG \dx01544A44 01 +5 * 10 09 88 04 \7gG \dx01544A44 \wx0001 // param[126] = 1 6 * 9 0D 7E \D= FF 00 \dx00000001 -7 * 9 09 7E 04 \7= \dx00000000 01 +7 * 10 09 7E 04 \7= \dx00000000 \wx0001 // param[127] = 1 8 * 9 0D 7F \D= FF 00 \dx00000001 -9 * 9 09 7F 04 \7! \dx00000000 01 +9 * 10 09 7F 04 \7! \dx00000000 \wx0001 10 * 13 0B 03 7F 05 "NuTracks" 00 -11 * 6 01 10 \b5 FF \wx000A +11 * 5 01 10 \b5 \wx000A 12 gfx/lc_right.png 8bpp 5 5 44 23 -21 4 normal 13 gfx/lc_right.png 8bpp 55 5 44 23 -21 4 normal @@ -94,57 +94,57 @@ 61 gfx/rails_overlays.png 8bpp 225 195 64 39 -32 -9 normal // Name: lc_right_closed - feature 10 -62 * 7 02 10 FF \b1 \b0 +62 * 8 02 10 \wx7FFF \b1 \b0 \w0 // Name: lc_right_open - feature 10 -63 * 7 02 10 FE \b1 \b0 +63 * 8 02 10 \wx7FFE \b1 \b0 \w1 // Name: right_level_crossing_state_switch -64 * 23 02 10 FE 89 +64 * 25 02 10 \wx7FFE 89 42 00 \dx000000FF -\b1 -\wx00FF \dx00000001 \dx00000001 // 1 .. 1: lc_right_closed; -\wx00FE // default: lc_right_open; +\w1 +\wx7FFF \dx00000001 \dx00000001 // 1 .. 1: lc_right_closed; +\wx7FFE // default: lc_right_open; // Name: lc_left_closed - feature 10 -65 * 7 02 10 FF \b1 \b0 +65 * 8 02 10 \wx7FFF \b1 \b0 \w2 // Name: lc_left_open - feature 10 -66 * 7 02 10 FD \b1 \b0 +66 * 8 02 10 \wx7FFD \b1 \b0 \w3 // Name: left_level_crossing_state_switch -67 * 23 02 10 FD 89 +67 * 25 02 10 \wx7FFD 89 42 00 \dx000000FF -\b1 -\wx00FF \dx00000001 \dx00000001 // 1 .. 1: lc_left_closed; -\wx00FD // default: lc_left_open; +\w1 +\wx7FFF \dx00000001 \dx00000001 // 1 .. 1: lc_left_closed; +\wx7FFD // default: lc_left_open; // Name: level_crossing_switch -68 * 23 02 10 FE 89 +68 * 25 02 10 \wx7FFE 89 06 04 \dx00000001 -\b1 -\wx00FD \dx00000000 \dx00000000 // 0 .. 0: left_level_crossing_state_switch; -\wx00FE // default: right_level_crossing_state_switch; +\w1 +\wx7FFD \dx00000000 \dx00000000 // 0 .. 0: left_level_crossing_state_switch; +\wx7FFE // default: right_level_crossing_state_switch; -69 * 152 00 10 \b3 01 FF \wx0000 +69 * 154 00 10 \b3 \wx0001 \wx0000 08 "RAIL" -0E \b17 "RAIL" "ELRL" "_040" "_080" "RLOW" "RMED" "RHIG" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNN" "DBNE" "DBHN" "DBHE" -0F \b17 "RAIL" "ELRL" "_040" "_080" "RLOW" "RMED" "RHIG" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNN" "DBNE" "DBHN" "DBHE" +0E \w17 "RAIL" "ELRL" "_040" "_080" "RLOW" "RMED" "RHIG" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNN" "DBNE" "DBHN" "DBHE" +0F \w17 "RAIL" "ELRL" "_040" "_080" "RLOW" "RMED" "RHIG" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNN" "DBNE" "DBHN" "DBHE" // Name: track_overlays - feature 10 -70 * 7 02 10 FD \b1 \b0 +70 * 8 02 10 \wx7FFD \b1 \b0 \w4 -71 * 12 01 10 00 FF \wx0005 FF \wx0001 FF \wx0010 +71 * 9 01 10 00 \wx0005 \wx0001 \wx0010 72 gfx/rails_overlays.png 8bpp 75 0 64 31 -31 0 normal 73 gfx/rails_overlays.png 8bpp 0 0 64 31 -31 0 normal @@ -164,11 +164,11 @@ 87 gfx/rails_overlays.png 8bpp 300 80 64 31 -31 0 normal // Name: track_underlays - feature 10 -88 * 7 02 10 FF \b1 \b0 +88 * 8 02 10 \wx7FFF \b1 \b0 \w5 -89 * 12 01 10 00 FF \wx0006 FF \wx0001 FF \wx0004 +89 * 9 01 10 00 \wx0006 \wx0001 \wx0004 90 gfx/tunnel_track.png 8bpp 75 0 64 31 -31 0 normal 91 gfx/tunnel_track.png 8bpp 0 0 64 31 -31 0 normal @@ -176,11 +176,11 @@ 93 gfx/tunnel_track.png 8bpp 0 50 64 31 -31 0 normal // Name: tunnel_overlays - feature 10 -94 * 7 02 10 FC \b1 \b0 +94 * 8 02 10 \wx7FFC \b1 \b0 \w6 -95 * 12 01 10 00 FF \wx0007 FF \wx0001 FF \wx0006 +95 * 9 01 10 00 \wx0007 \wx0001 \wx0006 96 gfx/depot_normal.png 8bpp 200 10 16 8 17 7 normal 97 gfx/depot_normal.png 8bpp 118 8 64 47 -9 -31 normal @@ -190,11 +190,11 @@ 101 gfx/depot_normal.png 8bpp 118 63 64 47 -9 -31 normal // Name: depot_normal_rail - feature 10 -102 * 7 02 10 FB \b1 \b0 +102 * 8 02 10 \wx7FFB \b1 \b0 \w7 -103 * 12 01 10 00 FF \wx0008 FF \wx0001 FF \wx000A +103 * 9 01 10 00 \wx0008 \wx0001 \wx000A 104 gfx/rails_overlays.png 8bpp 75 0 64 31 -31 0 normal 105 gfx/rails_overlays.png 8bpp 0 0 64 31 -31 0 normal @@ -208,11 +208,11 @@ 113 gfx/rails_overlays.png 8bpp 300 0 64 31 -31 0 normal // Name: bridge_underlay - feature 10 -114 * 7 02 10 FA \b1 \b0 +114 * 8 02 10 \wx7FFA \b1 \b0 \w8 -115 * 12 01 10 00 FF \wx0009 FF \wx0001 FF \wx0008 +115 * 9 01 10 00 \wx0009 \wx0001 \wx0008 116 gfx/fences.png 8bpp 0 0 32 20 -30 -4 normal 117 gfx/fences.png 8bpp 48 0 32 20 0 -3 normal @@ -224,11 +224,11 @@ 123 gfx/fences.png 8bpp 350 0 32 28 1 -10 normal // Name: fencesCC - feature 10 -124 * 7 02 10 F9 \b1 \b0 +124 * 8 02 10 \wx7FF9 \b1 \b0 \w9 -125 * 12 01 10 00 FF \wx000A FF \wx0001 FF \wx0010 +125 * 9 01 10 00 \wx000A \wx0001 \wx0010 126 gfx/gui_rail.png 8bpp 0 0 20 20 0 0 normal 127 gfx/gui_rail.png 8bpp 25 0 20 20 0 0 normal @@ -248,27 +248,27 @@ 141 gfx/gui_rail.png 8bpp 550 0 32 32 0 0 normal // Name: gui_normal - feature 10 -142 * 7 02 10 F8 \b1 \b0 +142 * 8 02 10 \wx7FF8 \b1 \b0 \w10 -143 * 31 03 10 01 00 \b8 -00 \wx00F8 // gui_normal; -01 \wx00FD // track_overlays; -02 \wx00FF // track_underlays; -03 \wx00FC // tunnel_overlays; -06 \wx00FA // bridge_underlay; -07 \wx00FE // level_crossing_switch; -08 \wx00FB // depot_normal_rail; -09 \wx00F9 // fencesCC; +143 * 42 03 10 \wx0001 \wx0000 \w8 +\wx0000 \wx7FF8 // gui_normal; +\wx0001 \wx7FFD // track_overlays; +\wx0002 \wx7FFF // track_underlays; +\wx0003 \wx7FFC // tunnel_overlays; +\wx0006 \wx7FFA // bridge_underlay; +\wx0007 \wx7FFE // level_crossing_switch; +\wx0008 \wx7FFB // depot_normal_rail; +\wx0009 \wx7FF9 // fencesCC; \wx0000 -144 * 120 00 10 \b3 01 FF \wx0001 +144 * 122 00 10 \b3 \wx0001 \wx0001 08 "ELRL" -0E \b17 "RAIL" "ELRL" "_040" "_080" "RLOW" "RMED" "RHIG" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNN" "DBNE" "DBHN" "DBHE" -0F \b9 "ELRL" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNE" "DBHE" +0E \w17 "RAIL" "ELRL" "_040" "_080" "RLOW" "RMED" "RHIG" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNN" "DBNE" "DBHN" "DBHE" +0F \w9 "ELRL" "E040" "E080" "ELOW" "EMED" "EHIG" "HSTR" "DBNE" "DBHE" -145 * 12 01 10 00 FF \wx000B FF \wx0001 FF \wx0006 +145 * 9 01 10 00 \wx000B \wx0001 \wx0006 146 gfx/depot_electric.png 8bpp 200 10 16 8 17 7 normal 147 gfx/depot_electric.png 8bpp 118 8 64 47 -9 -31 normal @@ -278,11 +278,11 @@ 151 gfx/depot_electric.png 8bpp 118 63 64 47 -9 -31 normal // Name: depot_electric_rail - feature 10 -152 * 7 02 10 FB \b1 \b0 +152 * 8 02 10 \wx7FFB \b1 \b0 \w11 -153 * 12 01 10 00 FF \wx000C FF \wx0001 FF \wx0010 +153 * 9 01 10 00 \wx000C \wx0001 \wx0010 154 gfx/gui_erail.png 8bpp 0 0 20 20 0 0 normal 155 gfx/gui_erail.png 8bpp 25 0 20 20 0 0 normal @@ -302,18 +302,18 @@ 169 gfx/gui_erail.png 8bpp 550 0 32 32 0 0 normal // Name: gui_electric - feature 10 -170 * 7 02 10 F8 \b1 \b0 +170 * 8 02 10 \wx7FF8 \b1 \b0 \w12 -171 * 31 03 10 01 01 \b8 -00 \wx00F8 // gui_electric; -01 \wx00FD // track_overlays; -02 \wx00FF // track_underlays; -03 \wx00FC // tunnel_overlays; -06 \wx00FA // bridge_underlay; -07 \wx00FE // level_crossing_switch; -08 \wx00FB // depot_electric_rail; -09 \wx00F9 // fencesCC; +171 * 42 03 10 \wx0001 \wx0001 \w8 +\wx0000 \wx7FF8 // gui_electric; +\wx0001 \wx7FFD // track_overlays; +\wx0002 \wx7FFF // track_underlays; +\wx0003 \wx7FFC // tunnel_overlays; +\wx0006 \wx7FFA // bridge_underlay; +\wx0007 \wx7FFE // level_crossing_switch; +\wx0008 \wx7FFB // depot_electric_rail; +\wx0009 \wx7FF9 // fencesCC; \wx0000 diff --git a/regression/expected/example_road_vehicle.grf b/regression/expected/example_road_vehicle.grf index 02249dab..b8e817d7 100644 Binary files a/regression/expected/example_road_vehicle.grf and b/regression/expected/example_road_vehicle.grf differ diff --git a/regression/expected/example_road_vehicle.nfo b/regression/expected/example_road_vehicle.nfo index 2af0e51d..e8b6def5 100644 --- a/regression/expected/example_road_vehicle.nfo +++ b/regression/expected/example_road_vehicle.nfo @@ -15,45 +15,45 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 301 08 08 "NML\03" "NML Example NewGRF: Road Vehicle" 00 "\8ENML Example NewGRF: Road Vehicle\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89DanMack, Zephyris, \98coding by \89Terkhen, planetmaker.\0D\98This NewGRF defines first-generation flatbed truck." 00 +2 * 301 08 09 "NML\03" "NML Example NewGRF: Road Vehicle" 00 "\8ENML Example NewGRF: Road Vehicle\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89DanMack, Zephyris, \98coding by \89Terkhen, planetmaker.\0D\98This NewGRF defines first-generation flatbed truck." 00 // param[127] = 0 3 * 9 0D 7F \D= FF 00 \dx00000000 -4 * 6 09 85 01 \70 78 01 +4 * 7 09 85 01 \70 78 \wx0001 // param[127] = 1 5 * 9 0D 7F \D= FF 00 \dx00000001 -6 * 9 09 7F 04 \7! \dx00000000 01 +6 * 10 09 7F 04 \7! \dx00000000 \wx0001 7 * 44 0B 02 7F 02 "enable multiple NewGRF engine sets = on" 00 -8 * 68 00 08 \b1 0F FF \wx0000 -09 "LVST" "WOOL" "SCRP" "FICR" "PETR" +8 * 69 00 08 \b1 \wx000F \wx0000 +\wx0009 "LVST" "WOOL" "SCRP" "FICR" "PETR" "RFPR" "GOOD" "ENSP" "FMSP" "MNSP" "PAPR" "STEL" "VEHI" "COPR" "WOOD" // param[127] = 1145130834 9 * 9 0D 7F \D= FF 00 \dx44414F52 -10 * 9 09 00 04 0F \dx52444552 01 +10 * 10 09 00 04 0F \dx52444552 \wx0001 // param[127] = 1380205906 11 * 9 0D 7F \D= FF FF \dx52444552 -12 * 9 09 00 04 0F \dx5F444552 01 +12 * 10 09 00 04 0F \dx5F444552 \wx0001 // param[127] = 1598309714 13 * 9 0D 7F \D= FF FF \dx5F444552 -14 * 7 06 -7F 04 FF \wx0014 +14 * 6 06 +7F 04 \wx0014 FF -15 * 24 00 08 \b1 04 FF \wx0000 -16 "ROAD" "ELRD" "2YEL" "\00\00\00\00" +15 * 25 00 08 \b1 \wx0004 \wx0000 +\wx0016 "ROAD" "ELRD" "2YEL" "\00\00\00\00" -16 * 6 01 01 \b10 FF \wx0008 +16 * 5 01 01 \b10 \wx0008 17 gfx/flatbed_truck_1_paper.png 8bpp 0 0 8 18 -3 -10 normal 18 gfx/flatbed_truck_1_paper.png 8bpp 16 0 20 16 -14 -7 normal @@ -146,34 +146,34 @@ FF 96 gfx/flatbed_truck_1_goods.png 8bpp 484 0 20 16 -6 -7 normal // Name: flatbed_truck_1_paper - feature 01 -97 * 13 02 01 FF \b2 \b2 +97 * 14 02 01 \wx7FFF \b2 \b2 \w0 \w1 \w0 \w1 // Name: flatbed_truck_1_steel - feature 01 -98 * 13 02 01 FE \b2 \b2 +98 * 14 02 01 \wx7FFE \b2 \b2 \w2 \w3 \w2 \w3 // Name: flatbed_truck_1_wood - feature 01 -99 * 13 02 01 FD \b2 \b2 +99 * 14 02 01 \wx7FFD \b2 \b2 \w4 \w5 \w4 \w5 // Name: flatbed_truck_1_copper - feature 01 -100 * 13 02 01 FC \b2 \b2 +100 * 14 02 01 \wx7FFC \b2 \b2 \w6 \w7 \w6 \w7 // Name: flatbed_truck_1_goods - feature 01 -101 * 13 02 01 FB \b2 \b2 +101 * 14 02 01 \wx7FFB \b2 \b2 \w8 \w9 \w8 \w9 // Name: flatbed_truck_1_capacity_switch -102 * 103 02 01 FA 89 +102 * 105 02 01 \wx7FFA 89 47 00 \dx000000FF -\b9 +\w9 \wx800E \dx00000006 \dx00000006 // 6 .. 6: return 14; \wx800E \dx00000007 \dx00000007 // 7 .. 7: return 14; \wx800E \dx00000008 \dx00000008 // 8 .. 8: return 14; @@ -185,9 +185,9 @@ FF \wx800C \dx0000000C \dx0000000C // 12 .. 12: return 12; \wx8014 // default: return 20; -103 * 85 00 01 \b26 01 FF \wx0058 +103 * 95 00 01 \b26 \wx0001 \wx0058 06 07 -05 00 +05 \wx0000 1F \dx000ABBE1 04 41 03 0F @@ -196,10 +196,10 @@ FF 16 \dx00000000 1E \wx0081 16 \dx00000000 -24 \b6 -00 01 02 03 04 05 +24 \w6 +\wx0000 \wx0001 \wx0002 \wx0003 \wx0004 \wx0005 16 \dx00000000 -25 \b0 +25 \w0 16 \dx00000000 07 05 11 6C @@ -212,81 +212,81 @@ FF 13 0C 14 26 0F 14 -12 17 +12 \wx0017 -104 * 37 04 01 7F 01 FF \wx0058 "Flatbed Truck 1 (Normal Road)" 00 +104 * 37 04 01 7F \wx0001 \wx0058 "Flatbed Truck 1 (Normal Road)" 00 -105 * 9 00 01 \b1 01 FF \wx0058 +105 * 9 00 01 \b1 \wx0001 \wx0058 17 08 // Name: @action3_0 -106 * 23 02 01 F9 89 +106 * 25 02 01 \wx7FF9 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_1 -107 * 23 02 01 00 89 +107 * 25 02 01 \wx0000 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_2 -108 * 33 02 01 F8 89 +108 * 35 02 01 \wx7FF8 89 0C 00 \dx0000FFFF -\b2 -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_0; -\wx00FB // flatbed_truck_1_goods; +\w2 +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_0; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_3 -109 * 43 02 01 F7 89 +109 * 45 02 01 \wx7FF7 89 0C 00 \dx0000FFFF -\b3 -\wx00FF \dx00000000 \dx00000000 // flatbed_truck_1_paper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_0; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFF \dx00000000 \dx00000000 // flatbed_truck_1_paper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_0; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_4 -110 * 43 02 01 F6 89 +110 * 45 02 01 \wx7FF6 89 0C 00 \dx0000FFFF -\b3 -\wx00FE \dx00000000 \dx00000000 // flatbed_truck_1_steel; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_0; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFE \dx00000000 \dx00000000 // flatbed_truck_1_steel; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_0; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_5 -111 * 43 02 01 F5 89 +111 * 45 02 01 \wx7FF5 89 0C 00 \dx0000FFFF -\b3 -\wx00FC \dx00000000 \dx00000000 // flatbed_truck_1_copper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_0; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFC \dx00000000 \dx00000000 // flatbed_truck_1_copper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_0; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_6 -112 * 43 02 01 F9 89 +112 * 45 02 01 \wx7FF9 89 0C 00 \dx0000FFFF -\b3 -\wx00FD \dx00000000 \dx00000000 // flatbed_truck_1_wood; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_0; -\wx00FB // flatbed_truck_1_goods; - -113 * 21 03 01 01 FF \wx0058 \b4 -0A \wx00F7 // @action3_3; -0B \wx00F6 // @action3_4; -0D \wx00F5 // @action3_5; -0E \wx00F9 // @action3_6; -\wx00F8 // @action3_2; - -114 * 85 00 01 \b26 01 FF \wx0059 +\w3 +\wx7FFD \dx00000000 \dx00000000 // flatbed_truck_1_wood; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_0; +\wx7FFB // flatbed_truck_1_goods; + +113 * 26 03 01 \wx0001 \wx0058 \w4 +\wx000A \wx7FF7 // @action3_3; +\wx000B \wx7FF6 // @action3_4; +\wx000D \wx7FF5 // @action3_5; +\wx000E \wx7FF9 // @action3_6; +\wx7FF8 // @action3_2; + +114 * 95 00 01 \b26 \wx0001 \wx0059 06 07 -05 01 +05 \wx0001 1F \dx000ABBE1 04 41 03 0F @@ -295,10 +295,10 @@ FF 16 \dx00000000 1E \wx0081 16 \dx00000000 -24 \b6 -00 01 02 03 04 05 +24 \w6 +\wx0000 \wx0001 \wx0002 \wx0003 \wx0004 \wx0005 16 \dx00000000 -25 \b0 +25 \w0 16 \dx00000000 07 05 11 6C @@ -311,81 +311,81 @@ FF 13 0C 14 26 0F 14 -12 17 +12 \wx0017 -115 * 42 04 01 7F 01 FF \wx0059 "Flatbed Truck 2 (Electrified Road)" 00 +115 * 42 04 01 7F \wx0001 \wx0059 "Flatbed Truck 2 (Electrified Road)" 00 -116 * 9 00 01 \b1 01 FF \wx0059 +116 * 9 00 01 \b1 \wx0001 \wx0059 17 08 // Name: @action3_7 -117 * 23 02 01 F8 89 +117 * 25 02 01 \wx7FF8 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_8 -118 * 23 02 01 00 89 +118 * 25 02 01 \wx0000 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_9 -119 * 33 02 01 F9 89 +119 * 35 02 01 \wx7FF9 89 0C 00 \dx0000FFFF -\b2 -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_7; -\wx00FB // flatbed_truck_1_goods; +\w2 +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_7; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_10 -120 * 43 02 01 F5 89 +120 * 45 02 01 \wx7FF5 89 0C 00 \dx0000FFFF -\b3 -\wx00FF \dx00000000 \dx00000000 // flatbed_truck_1_paper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_7; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFF \dx00000000 \dx00000000 // flatbed_truck_1_paper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_7; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_11 -121 * 43 02 01 F6 89 +121 * 45 02 01 \wx7FF6 89 0C 00 \dx0000FFFF -\b3 -\wx00FE \dx00000000 \dx00000000 // flatbed_truck_1_steel; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_7; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFE \dx00000000 \dx00000000 // flatbed_truck_1_steel; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_7; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_12 -122 * 43 02 01 F7 89 +122 * 45 02 01 \wx7FF7 89 0C 00 \dx0000FFFF -\b3 -\wx00FC \dx00000000 \dx00000000 // flatbed_truck_1_copper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_7; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFC \dx00000000 \dx00000000 // flatbed_truck_1_copper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_7; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_13 -123 * 43 02 01 F8 89 +123 * 45 02 01 \wx7FF8 89 0C 00 \dx0000FFFF -\b3 -\wx00FD \dx00000000 \dx00000000 // flatbed_truck_1_wood; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_7; -\wx00FB // flatbed_truck_1_goods; - -124 * 21 03 01 01 FF \wx0059 \b4 -0A \wx00F5 // @action3_10; -0B \wx00F6 // @action3_11; -0D \wx00F7 // @action3_12; -0E \wx00F8 // @action3_13; -\wx00F9 // @action3_9; - -125 * 85 00 01 \b26 01 FF \wx005A +\w3 +\wx7FFD \dx00000000 \dx00000000 // flatbed_truck_1_wood; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_7; +\wx7FFB // flatbed_truck_1_goods; + +124 * 26 03 01 \wx0001 \wx0059 \w4 +\wx000A \wx7FF5 // @action3_10; +\wx000B \wx7FF6 // @action3_11; +\wx000D \wx7FF7 // @action3_12; +\wx000E \wx7FF8 // @action3_13; +\wx7FF9 // @action3_9; + +125 * 95 00 01 \b26 \wx0001 \wx005A 06 07 -05 02 +05 \wx0002 1F \dx000ABBE1 04 41 03 0F @@ -394,10 +394,10 @@ FF 16 \dx00000000 1E \wx0081 16 \dx00000000 -24 \b6 -00 01 02 03 04 05 +24 \w6 +\wx0000 \wx0001 \wx0002 \wx0003 \wx0004 \wx0005 16 \dx00000000 -25 \b0 +25 \w0 16 \dx00000000 07 05 11 6C @@ -410,81 +410,81 @@ FF 13 0C 14 26 0F 14 -12 17 +12 \wx0017 -126 * 37 04 01 7F 01 FF \wx005A "Flatbed Truck 3 (Yellow Road)" 00 +126 * 37 04 01 7F \wx0001 \wx005A "Flatbed Truck 3 (Yellow Road)" 00 -127 * 9 00 01 \b1 01 FF \wx005A +127 * 9 00 01 \b1 \wx0001 \wx005A 17 08 // Name: @action3_14 -128 * 23 02 01 F9 89 +128 * 25 02 01 \wx7FF9 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_15 -129 * 23 02 01 00 89 +129 * 25 02 01 \wx0000 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_16 -130 * 33 02 01 F8 89 +130 * 35 02 01 \wx7FF8 89 0C 00 \dx0000FFFF -\b2 -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_14; -\wx00FB // flatbed_truck_1_goods; +\w2 +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_14; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_17 -131 * 43 02 01 F7 89 +131 * 45 02 01 \wx7FF7 89 0C 00 \dx0000FFFF -\b3 -\wx00FF \dx00000000 \dx00000000 // flatbed_truck_1_paper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_14; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFF \dx00000000 \dx00000000 // flatbed_truck_1_paper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_14; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_18 -132 * 43 02 01 F6 89 +132 * 45 02 01 \wx7FF6 89 0C 00 \dx0000FFFF -\b3 -\wx00FE \dx00000000 \dx00000000 // flatbed_truck_1_steel; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_14; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFE \dx00000000 \dx00000000 // flatbed_truck_1_steel; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_14; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_19 -133 * 43 02 01 F5 89 +133 * 45 02 01 \wx7FF5 89 0C 00 \dx0000FFFF -\b3 -\wx00FC \dx00000000 \dx00000000 // flatbed_truck_1_copper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_14; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFC \dx00000000 \dx00000000 // flatbed_truck_1_copper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_14; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_20 -134 * 43 02 01 F9 89 +134 * 45 02 01 \wx7FF9 89 0C 00 \dx0000FFFF -\b3 -\wx00FD \dx00000000 \dx00000000 // flatbed_truck_1_wood; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F9 \dx00000036 \dx00000036 // @action3_14; -\wx00FB // flatbed_truck_1_goods; - -135 * 21 03 01 01 FF \wx005A \b4 -0A \wx00F7 // @action3_17; -0B \wx00F6 // @action3_18; -0D \wx00F5 // @action3_19; -0E \wx00F9 // @action3_20; -\wx00F8 // @action3_16; - -136 * 85 00 01 \b26 01 FF \wx005B +\w3 +\wx7FFD \dx00000000 \dx00000000 // flatbed_truck_1_wood; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF9 \dx00000036 \dx00000036 // @action3_14; +\wx7FFB // flatbed_truck_1_goods; + +135 * 26 03 01 \wx0001 \wx005A \w4 +\wx000A \wx7FF7 // @action3_17; +\wx000B \wx7FF6 // @action3_18; +\wx000D \wx7FF5 // @action3_19; +\wx000E \wx7FF9 // @action3_20; +\wx7FF8 // @action3_16; + +136 * 95 00 01 \b26 \wx0001 \wx005B 06 07 -05 03 +05 \wx0003 1F \dx000ABBE1 04 41 03 0F @@ -493,10 +493,10 @@ FF 16 \dx00000000 1E \wx0081 16 \dx00000000 -24 \b6 -00 01 02 03 04 05 +24 \w6 +\wx0000 \wx0001 \wx0002 \wx0003 \wx0004 \wx0005 16 \dx00000000 -25 \b0 +25 \w0 16 \dx00000000 07 05 11 6C @@ -509,75 +509,75 @@ FF 13 0C 14 26 0F 14 -12 17 +12 \wx0017 -137 * 60 04 01 7F 01 FF \wx005B "Flatbed Truck 4 (Unknown, fallback to Red then Road)" 00 +137 * 60 04 01 7F \wx0001 \wx005B "Flatbed Truck 4 (Unknown, fallback to Red then Road)" 00 -138 * 9 00 01 \b1 01 FF \wx005B +138 * 9 00 01 \b1 \wx0001 \wx005B 17 08 // Name: @action3_21 -139 * 23 02 01 F8 89 +139 * 25 02 01 \wx7FF8 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_22 -140 * 23 02 01 00 89 +140 * 25 02 01 \wx0000 89 10 00 \dx000000FF -\b1 -\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; -\wx00FB // flatbed_truck_1_goods; +\w1 +\wx7FFA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_23 -141 * 33 02 01 F9 89 +141 * 35 02 01 \wx7FF9 89 0C 00 \dx0000FFFF -\b2 -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_21; -\wx00FB // flatbed_truck_1_goods; +\w2 +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_21; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_24 -142 * 43 02 01 FF 89 +142 * 45 02 01 \wx7FFF 89 0C 00 \dx0000FFFF -\b3 -\wx00FF \dx00000000 \dx00000000 // flatbed_truck_1_paper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_21; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFF \dx00000000 \dx00000000 // flatbed_truck_1_paper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_21; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_25 -143 * 43 02 01 FE 89 +143 * 45 02 01 \wx7FFE 89 0C 00 \dx0000FFFF -\b3 -\wx00FE \dx00000000 \dx00000000 // flatbed_truck_1_steel; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_21; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFE \dx00000000 \dx00000000 // flatbed_truck_1_steel; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_21; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_26 -144 * 43 02 01 FC 89 +144 * 45 02 01 \wx7FFC 89 0C 00 \dx0000FFFF -\b3 -\wx00FC \dx00000000 \dx00000000 // flatbed_truck_1_copper; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_21; -\wx00FB // flatbed_truck_1_goods; +\w3 +\wx7FFC \dx00000000 \dx00000000 // flatbed_truck_1_copper; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_21; +\wx7FFB // flatbed_truck_1_goods; // Name: @action3_27 -145 * 43 02 01 FB 89 +145 * 45 02 01 \wx7FFB 89 0C 00 \dx0000FFFF -\b3 -\wx00FD \dx00000000 \dx00000000 // flatbed_truck_1_wood; -\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; -\wx00F8 \dx00000036 \dx00000036 // @action3_21; -\wx00FB // flatbed_truck_1_goods; - -146 * 21 03 01 01 FF \wx005B \b4 -0A \wx00FF // @action3_24; -0B \wx00FE // @action3_25; -0D \wx00FC // @action3_26; -0E \wx00FB // @action3_27; -\wx00F9 // @action3_23; +\w3 +\wx7FFD \dx00000000 \dx00000000 // flatbed_truck_1_wood; +\wx7FFA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx7FF8 \dx00000036 \dx00000036 // @action3_21; +\wx7FFB // flatbed_truck_1_goods; + +146 * 26 03 01 \wx0001 \wx005B \w4 +\wx000A \wx7FFF // @action3_24; +\wx000B \wx7FFE // @action3_25; +\wx000D \wx7FFC // @action3_26; +\wx000E \wx7FFB // @action3_27; +\wx7FF9 // @action3_23; diff --git a/regression/expected/example_roadtype_and_tramtype.grf b/regression/expected/example_roadtype_and_tramtype.grf index 853d7800..9dc6d460 100644 Binary files a/regression/expected/example_roadtype_and_tramtype.grf and b/regression/expected/example_roadtype_and_tramtype.grf differ diff --git a/regression/expected/example_roadtype_and_tramtype.nfo b/regression/expected/example_roadtype_and_tramtype.nfo index c4ab8d80..7dfe7823 100644 --- a/regression/expected/example_roadtype_and_tramtype.nfo +++ b/regression/expected/example_roadtype_and_tramtype.nfo @@ -15,15 +15,15 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 245 08 08 "NML\04" "NML Example NewGRF: Roadtype and Tramtype" 00 "\8ENML Example NewGRF: Roadtype and Tramtype\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89Irwe, \98coding by \89andythenorth." 00 -3 * 627 04 12 FF 12 \wxDC00 "(Name 0x1B) Red Electric Road" 00 "(Toolbar Caption 0x09) Red Electric Road" 00 "(Menu Text 0x0A) Red Electric Road" 00 "(Build Window Caption 0x0B) Red Electric Road" 00 "(Autoreplace Text 0x0C) Red Electric Road" 00 "(New Engine Text 0x0D) red Electric Road" 00 "(Name 0x1B) Blue Road" 00 "(Toolbar Caption 0x09) Blue Road" 00 "(Menu Text 0x0A) Blue Road" 00 "(Build Window Caption 0x0B) Blue Road" 00 "(Autoreplace Text 0x0C) Blue Road" 00 "(New Engine Text 0x0D) Blue Road" 00 "(Name 0x1B) Yellow Road" 00 "(Toolbar Caption 0x09) Yellow Road" 00 "(Menu Text 0x0A) Yellow Road" 00 "(Build Window Caption 0x0B) Yellow Road" 00 "(Autoreplace Text 0x0C) Yellow Road" 00 "(New Engine Text 0x0D) Yellow Road" 00 +2 * 245 08 09 "NML\04" "NML Example NewGRF: Roadtype and Tramtype" 00 "\8ENML Example NewGRF: Roadtype and Tramtype\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89Irwe, \98coding by \89andythenorth." 00 +3 * 628 04 12 FF \wx0012 \wxDC00 "(Name 0x1B) Red Electric Road" 00 "(Toolbar Caption 0x09) Red Electric Road" 00 "(Menu Text 0x0A) Red Electric Road" 00 "(Build Window Caption 0x0B) Red Electric Road" 00 "(Autoreplace Text 0x0C) Red Electric Road" 00 "(New Engine Text 0x0D) red Electric Road" 00 "(Name 0x1B) Blue Road" 00 "(Toolbar Caption 0x09) Blue Road" 00 "(Menu Text 0x0A) Blue Road" 00 "(Build Window Caption 0x0B) Blue Road" 00 "(Autoreplace Text 0x0C) Blue Road" 00 "(New Engine Text 0x0D) Blue Road" 00 "(Name 0x1B) Yellow Road" 00 "(Toolbar Caption 0x09) Yellow Road" 00 "(Menu Text 0x0A) Yellow Road" 00 "(Build Window Caption 0x0B) Yellow Road" 00 "(Autoreplace Text 0x0C) Yellow Road" 00 "(New Engine Text 0x0D) Yellow Road" 00 -4 * 199 04 13 FF 06 \wxDC12 "(Name 0x1B) Green Tram" 00 "(Toolbar Caption 0x09) Green Tram" 00 "(Menu Text 0x0A) Green Tram" 00 "(Build Window Caption 0x0B) Green Tram" 00 "(Autoreplace Text 0x0C) Green Tram" 00 "(New Engine Text 0x0D) Green Tram" 00 +4 * 200 04 13 FF \wx0006 \wxDC12 "(Name 0x1B) Green Tram" 00 "(Toolbar Caption 0x09) Green Tram" 00 "(Menu Text 0x0A) Green Tram" 00 "(Build Window Caption 0x0B) Green Tram" 00 "(Autoreplace Text 0x0C) Green Tram" 00 "(New Engine Text 0x0D) Green Tram" 00 -5 * 52 00 12 \b10 01 FF \wx0005 +5 * 53 00 12 \b10 \wx0001 \wx0005 1B \wxDC00 08 "REDR" -0F \b4 "BLUE" "REDR" "ROAD" "ELRD" +0F \w4 "BLUE" "REDR" "ROAD" "ELRD" 09 \wxDC01 0A \wxDC02 0B \wxDC03 @@ -32,7 +32,7 @@ 10 01 1A 65 -6 * 6 01 12 \b2 FF \wx0013 +6 * 5 01 12 \b2 \wx0013 7 gfx/roads_red.png 8bpp 0 0 64 31 -31 0 normal 8 gfx/roads_red.png 8bpp 75 0 64 31 -31 0 normal @@ -75,16 +75,16 @@ 44 gfx/roads_underlay.png 8bpp 225 80 64 31 -31 0 normal // Name: road_overlays_red - feature 12 -45 * 7 02 12 FF \b1 \b0 +45 * 8 02 12 \wx7FFF \b1 \b0 \w0 // Name: track_underlays - feature 12 -46 * 7 02 12 FE \b1 \b0 +46 * 8 02 12 \wx7FFE \b1 \b0 \w1 -47 * 12 01 12 00 FF \wx0002 FF \wx0001 FF \wx0006 +47 * 9 01 12 00 \wx0002 \wx0001 \wx0006 48 gfx/depot_normal.png 8bpp 200 10 16 8 17 11 normal 49 gfx/depot_normal.png 8bpp 118 8 64 47 -1 -31 normal @@ -94,11 +94,11 @@ 53 gfx/depot_normal.png 8bpp 118 63 64 47 -1 -31 normal // Name: depot_normal_road - feature 12 -54 * 7 02 12 FD \b1 \b0 +54 * 8 02 12 \wx7FFD \b1 \b0 \w2 -55 * 12 01 12 00 FF \wx0003 FF \wx0001 FF \wx000B +55 * 9 01 12 00 \wx0003 \wx0001 \wx000B 56 gfx/roads_red.png 8bpp 0 0 64 31 -31 0 normal 57 gfx/roads_red.png 8bpp 75 0 64 31 -31 0 normal @@ -113,11 +113,11 @@ 66 gfx/roads_red.png 8bpp 450 0 64 31 -31 0 normal // Name: bridge_underlay - feature 12 -67 * 7 02 12 FC \b1 \b0 +67 * 8 02 12 \wx7FFC \b1 \b0 \w3 -68 * 12 01 12 00 FF \wx0004 FF \wx0001 FF \wx0004 +68 * 9 01 12 00 \wx0004 \wx0001 \wx0004 69 gfx/roads_red.png 8bpp 0 120 64 31 -31 0 normal 70 gfx/roads_red.png 8bpp 75 120 64 31 -31 0 normal @@ -125,11 +125,11 @@ 72 gfx/roads_red.png 8bpp 225 120 64 31 -31 0 normal // Name: roadstop_underlay_red - feature 12 -73 * 7 02 12 FB \b1 \b0 +73 * 8 02 12 \wx7FFB \b1 \b0 \w4 -74 * 12 01 12 00 FF \wx0005 FF \wx0001 FF \wx0012 +74 * 9 01 12 00 \wx0005 \wx0001 \wx0012 75 gfx/direction_markings.png 8bpp 34 8 24 16 -10 -9 normal 76 gfx/direction_markings.png 8bpp 66 8 24 16 -13 -7 normal @@ -151,23 +151,23 @@ 92 gfx/direction_markings.png 8bpp 194 72 24 16 -12 -8 normal // Name: st_direction_markings - feature 12 -93 * 7 02 12 FA \b1 \b0 +93 * 8 02 12 \wx7FFA \b1 \b0 \w5 -94 * 25 03 12 01 05 \b6 -01 \wx00FF // road_overlays_red; -02 \wx00FE // track_underlays; -06 \wx00FC // bridge_underlay; -08 \wx00FD // depot_normal_road; -0A \wx00FB // roadstop_underlay_red; -0B \wx00FA // st_direction_markings; +94 * 34 03 12 \wx0001 \wx0005 \w6 +\wx0001 \wx7FFF // road_overlays_red; +\wx0002 \wx7FFE // track_underlays; +\wx0006 \wx7FFC // bridge_underlay; +\wx0008 \wx7FFD // depot_normal_road; +\wx000A \wx7FFB // roadstop_underlay_red; +\wx000B \wx7FFA // st_direction_markings; \wx0000 -95 * 40 00 12 \b10 01 FF \wx0006 +95 * 41 00 12 \b10 \wx0001 \wx0006 1B \wxDC06 08 "BLUE" -0F \b1 "ROAD" +0F \w1 "ROAD" 09 \wxDC07 0A \wxDC08 0B \wxDC09 @@ -176,7 +176,7 @@ 10 00 1A 63 -96 * 12 01 12 00 FF \wx0006 FF \wx0001 FF \wx0013 +96 * 9 01 12 00 \wx0006 \wx0001 \wx0013 97 gfx/roads_blue.png 8bpp 0 0 64 31 -31 0 normal 98 gfx/roads_blue.png 8bpp 75 0 64 31 -31 0 normal @@ -199,11 +199,11 @@ 115 gfx/roads_blue.png 8bpp 225 80 64 31 -31 0 normal // Name: road_overlays_blue - feature 12 -116 * 7 02 12 FB \b1 \b0 +116 * 8 02 12 \wx7FFB \b1 \b0 \w6 -117 * 12 01 12 00 FF \wx0007 FF \wx0001 FF \wx0004 +117 * 9 01 12 00 \wx0007 \wx0001 \wx0004 118 gfx/roads_blue.png 8bpp 0 120 64 31 -31 0 normal 119 gfx/roads_blue.png 8bpp 75 120 64 31 -31 0 normal @@ -211,23 +211,23 @@ 121 gfx/roads_blue.png 8bpp 225 120 64 31 -31 0 normal // Name: roadstop_underlay_blue - feature 12 -122 * 7 02 12 FF \b1 \b0 +122 * 8 02 12 \wx7FFF \b1 \b0 \w7 -123 * 25 03 12 01 06 \b6 -01 \wx00FB // road_overlays_blue; -02 \wx00FE // track_underlays; -06 \wx00FC // bridge_underlay; -08 \wx00FD // depot_normal_road; -0A \wx00FF // roadstop_underlay_blue; -0B \wx00FA // st_direction_markings; +123 * 34 03 12 \wx0001 \wx0006 \w6 +\wx0001 \wx7FFB // road_overlays_blue; +\wx0002 \wx7FFE // track_underlays; +\wx0006 \wx7FFC // bridge_underlay; +\wx0008 \wx7FFD // depot_normal_road; +\wx000A \wx7FFF // roadstop_underlay_blue; +\wx000B \wx7FFA // st_direction_markings; \wx0000 -124 * 40 00 12 \b10 01 FF \wx0007 +124 * 41 00 12 \b10 \wx0001 \wx0007 1B \wxDC0C 08 "2YEL" -0F \b1 "ROAD" +0F \w1 "ROAD" 09 \wxDC0D 0A \wxDC0E 0B \wxDC0F @@ -236,7 +236,7 @@ 10 00 1A 64 -125 * 12 01 12 00 FF \wx0008 FF \wx0001 FF \wx0013 +125 * 9 01 12 00 \wx0008 \wx0001 \wx0013 126 gfx/roads_yellow.png 8bpp 0 0 64 31 -31 0 normal 127 gfx/roads_yellow.png 8bpp 75 0 64 31 -31 0 normal @@ -259,11 +259,11 @@ 144 gfx/roads_yellow.png 8bpp 225 80 64 31 -31 0 normal // Name: road_overlays_yellow - feature 12 -145 * 7 02 12 FF \b1 \b0 +145 * 8 02 12 \wx7FFF \b1 \b0 \w8 -146 * 12 01 12 00 FF \wx0009 FF \wx0001 FF \wx0004 +146 * 9 01 12 00 \wx0009 \wx0001 \wx0004 147 gfx/roads_yellow.png 8bpp 0 120 64 31 -31 0 normal 148 gfx/roads_yellow.png 8bpp 75 120 64 31 -31 0 normal @@ -271,23 +271,23 @@ 150 gfx/roads_yellow.png 8bpp 225 120 64 31 -31 0 normal // Name: roadstop_underlay_yellow - feature 12 -151 * 7 02 12 FB \b1 \b0 +151 * 8 02 12 \wx7FFB \b1 \b0 \w9 -152 * 25 03 12 01 07 \b6 -01 \wx00FF // road_overlays_yellow; -02 \wx00FE // track_underlays; -06 \wx00FC // bridge_underlay; -08 \wx00FD // depot_normal_road; -0A \wx00FB // roadstop_underlay_yellow; -0B \wx00FA // st_direction_markings; +152 * 34 03 12 \wx0001 \wx0007 \w6 +\wx0001 \wx7FFF // road_overlays_yellow; +\wx0002 \wx7FFE // track_underlays; +\wx0006 \wx7FFC // bridge_underlay; +\wx0008 \wx7FFD // depot_normal_road; +\wx000A \wx7FFB // roadstop_underlay_yellow; +\wx000B \wx7FFA // st_direction_markings; \wx0000 -153 * 38 00 13 \b9 01 FF \wx0009 +153 * 39 00 13 \b9 \wx0001 \wx0009 1B \wxDC12 08 "GRTR" -0F \b1 "TRAM" +0F \w1 "TRAM" 09 \wxDC13 0A \wxDC14 0B \wxDC15 @@ -295,7 +295,7 @@ 0D \wxDC17 10 00 -154 * 6 01 13 \b2 FF \wx0013 +154 * 5 01 13 \b2 \wx0013 155 gfx/tram_green.png 8bpp 0 0 64 31 -31 0 normal 156 gfx/tram_green.png 8bpp 75 0 64 31 -31 0 normal @@ -338,16 +338,16 @@ 192 gfx/roads_underlay.png 8bpp 225 80 64 31 -31 0 normal // Name: tram_overlays_green - feature 13 -193 * 7 02 13 FA \b1 \b0 +193 * 8 02 13 \wx7FFA \b1 \b0 \w0 // Name: track_underlays - feature 13 -194 * 7 02 13 FB \b1 \b0 +194 * 8 02 13 \wx7FFB \b1 \b0 \w1 -195 * 12 01 13 00 FF \wx0002 FF \wx0001 FF \wx0006 +195 * 9 01 13 00 \wx0002 \wx0001 \wx0006 196 gfx/depot_normal.png 8bpp 200 10 16 8 17 11 normal 197 gfx/depot_normal.png 8bpp 118 8 64 47 -1 -31 normal @@ -357,11 +357,11 @@ 201 gfx/depot_normal.png 8bpp 118 63 64 47 -1 -31 normal // Name: depot_normal_road - feature 13 -202 * 7 02 13 FD \b1 \b0 +202 * 8 02 13 \wx7FFD \b1 \b0 \w2 -203 * 12 01 13 00 FF \wx0003 FF \wx0001 FF \wx000B +203 * 9 01 13 00 \wx0003 \wx0001 \wx000B 204 gfx/roads_red.png 8bpp 0 0 64 31 -31 0 normal 205 gfx/roads_red.png 8bpp 75 0 64 31 -31 0 normal @@ -376,14 +376,14 @@ 214 gfx/roads_red.png 8bpp 450 0 64 31 -31 0 normal // Name: bridge_underlay - feature 13 -215 * 7 02 13 FC \b1 \b0 +215 * 8 02 13 \wx7FFC \b1 \b0 \w3 -216 * 19 03 13 01 09 \b4 -01 \wx00FA // tram_overlays_green; -02 \wx00FB // track_underlays; -06 \wx00FC // bridge_underlay; -08 \wx00FD // depot_normal_road; +216 * 26 03 13 \wx0001 \wx0009 \w4 +\wx0001 \wx7FFA // tram_overlays_green; +\wx0002 \wx7FFB // track_underlays; +\wx0006 \wx7FFC // bridge_underlay; +\wx0008 \wx7FFD // depot_normal_road; \wx0000 diff --git a/regression/expected/example_station.grf b/regression/expected/example_station.grf index 3ab4b1a4..706bc753 100644 Binary files a/regression/expected/example_station.grf and b/regression/expected/example_station.grf differ diff --git a/regression/expected/example_station.nfo b/regression/expected/example_station.nfo index 87528d2c..69b56e3b 100644 --- a/regression/expected/example_station.nfo +++ b/regression/expected/example_station.nfo @@ -15,7 +15,7 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 193 08 08 "NML\06" "NML Example NewGRF: Station" 00 "\8ENML Example NewGRF: Station\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DConversion of CHIPS Cow pens." 00 +2 * 193 08 09 "NML\06" "NML Example NewGRF: Station" 00 "\8ENML Example NewGRF: Station\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DConversion of CHIPS Cow pens." 00 // param[126] = param[161] 3 * 5 0D 7E \D= A1 00 @@ -25,14 +25,14 @@ // param[127] = (param[127] << -31) 5 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 -6 * 9 09 7F 04 \7= \dx00000000 01 +6 * 10 09 7F 04 \7= \dx00000000 \wx0001 7 * 19 0B 03 7F 06 "1.2.0 (r22723)" 00 -8 * 12 00 08 \b1 01 FF \wx0000 -09 "LVST" +8 * 13 00 08 \b1 \wx0001 \wx0000 +\wx0009 "LVST" -9 * 6 01 04 \b3 FF \wx0002 +9 * 5 01 04 \b3 \wx0002 10 cows_cargo.png 8bpp 10 10 64 65 -31 -34 normal 11 cows_cargo.png 8bpp 220 10 64 65 -31 -34 normal @@ -44,42 +44,42 @@ 15 cows_cargo.png 8bpp 360 10 64 65 -31 -34 normal // Name: cow_pen_1 - feature 04 -16 * 11 02 04 FF \b2 \b1 +16 * 12 02 04 \wx7FFF \b2 \b1 \w0 \w1 \w2 // Name: cow_pen_2 - feature 04 -17 * 13 02 04 FE \b3 \b1 +17 * 14 02 04 \wx7FFE \b3 \b1 \w0 \w1 \w2 \w2 // Name: random_cow_pen -18 * 11 02 04 FE 80 00 \b16 02 -\wx00FF // (1/2) -> (1/2): cow_pen_1; -\wx00FE // (1/2) -> (1/2): cow_pen_2; +18 * 13 02 04 \wx7FFE 80 00 \b16 \wx0002 +\wx7FFF // (1/2) -> (1/2): cow_pen_1; +\wx7FFE // (1/2) -> (1/2): cow_pen_2; -19 * 21 00 04 \b5 01 FF \wx0000 +19 * 21 00 04 \b5 \wx0001 \wx0000 08 "NML_" 10 \wx00A0 11 00 14 03 15 03 -20 * 18 04 04 FF 01 \wxC400 "NML Example" 00 +20 * 19 04 04 FF \wx0001 \wxC400 "NML Example" 00 -21 * 21 04 04 FF 01 \wxC500 "CHIPS Cow pens" 00 +21 * 22 04 04 FF \wx0001 \wxC500 "CHIPS Cow pens" 00 // Name: cow_pen_half - feature 04 -22 * 7 02 04 FF \b0 \b1 +22 * 8 02 04 \wx7FFF \b0 \b1 \w1 // Name: cow_pen_empty - feature 04 -23 * 7 02 04 FD \b0 \b1 +23 * 8 02 04 \wx7FFD \b0 \b1 \w0 -24 * 51 00 04 \b1 01 FF \wx0000 +24 * 51 00 04 \b1 \wx0001 \wx0000 1A \b2 \b65 \dx00000000 \wx0002 82 \dx8000842D \wx0002 \b0 \b0 \b0 \b16 \b16 \b36 83 @@ -89,58 +89,58 @@ // Name: Station Layout@registers - Id 00 // a : register 80 // a : register 81 -25 * 106 02 04 FC 89 +25 * 114 02 04 \wx7FFC 89 1A 20 \dx00000000 \2sto 1A 20 \dx00000080 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000081 -\2r 7D 80 20 \dxFFFFFFFF // a +\2r 7D \dx00000080 20 \dxFFFFFFFF // a \2+ 1A 20 \dx000007E6 \2sto 1A 20 \dx00000082 \2r 1A 20 \dx00000000 \2sto 1A 20 \dx00000083 -\2r 7D 81 20 \dxFFFFFFFF // a +\2r 7D \dx00000081 20 \dxFFFFFFFF // a \2+ 1A 20 \dx000007E6 \2sto 1A 20 \dx00000084 \2r 1A 20 \dx00000001 \2sto 1A 00 \dx00000085 -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_0 -26 * 31 02 04 FD 89 -7E FC 20 \dxFFFFFFFF // Station Layout@registers - Id 00 +26 * 34 02 04 \wx7FFD 89 +7E \wx7FFC 20 \dxFFFFFFFF // Station Layout@registers - Id 00 \2r 10 00 \dx000000FF -\b1 -\wx00FD \dx00000000 \dx00000000 // cow_pen_empty; -\wx00FD // cow_pen_empty; +\w1 +\wx7FFD \dx00000000 \dx00000000 // cow_pen_empty; +\wx7FFD // cow_pen_empty; // Name: @action3_1 -27 * 31 02 04 FE 89 -7E FC 20 \dxFFFFFFFF // Station Layout@registers - Id 00 +27 * 34 02 04 \wx7FFE 89 +7E \wx7FFC 20 \dxFFFFFFFF // Station Layout@registers - Id 00 \2r 10 00 \dx000000FF -\b1 -\wx00FE \dx00000000 \dx00000000 // random_cow_pen; -\wx00FE // random_cow_pen; +\w1 +\wx7FFE \dx00000000 \dx00000000 // random_cow_pen; +\wx7FFE // random_cow_pen; // Name: @action3_2 -28 * 31 02 04 FF 89 -7E FC 20 \dxFFFFFFFF // Station Layout@registers - Id 00 +28 * 34 02 04 \wx7FFF 89 +7E \wx7FFC 20 \dxFFFFFFFF // Station Layout@registers - Id 00 \2r 10 00 \dx000000FF -\b1 -\wx00FF \dx00000000 \dx00000000 // cow_pen_half; -\wx00FF // cow_pen_half; +\w1 +\wx7FFF \dx00000000 \dx00000000 // cow_pen_half; +\wx7FFF // cow_pen_half; // Name: @action3_3 -29 * 33 02 04 FF 89 +29 * 35 02 04 \wx7FFF 89 0C 00 \dx0000FFFF -\b2 -\wx00FF \dx00000000 \dx00000000 // @action3_2; +\w2 +\wx7FFF \dx00000000 \dx00000000 // @action3_2; \wx8000 \dx00000024 \dx00000024 // return 0; -\wx00FD // @action3_0; +\wx7FFD // @action3_0; -30 * 13 03 04 01 00 \b2 -00 \wx00FE // @action3_1; -FF \wx00FF // @action3_3; -\wx00FD // @action3_0; +30 * 18 03 04 \wx0001 \wx0000 \w2 +\wx0000 \wx7FFE // @action3_1; +\wx00FF \wx7FFF // @action3_3; +\wx7FFD // @action3_0; diff --git a/regression/expected/example_train.grf b/regression/expected/example_train.grf index d94558e7..153234cd 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 5c36b02a..b42940f7 100644 --- a/regression/expected/example_train.nfo +++ b/regression/expected/example_train.nfo @@ -36,15 +36,15 @@ "B" "BLTR" \w1 "8" 00 00 -2 * 264 08 08 "NML\00" "NML Example NewGRF: Train" 00 "\8ENML Example NewGRF: Train\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89Purno, \98coding by \89DJNekkid.\0D\98This NewGRF defines a Dutch EMU, the ICM 'Koploper'." 00 -3 * 287 04 00 FF 05 \wxD000 " (3 parts)" 00 " (4 parts)" 00 "... train too long (max. 4 coupled EMUs)." 00 "... ICM may not be attached to other types of trains." 00 "Choose between 3- and 4-part EMU via refit\0DStated values are for the 3-part variant, the 4-part version has 33% more capacity and 50% more power and running cost." 00 +2 * 264 08 09 "NML\00" "NML Example NewGRF: Train" 00 "\8ENML Example NewGRF: Train\0D\98This NewGRF is intended to provide a coding example for the high-level NewGRF-coding language NML.\0DOriginal graphics by \89Purno, \98coding by \89DJNekkid.\0D\98This NewGRF defines a Dutch EMU, the ICM 'Koploper'." 00 +3 * 288 04 00 FF \wx0005 \wxD000 " (3 parts)" 00 " (4 parts)" 00 "... train too long (max. 4 coupled EMUs)." 00 "... ICM may not be attached to other types of trains." 00 "Choose between 3- and 4-part EMU via refit\0DStated values are for the 3-part variant, the 4-part version has 33% more capacity and 50% more power and running cost." 00 -4 * 342 04 00 9F 05 \wxD000 " (driedelig)" 00 " (vierdelig)" 00 "... trein te lang (max. 4 gekoppelde treinstellen)." 00 "... ICM kan niet aan andere treinsoorten worden gekoppeld." 00 "Kies door ombouwen tussen een 3- of vierdelig treinstel.\0D De waarden hierboven zijn voor de driedelige variant, de vierdelige versie heeft 33% meer capaciteit en 50% meer vermogen en bedrijfskosten." 00 +4 * 343 04 00 9F \wx0005 \wxD000 " (driedelig)" 00 " (vierdelig)" 00 "... trein te lang (max. 4 gekoppelde treinstellen)." 00 "... ICM kan niet aan andere treinsoorten worden gekoppeld." 00 "Kies door ombouwen tussen een 3- of vierdelig treinstel.\0D De waarden hierboven zijn voor de driedelige variant, de vierdelige versie heeft 33% meer capaciteit en 50% meer vermogen en bedrijfskosten." 00 -5 * 24 00 08 \b1 04 FF \wx0000 -12 "RAIL" "ELRL" "MONO" "MGLV" +5 * 25 00 08 \b1 \wx0004 \wx0000 +\wx0012 "RAIL" "ELRL" "MONO" "MGLV" -6 * 6 01 00 \b4 FF \wx0008 +6 * 5 01 00 \b4 \wx0008 7 icm.png 8bpp 1 1 8 24 -3 -12 normal 8 icm.png 8bpp 10 1 22 20 -14 -12 normal @@ -83,49 +83,49 @@ 38 icm.png 8bpp 66 97 22 20 -6 -12 normal // Name: set_icm_front_lighted - feature 00 -39 * 9 02 00 FF \b1 \b1 +39 * 10 02 00 \wx7FFF \b1 \b1 \w0 \w0 // Name: set_icm_front - feature 00 -40 * 9 02 00 FE \b1 \b1 +40 * 10 02 00 \wx7FFE \b1 \b1 \w1 \w1 // Name: sw_icm_graphics_front -41 * 23 02 00 FE 89 +41 * 25 02 00 \wx7FFE 89 40 00 \dx000000FF -\b1 -\wx00FF \dx00000000 \dx00000000 // 0 .. 0: set_icm_front_lighted; -\wx00FE // default: set_icm_front; +\w1 +\wx7FFF \dx00000000 \dx00000000 // 0 .. 0: set_icm_front_lighted; +\wx7FFE // default: set_icm_front; // Name: set_icm_rear_lighted - feature 00 -42 * 9 02 00 FF \b1 \b1 +42 * 10 02 00 \wx7FFF \b1 \b1 \w2 \w2 // Name: set_icm_rear - feature 00 -43 * 9 02 00 FD \b1 \b1 +43 * 10 02 00 \wx7FFD \b1 \b1 \w3 \w3 // Name: sw_icm_graphics_rear -44 * 23 02 00 FD 89 +44 * 25 02 00 \wx7FFD 89 40 08 \dx000000FF -\b1 -\wx00FF \dx00000000 \dx00000000 // 0 .. 0: set_icm_rear_lighted; -\wx00FD // default: set_icm_rear; +\w1 +\wx7FFF \dx00000000 \dx00000000 // 0 .. 0: set_icm_rear_lighted; +\wx7FFD // default: set_icm_rear; -45 * 12 01 00 00 FF \wx0004 FF \wx0001 FF \wx0001 +45 * 9 01 00 00 \wx0004 \wx0001 \wx0001 46 icm.png 8bpp 1 193 1 1 0 0 normal // Name: set_icm_invisible - feature 00 -47 * 9 02 00 FF \b1 \b1 +47 * 10 02 00 \wx7FFF \b1 \b1 \w4 \w4 -48 * 12 01 00 00 FF \wx0005 FF \wx0001 FF \wx0004 +48 * 9 01 00 00 \wx0005 \wx0001 \wx0004 49 icm.png 8bpp 1 129 8 24 -3 -12 normal 50 icm.png 8bpp 10 129 22 20 -14 -12 normal @@ -133,12 +133,12 @@ 52 icm.png 8bpp 66 129 22 20 -6 -12 normal // Name: set_icm_middle - feature 00 -53 * 9 02 00 FC \b1 \b1 +53 * 10 02 00 \wx7FFC \b1 \b1 \w5 \w5 // Name: sw_icm_graphics_middle -54 * 81 02 00 FC 89 +54 * 86 02 00 \wx7FFC 89 F2 20 \dx000000FF \2cmp 1A 20 \dx00000000 \2& 1A 20 \dx00000001 @@ -146,36 +146,36 @@ F2 20 \dx000000FF \2r 40 A0 \dx000000FF \dx00000000 \dx00000004 \2cmp 1A 20 \dx00000002 \2& 1A 20 \dx00000001 -\2& 7D 80 00 \dxFFFFFFFF -\b1 -\wx00FF \dx00000001 \dx00000001 // 1 .. 1: set_icm_invisible; -\wx00FC // default: set_icm_middle; +\2& 7D \dx00000080 00 \dxFFFFFFFF +\w1 +\wx7FFF \dx00000001 \dx00000001 // 1 .. 1: set_icm_invisible; +\wx7FFC // default: set_icm_middle; // Name: @CB_FAILED_REAL00 -55 * 9 02 00 FF \b1 \b1 +55 * 10 02 00 \wx7FFF \b1 \b1 \w0 \w0 // Name: @CB_FAILED00 -56 * 23 02 00 FF 89 +56 * 25 02 00 \wx7FFF 89 0C 00 \dx0000FFFF -\b1 +\w1 \wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 -\wx00FF // Non-graphics callback, return graphics result +\wx7FFF // Non-graphics callback, return graphics result // Name: sw_icm_graphics -57 * 51 02 00 FD 89 +57 * 53 02 00 \wx7FFD 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; +\w3 +\wx7FFE \dx00000000 \dx00000000 // 0 .. 0: sw_icm_graphics_front; +\wx7FFC \dx00000001 \dx00000002 // 1 .. 2: sw_icm_graphics_middle; +\wx7FFD \dx00000003 \dx00000003 // 3 .. 3: sw_icm_graphics_rear; +\wx7FFF // default: @CB_FAILED00; // Name: sw_icm_cargo_subtype_text -58 * 33 02 00 FC 89 +58 * 35 02 00 \wx7FFC 89 F2 00 \dx000000FF -\b2 +\w2 \wx8000 \dx00000000 \dx00000000 // 0 .. 0: return string(STR_ICM_SUBTYPE_3_PART); \wx8001 \dx00000001 \dx00000001 // 1 .. 1: return string(STR_ICM_SUBTYPE_4_PART); \wx8400 // default: return 1024; @@ -183,17 +183,17 @@ F2 00 \dx000000FF // param[127] = param[17] 59 * 9 0D 7F \D= 11 FE \dx0000FFFF -60 * 7 06 -7F 04 FF \wx001B +60 * 6 06 +7F 04 \wx001C FF // Name: @return_action_0 -61 * 34 02 00 FE 89 +61 * 36 02 00 \wx7FFE 89 43 38 \dx0000000F \2* 1A 20 \dx00000010 \2+ 1A 20 \dx00000003 \2+ 1A 00 \dx00000000 // param[127] -\b0 +\w0 \wx8000 // Return computed value // param[124] = param[17] @@ -214,75 +214,75 @@ FF // param[125] = (param[124] | 32768) 67 * 9 0D 7D \D| 7C FF \dx00008000 -68 * 17 06 -00 04 FF \wx0006 -7E 02 FF \wx0015 -7D 02 FF \wx001F +68 * 14 06 +00 04 \wx0007 +7E 02 \wx0017 +7D 02 \wx0021 FF // Name: sw_icm_colour_mapping -69 * 43 02 00 FE 89 +69 * 45 02 00 \wx7FFE 89 1A 00 \dx00000000 // param[0] -\b3 -\wx00FE \dx00000000 \dx00000000 // 0 .. 0: return (((var[0x43, 24, 15] * 16) + 3) + base_sprite_2cc) +\w3 +\wx7FFE \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_FAILED00; // Name: sw_icm_start_stop -70 * 31 02 00 FB 89 +70 * 33 02 00 \wx7FFB 89 40 50 \dx000000FF \dx00000001 \dx00000001 -\b1 +\w1 \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 +71 * 25 02 00 \wx7FFA 89 10 00 \dxFFFFFFFF -\b1 +\w1 \wx8074 \dx00000001 \dx00000003 // 1 .. 3: return 116; \wxFFFF // default: return 32767; // Name: sw_icm_can_attach_wagon -72 * 23 02 00 F9 89 +72 * 25 02 00 \wx7FF9 89 C6 00 \dx0000FFFF -\b1 +\w1 \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 +73 * 43 02 00 \wx7FF8 89 40 80 \dx000000FF \dx00000000 \dx00000004 -\b2 +\w2 \wx8001 \dx00000001 \dx00000001 // 1 .. 1: return 1; \wx8007 \dx00000002 \dx00000002 // 2 .. 2: return 7; \wx8008 // default: return 8; // Name: sw_icm_length -74 * 23 02 00 F8 89 +74 * 25 02 00 \wx7FF8 89 F2 00 \dx000000FF -\b1 -\wx00F8 \dx00000000 \dx00000000 // 0 .. 0: sw_icm_length_3_part_vehicle; +\w1 +\wx7FF8 \dx00000000 \dx00000000 // 0 .. 0: sw_icm_length_3_part_vehicle; \wx8008 // default: return 8; // Name: sw_icm_power -75 * 23 02 00 F7 89 +75 * 25 02 00 \wx7FF7 89 F2 00 \dx000000FF -\b1 +\w1 \wx8699 \dx00000000 \dx00000000 // 0 .. 0: return 1689; \wx89E6 // default: return 2534; // Name: sw_icm_weight -76 * 23 02 00 F6 89 +76 * 25 02 00 \wx7FF6 89 F2 00 \dx000000FF -\b1 +\w1 \wx8090 \dx00000000 \dx00000000 // 0 .. 0: return 144; \wx80C0 // default: return 192; // Name: sw_icm_te -77 * 23 02 00 F5 89 +77 * 25 02 00 \wx7FF5 89 F2 00 \dx000000FF -\b1 +\w1 \wx8019 \dx00000000 \dx00000000 // 0 .. 0: return 25; \wx801C // default: return 28; @@ -292,10 +292,10 @@ F2 00 \dx000000FF // param[158] = (param[158] | 8) 79 * 9 0D 9E \D| 9E FF \dx00000008 -80 * 9 00 08 \b1 01 FF \wx002C +80 * 9 00 08 \b1 \wx0001 \wx002C 08 0A -81 * 104 00 00 \b37 01 FF \wx0074 +81 * 107 00 00 \b37 \wx0001 \wx0074 06 07 2A \dx000B0D34 04 FF @@ -305,9 +305,9 @@ F2 00 \dx000000FF 1D \dx00000000 29 \wx0000 1D \dx00000000 -2C \b0 +2C \w0 1D \dx00000000 -2D \b0 +2D \w0 1D \dx00000000 07 06 17 2D @@ -316,7 +316,7 @@ F2 00 \dx000000FF 09 \wx008D 27 06 1C 00 -05 01 +05 \wx0001 08 01 0B \wx069A 0E \dx00004C3C @@ -334,123 +334,123 @@ F2 00 \dx000000FF 23 00 25 00 -82 * 33 04 00 7F 01 FF \wx0074 "ICM 'Koploper' (Electric)" 00 +82 * 33 04 00 7F \wx0001 \wx0074 "ICM 'Koploper' (Electric)" 00 -83 * 35 04 00 1F 01 FF \wx0074 "ICM 'Koploper' (Electrisch)" 00 +83 * 35 04 00 1F \wx0001 \wx0074 "ICM 'Koploper' (Electrisch)" 00 -84 * 12 01 00 00 FF \wx0006 FF \wx0001 FF \wx0001 +84 * 9 01 00 00 \wx0006 \wx0001 \wx0001 85 icm.png 8bpp 1 161 53 14 -25 -10 normal // Name: set_icm_purchase - feature 00 -86 * 9 02 00 F4 \b1 \b1 +86 * 10 02 00 \wx7FF4 \b1 \b1 \w6 \w6 -87 * 9 00 00 \b1 01 FF \wx0074 +87 * 9 00 00 \b1 \wx0001 \wx0074 1E 79 // Name: @return_action_0 -88 * 41 02 00 F3 89 +88 * 43 02 00 \wx7FF3 89 F2 20 \dx000000FF \2cmp 1A 20 \dx00000001 \2& 1A 20 \dx00000001 \2* 1A 20 \dx00000032 // expr1 - expr2 \2+ 1A 00 \dx00000064 -\b0 +\w0 \wx8000 // Return computed value // Name: @return_action_1 -89 * 35 02 00 F2 89 +89 * 37 02 00 \wx7FF2 89 F2 60 \dx000000FF \dx00000003 \dx00000001 \2* 1A 20 \dx00000024 \2/ 1A 00 \dx00000004 -\b0 +\w0 \wx8000 // Return computed value // Name: @return_action_2 -90 * 20 02 00 F1 89 +90 * 22 02 00 \wx7FF1 89 1A 20 \dx00000008 \2- 1C 00 \dxFFFFFFFF -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_1 -91 * 24 02 00 F1 89 -7E F8 00 \dxFFFFFFFF // sw_icm_length -\b1 -\wx00FF \dx0000FFFF \dx0000FFFF // @CB_FAILED00; -\wx00F1 // return (8 - var[0x1C, 0, -1]) +91 * 27 02 00 \wx7FF1 89 +7E \wx7FF8 00 \dxFFFFFFFF // sw_icm_length +\w1 +\wx7FFF \dx0000FFFF \dx0000FFFF // @CB_FAILED00; +\wx7FF1 // return (8 - var[0x1C, 0, -1]) // Name: @action3_0 -92 * 73 02 00 F1 89 +92 * 75 02 00 \wx7FF1 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; -\wx00FD // sw_icm_graphics; +\w6 +\wx7FF7 \dx0000000B \dx0000000B // sw_icm_power; +\wx7FF3 \dx0000000D \dx0000000D // return ((var[0xF2, 0, 255] == 1) ? 150 : 100) +\wx7FF2 \dx00000014 \dx00000014 // return (((var[0xF2, 0, 255] + 3) * 36) / 4) +\wx7FF6 \dx00000016 \dx00000016 // sw_icm_weight; +\wx7FF5 \dx0000001F \dx0000001F // sw_icm_te; +\wx7FF1 \dx00000021 \dx00000021 // @action3_1; +\wx7FFD // sw_icm_graphics; // Name: @action3_2 -93 * 63 02 00 F5 89 +93 * 65 02 00 \wx7FF5 89 10 00 \dx000000FF -\b5 +\w5 \wx8699 \dx0000000B \dx0000000B // return 1689; \wx8064 \dx0000000D \dx0000000D // return 100; \wx801B \dx00000014 \dx00000014 // return 27; \wx8090 \dx00000016 \dx00000016 // return 144; \wx8019 \dx0000001F \dx0000001F // return 25; -\wx00FD // sw_icm_graphics; +\wx7FFD // sw_icm_graphics; // Name: @return_action_3 -94 * 49 02 00 F6 89 +94 * 51 02 00 \wx7FF6 89 40 A0 \dx000000FF \dx00000000 \dx00000004 \2cmp 1A 20 \dx00000000 \2& 1A 20 \dx00000001 \2* 1A 20 \dxFFFFFFF2 // expr1 - expr2 \2+ 1A 00 \dx000000C8 -\b0 +\w0 \wx8000 // Return computed value // Name: @return_action_4 -95 * 35 02 00 F2 89 +95 * 37 02 00 \wx7FF2 89 F2 60 \dx000000FF \dx00000003 \dx00000001 \2* 1A 20 \dx00000024 \2/ 1A 00 \dx00000004 -\b0 +\w0 \wx8000 // Return computed value // Name: @action3_3 -96 * 93 02 00 F1 89 +96 * 95 02 00 \wx7FF1 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; -\wx00FC \dx00000019 \dx00000019 // sw_icm_cargo_subtype_text; -\wx00F9 \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; -\wx00FD // sw_icm_graphics; +\w8 +\wx7FF6 \dx00000010 \dx00000010 // return ((((var[0x40, 0, 255] + 0) % 4) == 0) ? 186 : 200) +\wx7FF2 \dx00000015 \dx00000015 // return (((var[0xF2, 0, 255] + 3) * 36) / 4) +\wx7FFA \dx00000016 \dx00000016 // sw_icm_articulated_part; +\wx7FFC \dx00000019 \dx00000019 // sw_icm_cargo_subtype_text; +\wx7FF9 \dx0000001D \dx0000001D // sw_icm_can_attach_wagon; +\wx7FFE \dx0000002D \dx0000002D // sw_icm_colour_mapping; +\wx7FFB \dx00000031 \dx00000031 // sw_icm_start_stop; +\wx7FF1 \dx00000036 \dx00000036 // @action3_0; +\wx7FFD // sw_icm_graphics; // Name: @action3_4 -97 * 63 02 00 FD 89 +97 * 65 02 00 \wx7FFD 89 0C 00 \dx0000FFFF -\b5 -\wx00F4 \dx00000000 \dx00000000 // set_icm_purchase; -\wx00FA \dx00000016 \dx00000016 // sw_icm_articulated_part; +\w5 +\wx7FF4 \dx00000000 \dx00000000 // set_icm_purchase; +\wx7FFA \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; -\wx00FD // sw_icm_graphics; +\wx7FFE \dx0000002D \dx0000002D // sw_icm_colour_mapping; +\wx7FF5 \dx00000036 \dx00000036 // @action3_2; +\wx7FFD // sw_icm_graphics; -98 * 12 03 00 01 FF \wx0074 \b1 -FF \wx00FD // @action3_4; -\wx00F1 // @action3_3; +98 * 14 03 00 \wx0001 \wx0074 \w1 +\wx00FF \wx7FFD // @action3_4; +\wx7FF1 // @action3_3; // param[126] = param[161] 99 * 5 0D 7E \D= A1 00 @@ -461,12 +461,12 @@ FF \wx00FD // @action3_4; // param[127] = (param[127] << -31) 101 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 -102 * 9 07 7F 04 \7= \dx00000000 01 +102 * 10 07 7F 04 \7= \dx00000000 \wx0001 -103 * 10 00 00 \b1 01 FF \wx0074 +103 * 10 00 00 \b1 \wx0001 \wx0074 2B \wx00B9 -104 * 12 01 00 00 FF \wx0007 FF \wx0002 FF \wx0004 +104 * 9 01 00 00 \wx0007 \wx0002 \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 @@ -479,39 +479,39 @@ FF \wx00FD // @action3_4; 112 cargo_wagons.png 8bpp 66 33 22 20 -6 -12 normal // Name: set_cargo_wagon - feature 00 -113 * 9 02 00 F1 \b1 \b1 +113 * 10 02 00 \wx7FF1 \b1 \b1 \w7 \w7 // Name: cargo_wagon_switch_vehicle -114 * 30 02 00 F1 89 +114 * 32 02 00 \wx7FF1 89 1A 20 \dx80000000 \2sto 1A 00 \dx00000100 -\b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00F1 // default: set_cargo_wagon; +\w1 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FF1 // default: set_cargo_wagon; // Name: set_cargo_wagon_load - feature 00 -115 * 9 02 00 FD \b1 \b1 +115 * 10 02 00 \wx7FFD \b1 \b1 \w8 \w8 // Name: cargo_wagon_switch_load -116 * 30 02 00 FD 89 +116 * 32 02 00 \wx7FFD 89 1A 20 \dx00000000 \2sto 1A 00 \dx00000100 -\b1 -\wx00FF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 -\wx00FD // default: set_cargo_wagon_load; +\w1 +\wx7FFF \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx7FFD // default: set_cargo_wagon_load; // Name: cargo_wagon_switch_graphics -117 * 23 02 00 FD 89 +117 * 25 02 00 \wx7FFD 89 10 08 \dx000000FF -\b1 -\wx00F1 \dx00000000 \dx00000000 // 0 .. 0: cargo_wagon_switch_vehicle; -\wx00FD // default: cargo_wagon_switch_load; +\w1 +\wx7FF1 \dx00000000 \dx00000000 // 0 .. 0: cargo_wagon_switch_vehicle; +\wx7FFD // default: cargo_wagon_switch_load; -118 * 37 00 00 \b11 01 FF \wx0075 +118 * 37 00 00 \b11 \wx0001 \wx0075 06 0F 2A \dx000A96C9 04 FF @@ -524,9 +524,9 @@ FF \wx00FD // @action3_4; 24 00 0B \wx0000 -119 * 19 04 00 7F 01 FF \wx0075 "Cargo Wagon" 00 +119 * 19 04 00 7F \wx0001 \wx0075 "Cargo Wagon" 00 -120 * 12 03 00 01 FF \wx0075 \b1 -FF \wx00FD // cargo_wagon_switch_graphics; -\wx00FD // cargo_wagon_switch_graphics; +120 * 14 03 00 \wx0001 \wx0075 \w1 +\wx00FF \wx7FFD // cargo_wagon_switch_graphics; +\wx7FFD // cargo_wagon_switch_graphics;