diff --git a/regression/Makefile b/regression/Makefile index a1c67e27..c1b335cf 100644 --- a/regression/Makefile +++ b/regression/Makefile @@ -6,13 +6,14 @@ _E ?= @echo _SE ?= echo TEST_FILES = $(basename $(shell ls *.nml)) -NMLC ?= ../nmlc +EXAMPLES = $(shell ls ../examples) +NMLC ?= $(abspath ../nmlc) # Note: Manually overriding NML_FLAGS may break the regression test NML_FLAGS ?= -s -c --verbosity=1 -.PHONY: $(TEST_FILES) clean +.PHONY: $(TEST_FILES) $(EXAMPLES) clean -all: $(TEST_FILES) +all: $(TEST_FILES) $(EXAMPLES) $(TEST_FILES): $(_V) echo "Running test $@" @@ -20,11 +21,33 @@ $(TEST_FILES): # First pass : check compilation of source nml and generation of optimised nml $(_V) $(NMLC) $(NML_FLAGS) --nfo output/$@.nfo --grf output/$@.grf $@.nml --nml nml_output/$@.nml $(_V) diff -u --strip-trailing-cr expected/$@.nfo output/$@.nfo - $(_V) diff -u expected/$@.grf output/$@.grf + $(_V) diff expected/$@.grf output/$@.grf # Second pass : check compilation of optimised nml $(_V) $(NMLC) $(NML_FLAGS) -n --nfo output2/$@.nfo --grf output2/$@.grf nml_output/$@.nml $(_V) diff -u --strip-trailing-cr expected/$@.nfo output2/$@.nfo - $(_V) diff -u expected/$@.grf output2/$@.grf + $(_V) diff expected/$@.grf output2/$@.grf + +$(EXAMPLES): + $(_V) echo "Testing example $@" + $(_V) mkdir -p output nml_output output2 +# First pass as above +# We must change directory, because nmlc provides no way to set a base directory for realsprite files. + $(_V) cd ../examples/$@/ && \ + $(NMLC) $(NML_FLAGS) -n \ + --nfo ../../regression/output/example_$@.nfo \ + --nml ../../regression/nml_output/example_$@.nml \ + --grf ../../regression/output/example_$@.grf \ + example_$@.nml && cd ../../regression + $(_V) diff -u --strip-trailing-cr expected/example_$@.nfo output/example_$@.nfo + $(_V) diff expected/example_$@.grf output/example_$@.grf +# Second pass + $(_V) cd ../examples/$@/ && \ + $(NMLC) $(NML_FLAGS) -n \ + --nfo ../../regression/output2/example_$@.nfo \ + --grf ../../regression/output2/example_$@.grf \ + ../../regression/nml_output/example_$@.nml && cd ../../regression + $(_V) diff -u --strip-trailing-cr expected/example_$@.nfo output2/example_$@.nfo + $(_V) diff expected/example_$@.grf output2/example_$@.grf clean: $(_V) rm -rf output nml_output output2 diff --git a/regression/expected/example_industry.grf b/regression/expected/example_industry.grf new file mode 100644 index 00000000..431df826 Binary files /dev/null and b/regression/expected/example_industry.grf differ diff --git a/regression/expected/example_industry.nfo b/regression/expected/example_industry.nfo new file mode 100644 index 00000000..fd174a61 --- /dev/null +++ b/regression/expected/example_industry.nfo @@ -0,0 +1,128 @@ +// Automatically generated by GRFCODEC. Do not modify! +// (Info version 32) +// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>> +// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C +// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% +// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags + +0 * 4 \d19 + +1 * 54 14 "C" "INFO" +"B" "VRSN" \w4 \dx00000000 +"B" "MINV" \w4 \dx00000000 +"B" "NPAR" \w1 00 +"B" "PALS" \w1 "A" +"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 * 36 04 00 FF 01 \wxD000 "\0DMail produced this month: \90\7C" 00 + +4 * 52 00 08 \b1 0B FF \wx0000 +09 "PASS" "COAL" "MAIL" "OIL_" "LVST" +"GOOD" "GRAI" "WOOD" "IORE" "STEL" +"VALU" + +// Name: test_produce1 +5 * 13 02 0A FF 02 \b2 01 80 08 81 \b1 09 82 83 + +// Name: test_produce1@registers +6 * 86 02 0A FF 89 +1A 20 \dx00000005 +\2sto 1A 20 \dx00000000 +\2sto 1A 20 \dx00000080 +\2r 1A 20 \dx00000007 +\2sto 1A 20 \dx00000001 +\2sto 1A 20 \dx00000081 +\2r 1A 20 \dx00000005 +\2sto 1A 20 \dx00000082 +\2r 1A 20 \dx00000001 +\2sto 1A 00 \dx00000083 +\b1 +\wx00FF \dx00000000 \dx00000000 +\wx00FF // + +// Name: extra_text_switch +7 * 31 02 0A FE 89 +6A 02 20 \dxFFFFFFFF +\2sto 1A 00 \dx00000100 +\b1 +\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx8000 // default: return string(STR_INDUSTRY_EXTRA_TEXT); + +8 * 64 00 0A \b6 01 FF \wx0000 +08 06 +09 06 +25 \b4 +02 05 09 0A +26 \b4 +01 03 08 06 +27 \b4 +00 00 00 00 +28 \b4 \b4 +\wx0100 \wx0100 \wx0100 \wx0100 +\wx0000 \wx0000 \wx0000 \wx0000 +\wx0000 \wx0000 \wx0400 \wx0000 +\wx0080 \wx0000 \wx0000 \wx0080 + +9 * 11 00 0A \b2 01 FF \wx0000 +21 02 +22 01 + +// Name: @CB_FAILED_PROD +10 * 15 02 0A FD 00 \wx0000 \wx0000 \wx0000 \wx0000 \wx0000 00 + +// Name: @CB_FAILED0A +11 * 23 02 0A FD 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FD // Non-graphics callback, return graphics result + +// Name: @action3_0 +12 * 23 02 0A FF 89 +18 00 \dx000000FF +\b1 +\wx00FF \dx00000000 \dx00000000 // test_produce1; +\wx00FD // @CB_FAILED0A; + +// Name: @action3_1 +13 * 33 02 0A FD 89 +0C 00 \dx0000FFFF +\b2 +\wx00FF \dx00000000 \dx00000000 // @action3_0; +\wx00FE \dx0000003A \dx0000003A // extra_text_switch; +\wx00FD // @CB_FAILED0A; + +14 * 7 03 0A 01 00 \b0 +\wx00FD // @action3_1; + +15 * 13 00 09 \b3 01 FF \wx0000 +08 27 +09 27 +12 02 + +16 * 13 00 09 \b3 01 FF \wx0001 +08 28 +09 28 +12 02 + +17 * 13 00 09 \b3 01 FF \wx0002 +08 29 +09 29 +12 02 + +18 * 13 00 09 \b3 01 FF \wx0003 +08 2A +09 2A +12 02 + +19 * 26 00 0A \b6 01 FF \wx0001 +08 09 +09 09 +25 \b3 +04 06 07 +26 \b0 +27 \b3 +08 0C 04 +28 \b0 \b0 diff --git a/regression/expected/example_object.grf b/regression/expected/example_object.grf new file mode 100644 index 00000000..75993f62 Binary files /dev/null and b/regression/expected/example_object.grf differ diff --git a/regression/expected/example_object.nfo b/regression/expected/example_object.nfo new file mode 100644 index 00000000..b8177ddd --- /dev/null +++ b/regression/expected/example_object.nfo @@ -0,0 +1,188 @@ +// Automatically generated by GRFCODEC. Do not modify! +// (Info version 32) +// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>> +// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C +// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% +// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags + +0 * 4 \d37 + +1 * 54 14 "C" "INFO" +"B" "VRSN" \w4 \dx00000000 +"B" "MINV" \w4 \dx00000000 +"B" "NPAR" \w1 00 +"B" "PALS" \w1 "D" +"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 + +4 * 19 04 00 FF 01 \wxD002 "Company land" 00 + +// param[126] = param[161] +5 * 5 0D 7E \D= A1 00 + +// param[127] = (param[126] - 302012611) +6 * 9 0D 7F \D- 7E FF \dx120058C3 + +// param[127] = (param[127] << -31) +7 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 + +8 * 9 09 7F 04 \7= \dx00000000 01 + +9 * 19 0B 03 7F 06 "1.2.0 (r22723)" 00 + +10 * 6 01 0F \b1 FF \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 +13 cc_grid.png 8bpp 161 1 64 23 -31 0 normal +14 cc_grid.png 8bpp 241 1 64 23 -31 0 normal +15 cc_grid.png 8bpp 321 1 64 31 -31 0 normal +16 cc_grid.png 8bpp 399 1 64 31 -31 0 normal +17 cc_grid.png 8bpp 479 1 64 23 -31 0 normal +18 cc_grid.png 8bpp 559 1 64 23 -31 0 normal +19 cc_grid.png 8bpp 639 1 64 39 -31 -8 normal +20 cc_grid.png 8bpp 719 1 64 39 -31 -8 normal +21 cc_grid.png 8bpp 799 1 64 31 -31 -8 normal +22 cc_grid.png 8bpp 879 1 64 31 -31 -8 normal +23 cc_grid.png 8bpp 959 1 64 39 -31 -8 normal +24 cc_grid.png 8bpp 1039 1 64 39 -31 -8 normal +25 cc_grid.png 8bpp 1119 1 64 31 -31 -8 normal +26 cc_grid.png 8bpp 1197 1 64 47 -31 -16 normal +27 cc_grid.png 8bpp 1277 1 64 15 -31 0 normal +28 cc_grid.png 8bpp 1357 1 64 31 -31 -8 normal +29 cc_grid.png 8bpp 1437 1 64 31 -31 -8 normal + +// Name: company_land_layout - feature 0F +30 * 31 02 0F FF \b66 \dx00000000 \wx0002 81 +\dxC0008000 \wx0002 \b0 \b0 80 00 +\dx00000000 \wx0002 \b0 \b0 80 83 + +// Name: company_land_layout@registers - feature 0F +31 * 92 02 0F FF 89 +7D 01 20 \dxFFFFFFFF +\2sto 1A 20 \dx00000080 +\2r 7D 00 20 \dxFFFFFFFF +\2+ 7D 80 20 \dxFFFFFFFF +\2sto 1A 20 \dx00000081 +\2r 7D 01 20 \dxFFFFFFFF +\2sto 1A 20 \dx00000082 +\2r 7D 00 20 \dxFFFFFFFF +\2+ 7D 82 20 \dxFFFFFFFF +\2sto 1A 00 \dx00000083 +\b1 +\wx00FF \dx00000000 \dx00000000 +\wx00FF // + +// Name: company_land_terrain_switch +32 * 470 02 0F FE 89 +41 28 \dx0000001F +\2cmp 1A 20 \dx0000001E +\2& 1A 20 \dx00000001 +\2* 1A 20 \dx00000012 +\2sto 1A 20 \dx00000080 +\2r 41 28 \dx0000001F +\2cmp 1A 20 \dx0000001D +\2& 1A 20 \dx00000001 +\2* 1A 20 \dx0000000F +\2sto 1A 20 \dx00000081 +\2r 41 28 \dx0000001F +\2cmp 1A 20 \dx0000001B +\2& 1A 20 \dx00000001 +\2* 1A 20 \dx00000011 +\2sto 1A 20 \dx00000082 +\2r 41 28 \dx0000001F +\2cmp 1A 20 \dx00000017 +\2& 1A 20 \dx00000001 +\2* 1A 20 \dx00000010 +\2sto 1A 20 \dx00000083 +\2r 41 28 \dx0000001F +\2cmp 1A 20 \dx00000000 +\2< 1A 20 \dx00000001 +\2sto 1A 20 \dx00000084 +\2r 41 28 \dx0000001F +\2cmp 1A 20 \dx0000000E +\2^ 1A 20 \dx00000002 +\2< 1A 20 \dx00000001 +\2& 7D 84 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 +\2sto 1A 20 \dx00000000 +\2r 1A 20 \dx00000F8D +\2sto 1A 20 \dx00000001 +\2r 41 20 \dx00000007 +\2cmp 1A 20 \dx00000001 +\2& 1A 20 \dx00000001 +\2sto 1A 20 \dx00000085 // guard +\2^ 1A 20 \dx00000001 +\2sto 1A 20 \dx00000086 // !guard +\2r 7D 01 20 \dxFFFFFFFF +\2* 7D 86 20 \dxFFFFFFFF +\2sto 1A 20 \dx00000087 +\2r 7D 85 20 \dxFFFFFFFF +\2* 1A 20 \dx000011C6 +\2+ 7D 87 20 \dxFFFFFFFF +\2sto 1A 20 \dx00000001 +\2r 41 20 \dx00000007 +\2cmp 1A 20 \dx00000004 +\2& 1A 20 \dx00000001 +\2sto 1A 20 \dx00000088 // guard +\2^ 1A 20 \dx00000001 +\2sto 1A 20 \dx00000089 // !guard +\2r 7D 01 20 \dxFFFFFFFF +\2* 7D 89 20 \dxFFFFFFFF +\2sto 1A 20 \dx0000008A +\2r 7D 88 20 \dxFFFFFFFF +\2* 1A 20 \dx000011C6 +\2+ 7D 8A 20 \dxFFFFFFFF +\2sto 1A 00 \dx00000001 +\b1 +\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FF // default: company_land_layout; + +// Name: company_land_purchase_switch +33 * 51 02 0F FF 89 +1A 20 \dx00000000 +\2sto 1A 20 \dx00000000 +\2r 1A 20 \dx00000F8D +\2sto 1A 20 \dx00000001 +\2r 1A 00 \dx00000001 +\b1 +\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FF // default: company_land_layout; + +34 * 43 00 0F \b12 01 FF \wx0000 +08 "INFR" +09 \wxD000 +0A \wxD001 +0B 0F +0C 11 +0D 01 +14 01 +0E \dx0000016E +0F \dx0037BB49 +10 \wx0834 +16 00 +17 01 + +35 * 10 00 0F \b1 01 FF \wx0000 +15 \wx0011 + +// Name: @action3_0 +36 * 43 02 0F FF 89 +0C 00 \dx0000FFFF +\b3 +\wx00FF \dx00000000 \dx00000000 // company_land_purchase_switch; +\wx8400 \dx00000157 \dx00000157 // return 1024; +\wx8002 \dx0000015C \dx0000015C // return string(STR_NAME_COMPANY_LAND); +\wx00FE // company_land_terrain_switch; + +37 * 10 03 0F 01 00 \b1 +FF \wx00FF // @action3_0; +\wx00FE // company_land_terrain_switch; + diff --git a/regression/expected/example_railtype.grf b/regression/expected/example_railtype.grf new file mode 100644 index 00000000..7b3f41b8 Binary files /dev/null and b/regression/expected/example_railtype.grf differ diff --git a/regression/expected/example_railtype.nfo b/regression/expected/example_railtype.nfo new file mode 100644 index 00000000..2b315d8a --- /dev/null +++ b/regression/expected/example_railtype.nfo @@ -0,0 +1,319 @@ +// Automatically generated by GRFCODEC. Do not modify! +// (Info version 32) +// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>> +// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C +// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% +// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags + +0 * 4 \d171 + +1 * 54 14 "C" "INFO" +"B" "VRSN" \w4 \dx00000000 +"B" "MINV" \w4 \dx00000000 +"B" "NPAR" \w1 00 +"B" "PALS" \w1 "W" +"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 +// 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 + +// param[126] = 1 +6 * 9 0D 7E \D= FF 00 \dx00000001 + +7 * 9 09 7E 04 \7= \dx00000000 01 + +// param[127] = 1 +8 * 9 0D 7F \D= FF 00 \dx00000001 + +9 * 9 09 7F 04 \7! \dx00000000 01 + +10 * 13 0B 03 7F 05 "NuTracks" 00 + +11 * 6 01 10 \b5 FF \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 +14 gfx/lc_right.png 8bpp 0 100 5 12 -3 -8 normal +15 gfx/lc_right.png 8bpp 50 100 19 19 -4 -6 normal +16 gfx/lc_right.png 8bpp 100 100 23 17 -24 -9 normal +17 gfx/lc_right.png 8bpp 150 100 5 12 -5 -8 normal +18 gfx/lc_right.png 8bpp 200 100 25 14 3 -9 normal +19 gfx/lc_right.png 8bpp 250 100 5 12 -1 -8 normal +20 gfx/lc_right.png 8bpp 300 100 5 12 -3 -10 normal +21 gfx/lc_right.png 8bpp 350 100 19 14 -15 -11 normal + +22 gfx/lc_right.png 8bpp 5 5 44 23 -21 4 normal +23 gfx/lc_right.png 8bpp 55 5 44 23 -21 4 normal +24 gfx/lc_right.png 8bpp 0 50 5 12 -3 -8 normal +25 gfx/lc_right.png 8bpp 50 50 8 21 -5 -14 normal +26 gfx/lc_right.png 8bpp 100 50 6 23 -7 -20 normal +27 gfx/lc_right.png 8bpp 150 50 5 12 -5 -8 normal +28 gfx/lc_right.png 8bpp 200 50 7 21 3 -15 normal +29 gfx/lc_right.png 8bpp 250 50 5 12 -1 -8 normal +30 gfx/lc_right.png 8bpp 300 50 5 12 -3 -10 normal +31 gfx/lc_right.png 8bpp 350 50 8 22 -3 -19 normal + +32 gfx/lc_left.png 8bpp 5 5 44 23 -21 4 normal +33 gfx/lc_left.png 8bpp 55 5 44 23 -21 4 normal +34 gfx/lc_left.png 8bpp 0 100 21 19 -14 -6 normal +35 gfx/lc_left.png 8bpp 50 100 5 12 -2 -6 normal +36 gfx/lc_left.png 8bpp 100 100 5 12 -3 -9 normal +37 gfx/lc_left.png 8bpp 150 100 23 15 -23 -9 normal +38 gfx/lc_left.png 8bpp 200 100 5 12 4 -7 normal +39 gfx/lc_left.png 8bpp 250 100 23 17 0 -7 normal +40 gfx/lc_left.png 8bpp 300 100 21 13 -2 -11 normal +41 gfx/lc_left.png 8bpp 350 100 5 12 -3 -9 normal + +42 gfx/lc_left.png 8bpp 5 5 44 23 -21 4 normal +43 gfx/lc_left.png 8bpp 55 5 44 23 -21 4 normal +44 gfx/lc_left.png 8bpp 0 50 7 21 0 -14 normal +45 gfx/lc_left.png 8bpp 50 50 5 12 -2 -6 normal +46 gfx/lc_left.png 8bpp 100 50 5 12 -3 -9 normal +47 gfx/lc_left.png 8bpp 150 50 7 21 -7 -15 normal +48 gfx/lc_left.png 8bpp 200 50 5 12 4 -7 normal +49 gfx/lc_left.png 8bpp 250 50 7 22 0 -17 normal +50 gfx/lc_left.png 8bpp 300 50 6 21 -2 -19 normal +51 gfx/lc_left.png 8bpp 350 50 5 12 -3 -9 normal + +52 gfx/rails_overlays.png 8bpp 0 155 40 21 -19 5 normal +53 gfx/rails_overlays.png 8bpp 50 155 40 21 -19 5 normal +54 gfx/rails_overlays.png 8bpp 100 155 40 7 -19 4 normal +55 gfx/rails_overlays.png 8bpp 150 155 40 7 -21 20 normal +56 gfx/rails_overlays.png 8bpp 200 155 12 19 11 6 normal +57 gfx/rails_overlays.png 8bpp 250 155 12 19 -21 6 normal +58 gfx/rails_overlays.png 8bpp 0 195 64 39 -33 -8 normal +59 gfx/rails_overlays.png 8bpp 75 195 64 23 -31 0 normal +60 gfx/rails_overlays.png 8bpp 150 195 64 23 -31 0 normal +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 +\w0 + + +// Name: lc_right_open - feature 10 +63 * 7 02 10 FE \b1 \b0 +\w1 + + +// Name: right_level_crossing_state_switch +64 * 23 02 10 FE 89 +42 00 \dx000000FF +\b1 +\wx00FF \dx00000001 \dx00000001 // 1 .. 1: lc_right_closed; +\wx00FE // default: lc_right_open; + +// Name: lc_left_closed - feature 10 +65 * 7 02 10 FF \b1 \b0 +\w2 + + +// Name: lc_left_open - feature 10 +66 * 7 02 10 FD \b1 \b0 +\w3 + + +// Name: left_level_crossing_state_switch +67 * 23 02 10 FD 89 +42 00 \dx000000FF +\b1 +\wx00FF \dx00000001 \dx00000001 // 1 .. 1: lc_left_closed; +\wx00FD // default: lc_left_open; + +// Name: level_crossing_switch +68 * 23 02 10 FE 89 +06 04 \dx00000001 +\b1 +\wx00FD \dx00000000 \dx00000000 // 0 .. 0: left_level_crossing_state_switch; +\wx00FE // default: right_level_crossing_state_switch; + +69 * 152 00 10 \b3 01 FF \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" + +// Name: track_overlays - feature 10 +70 * 7 02 10 FD \b1 \b0 +\w4 + + +71 * 6 01 10 \b1 FF \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 +74 gfx/rails_overlays.png 8bpp 150 0 64 31 -31 0 normal +75 gfx/rails_overlays.png 8bpp 225 0 64 31 -31 0 normal +76 gfx/rails_overlays.png 8bpp 0 40 64 31 -31 0 normal +77 gfx/rails_overlays.png 8bpp 300 0 64 31 -31 0 normal +78 gfx/rails_overlays.png 8bpp 75 40 64 39 -31 -8 normal +79 gfx/rails_overlays.png 8bpp 150 40 64 23 -31 0 normal +80 gfx/rails_overlays.png 8bpp 225 40 64 23 -31 0 normal +81 gfx/rails_overlays.png 8bpp 300 40 64 39 -30 -9 normal +82 gfx/rails_overlays.png 8bpp 0 120 64 31 -31 0 normal +83 gfx/rails_overlays.png 8bpp 0 80 64 31 -31 0 normal +84 gfx/rails_overlays.png 8bpp 225 80 64 31 -31 0 normal +85 gfx/rails_overlays.png 8bpp 150 80 64 31 -31 0 normal +86 gfx/rails_overlays.png 8bpp 75 80 64 31 -31 0 normal +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 +\w0 + + +89 * 6 01 10 \b1 FF \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 +92 gfx/tunnel_track.png 8bpp 75 50 64 31 -31 0 normal +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 +\w0 + + +95 * 6 01 10 \b1 FF \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 +98 gfx/depot_normal.png 8bpp 0 10 16 8 -31 7 normal +99 gfx/depot_normal.png 8bpp 37 8 64 47 -53 -31 normal +100 gfx/depot_normal.png 8bpp 37 63 64 47 -53 -31 normal +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 +\w0 + + +103 * 6 01 10 \b1 FF \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 +106 gfx/rails_overlays.png 8bpp 75 40 64 39 -31 -8 normal +107 gfx/rails_overlays.png 8bpp 150 40 64 23 -31 0 normal +108 gfx/rails_overlays.png 8bpp 225 40 64 23 -31 0 normal +109 gfx/rails_overlays.png 8bpp 300 40 64 39 -30 -9 normal +110 gfx/rails_overlays.png 8bpp 150 0 64 31 -31 0 normal +111 gfx/rails_overlays.png 8bpp 225 0 64 31 -31 0 normal +112 gfx/rails_overlays.png 8bpp 0 40 64 31 -31 0 normal +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 +\w0 + + +115 * 6 01 10 \b1 FF \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 +118 gfx/fences.png 8bpp 96 0 2 30 0 -17 normal +119 gfx/fences.png 8bpp 112 0 64 5 -30 -4 normal +120 gfx/fences.png 8bpp 192 0 32 12 -30 -4 normal +121 gfx/fences.png 8bpp 240 0 32 12 2 -3 normal +122 gfx/fences.png 8bpp 288 0 32 28 -31 -12 normal +123 gfx/fences.png 8bpp 350 0 32 28 1 -10 normal + +// Name: fencesCC - feature 10 +124 * 7 02 10 F9 \b1 \b0 +\w0 + + +125 * 6 01 10 \b1 FF \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 +128 gfx/gui_rail.png 8bpp 50 0 20 20 0 0 normal +129 gfx/gui_rail.png 8bpp 75 0 20 20 0 0 normal +130 gfx/gui_rail.png 8bpp 100 0 20 20 0 0 normal +131 gfx/gui_rail.png 8bpp 125 0 20 20 0 0 normal +132 gfx/gui_rail.png 8bpp 150 0 20 20 0 0 normal +133 gfx/gui_rail.png 8bpp 175 0 20 20 0 0 normal +134 gfx/gui_rail.png 8bpp 200 0 32 32 0 0 normal +135 gfx/gui_rail.png 8bpp 250 0 32 32 0 0 normal +136 gfx/gui_rail.png 8bpp 300 0 32 32 0 0 normal +137 gfx/gui_rail.png 8bpp 350 0 32 32 0 0 normal +138 gfx/gui_rail.png 8bpp 400 0 32 32 0 0 normal +139 gfx/gui_rail.png 8bpp 450 0 32 32 0 0 normal +140 gfx/gui_rail.png 8bpp 500 0 32 32 0 0 normal +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 +\w0 + + +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; +\wx0000 + +144 * 120 00 10 \b3 01 FF \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" + +145 * 6 01 10 \b1 FF \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 +148 gfx/depot_electric.png 8bpp 0 10 16 8 -31 7 normal +149 gfx/depot_electric.png 8bpp 37 8 64 47 -53 -31 normal +150 gfx/depot_electric.png 8bpp 37 63 64 47 -53 -31 normal +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 +\w0 + + +153 * 6 01 10 \b1 FF \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 +156 gfx/gui_erail.png 8bpp 50 0 20 20 0 0 normal +157 gfx/gui_erail.png 8bpp 75 0 20 20 0 0 normal +158 gfx/gui_erail.png 8bpp 100 0 20 20 0 0 normal +159 gfx/gui_erail.png 8bpp 125 0 20 20 0 0 normal +160 gfx/gui_erail.png 8bpp 150 0 20 20 0 0 normal +161 gfx/gui_erail.png 8bpp 175 0 20 20 0 0 normal +162 gfx/gui_erail.png 8bpp 200 0 32 32 0 0 normal +163 gfx/gui_erail.png 8bpp 250 0 32 32 0 0 normal +164 gfx/gui_erail.png 8bpp 300 0 32 32 0 0 normal +165 gfx/gui_erail.png 8bpp 350 0 32 32 0 0 normal +166 gfx/gui_erail.png 8bpp 400 0 32 32 0 0 normal +167 gfx/gui_erail.png 8bpp 450 0 32 32 0 0 normal +168 gfx/gui_erail.png 8bpp 500 0 32 32 0 0 normal +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 +\w0 + + +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; +\wx0000 + diff --git a/regression/expected/example_road_vehicle.grf b/regression/expected/example_road_vehicle.grf new file mode 100644 index 00000000..2f843992 Binary files /dev/null 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 new file mode 100644 index 00000000..83b50bc7 --- /dev/null +++ b/regression/expected/example_road_vehicle.nfo @@ -0,0 +1,583 @@ +// Automatically generated by GRFCODEC. Do not modify! +// (Info version 32) +// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>> +// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C +// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% +// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags + +0 * 4 \d146 + +1 * 54 14 "C" "INFO" +"B" "VRSN" \w4 \dx00000000 +"B" "MINV" \w4 \dx00000000 +"B" "NPAR" \w1 00 +"B" "PALS" \w1 "W" +"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 +// param[127] = 0 +3 * 9 0D 7F \D= FF 00 \dx00000000 + +4 * 6 09 85 01 \70 78 01 + +// param[127] = 1 +5 * 9 0D 7F \D= FF 00 \dx00000001 + +6 * 9 09 7F 04 \7! \dx00000000 01 + +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" +"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 + +// param[127] = 1380205906 +11 * 9 0D 7F \D= FF FF \dx52444552 + +12 * 9 09 00 04 0F \dx5F444552 01 + +// param[127] = 1598309714 +13 * 9 0D 7F \D= FF FF \dx5F444552 + +14 * 7 06 +7F 04 FF \wx0014 +FF + +15 * 24 00 08 \b1 04 FF \wx0000 +16 "ROAD" "ELRD" "2YEL" "\00\00\00\00" + +16 * 6 01 01 \b10 FF \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 +19 gfx/flatbed_truck_1_paper.png 8bpp 48 0 28 12 -14 -6 normal +20 gfx/flatbed_truck_1_paper.png 8bpp 96 0 20 16 -6 -7 normal +21 gfx/flatbed_truck_1_paper.png 8bpp 128 0 8 18 -3 -10 normal +22 gfx/flatbed_truck_1_paper.png 8bpp 144 0 20 16 -14 -7 normal +23 gfx/flatbed_truck_1_paper.png 8bpp 176 0 28 12 -14 -6 normal +24 gfx/flatbed_truck_1_paper.png 8bpp 224 0 20 16 -6 -7 normal + +25 gfx/flatbed_truck_1_paper.png 8bpp 260 0 8 18 -3 -10 normal +26 gfx/flatbed_truck_1_paper.png 8bpp 276 0 20 16 -14 -7 normal +27 gfx/flatbed_truck_1_paper.png 8bpp 308 0 28 12 -14 -6 normal +28 gfx/flatbed_truck_1_paper.png 8bpp 356 0 20 16 -6 -7 normal +29 gfx/flatbed_truck_1_paper.png 8bpp 388 0 8 18 -3 -10 normal +30 gfx/flatbed_truck_1_paper.png 8bpp 404 0 20 16 -14 -7 normal +31 gfx/flatbed_truck_1_paper.png 8bpp 436 0 28 12 -14 -6 normal +32 gfx/flatbed_truck_1_paper.png 8bpp 484 0 20 16 -6 -7 normal + +33 gfx/flatbed_truck_1_steel.png 8bpp 0 0 8 18 -3 -10 normal +34 gfx/flatbed_truck_1_steel.png 8bpp 16 0 20 16 -14 -7 normal +35 gfx/flatbed_truck_1_steel.png 8bpp 48 0 28 12 -14 -6 normal +36 gfx/flatbed_truck_1_steel.png 8bpp 96 0 20 16 -6 -7 normal +37 gfx/flatbed_truck_1_steel.png 8bpp 128 0 8 18 -3 -10 normal +38 gfx/flatbed_truck_1_steel.png 8bpp 144 0 20 16 -14 -7 normal +39 gfx/flatbed_truck_1_steel.png 8bpp 176 0 28 12 -14 -6 normal +40 gfx/flatbed_truck_1_steel.png 8bpp 224 0 20 16 -6 -7 normal + +41 gfx/flatbed_truck_1_steel.png 8bpp 260 0 8 18 -3 -10 normal +42 gfx/flatbed_truck_1_steel.png 8bpp 276 0 20 16 -14 -7 normal +43 gfx/flatbed_truck_1_steel.png 8bpp 308 0 28 12 -14 -6 normal +44 gfx/flatbed_truck_1_steel.png 8bpp 356 0 20 16 -6 -7 normal +45 gfx/flatbed_truck_1_steel.png 8bpp 388 0 8 18 -3 -10 normal +46 gfx/flatbed_truck_1_steel.png 8bpp 404 0 20 16 -14 -7 normal +47 gfx/flatbed_truck_1_steel.png 8bpp 436 0 28 12 -14 -6 normal +48 gfx/flatbed_truck_1_steel.png 8bpp 484 0 20 16 -6 -7 normal + +49 gfx/flatbed_truck_1_wood.png 8bpp 0 0 8 18 -3 -10 normal +50 gfx/flatbed_truck_1_wood.png 8bpp 16 0 20 16 -14 -7 normal +51 gfx/flatbed_truck_1_wood.png 8bpp 48 0 28 12 -14 -6 normal +52 gfx/flatbed_truck_1_wood.png 8bpp 96 0 20 16 -6 -7 normal +53 gfx/flatbed_truck_1_wood.png 8bpp 128 0 8 18 -3 -10 normal +54 gfx/flatbed_truck_1_wood.png 8bpp 144 0 20 16 -14 -7 normal +55 gfx/flatbed_truck_1_wood.png 8bpp 176 0 28 12 -14 -6 normal +56 gfx/flatbed_truck_1_wood.png 8bpp 224 0 20 16 -6 -7 normal + +57 gfx/flatbed_truck_1_wood.png 8bpp 260 0 8 18 -3 -10 normal +58 gfx/flatbed_truck_1_wood.png 8bpp 276 0 20 16 -14 -7 normal +59 gfx/flatbed_truck_1_wood.png 8bpp 308 0 28 12 -14 -6 normal +60 gfx/flatbed_truck_1_wood.png 8bpp 356 0 20 16 -6 -7 normal +61 gfx/flatbed_truck_1_wood.png 8bpp 388 0 8 18 -3 -10 normal +62 gfx/flatbed_truck_1_wood.png 8bpp 404 0 20 16 -14 -7 normal +63 gfx/flatbed_truck_1_wood.png 8bpp 436 0 28 12 -14 -6 normal +64 gfx/flatbed_truck_1_wood.png 8bpp 484 0 20 16 -6 -7 normal + +65 gfx/flatbed_truck_1_copper.png 8bpp 0 0 8 18 -3 -10 normal +66 gfx/flatbed_truck_1_copper.png 8bpp 16 0 20 16 -14 -7 normal +67 gfx/flatbed_truck_1_copper.png 8bpp 48 0 28 12 -14 -6 normal +68 gfx/flatbed_truck_1_copper.png 8bpp 96 0 20 16 -6 -7 normal +69 gfx/flatbed_truck_1_copper.png 8bpp 128 0 8 18 -3 -10 normal +70 gfx/flatbed_truck_1_copper.png 8bpp 144 0 20 16 -14 -7 normal +71 gfx/flatbed_truck_1_copper.png 8bpp 176 0 28 12 -14 -6 normal +72 gfx/flatbed_truck_1_copper.png 8bpp 224 0 20 16 -6 -7 normal + +73 gfx/flatbed_truck_1_copper.png 8bpp 260 0 8 18 -3 -10 normal +74 gfx/flatbed_truck_1_copper.png 8bpp 276 0 20 16 -14 -7 normal +75 gfx/flatbed_truck_1_copper.png 8bpp 308 0 28 12 -14 -6 normal +76 gfx/flatbed_truck_1_copper.png 8bpp 356 0 20 16 -6 -7 normal +77 gfx/flatbed_truck_1_copper.png 8bpp 388 0 8 18 -3 -10 normal +78 gfx/flatbed_truck_1_copper.png 8bpp 404 0 20 16 -14 -7 normal +79 gfx/flatbed_truck_1_copper.png 8bpp 436 0 28 12 -14 -6 normal +80 gfx/flatbed_truck_1_copper.png 8bpp 484 0 20 16 -6 -7 normal + +81 gfx/flatbed_truck_1_goods.png 8bpp 0 0 8 18 -3 -10 normal +82 gfx/flatbed_truck_1_goods.png 8bpp 16 0 20 16 -14 -7 normal +83 gfx/flatbed_truck_1_goods.png 8bpp 48 0 28 12 -14 -6 normal +84 gfx/flatbed_truck_1_goods.png 8bpp 96 0 20 16 -6 -7 normal +85 gfx/flatbed_truck_1_goods.png 8bpp 128 0 8 18 -3 -10 normal +86 gfx/flatbed_truck_1_goods.png 8bpp 144 0 20 16 -14 -7 normal +87 gfx/flatbed_truck_1_goods.png 8bpp 176 0 28 12 -14 -6 normal +88 gfx/flatbed_truck_1_goods.png 8bpp 224 0 20 16 -6 -7 normal + +89 gfx/flatbed_truck_1_goods.png 8bpp 260 0 8 18 -3 -10 normal +90 gfx/flatbed_truck_1_goods.png 8bpp 276 0 20 16 -14 -7 normal +91 gfx/flatbed_truck_1_goods.png 8bpp 308 0 28 12 -14 -6 normal +92 gfx/flatbed_truck_1_goods.png 8bpp 356 0 20 16 -6 -7 normal +93 gfx/flatbed_truck_1_goods.png 8bpp 388 0 8 18 -3 -10 normal +94 gfx/flatbed_truck_1_goods.png 8bpp 404 0 20 16 -14 -7 normal +95 gfx/flatbed_truck_1_goods.png 8bpp 436 0 28 12 -14 -6 normal +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 +\w0 \w1 +\w0 \w1 + +// Name: flatbed_truck_1_steel - feature 01 +98 * 13 02 01 FE \b2 \b2 +\w2 \w3 +\w2 \w3 + +// Name: flatbed_truck_1_wood - feature 01 +99 * 13 02 01 FD \b2 \b2 +\w4 \w5 +\w4 \w5 + +// Name: flatbed_truck_1_copper - feature 01 +100 * 13 02 01 FC \b2 \b2 +\w6 \w7 +\w6 \w7 + +// Name: flatbed_truck_1_goods - feature 01 +101 * 13 02 01 FB \b2 \b2 +\w8 \w9 +\w8 \w9 + +// Name: flatbed_truck_1_capacity_switch +102 * 103 02 01 FA 89 +47 00 \dx000000FF +\b9 +\wx800E \dx00000006 \dx00000006 // 6 .. 6: return 14; +\wx800E \dx00000007 \dx00000007 // 7 .. 7: return 14; +\wx800E \dx00000008 \dx00000008 // 8 .. 8: return 14; +\wx800E \dx00000009 \dx00000009 // 9 .. 9: return 14; +\wx800F \dx0000000A \dx0000000A // 10 .. 10: return 15; +\wx800A \dx00000004 \dx00000004 // 4 .. 4: return 10; +\wx800A \dx00000005 \dx00000005 // 5 .. 5: return 10; +\wx800F \dx0000000B \dx0000000B // 11 .. 11: return 15; +\wx800C \dx0000000C \dx0000000C // 12 .. 12: return 12; +\wx8014 // default: return 20; + +103 * 85 00 01 \b26 01 FF \wx0058 +06 07 +05 00 +1F \dx000ABBE1 +04 41 +03 0F +02 14 +1D \wx0024 +16 \dx00000000 +1E \wx0081 +16 \dx00000000 +24 \b6 +00 01 02 03 04 05 +16 \dx00000000 +25 \b0 +16 \dx00000000 +07 05 +11 6C +09 5A +0E FF +08 60 +1C 02 +1A 00 +0A \dx00004C48 +13 0C +14 26 +0F 14 +12 17 + +104 * 37 04 01 7F 01 FF \wx0058 "Flatbed Truck 1 (Normal Road)" 00 + +105 * 9 00 01 \b1 01 FF \wx0058 +17 08 + +// Name: @action3_0 +106 * 23 02 01 F9 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_1 +107 * 23 02 01 00 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_2 +108 * 33 02 01 F8 89 +0C 00 \dx0000FFFF +\b2 +\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx00F9 \dx00000036 \dx00000036 // @action3_0; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_3 +109 * 43 02 01 F7 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; + +// Name: @action3_4 +110 * 43 02 01 F6 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; + +// Name: @action3_5 +111 * 43 02 01 F5 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; + +// Name: @action3_6 +112 * 43 02 01 F9 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 +06 07 +05 01 +1F \dx000ABBE1 +04 41 +03 0F +02 14 +1D \wx0024 +16 \dx00000000 +1E \wx0081 +16 \dx00000000 +24 \b6 +00 01 02 03 04 05 +16 \dx00000000 +25 \b0 +16 \dx00000000 +07 05 +11 6C +09 5A +0E FF +08 60 +1C 02 +1A 00 +0A \dx00004C48 +13 0C +14 26 +0F 14 +12 17 + +115 * 42 04 01 7F 01 FF \wx0059 "Flatbed Truck 2 (Electrified Road)" 00 + +116 * 9 00 01 \b1 01 FF \wx0059 +17 08 + +// Name: @action3_7 +117 * 23 02 01 F8 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_8 +118 * 23 02 01 00 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_9 +119 * 33 02 01 F9 89 +0C 00 \dx0000FFFF +\b2 +\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx00F8 \dx00000036 \dx00000036 // @action3_7; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_10 +120 * 43 02 01 F5 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; + +// Name: @action3_11 +121 * 43 02 01 F6 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; + +// Name: @action3_12 +122 * 43 02 01 F7 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; + +// Name: @action3_13 +123 * 43 02 01 F8 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 +06 07 +05 02 +1F \dx000ABBE1 +04 41 +03 0F +02 14 +1D \wx0024 +16 \dx00000000 +1E \wx0081 +16 \dx00000000 +24 \b6 +00 01 02 03 04 05 +16 \dx00000000 +25 \b0 +16 \dx00000000 +07 05 +11 6C +09 5A +0E FF +08 60 +1C 02 +1A 00 +0A \dx00004C48 +13 0C +14 26 +0F 14 +12 17 + +126 * 37 04 01 7F 01 FF \wx005A "Flatbed Truck 3 (Yellow Road)" 00 + +127 * 9 00 01 \b1 01 FF \wx005A +17 08 + +// Name: @action3_14 +128 * 23 02 01 F9 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_15 +129 * 23 02 01 00 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_16 +130 * 33 02 01 F8 89 +0C 00 \dx0000FFFF +\b2 +\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx00F9 \dx00000036 \dx00000036 // @action3_14; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_17 +131 * 43 02 01 F7 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; + +// Name: @action3_18 +132 * 43 02 01 F6 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; + +// Name: @action3_19 +133 * 43 02 01 F5 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; + +// Name: @action3_20 +134 * 43 02 01 F9 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 +06 07 +05 03 +1F \dx000ABBE1 +04 41 +03 0F +02 14 +1D \wx0024 +16 \dx00000000 +1E \wx0081 +16 \dx00000000 +24 \b6 +00 01 02 03 04 05 +16 \dx00000000 +25 \b0 +16 \dx00000000 +07 05 +11 6C +09 5A +0E FF +08 60 +1C 02 +1A 00 +0A \dx00004C48 +13 0C +14 26 +0F 14 +12 17 + +137 * 60 04 01 7F 01 FF \wx005B "Flatbed Truck 4 (Unknown, fallback to Red then Road)" 00 + +138 * 9 00 01 \b1 01 FF \wx005B +17 08 + +// Name: @action3_21 +139 * 23 02 01 F8 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_22 +140 * 23 02 01 00 89 +10 00 \dx000000FF +\b1 +\wx00FA \dx0000000F \dx0000000F // flatbed_truck_1_capacity_switch; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_23 +141 * 33 02 01 F9 89 +0C 00 \dx0000FFFF +\b2 +\wx00FA \dx00000015 \dx00000015 // flatbed_truck_1_capacity_switch; +\wx00F8 \dx00000036 \dx00000036 // @action3_21; +\wx00FB // flatbed_truck_1_goods; + +// Name: @action3_24 +142 * 43 02 01 FF 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; + +// Name: @action3_25 +143 * 43 02 01 FE 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; + +// Name: @action3_26 +144 * 43 02 01 FC 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; + +// Name: @action3_27 +145 * 43 02 01 FB 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; + diff --git a/regression/expected/example_roadtype_and_tramtype.grf b/regression/expected/example_roadtype_and_tramtype.grf new file mode 100644 index 00000000..f18ac364 Binary files /dev/null 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 new file mode 100644 index 00000000..19181bff --- /dev/null +++ b/regression/expected/example_roadtype_and_tramtype.nfo @@ -0,0 +1,360 @@ +// Automatically generated by GRFCODEC. Do not modify! +// (Info version 32) +// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>> +// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C +// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% +// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags + +0 * 4 \d196 + +1 * 54 14 "C" "INFO" +"B" "VRSN" \w4 \dx00000000 +"B" "MINV" \w4 \dx00000000 +"B" "NPAR" \w1 00 +"B" "PALS" \w1 "W" +"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 + +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 + +5 * 52 00 12 \b10 01 FF \wx0005 +1B \wxDC00 +08 "REDR" +0F \b4 "BLUE" "REDR" "ROAD" "ELRD" +09 \wxDC01 +0A \wxDC02 +0B \wxDC03 +0C \wxDC04 +0D \wxDC05 +10 01 +1A 65 + +6 * 6 01 12 \b2 FF \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 +9 gfx/roads_red.png 8bpp 150 0 64 31 -31 0 normal +10 gfx/roads_red.png 8bpp 225 0 64 31 -31 0 normal +11 gfx/roads_red.png 8bpp 300 0 64 31 -31 0 normal +12 gfx/roads_red.png 8bpp 375 0 64 31 -31 0 normal +13 gfx/roads_red.png 8bpp 450 0 64 31 -31 0 normal +14 gfx/roads_red.png 8bpp 0 40 64 31 -31 0 normal +15 gfx/roads_red.png 8bpp 75 40 64 31 -31 0 normal +16 gfx/roads_red.png 8bpp 150 40 64 31 -31 0 normal +17 gfx/roads_red.png 8bpp 225 40 64 31 -31 0 normal +18 gfx/roads_red.png 8bpp 300 40 64 39 -31 -8 normal +19 gfx/roads_red.png 8bpp 375 40 64 21 -31 0 normal +20 gfx/roads_red.png 8bpp 450 40 64 21 -31 0 normal +21 gfx/roads_red.png 8bpp 525 40 64 39 -31 -8 normal +22 gfx/roads_red.png 8bpp 0 80 64 31 -31 0 normal +23 gfx/roads_red.png 8bpp 75 80 64 31 -31 0 normal +24 gfx/roads_red.png 8bpp 150 80 64 31 -31 0 normal +25 gfx/roads_red.png 8bpp 225 80 64 31 -31 0 normal + +26 gfx/roads_underlay.png 8bpp 0 0 64 31 -31 0 normal +27 gfx/roads_underlay.png 8bpp 75 0 64 31 -31 0 normal +28 gfx/roads_underlay.png 8bpp 150 0 64 31 -31 0 normal +29 gfx/roads_underlay.png 8bpp 225 0 64 31 -31 0 normal +30 gfx/roads_underlay.png 8bpp 300 0 64 31 -31 0 normal +31 gfx/roads_underlay.png 8bpp 375 0 64 31 -31 0 normal +32 gfx/roads_underlay.png 8bpp 450 0 64 31 -31 0 normal +33 gfx/roads_underlay.png 8bpp 0 40 64 31 -31 0 normal +34 gfx/roads_underlay.png 8bpp 75 40 64 31 -31 0 normal +35 gfx/roads_underlay.png 8bpp 150 40 64 31 -31 0 normal +36 gfx/roads_underlay.png 8bpp 225 40 64 31 -31 0 normal +37 gfx/roads_underlay.png 8bpp 300 40 64 39 -31 -8 normal +38 gfx/roads_underlay.png 8bpp 375 40 64 23 -31 0 normal +39 gfx/roads_underlay.png 8bpp 450 40 64 23 -31 0 normal +40 gfx/roads_underlay.png 8bpp 525 40 64 39 -31 -8 normal +41 gfx/roads_underlay.png 8bpp 0 80 64 31 -31 0 normal +42 gfx/roads_underlay.png 8bpp 75 80 64 31 -31 0 normal +43 gfx/roads_underlay.png 8bpp 150 80 64 31 -31 0 normal +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 +\w0 + + +// Name: track_underlays - feature 12 +46 * 7 02 12 FE \b1 \b0 +\w1 + + +47 * 6 01 12 \b1 FF \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 +50 gfx/depot_normal.png 8bpp 0 10 16 8 -31 11 normal +51 gfx/depot_normal.png 8bpp 37 8 64 47 -61 -31 normal +52 gfx/depot_normal.png 8bpp 37 63 64 47 -61 -31 normal +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 +\w0 + + +55 * 6 01 12 \b1 FF \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 +58 gfx/roads_red.png 8bpp 300 40 64 39 -31 -8 normal +59 gfx/roads_red.png 8bpp 375 40 64 23 -31 0 normal +60 gfx/roads_red.png 8bpp 450 40 64 23 -31 0 normal +61 gfx/roads_red.png 8bpp 525 40 64 39 -31 -8 normal +62 gfx/roads_red.png 8bpp 150 0 64 31 -31 0 normal +63 gfx/roads_red.png 8bpp 225 0 64 31 -31 0 normal +64 gfx/roads_red.png 8bpp 300 0 64 31 -31 0 normal +65 gfx/roads_red.png 8bpp 375 0 64 31 -31 0 normal +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 +\w0 + + +68 * 6 01 12 \b1 FF \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 +71 gfx/roads_red.png 8bpp 150 120 64 31 -31 0 normal +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 +\w0 + + +74 * 22 03 12 01 05 \b5 +01 \wx00FF // road_overlays_red; +02 \wx00FE // track_underlays; +06 \wx00FC // bridge_underlay; +08 \wx00FD // depot_normal_road; +0A \wx00FB // roadstop_underlay_red; +\wx0000 + +75 * 40 00 12 \b10 01 FF \wx0006 +1B \wxDC06 +08 "BLUE" +0F \b1 "ROAD" +09 \wxDC07 +0A \wxDC08 +0B \wxDC09 +0C \wxDC0A +0D \wxDC0B +10 00 +1A 63 + +76 * 6 01 12 \b1 FF \wx0013 + +77 gfx/roads_blue.png 8bpp 0 0 64 31 -31 0 normal +78 gfx/roads_blue.png 8bpp 75 0 64 31 -31 0 normal +79 gfx/roads_blue.png 8bpp 150 0 64 31 -31 0 normal +80 gfx/roads_blue.png 8bpp 225 0 64 31 -31 0 normal +81 gfx/roads_blue.png 8bpp 300 0 64 31 -31 0 normal +82 gfx/roads_blue.png 8bpp 375 0 64 31 -31 0 normal +83 gfx/roads_blue.png 8bpp 450 0 64 31 -31 0 normal +84 gfx/roads_blue.png 8bpp 0 40 64 31 -31 0 normal +85 gfx/roads_blue.png 8bpp 75 40 64 31 -31 0 normal +86 gfx/roads_blue.png 8bpp 150 40 64 31 -31 0 normal +87 gfx/roads_blue.png 8bpp 225 40 64 31 -31 0 normal +88 gfx/roads_blue.png 8bpp 300 40 64 39 -31 -8 normal +89 gfx/roads_blue.png 8bpp 375 40 64 21 -31 0 normal +90 gfx/roads_blue.png 8bpp 450 40 64 21 -31 0 normal +91 gfx/roads_blue.png 8bpp 525 40 64 39 -31 -8 normal +92 gfx/roads_blue.png 8bpp 0 80 64 31 -31 0 normal +93 gfx/roads_blue.png 8bpp 75 80 64 31 -31 0 normal +94 gfx/roads_blue.png 8bpp 150 80 64 31 -31 0 normal +95 gfx/roads_blue.png 8bpp 225 80 64 31 -31 0 normal + +// Name: road_overlays_blue - feature 12 +96 * 7 02 12 FB \b1 \b0 +\w0 + + +97 * 6 01 12 \b1 FF \wx0004 + +98 gfx/roads_blue.png 8bpp 0 120 64 31 -31 0 normal +99 gfx/roads_blue.png 8bpp 75 120 64 31 -31 0 normal +100 gfx/roads_blue.png 8bpp 150 120 64 31 -31 0 normal +101 gfx/roads_blue.png 8bpp 225 120 64 31 -31 0 normal + +// Name: roadstop_underlay_blue - feature 12 +102 * 7 02 12 FF \b1 \b0 +\w0 + + +103 * 22 03 12 01 06 \b5 +01 \wx00FB // road_overlays_blue; +02 \wx00FE // track_underlays; +06 \wx00FC // bridge_underlay; +08 \wx00FD // depot_normal_road; +0A \wx00FF // roadstop_underlay_blue; +\wx0000 + +104 * 40 00 12 \b10 01 FF \wx0007 +1B \wxDC0C +08 "2YEL" +0F \b1 "ROAD" +09 \wxDC0D +0A \wxDC0E +0B \wxDC0F +0C \wxDC10 +0D \wxDC11 +10 00 +1A 64 + +105 * 6 01 12 \b1 FF \wx0013 + +106 gfx/roads_yellow.png 8bpp 0 0 64 31 -31 0 normal +107 gfx/roads_yellow.png 8bpp 75 0 64 31 -31 0 normal +108 gfx/roads_yellow.png 8bpp 150 0 64 31 -31 0 normal +109 gfx/roads_yellow.png 8bpp 225 0 64 31 -31 0 normal +110 gfx/roads_yellow.png 8bpp 300 0 64 31 -31 0 normal +111 gfx/roads_yellow.png 8bpp 375 0 64 31 -31 0 normal +112 gfx/roads_yellow.png 8bpp 450 0 64 31 -31 0 normal +113 gfx/roads_yellow.png 8bpp 0 40 64 31 -31 0 normal +114 gfx/roads_yellow.png 8bpp 75 40 64 31 -31 0 normal +115 gfx/roads_yellow.png 8bpp 150 40 64 31 -31 0 normal +116 gfx/roads_yellow.png 8bpp 225 40 64 31 -31 0 normal +117 gfx/roads_yellow.png 8bpp 300 40 64 39 -31 -8 normal +118 gfx/roads_yellow.png 8bpp 375 40 64 21 -31 0 normal +119 gfx/roads_yellow.png 8bpp 450 40 64 21 -31 0 normal +120 gfx/roads_yellow.png 8bpp 525 40 64 39 -31 -8 normal +121 gfx/roads_yellow.png 8bpp 0 80 64 31 -31 0 normal +122 gfx/roads_yellow.png 8bpp 75 80 64 31 -31 0 normal +123 gfx/roads_yellow.png 8bpp 150 80 64 31 -31 0 normal +124 gfx/roads_yellow.png 8bpp 225 80 64 31 -31 0 normal + +// Name: road_overlays_yellow - feature 12 +125 * 7 02 12 FF \b1 \b0 +\w0 + + +126 * 6 01 12 \b1 FF \wx0004 + +127 gfx/roads_yellow.png 8bpp 0 120 64 31 -31 0 normal +128 gfx/roads_yellow.png 8bpp 75 120 64 31 -31 0 normal +129 gfx/roads_yellow.png 8bpp 150 120 64 31 -31 0 normal +130 gfx/roads_yellow.png 8bpp 225 120 64 31 -31 0 normal + +// Name: roadstop_underlay_yellow - feature 12 +131 * 7 02 12 FB \b1 \b0 +\w0 + + +132 * 22 03 12 01 07 \b5 +01 \wx00FF // road_overlays_yellow; +02 \wx00FE // track_underlays; +06 \wx00FC // bridge_underlay; +08 \wx00FD // depot_normal_road; +0A \wx00FB // roadstop_underlay_yellow; +\wx0000 + +133 * 38 00 13 \b9 01 FF \wx0009 +1B \wxDC12 +08 "GRTR" +0F \b1 "TRAM" +09 \wxDC13 +0A \wxDC14 +0B \wxDC15 +0C \wxDC16 +0D \wxDC17 +10 00 + +134 * 6 01 13 \b2 FF \wx0013 + +135 gfx/tram_green.png 8bpp 0 0 64 31 -31 0 normal +136 gfx/tram_green.png 8bpp 75 0 64 31 -31 0 normal +137 gfx/tram_green.png 8bpp 150 0 64 31 -31 0 normal +138 gfx/tram_green.png 8bpp 225 0 64 31 -31 0 normal +139 gfx/tram_green.png 8bpp 300 0 64 31 -31 0 normal +140 gfx/tram_green.png 8bpp 375 0 64 31 -31 0 normal +141 gfx/tram_green.png 8bpp 450 0 64 31 -31 0 normal +142 gfx/tram_green.png 8bpp 0 40 64 31 -31 0 normal +143 gfx/tram_green.png 8bpp 75 40 64 31 -31 0 normal +144 gfx/tram_green.png 8bpp 150 40 64 31 -31 0 normal +145 gfx/tram_green.png 8bpp 225 40 64 31 -31 0 normal +146 gfx/tram_green.png 8bpp 300 40 64 39 -31 -8 normal +147 gfx/tram_green.png 8bpp 375 40 64 21 -31 0 normal +148 gfx/tram_green.png 8bpp 450 40 64 21 -31 0 normal +149 gfx/tram_green.png 8bpp 525 40 64 39 -31 -8 normal +150 gfx/tram_green.png 8bpp 0 80 64 31 -31 0 normal +151 gfx/tram_green.png 8bpp 75 80 64 31 -31 0 normal +152 gfx/tram_green.png 8bpp 150 80 64 31 -31 0 normal +153 gfx/tram_green.png 8bpp 225 80 64 31 -31 0 normal + +154 gfx/roads_underlay.png 8bpp 0 0 64 31 -31 0 normal +155 gfx/roads_underlay.png 8bpp 75 0 64 31 -31 0 normal +156 gfx/roads_underlay.png 8bpp 150 0 64 31 -31 0 normal +157 gfx/roads_underlay.png 8bpp 225 0 64 31 -31 0 normal +158 gfx/roads_underlay.png 8bpp 300 0 64 31 -31 0 normal +159 gfx/roads_underlay.png 8bpp 375 0 64 31 -31 0 normal +160 gfx/roads_underlay.png 8bpp 450 0 64 31 -31 0 normal +161 gfx/roads_underlay.png 8bpp 0 40 64 31 -31 0 normal +162 gfx/roads_underlay.png 8bpp 75 40 64 31 -31 0 normal +163 gfx/roads_underlay.png 8bpp 150 40 64 31 -31 0 normal +164 gfx/roads_underlay.png 8bpp 225 40 64 31 -31 0 normal +165 gfx/roads_underlay.png 8bpp 300 40 64 39 -31 -8 normal +166 gfx/roads_underlay.png 8bpp 375 40 64 23 -31 0 normal +167 gfx/roads_underlay.png 8bpp 450 40 64 23 -31 0 normal +168 gfx/roads_underlay.png 8bpp 525 40 64 39 -31 -8 normal +169 gfx/roads_underlay.png 8bpp 0 80 64 31 -31 0 normal +170 gfx/roads_underlay.png 8bpp 75 80 64 31 -31 0 normal +171 gfx/roads_underlay.png 8bpp 150 80 64 31 -31 0 normal +172 gfx/roads_underlay.png 8bpp 225 80 64 31 -31 0 normal + +// Name: tram_overlays_green - feature 13 +173 * 7 02 13 FB \b1 \b0 +\w0 + + +// Name: track_underlays - feature 13 +174 * 7 02 13 FD \b1 \b0 +\w1 + + +175 * 6 01 13 \b1 FF \wx0006 + +176 gfx/depot_normal.png 8bpp 200 10 16 8 17 11 normal +177 gfx/depot_normal.png 8bpp 118 8 64 47 -1 -31 normal +178 gfx/depot_normal.png 8bpp 0 10 16 8 -31 11 normal +179 gfx/depot_normal.png 8bpp 37 8 64 47 -61 -31 normal +180 gfx/depot_normal.png 8bpp 37 63 64 47 -61 -31 normal +181 gfx/depot_normal.png 8bpp 118 63 64 47 -1 -31 normal + +// Name: depot_normal_road - feature 13 +182 * 7 02 13 FC \b1 \b0 +\w0 + + +183 * 6 01 13 \b1 FF \wx000B + +184 gfx/roads_red.png 8bpp 0 0 64 31 -31 0 normal +185 gfx/roads_red.png 8bpp 75 0 64 31 -31 0 normal +186 gfx/roads_red.png 8bpp 300 40 64 39 -31 -8 normal +187 gfx/roads_red.png 8bpp 375 40 64 23 -31 0 normal +188 gfx/roads_red.png 8bpp 450 40 64 23 -31 0 normal +189 gfx/roads_red.png 8bpp 525 40 64 39 -31 -8 normal +190 gfx/roads_red.png 8bpp 150 0 64 31 -31 0 normal +191 gfx/roads_red.png 8bpp 225 0 64 31 -31 0 normal +192 gfx/roads_red.png 8bpp 300 0 64 31 -31 0 normal +193 gfx/roads_red.png 8bpp 375 0 64 31 -31 0 normal +194 gfx/roads_red.png 8bpp 450 0 64 31 -31 0 normal + +// Name: bridge_underlay - feature 13 +195 * 7 02 13 FE \b1 \b0 +\w0 + + +196 * 19 03 13 01 09 \b4 +01 \wx00FB // tram_overlays_green; +02 \wx00FD // track_underlays; +06 \wx00FE // bridge_underlay; +08 \wx00FC // depot_normal_road; +\wx0000 + diff --git a/regression/expected/example_train.grf b/regression/expected/example_train.grf new file mode 100644 index 00000000..befbd64e Binary files /dev/null and b/regression/expected/example_train.grf differ diff --git a/regression/expected/example_train.nfo b/regression/expected/example_train.nfo new file mode 100644 index 00000000..9cc3be41 --- /dev/null +++ b/regression/expected/example_train.nfo @@ -0,0 +1,548 @@ +// Automatically generated by GRFCODEC. Do not modify! +// (Info version 32) +// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>> +// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C +// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% +// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags + +0 * 4 \d120 + +1 * 665 14 "C" "INFO" +"T" "NAME" 1F "NML Voorbeeld NewGRF: Trein" 00 +"T" "DESC" 1F "\8ENML Voorbeeld NewGRF: Trein\0D\98Deze NewGRF is bedoeld als voorbeeld van de hogere NewGRF-programmeertaal NML.\0DOriginele graphics door \89Purno, \98geprogrammeerd door \89DJNekkid.\0D\98Deze NewGRF voegt een Nederlands treinstel toe, de ICM 'Koploper'." 00 +"B" "VRSN" \w4 \dx00000000 +"B" "MINV" \w4 \dx00000000 +"B" "NPAR" \w1 01 +"C" "PARA" +"C" \d0 +"T" "NAME" 7F "Colour scheme" 00 +"T" "NAME" 1F "Kleurenschema" 00 +"T" "DESC" 7F "Select the type of colour scheme to use" 00 +"T" "DESC" 1F "Kies het soort kleurenschema" 00 +"B" "MASK" \w1 00 +"B" "LIMI" \w8 \d0 \d2 +"C" "VALU" +"T" \d0 7F "One company colour" 00 +"T" \d0 1F "ÞEén bedrijfskleur" 00 +"T" \d1 7F "Two company colours" 00 +"T" \d1 1F "Twee bedrijfskleuren" 00 +"T" \d2 7F "Real-world colours" 00 +"T" \d2 1F "Realistische kleuren" 00 +00 +"B" "DFLT" \w4 \dx00000001 +00 +00 +"B" "PALS" \w1 "W" +"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 + +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 + +5 * 24 00 08 \b1 04 FF \wx0000 +12 "RAIL" "ELRL" "MONO" "MGLV" + +6 * 6 01 00 \b4 FF \wx0008 + +7 icm.png 8bpp 1 1 8 24 -3 -12 normal +8 icm.png 8bpp 10 1 22 20 -14 -12 normal +9 icm.png 8bpp 33 1 32 16 -16 -12 normal +10 icm.png 8bpp 66 1 22 20 -6 -12 normal +11 icm.png 8bpp 89 1 8 24 -3 -12 normal +12 icm.png 8bpp 98 1 22 20 -14 -12 normal +13 icm.png 8bpp 121 1 32 16 -16 -12 normal +14 icm.png 8bpp 154 1 22 20 -6 -12 normal + +15 icm.png 8bpp 1 65 8 24 -3 -12 normal +16 icm.png 8bpp 10 65 22 20 -14 -12 normal +17 icm.png 8bpp 33 65 32 16 -16 -12 normal +18 icm.png 8bpp 66 65 22 20 -6 -12 normal +19 icm.png 8bpp 89 65 8 24 -3 -12 normal +20 icm.png 8bpp 98 65 22 20 -14 -12 normal +21 icm.png 8bpp 121 65 32 16 -16 -12 normal +22 icm.png 8bpp 154 65 22 20 -6 -12 normal + +23 icm.png 8bpp 89 33 8 24 -3 -12 normal +24 icm.png 8bpp 98 33 22 20 -14 -12 normal +25 icm.png 8bpp 121 33 32 16 -16 -12 normal +26 icm.png 8bpp 154 33 22 20 -6 -12 normal +27 icm.png 8bpp 1 33 8 24 -3 -12 normal +28 icm.png 8bpp 10 33 22 20 -14 -12 normal +29 icm.png 8bpp 33 33 32 16 -16 -12 normal +30 icm.png 8bpp 66 33 22 20 -6 -12 normal + +31 icm.png 8bpp 89 97 8 24 -3 -12 normal +32 icm.png 8bpp 98 97 22 20 -14 -12 normal +33 icm.png 8bpp 121 97 32 16 -16 -12 normal +34 icm.png 8bpp 154 97 22 20 -6 -12 normal +35 icm.png 8bpp 1 97 8 24 -3 -12 normal +36 icm.png 8bpp 10 97 22 20 -14 -12 normal +37 icm.png 8bpp 33 97 32 16 -16 -12 normal +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 +\w0 +\w0 + +// Name: set_icm_front - feature 00 +40 * 9 02 00 FE \b1 \b1 +\w1 +\w1 + +// Name: sw_icm_graphics_front +41 * 23 02 00 FE 89 +40 00 \dx000000FF +\b1 +\wx00FF \dx00000000 \dx00000000 // 0 .. 0: set_icm_front_lighted; +\wx00FE // default: set_icm_front; + +// Name: set_icm_rear_lighted - feature 00 +42 * 9 02 00 FF \b1 \b1 +\w2 +\w2 + +// Name: set_icm_rear - feature 00 +43 * 9 02 00 FD \b1 \b1 +\w3 +\w3 + +// Name: sw_icm_graphics_rear +44 * 23 02 00 FD 89 +40 08 \dx000000FF +\b1 +\wx00FF \dx00000000 \dx00000000 // 0 .. 0: set_icm_rear_lighted; +\wx00FD // default: set_icm_rear; + +45 * 6 01 00 \b1 FF \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 +\w0 +\w0 + +48 * 6 01 00 \b1 FF \wx0004 + +49 icm.png 8bpp 1 129 8 24 -3 -12 normal +50 icm.png 8bpp 10 129 22 20 -14 -12 normal +51 icm.png 8bpp 33 129 32 16 -16 -12 normal +52 icm.png 8bpp 66 129 22 20 -6 -12 normal + +// Name: set_icm_middle - feature 00 +53 * 9 02 00 FC \b1 \b1 +\w0 +\w0 + +// Name: sw_icm_graphics_middle +54 * 81 02 00 FC 89 +F2 20 \dx000000FF +\2cmp 1A 20 \dx00000000 +\2& 1A 20 \dx00000001 +\2sto 1A 20 \dx00000080 +\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; + +// Name: @CB_FAILED_REAL00 +55 * 9 02 00 FF \b1 \b1 +\w0 +\w0 + +// Name: @CB_FAILED00 +56 * 23 02 00 FF 89 +0C 00 \dx0000FFFF +\b1 +\wx8000 \dx00000000 \dx00000000 // graphics callback -> return 0 +\wx00FF // Non-graphics callback, return graphics result + +// Name: sw_icm_graphics +57 * 51 02 00 FD 89 +40 80 \dx000000FF \dx00000000 \dx00000004 +\b3 +\wx00FE \dx00000000 \dx00000000 // 0 .. 0: sw_icm_graphics_front; +\wx00FC \dx00000001 \dx00000002 // 1 .. 2: sw_icm_graphics_middle; +\wx00FD \dx00000003 \dx00000003 // 3 .. 3: sw_icm_graphics_rear; +\wx00FF // default: @CB_FAILED00; + +// Name: sw_icm_cargo_subtype_text +58 * 33 02 00 FC 89 +F2 00 \dx000000FF +\b2 +\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; + +// param[127] = param[17] +59 * 9 0D 7F \D= 11 FE \dx0000FFFF + +60 * 7 06 +7F 04 FF \wx001B +FF + +// Name: @return_action_0 +61 * 34 02 00 FE 89 +43 38 \dx0000000F +\2* 1A 20 \dx00000010 +\2+ 1A 20 \dx00000003 +\2+ 1A 00 \dx00000000 // param[127] +\b0 +\wx8000 // Return computed value + +// param[124] = param[17] +62 * 9 0D 7C \D= 11 FE \dx0000FFFF + +// param[125] = (param[124] + 16384) +63 * 9 0D 7D \D+ 7C FF \dx00004000 + +// param[126] = (param[125] | 32768) +64 * 9 0D 7E \D| 7D FF \dx00008000 + +// param[123] = param[17] +65 * 9 0D 7B \D= 11 FE \dx0000FFFF + +// param[124] = (param[123] + 3) +66 * 9 0D 7C \D+ 7B FF \dx00000003 + +// 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 +FF + +// Name: sw_icm_colour_mapping +69 * 43 02 00 FE 89 +1A 00 \dx00000000 // param[0] +\b3 +\wx00FE \dx00000000 \dx00000000 // 0 .. 0: return (((var[0x43, 24, 15] * 16) + 3) + base_sprite_2cc) +\wx8000 \dx00000001 \dx00000001 // 1 .. 1: return param[126]; +\wx8000 \dx00000002 \dx00000002 // 2 .. 2: return param[125]; +\wx00FF // default: @CB_FAILED00; + +// Name: sw_icm_start_stop +70 * 31 02 00 FB 89 +40 50 \dx000000FF \dx00000001 \dx00000001 +\b1 +\wx8400 \dx00000001 \dx00000010 // 1 .. 16: return 1024; +\wx8002 // default: return string(STR_ICM_CANNOT_START); + +// Name: sw_icm_articulated_part +71 * 23 02 00 FA 89 +10 00 \dxFFFFFFFF +\b1 +\wx8074 \dx00000001 \dx00000003 // 1 .. 3: return 116; +\wxFFFF // default: return 32767; + +// Name: sw_icm_can_attach_wagon +72 * 23 02 00 F9 89 +C6 00 \dx0000FFFF +\b1 +\wx8401 \dx00000074 \dx00000074 // 116 .. 116: return 1025; +\wx8003 // default: return string(STR_ICM_CANNOT_ATTACH_OTHER); + +// Name: sw_icm_shorten_3_part_vehicle +73 * 41 02 00 F8 89 +40 80 \dx000000FF \dx00000000 \dx00000004 +\b2 +\wx8007 \dx00000001 \dx00000001 // 1 .. 1: return 7; +\wx8001 \dx00000002 \dx00000002 // 2 .. 2: return 1; +\wx8000 // default: return 0; + +// Name: sw_icm_length +74 * 23 02 00 F8 89 +F2 00 \dx000000FF +\b1 +\wx00F8 \dx00000000 \dx00000000 // 0 .. 0: sw_icm_shorten_3_part_vehicle; +\wx8000 // default: return 0; + +// Name: sw_icm_power +75 * 23 02 00 F7 89 +F2 00 \dx000000FF +\b1 +\wx8699 \dx00000000 \dx00000000 // 0 .. 0: return 1689; +\wx89E6 // default: return 2534; + +// Name: sw_icm_weight +76 * 23 02 00 F6 89 +F2 00 \dx000000FF +\b1 +\wx8090 \dx00000000 \dx00000000 // 0 .. 0: return 144; +\wx80C0 // default: return 192; + +// Name: sw_icm_te +77 * 23 02 00 F5 89 +F2 00 \dx000000FF +\b1 +\wx8019 \dx00000000 \dx00000000 // 0 .. 0: return 25; +\wx801C // default: return 28; + +// param[142] = 2 +78 * 9 0D 8E \D= FF 00 \dx00000002 + +// param[158] = (param[158] | 8) +79 * 9 0D 9E \D| 9E FF \dx00000008 + +80 * 9 00 08 \b1 01 FF \wx002C +08 0A + +81 * 104 00 00 \b37 01 FF \wx0074 +06 07 +2A \dx000B0D34 +04 FF +03 1E +02 14 +28 \wx0001 +1D \dx00000000 +29 \wx0000 +1D \dx00000000 +2C \b0 +1D \dx00000000 +2D \b0 +1D \dx00000000 +07 06 +17 2D +0D 64 +12 FD +09 \wx008D +27 06 +1C 00 +05 01 +08 01 +0B \wx069A +0E \dx00004C3C +13 00 +14 24 +16 90 +24 00 +18 00 +19 28 +1B \wx0000 +1F 1A +20 0F +21 00 +22 BA +23 00 +25 00 + +82 * 33 04 00 7F 01 FF \wx0074 "ICM 'Koploper' (Electric)" 00 + +83 * 35 04 00 1F 01 FF \wx0074 "ICM 'Koploper' (Electrisch)" 00 + +84 * 6 01 00 \b1 FF \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 +\w0 +\w0 + +87 * 9 00 00 \b1 01 FF \wx0074 +1E 79 + +// Name: @return_action_0 +88 * 41 02 00 F3 89 +F2 20 \dx000000FF +\2cmp 1A 20 \dx00000001 +\2& 1A 20 \dx00000001 +\2* 1A 20 \dx00000032 // expr1 - expr2 +\2+ 1A 00 \dx00000064 +\b0 +\wx8000 // Return computed value + +// Name: @return_action_1 +89 * 85 02 00 F2 89 +40 A0 \dx000000FF \dx00000000 \dx00000004 +\2cmp 1A 20 \dx00000002 +\2& 1A 20 \dx00000001 +\2sto 1A 20 \dx00000080 +\2r F2 20 \dx000000FF +\2cmp 1A 20 \dx00000000 +\2& 1A 20 \dx00000001 +\2& 7D 80 20 \dxFFFFFFFF +\2* 1A 20 \dxFFFFFFDC // expr1 - expr2 +\2+ 1A 00 \dx00000024 +\b0 +\wx8000 // Return computed value + +// Name: @return_action_2 +90 * 20 02 00 F1 89 +1A 20 \dx00000008 +\2- 1C 00 \dxFFFFFFFF +\b0 +\wx8000 // Return computed value + +// Name: @action3_1 +91 * 24 02 00 00 89 +7E F8 00 \dxFFFFFFFF // sw_icm_length +\b1 +\wx00FF \dx0000FFFF \dx0000FFFF // @CB_FAILED00; +\wx00F1 // return (8 - var[0x1C, 0, -1]) + +// Name: @action3_0 +92 * 73 02 00 F5 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] == 0) & (((var[0x40, 0, 255] + 0) % 4) == 2)) ? 0 : 36) +\wx00F6 \dx00000016 \dx00000016 // sw_icm_weight; +\wx00F5 \dx0000001F \dx0000001F // sw_icm_te; +\wx0000 \dx00000021 \dx00000021 // @action3_1; +\wx00FD // sw_icm_graphics; + +// Name: @action3_2 +93 * 63 02 00 F6 89 +10 00 \dx000000FF +\b5 +\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; + +// Name: @return_action_3 +94 * 49 02 00 F2 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 +\wx8000 // Return computed value + +// Name: @return_action_4 +95 * 85 02 00 F3 89 +40 A0 \dx000000FF \dx00000000 \dx00000004 +\2cmp 1A 20 \dx00000002 +\2& 1A 20 \dx00000001 +\2sto 1A 20 \dx00000080 +\2r F2 20 \dx000000FF +\2cmp 1A 20 \dx00000000 +\2& 1A 20 \dx00000001 +\2& 7D 80 20 \dxFFFFFFFF +\2* 1A 20 \dxFFFFFFDC // expr1 - expr2 +\2+ 1A 00 \dx00000024 +\b0 +\wx8000 // Return computed value + +// Name: @action3_3 +96 * 93 02 00 F5 89 +0C 00 \dx0000FFFF +\b8 +\wx00F2 \dx00000010 \dx00000010 // return ((((var[0x40, 0, 255] + 0) % 4) == 0) ? 186 : 200) +\wx00F3 \dx00000015 \dx00000015 // return (((var[0xF2, 0, 255] == 0) & (((var[0x40, 0, 255] + 0) % 4) == 2)) ? 0 : 36) +\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; +\wx00F5 \dx00000036 \dx00000036 // @action3_0; +\wx00FD // sw_icm_graphics; + +// Name: @action3_4 +97 * 63 02 00 FD 89 +0C 00 \dx0000FFFF +\b5 +\wx00F4 \dx00000000 \dx00000000 // set_icm_purchase; +\wx00FA \dx00000016 \dx00000016 // sw_icm_articulated_part; +\wx8004 \dx00000023 \dx00000023 // return string(STR_ICM_ADDITIONAL_TEXT); +\wx00FE \dx0000002D \dx0000002D // sw_icm_colour_mapping; +\wx00F6 \dx00000036 \dx00000036 // @action3_2; +\wx00FD // sw_icm_graphics; + +98 * 12 03 00 01 FF \wx0074 \b1 +FF \wx00FD // @action3_4; +\wx00F5 // @action3_3; + +// param[126] = param[161] +99 * 5 0D 7E \D= A1 00 + +// param[127] = (302012601 - param[126]) +100 * 9 0D 7F \D- FF 7E \dx120058B9 + +// param[127] = (param[127] << -31) +101 * 9 0D 7F \Du<< 7F FF \dxFFFFFFE1 + +102 * 9 07 7F 04 \7= \dx00000000 01 + +103 * 10 00 00 \b1 01 FF \wx0074 +2B \wx00B9 + +104 * 6 01 00 \b2 FF \wx0004 + +105 cargo_wagons.png 8bpp 1 1 8 24 -3 -12 normal +106 cargo_wagons.png 8bpp 10 1 22 20 -14 -12 normal +107 cargo_wagons.png 8bpp 33 1 32 16 -16 -12 normal +108 cargo_wagons.png 8bpp 66 1 22 20 -6 -12 normal + +109 cargo_wagons.png 8bpp 1 33 8 24 -3 -12 normal +110 cargo_wagons.png 8bpp 10 33 22 20 -14 -12 normal +111 cargo_wagons.png 8bpp 33 33 32 16 -16 -12 normal +112 cargo_wagons.png 8bpp 66 33 22 20 -6 -12 normal + +// Name: set_cargo_wagon - feature 00 +113 * 9 02 00 F5 \b1 \b1 +\w0 +\w0 + +// Name: cargo_wagon_switch_vehicle +114 * 30 02 00 F5 89 +1A 20 \dx80000000 +\2sto 1A 00 \dx00000100 +\b1 +\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00F5 // default: set_cargo_wagon; + +// Name: set_cargo_wagon_load - feature 00 +115 * 9 02 00 FD \b1 \b1 +\w1 +\w1 + +// Name: cargo_wagon_switch_load +116 * 30 02 00 FD 89 +1A 20 \dx00000000 +\2sto 1A 00 \dx00000100 +\b1 +\wx8000 \dx00000001 \dx00000000 // Bogus range to avoid nvar == 0 +\wx00FD // default: set_cargo_wagon_load; + +// Name: cargo_wagon_switch_graphics +117 * 37 02 00 FD 89 +10 20 \dxFFFFFFFF +\2u>> 1A 20 \dx00000008 +\2& 1A 00 \dx000000FF +\b1 +\wx00F5 \dx00000000 \dx00000000 // 0 .. 0: cargo_wagon_switch_vehicle; +\wx00FD // default: cargo_wagon_switch_load; + +118 * 37 00 00 \b11 01 FF \wx0075 +06 0F +2A \dx000A96C9 +04 FF +28 \wx0020 +1D \dx00000000 +12 FD +27 80 +14 28 +16 14 +24 00 +0B \wx0000 + +119 * 19 04 00 7F 01 FF \wx0075 "Cargo Wagon" 00 + +120 * 12 03 00 01 FF \wx0075 \b1 +FF \wx00FD // cargo_wagon_switch_graphics; +\wx00FD // cargo_wagon_switch_graphics; +