Skip to content

Commit

Permalink
Codechange: Use "const" in 030_house regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed Oct 5, 2023
1 parent e0b4c84 commit 5fc8706
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 75 deletions.
4 changes: 2 additions & 2 deletions regression/030_house.nml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ spriteset(brewery_spriteset_building) {
tmpl_building_sprite(150, 60, 91, -60, "brewery_snow.png")
}

default_palette = PALETTE_USE_DEFAULT;
/* Generic sprite layout that is used for all tiles of the building. Parmaeters:
const default_palette = PALETTE_USE_DEFAULT;
/* Generic sprite layout that is used for all tiles of the building. Parmeters:
* - building_sprite: offset in the brewery_spriteset_building spriteset to use. -1 to skip building sprite.
* - with_smoke: Show smoke above the tile (also depends on animation state) */
spritelayout brewery_sprite_layout(building_sprite, with_smoke) {
Expand Down
Binary file modified regression/expected/030_house.grf
Binary file not shown.
133 changes: 60 additions & 73 deletions regression/expected/030_house.nfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags

0 * 4 \d63
0 * 4 \d59

1 * 54 14 "C" "INFO"
"B" "VRSN" \w4 \dx00000000
Expand All @@ -21,45 +21,32 @@
4 * 24 00 08 \b1 04 FF \wx0000
09 "PASS" "MAIL" "GRAI" "WHEA"

// param[127] = 0
5 * 9 0D 7F \D= FF 00 \dx00000000
5 * 6 01 07 \b2 FF \wx0006

6 * 6 01 07 \b2 FF \wx0006

7 groundtiles.png 8bpp 10 10 64 31 -31 0 normal
8 groundtiles.png 8bpp 150 10 64 31 -31 0 normal
9 groundtiles.png 8bpp 220 10 64 31 -31 0 normal
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 * 1 00
10 * 1 00
11 * 1 00
12 * 1 00

13 brewery.png 8bpp 10 60 64 91 -31 -60 normal nocrop
14 brewery.png 8bpp 80 60 64 91 -31 -60 normal nocrop
15 brewery.png 8bpp 150 60 64 91 -31 -60 normal nocrop
16 brewery_snow.png 8bpp 10 60 64 91 -31 -60 normal nocrop
17 brewery_snow.png 8bpp 80 60 64 91 -31 -60 normal nocrop
18 brewery_snow.png 8bpp 150 60 64 91 -31 -60 normal nocrop

// param[125] = (param[127] << 16)
19 * 9 0D 7D \D<< 7F FF \dx00000010

// param[126] = (param[125] + -2147450879)
20 * 9 0D 7E \D+ 7D FF \dx80008001

21 * 7 06
7E 04 FF \wx0014
FF
12 brewery.png 8bpp 10 60 64 91 -31 -60 normal nocrop
13 brewery.png 8bpp 80 60 64 91 -31 -60 normal nocrop
14 brewery.png 8bpp 150 60 64 91 -31 -60 normal nocrop
15 brewery_snow.png 8bpp 10 60 64 91 -31 -60 normal nocrop
16 brewery_snow.png 8bpp 80 60 64 91 -31 -60 normal nocrop
17 brewery_snow.png 8bpp 150 60 64 91 -31 -60 normal nocrop

// Name: brewery_sprite_layout - feature 07
// building_sprite : register 8B
// with_smoke : register 8C
22 * 49 02 07 FF \b67 \dx00000F8D \wx0000
18 * 49 02 07 FF \b67 \dx00000F8D \wx0000
\dxC0000000 \wx0002 \b0 \b0 80 83
\dx00000000 \wx0003 \b0 \b0 \b0 \b16 \b16 \b48 85 86
\dx80008001 \wx0003 \b0 \b0 \b0 \b16 \b16 \b48 85 86
\dx00000000 \wx0023 \b8 \b0 \b0 \b11 \b16 \b7 88 89 8A

// Name: brewery_sprite_layout@registers - feature 07
23 * 362 02 07 FF 89
19 * 362 02 07 FF 89
43 20 \dx000000FF
\2cmp 1A 20 \dx00000004
\2& 1A 20 \dx00000001
Expand Down Expand Up @@ -111,7 +98,7 @@ FF
\wx00FF //

// Name: @return_action_0
24 * 44 02 07 FE 89
20 * 44 02 07 FE 89
1A 20 \dx00000002
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000000
Expand All @@ -121,7 +108,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: @return_action_1
25 * 44 02 07 FD 89
21 * 44 02 07 FD 89
1A 20 \dx00000001
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000000
Expand All @@ -131,7 +118,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: @return_action_2
26 * 44 02 07 FC 89
22 * 44 02 07 FC 89
1A 20 \dxFFFFFFFF
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000000
Expand All @@ -141,7 +128,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: @return_action_3
27 * 44 02 07 FB 89
23 * 44 02 07 FB 89
1A 20 \dx00000000
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000001
Expand All @@ -151,7 +138,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: brewery_layout_1
28 * 44 02 07 FB 89
24 * 44 02 07 FB 89
7D FF 10 \dx000000FF
\b3
\wx00FE \dx00000000 \dx00000000 // 0 .. 0: @return_action_0;
Expand All @@ -160,7 +147,7 @@ FF
\wx00FB // default: @return_action_3;

// Name: @return_action_0
29 * 44 02 07 FC 89
25 * 44 02 07 FC 89
1A 20 \dxFFFFFFFF
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000000
Expand All @@ -170,7 +157,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: @return_action_1
30 * 44 02 07 FD 89
26 * 44 02 07 FD 89
1A 20 \dx00000000
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000001
Expand All @@ -180,7 +167,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: @return_action_2
31 * 44 02 07 FE 89
27 * 44 02 07 FE 89
1A 20 \dx00000002
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000000
Expand All @@ -190,7 +177,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: @return_action_3
32 * 44 02 07 FF 89
28 * 44 02 07 FF 89
1A 20 \dx00000001
\2sto 1A 20 \dx0000008B
\2r 1A 20 \dx00000000
Expand All @@ -200,7 +187,7 @@ FF
\wx00FF // brewery_sprite_layout

// Name: brewery_layout_2
33 * 44 02 07 FF 89
29 * 44 02 07 FF 89
7D FF 10 \dx000000FF
\b3
\wx00FC \dx00000000 \dx00000000 // 0 .. 0: @return_action_0;
Expand All @@ -209,21 +196,21 @@ FF
\wx00FF // default: @return_action_3;

// Name: brewery_choose_layout
34 * 23 02 07 FF 89
30 * 23 02 07 FF 89
5F 08 \dx00000001
\b1
\wx00FB \dx00000000 \dx00000000 // 0 .. 0: brewery_layout_1;
\wx00FF // default: brewery_layout_2;

// Name: brewery_next_frame
35 * 23 02 07 FB 89
31 * 23 02 07 FB 89
46 00 \dx000000FF
\b1
\wx80FF \dx00000000 \dx00000000 // 0 .. 0: return 255;
\wx80FE // default: return 254;

// Name: @return_action_0
36 * 41 02 07 FE 89
32 * 41 02 07 FE 89
46 20 \dx000000FF
\2cmp 1A 20 \dx00000000
\2& 1A 20 \dx00000001
Expand All @@ -233,7 +220,7 @@ FF
\wx8000 // Return computed value

// Name: brewery_cargo_accepted
37 * 59 02 07 FE 89
33 * 59 02 07 FE 89
5F 28 \dx00000001
\2u< 1A 20 \dx00000001
\2* 1A 20 \dxFFFFFFFF // expr1 - expr2
Expand All @@ -245,34 +232,34 @@ FF
\wx80FD // default: return 253;

// Name: brewery_check_location
38 * 23 02 07 FD 89
34 * 23 02 07 FD 89
44 00 \dx000000FF
\b1
\wx8001 \dx00000000 \dx00000000 // 0 .. 0: return 1;
\wx8000 // default: return 0;

// param[125] = 0
39 * 9 0D 7D \D= FF 00 \dx00000000
// param[126] = 0
35 * 9 0D 7E \D= FF 00 \dx00000000

40 * 9 09 00 04 \7c \dx49415247 01
36 * 9 09 00 04 \7c \dx49415247 01

// param[125] = 1
41 * 9 0D 7D \D= FF 00 \dx00000001
// param[126] = 1
37 * 9 0D 7E \D= FF 00 \dx00000001

// param[124] = 0
42 * 9 0D 7C \D= FF 00 \dx00000000
// param[125] = 0
38 * 9 0D 7D \D= FF 00 \dx00000000

43 * 9 09 00 04 \7c \dx41454857 01
39 * 9 09 00 04 \7c \dx41454857 01

// param[124] = 1
44 * 9 0D 7C \D= FF 00 \dx00000001
// param[125] = 1
40 * 9 0D 7D \D= FF 00 \dx00000001

// param[126] = (param[125] | param[124])
45 * 5 0D 7E \D| 7D 7C
// param[127] = (param[126] | param[125])
41 * 5 0D 7F \D| 7E 7D

46 * 9 07 7E 04 \7= \dx00000000 02
42 * 9 07 7F 04 \7= \dx00000000 02

47 * 183 00 07 \b20 04 FF \wx0000
43 * 183 00 07 \b20 04 FF \wx0000
08 28 29 2A 2B
12 \wxDC00 \wxDC00 \wxDC00 \wxDC00
09 30 20 20 20
Expand Down Expand Up @@ -308,11 +295,11 @@ FF
\b2
02 03

48 * 9 00 07 \b1 01 FF \wx0000
44 * 9 00 07 \b1 01 FF \wx0000
14 03

// Name: @action3_0
49 * 57 02 07 FD 89
45 * 57 02 07 FD 89
1A 20 \dx00000000
\2sto 1A 20 \dx000000FF
\2r 0C 00 \dx0000FFFF
Expand All @@ -322,16 +309,16 @@ FF
\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted;
\wx00FF // brewery_choose_layout;

50 * 9 07 7E 04 \7= \dx00000000 02
46 * 9 07 7F 04 \7= \dx00000000 02

51 * 7 03 07 01 00 \b0
47 * 7 03 07 01 00 \b0
\wx00FD // @action3_0;

52 * 9 00 07 \b1 01 FF \wx0001
48 * 9 00 07 \b1 01 FF \wx0001
14 02

// Name: @action3_1
53 * 47 02 07 FD 89
49 * 47 02 07 FD 89
1A 20 \dx00010100
\2sto 1A 20 \dx000000FF
\2r 0C 00 \dx0000FFFF
Expand All @@ -340,16 +327,16 @@ FF
\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted;
\wx00FF // brewery_choose_layout;

54 * 9 07 7E 04 \7= \dx00000000 02
50 * 9 07 7F 04 \7= \dx00000000 02

55 * 7 03 07 01 01 \b0
51 * 7 03 07 01 01 \b0
\wx00FD // @action3_1;

56 * 9 00 07 \b1 01 FF \wx0002
52 * 9 00 07 \b1 01 FF \wx0002
14 02

// Name: @action3_2
57 * 47 02 07 FD 89
53 * 47 02 07 FD 89
1A 20 \dx00020001
\2sto 1A 20 \dx000000FF
\2r 0C 00 \dx0000FFFF
Expand All @@ -358,16 +345,16 @@ FF
\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted;
\wx00FF // brewery_choose_layout;

58 * 9 07 7E 04 \7= \dx00000000 02
54 * 9 07 7F 04 \7= \dx00000000 02

59 * 7 03 07 01 02 \b0
55 * 7 03 07 01 02 \b0
\wx00FD // @action3_2;

60 * 9 00 07 \b1 01 FF \wx0003
56 * 9 00 07 \b1 01 FF \wx0003
14 02

// Name: @action3_3
61 * 47 02 07 FF 89
57 * 47 02 07 FF 89
1A 20 \dx00030101
\2sto 1A 20 \dx000000FF
\2r 0C 00 \dx0000FFFF
Expand All @@ -376,8 +363,8 @@ FF
\wx00FE \dx00000148 \dx00000148 // brewery_cargo_accepted;
\wx00FF // brewery_choose_layout;

62 * 9 07 7E 04 \7= \dx00000000 01
58 * 9 07 7F 04 \7= \dx00000000 01

63 * 7 03 07 01 03 \b0
59 * 7 03 07 01 03 \b0
\wx00FF // @action3_3;

0 comments on commit 5fc8706

Please sign in to comment.