diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index d1b397585..feb9c4188 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -41,5 +41,7 @@ jobs: - uses: actions/checkout@v4 with: persist-credentials: false + - name: Check RUL0 syntax + run: python src/scripts/syntax-check-rul0.py - name: Check RUL2 syntax run: sh src/scripts/syntax-check-rul2.sh diff --git a/Controller/RUL0/0000_TuLEPS_CanAM/0100_CanAM.txt b/Controller/RUL0/0000_TuLEPS_CanAM/0100_CanAM.txt index 0be32be42..761508b96 100644 --- a/Controller/RUL0/0000_TuLEPS_CanAM/0100_CanAM.txt +++ b/Controller/RUL0/0000_TuLEPS_CanAM/0100_CanAM.txt @@ -504,8 +504,8 @@ CheckType = c - highway: 0x04020002, 0x00000000 optional CheckType = d - highway: 0x00020402, 0x00000000 optional ConsLayout =......... -ConsLayout =...-+-... -ConsLayout =...-+-..< +ConsLayout =....+-... +ConsLayout =....+-..< ConsLayout =....^.... AutoTileBase = 0xCA1A1D00 diff --git a/Controller/RUL0/0000_TuLEPS_CanAM/0400_BasicTuLEPs.txt b/Controller/RUL0/0000_TuLEPS_CanAM/0400_BasicTuLEPs.txt index 342ef034c..ed752e256 100644 --- a/Controller/RUL0/0000_TuLEPS_CanAM/0400_BasicTuLEPs.txt +++ b/Controller/RUL0/0000_TuLEPS_CanAM/0400_BasicTuLEPs.txt @@ -1954,8 +1954,8 @@ CheckType = c - avenue: 0x04020002 CheckType = d - avenue: 0x00020402 ConsLayout =....... -ConsLayout =..++... ConsLayout =..++..< +ConsLayout =..++... ConsLayout =....... ConsLayout =..^.... diff --git a/Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt b/Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt index 0bcdc0523..96f31bbf1 100644 --- a/Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt +++ b/Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt @@ -93,18 +93,18 @@ CheckType = Y - highway:0x03020201 CheckType = Z - highway:0x01030202 ConsLayout =.............. -ConsLayout =.\\........//. -ConsLayout =.\\\......///. -ConsLayout =..\\\....///.. -ConsLayout =...\\\..///... -ConsLayout =....\\\///.... +ConsLayout =.\\........... +ConsLayout =.\\\.......... +ConsLayout =..\\\......... +ConsLayout =...\\\........ +ConsLayout =....\\\//..... ConsLayout =.....\##/....< ConsLayout =...../##\..... -ConsLayout =....///\\\.... -ConsLayout =...///..\\\... -ConsLayout =..///....\\\.. -ConsLayout =.///......\\\. -ConsLayout =.//........\\. +ConsLayout =.....//\\\.... +ConsLayout =........\\\... +ConsLayout =.........\\\.. +ConsLayout =..........\\\. +ConsLayout =...........\\. ConsLayout =......^....... AutoTileBase = 0x0C001000 @@ -154,17 +154,17 @@ CheckType = D - highway:0x01000302 CheckType = E - highway:0x00030201 ConsLayout =............. -ConsLayout =.\\.......//. -ConsLayout =.\\\.....///. -ConsLayout =..\\\...///.. -ConsLayout =...\\\.///... +ConsLayout =.\\.......... +ConsLayout =.\\\......... +ConsLayout =..\\\........ +ConsLayout =...\\\.//.... ConsLayout =....\\#//.... ConsLayout =.....###....< ConsLayout =....//#\\.... -ConsLayout =...///.\\\... -ConsLayout =..///...\\\.. -ConsLayout =.///.....\\\. -ConsLayout =.//.......\\. +ConsLayout =....//.\\\... +ConsLayout =........\\\.. +ConsLayout =.........\\\. +ConsLayout =..........\\. ConsLayout =......^...... AutoTileBase = 0x0C002000 @@ -216,20 +216,20 @@ CheckType = A - highway:0x02040203 CheckType = B - highway:0x02030204 ConsLayout =............. -ConsLayout =......||..... -ConsLayout =.\\...||..... -ConsLayout =.\\\..||..... -ConsLayout =..\\\.||..... +ConsLayout =............. +ConsLayout =.\\.......... +ConsLayout =.\\\......... +ConsLayout =..\\\........ ConsLayout =...\\\||..... ConsLayout =....\\#|....< ConsLayout =.....\##..... ConsLayout =......##\.... ConsLayout =......|#\\... ConsLayout =......||\\\.. -ConsLayout =......||.\\\. -ConsLayout =......||..\\. -ConsLayout =......||..... -ConsLayout =......||..... +ConsLayout =.........\\\. +ConsLayout =..........\\. +ConsLayout =............. +ConsLayout =............. ConsLayout =......^...... AutoTileBase = 0x0C003010 @@ -582,10 +582,10 @@ CheckType = U - groundhighway:0x03010000 check CheckType = V - groundhighway:0x03000001, 0xFF0000FF check CheckType = W - groundhighway:0x00000301 check -ConsLayout =\\XXX// +ConsLayout =\\X.X// ConsLayout =\\\X/// ConsLayout =X\\#//X -ConsLayout =.X###XX< +ConsLayout =.X###X.< ConsLayout =.XX#\\X ConsLayout =..XX\\\ ConsLayout =....X\\ @@ -698,10 +698,10 @@ CheckType = U - highway:0x03010000 check CheckType = V - highway:0x03000001, 0xFF0000FF check CheckType = W - highway:0x00000301 check -ConsLayout =\\XXX// +ConsLayout =\\X.X// ConsLayout =\\\X/// ConsLayout =X\\#//X -ConsLayout =.X###XX< +ConsLayout =.X###X.< ConsLayout =.XX#\\X ConsLayout =..XX\\\ ConsLayout =....X\\ diff --git a/Controller/RUL0/4000_RAM/4600_L2DTR.txt b/Controller/RUL0/4000_RAM/4600_L2DTR.txt index ac1154b07..827fcd6d6 100644 --- a/Controller/RUL0/4000_RAM/4600_L2DTR.txt +++ b/Controller/RUL0/4000_RAM/4600_L2DTR.txt @@ -578,7 +578,7 @@ CheckType = a - rail: 0x02000200 ConsLayout =.......... ConsLayout =...--....< ConsLayout =...---.... -CellLayout =.......... +ConsLayout =.......... ConsLayout =...^...... AutoTileBase = 0x53d7EB3A diff --git a/Controller/RUL0/5000_RHW/5050_Fillers.txt b/Controller/RUL0/5000_RHW/5050_Fillers.txt index 794106b3c..9e55af47f 100644 --- a/Controller/RUL0/5000_RHW/5050_Fillers.txt +++ b/Controller/RUL0/5000_RHW/5050_Fillers.txt @@ -378,7 +378,7 @@ CheckType = c - dirtroad: 0x02000200 ConsLayout = ....... ConsLayout = ....... ConsLayout = ...||<. -ConsLayout = =...^.. +ConsLayout = ....^.. AutoTileBase= 0x57F05300 ReplacementIntersection = 0, 0 diff --git a/Controller/RUL0/5000_RHW/5100_Ramps_SpecialCrossings.txt b/Controller/RUL0/5000_RHW/5100_Ramps_SpecialCrossings.txt index 217176d7e..b31b603a6 100644 --- a/Controller/RUL0/5000_RHW/5100_Ramps_SpecialCrossings.txt +++ b/Controller/RUL0/5000_RHW/5100_Ramps_SpecialCrossings.txt @@ -1532,8 +1532,8 @@ CheckType = g - dirtroad: 0x00000301 ConsLayout =......... ConsLayout =....|.... -ConsLayout =....|.... ConsLayout =....|...< +ConsLayout =....|.... ConsLayout =.../|.... ConsLayout =.../|.... ConsLayout =....^.... @@ -1643,9 +1643,9 @@ CheckType = j - dirtroad: 0x01030000 Lightrail: 0x03030000, 0xffffffff optional ConsLayout =......... ConsLayout =....|.... -ConsLayout =.../|\... ConsLayout =.../|\..< ConsLayout =.../|\... +ConsLayout =.../|\... ConsLayout =..-/|\... ConsLayout =....^.... @@ -1711,8 +1711,8 @@ CheckType = f - dirtroad: 0x03000001 Lightrail: 0x01000001, 0xffffffff optional ConsLayout =......... ConsLayout =....|.... -ConsLayout =.../|...< ConsLayout =.../|.... +ConsLayout =.../|...< ConsLayout =..-/|.... ConsLayout =....^.... @@ -3120,7 +3120,7 @@ ConsLayout =....||... ConsLayout =....||..< ConsLayout =....||... ConsLayout =.../||... -ConsLayout =..//||... +ConsLayout =..//.|... ConsLayout =.....^... AutoTileBase= 0x5cec2400 @@ -3164,7 +3164,7 @@ ConsLayout =..||..... ConsLayout =..||....< ConsLayout =..||..... ConsLayout =..||\.... -ConsLayout =..||\\... +ConsLayout =..|.\\... ConsLayout =..^...... AutoTileBase= 0x5cec2700 @@ -3328,9 +3328,9 @@ CheckType = f - dirtroad: 0x03000001 Lightrail: 0x01000001, 0xffffffff optional ConsLayout =......... ConsLayout =......... -ConsLayout =.../|.... ConsLayout =.../|...< ConsLayout =.../|.... +ConsLayout =.../|.... ConsLayout =.../..... ConsLayout =....^.... @@ -6278,13 +6278,13 @@ ConsLayout =..|.... ConsLayout =....... ConsLayout =...^... -ConsLayout =....... -ConsLayout =....... -ConsLayout =..|\<.. -ConsLayout =..|\... -ConsLayout =...|... -ConsLayout =....... -ConsLayout =..^.... +;ConsLayout =....... +;ConsLayout =....... +;ConsLayout =..|\<.. +;ConsLayout =..|\... +;ConsLayout =...|... +;ConsLayout =....... +;ConsLayout =..^.... AutoTileBase= 0x5cebF200 ReplacementIntersection = 0, 0 diff --git a/Controller/RUL0/5000_RHW/5700_QuickChange.txt b/Controller/RUL0/5000_RHW/5700_QuickChange.txt index 1d71073d8..543b7cde7 100644 --- a/Controller/RUL0/5000_RHW/5700_QuickChange.txt +++ b/Controller/RUL0/5000_RHW/5700_QuickChange.txt @@ -115,7 +115,7 @@ ConsLayout =....... ConsLayout =....... ConsLayout =....... ConsLayout =....... -ConsLayout =..^.... +ConsLayout =...^... AutoTileBase= 0x55387000 ReplacementIntersection = 0, 0 @@ -235,7 +235,7 @@ ConsLayout =....... ConsLayout =....... ConsLayout =....... ConsLayout =....... -ConsLayout =..^.... +ConsLayout =...^... AutoTileBase= 0x55387000 ReplacementIntersection = 0, 0 diff --git a/Controller/RUL0/5000_RHW/5F00_FARHW/5F20_FARHW_Curves.txt b/Controller/RUL0/5000_RHW/5F00_FARHW/5F20_FARHW_Curves.txt index 4a2d80faf..840a3dbc5 100644 --- a/Controller/RUL0/5000_RHW/5F00_FARHW/5F20_FARHW_Curves.txt +++ b/Controller/RUL0/5000_RHW/5F00_FARHW/5F20_FARHW_Curves.txt @@ -548,7 +548,7 @@ CheckType = c - dirtroad: 0x00000002 ConsLayout =............ ConsLayout =...-----...< ConsLayout =....----.... -ConsLayout =....^....... +ConsLayout =...^........ AutoTileBase= 0x5e150000 ReplacementIntersection = 0, 0 @@ -602,7 +602,7 @@ ConsLayout =............ ConsLayout =............ ConsLayout =...-----...< ConsLayout =.....---.... -ConsLayout =....^....... +ConsLayout =...^........ AutoTileBase= 0x5e150030 ReplacementIntersection = 0, 0 @@ -874,7 +874,7 @@ CheckType = c - dirtroad: 0x00000002 ConsLayout =............ ConsLayout =...-----...< ConsLayout =.....---.... -ConsLayout =....^....... +ConsLayout =...^........ AutoTileBase = 0x5e1a0300 ReplacementIntersection = 0, 0 @@ -926,7 +926,7 @@ CheckType = c - dirtroad: 0x00000002 ConsLayout =............ ConsLayout =...-----...< ConsLayout =.....---.... -ConsLayout =....^....... +ConsLayout =...^........ AutoTileBase = 0x5e1a0320 ReplacementIntersection = 0, 0 diff --git a/Controller/RUL0/5000_RHW/5F00_FARHW/5F90_FARHW_Ramps.txt b/Controller/RUL0/5000_RHW/5F00_FARHW/5F90_FARHW_Ramps.txt index 66d85ee0c..0bb107034 100644 --- a/Controller/RUL0/5000_RHW/5F00_FARHW/5F90_FARHW_Ramps.txt +++ b/Controller/RUL0/5000_RHW/5F00_FARHW/5F90_FARHW_Ramps.txt @@ -119,7 +119,7 @@ ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5e131200 ReplacementIntersection = 0, 0 @@ -205,7 +205,7 @@ ConsLayout =....|+....< ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5e131600 ReplacementIntersection = 0, 0 @@ -295,7 +295,7 @@ ConsLayout =....|+....< ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5e131a00 ReplacementIntersection = 0, 0 @@ -389,7 +389,7 @@ ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5e131a80 ReplacementIntersection = 0, 0 @@ -1259,7 +1259,7 @@ ConsLayout =......... ConsLayout =..-\\.... ConsLayout =...-\\..< ConsLayout =.....\... -ConsLayout =..^...... +ConsLayout =...^..... AutoTileBase = 0x5e131830 ReplacementIntersection = 0, 0 @@ -1511,7 +1511,7 @@ ConsLayout =......... ConsLayout =..-\\.... ConsLayout =...-\\..< ConsLayout =.....\... -ConsLayout =..^...... +ConsLayout =...^..... AutoTileBase = 0x5e151840 ReplacementIntersection = 0, 0 @@ -1678,7 +1678,7 @@ ConsLayout =....|+....< ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5e171e00 ReplacementIntersection = 0, 0 @@ -2198,7 +2198,7 @@ ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5e131e00 ReplacementIntersection = 0, 0 @@ -2375,7 +2375,7 @@ ConsLayout =....|+....< ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5CE40600 ReplacementIntersection = 0, 0 diff --git a/Controller/RUL0/7000_Road_NWM/7600_FARPieces.txt b/Controller/RUL0/7000_Road_NWM/7600_FARPieces.txt index e2a152229..83eb42d1a 100644 --- a/Controller/RUL0/7000_Road_NWM/7600_FARPieces.txt +++ b/Controller/RUL0/7000_Road_NWM/7600_FARPieces.txt @@ -119,8 +119,8 @@ CheckType = d - road: 0x00020000 ConsLayout =.............. ConsLayout =.....----....< -ConsLayout =.......\\\\... -ConsLayout =........|||... +ConsLayout =.......\\\.... +ConsLayout =........||.... ConsLayout =......^....... AutoTileBase= 0x50463700 @@ -257,10 +257,10 @@ CheckType = d - rail: 0x00000200, 0x0000ff00 check CheckType = e - road: 0x00000002 ConsLayout =......... -CellLayout =......... +ConsLayout =......... ConsLayout =...-|-..< ConsLayout =...-|-... -CellLayout =......... +ConsLayout =......... ConsLayout =...^..... AutoTileBase= 0x50465000 @@ -605,7 +605,7 @@ CheckType = d - road: 0x00000200 ConsLayout =......... ConsLayout =...---..< ConsLayout =...---... -CellLayout =...||.... +ConsLayout =...||.... ConsLayout =...^..... AutoTileBase= 0x5046A000 @@ -818,8 +818,8 @@ CheckType = d - onewayroad: 0x00020000 ConsLayout =.............. ConsLayout =.....----....< -ConsLayout =.......\\\\... -ConsLayout =........|||... +ConsLayout =.......\\\.... +ConsLayout =........||.... ConsLayout =......^....... AutoTileBase= 0x59463700 diff --git a/Controller/RUL0/7000_Road_NWM/7A00_NWM/7A00_URoad.txt b/Controller/RUL0/7000_Road_NWM/7A00_NWM/7A00_URoad.txt index e22068981..66dfd7cf1 100644 --- a/Controller/RUL0/7000_Road_NWM/7A00_NWM/7A00_URoad.txt +++ b/Controller/RUL0/7000_Road_NWM/7A00_NWM/7A00_URoad.txt @@ -1322,9 +1322,9 @@ CheckType = b - lightrail: 0x00000002 groundhighway: 0x03010301 CheckType = c - lightrail: 0x00000002 groundhighway: 0x00000301 ConsLayout =......... -ConsLayout =..../.... ConsLayout =..../...< ConsLayout =..../.... +ConsLayout =..../.... ConsLayout =....^.... AutoTileBase= 0x53e65600 diff --git a/Controller/RUL0/7000_Road_NWM/7A00_NWM/7B50_Transitions.txt b/Controller/RUL0/7000_Road_NWM/7A00_NWM/7B50_Transitions.txt index 6a45055c4..d7b08df58 100644 --- a/Controller/RUL0/7000_Road_NWM/7A00_NWM/7B50_Transitions.txt +++ b/Controller/RUL0/7000_Road_NWM/7A00_NWM/7B50_Transitions.txt @@ -2102,7 +2102,7 @@ ConsLayout =...... ConsLayout =...... ConsLayout =..--.< ConsLayout =..--.. -ConsLayout =..--.. +ConsLayout =..-... ConsLayout =...... ConsLayout =..^... diff --git a/Controller/RUL0/9000_Avenue/9100_L1Viaducts.txt b/Controller/RUL0/9000_Avenue/9100_L1Viaducts.txt index 2f0e956d4..6c24c1ba3 100644 --- a/Controller/RUL0/9000_Avenue/9100_L1Viaducts.txt +++ b/Controller/RUL0/9000_Avenue/9100_L1Viaducts.txt @@ -2417,8 +2417,8 @@ CheckType = c - avenue: 0x04020002 CheckType = d - avenue: 0x00020402 ConsLayout =....... -ConsLayout =..++... ConsLayout =..++..< +ConsLayout =..++... ConsLayout =....... ConsLayout =..^.... diff --git a/Controller/RUL0/9000_Avenue/9200_L2Viaducts.txt b/Controller/RUL0/9000_Avenue/9200_L2Viaducts.txt index 432e32e15..ff319bfa0 100644 --- a/Controller/RUL0/9000_Avenue/9200_L2Viaducts.txt +++ b/Controller/RUL0/9000_Avenue/9200_L2Viaducts.txt @@ -2637,8 +2637,8 @@ CheckType = c - avenue: 0x04020002 CheckType = d - avenue: 0x00020402 ConsLayout =....... -ConsLayout =..++... ConsLayout =..++..< +ConsLayout =..++... ConsLayout =....... ConsLayout =..^.... diff --git a/Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt b/Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt index f810667aa..755c5f909 100644 --- a/Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt +++ b/Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt @@ -988,7 +988,7 @@ CheckType = t - lightrail: 0x02000002 ConsLayout =....... ConsLayout =....... -ConsLayout =..|-..< +ConsLayout =..|...< ConsLayout =..-|... ConsLayout =....... ConsLayout =..^.... diff --git a/Controller/RUL0/9000_Avenue/9900_AvenuexRHW.txt b/Controller/RUL0/9000_Avenue/9900_AvenuexRHW.txt index 3b7779032..79e730e85 100644 --- a/Controller/RUL0/9000_Avenue/9900_AvenuexRHW.txt +++ b/Controller/RUL0/9000_Avenue/9900_AvenuexRHW.txt @@ -993,7 +993,7 @@ ConsLayout =....|+....< ConsLayout =....|+..... ConsLayout =.....+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5CE40E00 ReplacementIntersection = 0, 0 @@ -1092,7 +1092,7 @@ ConsLayout =....|+....< ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =........... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5CE40600 ReplacementIntersection = 0, 0 @@ -1196,7 +1196,7 @@ ConsLayout =....|+....< ConsLayout =....|+..... ConsLayout =....|+..... ConsLayout =.....+..... -ConsLayout =.....^..... +ConsLayout =....^...... AutoTileBase = 0x5CE40A00 ReplacementIntersection = 0, 0 diff --git a/Controller/RUL0/A000_Rail/A358_WideRadiusCurves.txt b/Controller/RUL0/A000_Rail/A358_WideRadiusCurves.txt index c26c0ddcd..14fbb9b3a 100644 --- a/Controller/RUL0/A000_Rail/A358_WideRadiusCurves.txt +++ b/Controller/RUL0/A000_Rail/A358_WideRadiusCurves.txt @@ -476,7 +476,7 @@ CheckType = z - rail: 0x02000000, 0xff000000 check ConsLayout =........ ConsLayout =...|...< -ConsLayout =...|.t... +ConsLayout =...|.... ConsLayout =...|\... ConsLayout =....\... ConsLayout =....\\.. diff --git a/Controller/RUL0/A000_Rail/A368_FARR.txt b/Controller/RUL0/A000_Rail/A368_FARR.txt index 3a297c82e..5c9b24ddf 100644 --- a/Controller/RUL0/A000_Rail/A368_FARR.txt +++ b/Controller/RUL0/A000_Rail/A368_FARR.txt @@ -93,15 +93,15 @@ CheckType = a - rail: 0x00020000,0x00ff0000 check CheckType = b - rail: 0x00020002 CheckType = c - rail: 0x00000002 -ConsLayout =............ -ConsLayout =..-\\......< -ConsLayout =....\\\..... -ConsLayout =......\\.... -ConsLayout =.......\\... -ConsLayout =.........\.. -ConsLayout =.........||. -ConsLayout =..........|. -ConsLayout =.^.......... +ConsLayout =........... +ConsLayout =..-\\.....< +ConsLayout =....\\\.... +ConsLayout =......\\... +ConsLayout =.......\\.. +ConsLayout =........\.. +ConsLayout =........||. +ConsLayout =.........|. +ConsLayout =.^......... AutoTileBase= 0x53135100 ReplacementIntersection = 0, 0 @@ -201,10 +201,10 @@ CheckType = d - road: 0x00000200, 0x0000ff00 check CheckType = e - rail: 0x00000002 ConsLayout =......... -CellLayout =......... -ConsLayout =....|-..< -ConsLayout =...-|.... -CellLayout =......... +ConsLayout =......... +ConsLayout =...-|...< +ConsLayout =....|-... +ConsLayout =......... ConsLayout =...^..... AutoTileBase= 0x53140000 diff --git a/Controller/RUL0/B000_Lightrail/B420_TramInAvenue.txt b/Controller/RUL0/B000_Lightrail/B420_TramInAvenue.txt index 090a8a61c..4dd57d923 100644 --- a/Controller/RUL0/B000_Lightrail/B420_TramInAvenue.txt +++ b/Controller/RUL0/B000_Lightrail/B420_TramInAvenue.txt @@ -2114,8 +2114,8 @@ ConsLayout = ...... ConsLayout = ...... ConsLayout = .++++. ConsLayout = .++.+. +ConsLayout = ....+. ConsLayout = ...++. -ConsLayout = ...+.. ConsLayout = .+++.< ConsLayout = .^.... @@ -2167,8 +2167,8 @@ CheckType = c - lightrail:0x00000000 ConsLayout = ...... ConsLayout = .++++. ConsLayout = .++.+. +ConsLayout = ....+. ConsLayout = ...++. -ConsLayout = ...+.. ConsLayout = .+++.< ConsLayout = .^.... diff --git a/Controller/RUL0/B000_Lightrail/B900_HighElRail.txt b/Controller/RUL0/B000_Lightrail/B900_HighElRail.txt index 69787b72b..30983fc16 100644 --- a/Controller/RUL0/B000_Lightrail/B900_HighElRail.txt +++ b/Controller/RUL0/B000_Lightrail/B900_HighElRail.txt @@ -610,7 +610,7 @@ CellLayout =.^.. CheckType = Z - lightrail: 0x02000200 road: 0x00020002 -ConsLayout =.,.. +ConsLayout =.... ConsLayout =.+.< ConsLayout =.^.. diff --git a/Controller/RUL0/B000_Lightrail/BA00_TramInRoad.txt b/Controller/RUL0/B000_Lightrail/BA00_TramInRoad.txt index 506210f8b..8d5602ce7 100644 --- a/Controller/RUL0/B000_Lightrail/BA00_TramInRoad.txt +++ b/Controller/RUL0/B000_Lightrail/BA00_TramInRoad.txt @@ -3117,8 +3117,8 @@ CellLayout = .^.. CheckType = a - lightrail: 0x00000000 road: 0x02000002 ConsLayout = ... +ConsLayout = .+< ConsLayout = .+. -ConsLayout = .+.< ConsLayout = .+. ConsLayout = .+. ConsLayout = .^. diff --git a/Controller/RUL0/B000_Lightrail/BBA0_TramOnRoad.txt b/Controller/RUL0/B000_Lightrail/BBA0_TramOnRoad.txt index b4635e587..db355e5ae 100644 --- a/Controller/RUL0/B000_Lightrail/BBA0_TramOnRoad.txt +++ b/Controller/RUL0/B000_Lightrail/BBA0_TramOnRoad.txt @@ -308,8 +308,8 @@ ConsLayout = ...... ConsLayout = ...... ConsLayout = .++++. ConsLayout = .++.+. +ConsLayout = ....+. ConsLayout = ...++. -ConsLayout = ...+.. ConsLayout = .+++.< ConsLayout = .^.... @@ -361,8 +361,8 @@ CheckType = c - lightrail:0x00000000 ConsLayout = ...... ConsLayout = .++++. ConsLayout = .++.+. +ConsLayout = ....+. ConsLayout = ...++. -ConsLayout = ...+.. ConsLayout = .+++.< ConsLayout = .^.... diff --git a/Controller/RUL0/C000_Monorail/CA00_HybridRailway-Straights.txt b/Controller/RUL0/C000_Monorail/CA00_HybridRailway-Straights.txt index 30d7154c9..9d8cb1d81 100644 --- a/Controller/RUL0/C000_Monorail/CA00_HybridRailway-Straights.txt +++ b/Controller/RUL0/C000_Monorail/CA00_HybridRailway-Straights.txt @@ -160,7 +160,6 @@ ConsLayout = ...|.... ConsLayout = ...|.... ConsLayout = ...|.... ConsLayout = ...|.... -ConsLayout = ...|.... ConsLayout = ..^..... AutoTileBase = 0x55387000 diff --git a/Controller/RUL0/C000_Monorail/CB00_DualNetworking_Curves.txt b/Controller/RUL0/C000_Monorail/CB00_DualNetworking_Curves.txt index fd347df16..f20dec205 100644 --- a/Controller/RUL0/C000_Monorail/CB00_DualNetworking_Curves.txt +++ b/Controller/RUL0/C000_Monorail/CB00_DualNetworking_Curves.txt @@ -295,9 +295,9 @@ PreviewEffect = preview_mac_s_dn_5_2_001 CellLayout = .......... CellLayout = .abbc..... -CellLayout = ....dbbe.< +CellLayout = ....dbbe.. CellLayout = ......Z..< -CellLayout = ..^...^... +CellLayout = ......^... ;senw CheckType = Z - rail:0x00000000 diff --git a/Controller/RUL0/C000_Monorail/CE00_HybridRailway_L1_Pieces.txt b/Controller/RUL0/C000_Monorail/CE00_HybridRailway_L1_Pieces.txt index 3cea31a24..0593be0f9 100644 --- a/Controller/RUL0/C000_Monorail/CE00_HybridRailway_L1_Pieces.txt +++ b/Controller/RUL0/C000_Monorail/CE00_HybridRailway_L1_Pieces.txt @@ -926,8 +926,8 @@ CheckType = c - monorail: 0x00000000 rail: 0x00000000 CheckType = d - monorail: 0x04000000 rail: 0x03000000, 0x00000000 optional ConsLayout = ..... -ConsLayout = ..+/. -ConsLayout = ./+.< +ConsLayout = ..+/< +ConsLayout = ./+.. ConsLayout = ..^.. ;AutoTileBase = 0x534b6800 diff --git a/Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt b/Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt index 6e0f10149..a7c976407 100644 --- a/Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt +++ b/Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt @@ -638,7 +638,7 @@ CheckType = E - groundhighway: 0x02040200 optional CheckType = F - groundhighway: 0x00040200, 0x00FFFFFF optional ConsLayout = ...... -ConsLayout = ..++... +ConsLayout = ..+.... ConsLayout = ..++.< ConsLayout = ...++. ConsLayout = ....+. diff --git a/Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt b/Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt index 609924ee8..004348212 100644 --- a/Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt +++ b/Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt @@ -365,8 +365,8 @@ ConsLayout =.......||........ ConsLayout =......X||X....... ConsLayout =....XXX||XXX..... ConsLayout =...XXXX||XXXX.... -ConsLayout =...XX..||..XX.... -ConsLayout =..XXX..||..XXX..< +ConsLayout =...XX..||..XX...< +ConsLayout =..XXX..||..XXX... ConsLayout =-------##-------. ConsLayout =-------##-------. ConsLayout =.......||........ @@ -777,13 +777,13 @@ CheckType = k - groundhighway:0x00000103,0x0000ffff check CheckType = W - groundhighway:0x04020102 CheckType = Z - groundhighway:0x01020402 -ConsLayout =....\\......... -ConsLayout =....\\\........ -ConsLayout =-----##-------< -ConsLayout =-------##-----. -ConsLayout =.......\\\..... -ConsLayout =........\\..... -ConsLayout =......^........ +ConsLayout =...\\........ +ConsLayout =...\\\....... +ConsLayout =----##------< +ConsLayout =------##----. +ConsLayout =......\\\.... +ConsLayout =.......\\.... +ConsLayout =......^...... AutoTileBase = 0x5A0C9FF0 Costs = 500 @@ -1071,8 +1071,7 @@ Checktype = j - groundhighway:0x02040202 Checktype = k - groundhighway:0x02040200 Checktype = l - groundhighway:0x02000204 -;ConsLayout =.........// -ConsLayout =.......XXX/ +ConsLayout =.......XXX. ConsLayout =...||XXXXX. ConsLayout =..X||XXXX.. ConsLayout =.XX||.XXX.. @@ -1084,7 +1083,6 @@ ConsLayout =..X||X..... ConsLayout =..X||X..... ConsLayout =..X||X..... ConsLayout =..X||X..... -ConsLayout =..X||X..... ConsLayout =...||...... ConsLayout =...||...... ConsLayout =...^....... @@ -1181,8 +1179,8 @@ ConsLayout =.\\\XXXXXXXXXX///. ConsLayout =..\\XXXXXXXXXX//.. ConsLayout =..XXX.XXXXX..XXX.. ConsLayout =...XXXXXXXXXXXX... -ConsLayout =....XXXXXXXXXX...< ConsLayout =....XXXXXXXXXX.... +ConsLayout =....XXXXXXXXXX...< ConsLayout =.....XXXXXXXX..... ConsLayout =......XXXXXX...... ConsLayout =......XX||XX...... diff --git a/Controller/RUL0/F000_Special/F210_AdvancedBridges.txt b/Controller/RUL0/F000_Special/F210_AdvancedBridges.txt index e4e32356c..4c9a39eca 100644 --- a/Controller/RUL0/F000_Special/F210_AdvancedBridges.txt +++ b/Controller/RUL0/F000_Special/F210_AdvancedBridges.txt @@ -25,7 +25,7 @@ CheckType = a - monorail: 0x01010000 rail: 0x02000200, 0xffffffff optional ConsLayout = ..X.. ConsLayout = ..#.< -ConsLayout = ..#.. +ConsLayout = ..... ConsLayout = ..^.. AutoTileBase = 0x55387000 @@ -66,7 +66,7 @@ CheckType = a - monorail: 0x03030000 rail: 0x02000200, 0xffffffff optional ConsLayout = ..X.. ConsLayout = ..#.< -ConsLayout = ..#.. +ConsLayout = ..... ConsLayout = ..^.. AutoTileBase = 0x55387000 @@ -107,7 +107,7 @@ CheckType = a - monorail: 0x03010000 rail: 0x02000200, 0xffffffff optional ConsLayout = ..X.. ConsLayout = ..#.< -ConsLayout = ..#.. +ConsLayout = ..... ConsLayout = ..^.. AutoTileBase = 0x55387000 diff --git a/Lite Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt b/Lite Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt index 0bcdc0523..96f31bbf1 100644 --- a/Lite Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt +++ b/Lite Controller/RUL0/1000_2000_3000_MaxisContent/2000_T-Intersections.txt @@ -93,18 +93,18 @@ CheckType = Y - highway:0x03020201 CheckType = Z - highway:0x01030202 ConsLayout =.............. -ConsLayout =.\\........//. -ConsLayout =.\\\......///. -ConsLayout =..\\\....///.. -ConsLayout =...\\\..///... -ConsLayout =....\\\///.... +ConsLayout =.\\........... +ConsLayout =.\\\.......... +ConsLayout =..\\\......... +ConsLayout =...\\\........ +ConsLayout =....\\\//..... ConsLayout =.....\##/....< ConsLayout =...../##\..... -ConsLayout =....///\\\.... -ConsLayout =...///..\\\... -ConsLayout =..///....\\\.. -ConsLayout =.///......\\\. -ConsLayout =.//........\\. +ConsLayout =.....//\\\.... +ConsLayout =........\\\... +ConsLayout =.........\\\.. +ConsLayout =..........\\\. +ConsLayout =...........\\. ConsLayout =......^....... AutoTileBase = 0x0C001000 @@ -154,17 +154,17 @@ CheckType = D - highway:0x01000302 CheckType = E - highway:0x00030201 ConsLayout =............. -ConsLayout =.\\.......//. -ConsLayout =.\\\.....///. -ConsLayout =..\\\...///.. -ConsLayout =...\\\.///... +ConsLayout =.\\.......... +ConsLayout =.\\\......... +ConsLayout =..\\\........ +ConsLayout =...\\\.//.... ConsLayout =....\\#//.... ConsLayout =.....###....< ConsLayout =....//#\\.... -ConsLayout =...///.\\\... -ConsLayout =..///...\\\.. -ConsLayout =.///.....\\\. -ConsLayout =.//.......\\. +ConsLayout =....//.\\\... +ConsLayout =........\\\.. +ConsLayout =.........\\\. +ConsLayout =..........\\. ConsLayout =......^...... AutoTileBase = 0x0C002000 @@ -216,20 +216,20 @@ CheckType = A - highway:0x02040203 CheckType = B - highway:0x02030204 ConsLayout =............. -ConsLayout =......||..... -ConsLayout =.\\...||..... -ConsLayout =.\\\..||..... -ConsLayout =..\\\.||..... +ConsLayout =............. +ConsLayout =.\\.......... +ConsLayout =.\\\......... +ConsLayout =..\\\........ ConsLayout =...\\\||..... ConsLayout =....\\#|....< ConsLayout =.....\##..... ConsLayout =......##\.... ConsLayout =......|#\\... ConsLayout =......||\\\.. -ConsLayout =......||.\\\. -ConsLayout =......||..\\. -ConsLayout =......||..... -ConsLayout =......||..... +ConsLayout =.........\\\. +ConsLayout =..........\\. +ConsLayout =............. +ConsLayout =............. ConsLayout =......^...... AutoTileBase = 0x0C003010 @@ -582,10 +582,10 @@ CheckType = U - groundhighway:0x03010000 check CheckType = V - groundhighway:0x03000001, 0xFF0000FF check CheckType = W - groundhighway:0x00000301 check -ConsLayout =\\XXX// +ConsLayout =\\X.X// ConsLayout =\\\X/// ConsLayout =X\\#//X -ConsLayout =.X###XX< +ConsLayout =.X###X.< ConsLayout =.XX#\\X ConsLayout =..XX\\\ ConsLayout =....X\\ @@ -698,10 +698,10 @@ CheckType = U - highway:0x03010000 check CheckType = V - highway:0x03000001, 0xFF0000FF check CheckType = W - highway:0x00000301 check -ConsLayout =\\XXX// +ConsLayout =\\X.X// ConsLayout =\\\X/// ConsLayout =X\\#//X -ConsLayout =.X###XX< +ConsLayout =.X###X.< ConsLayout =.XX#\\X ConsLayout =..XX\\\ ConsLayout =....X\\ diff --git a/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt b/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt index 02ec5bfe4..630c6bf48 100644 --- a/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt +++ b/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt @@ -988,7 +988,7 @@ CheckType = t - lightrail: 0x02000002 ConsLayout =....... ConsLayout =....... -ConsLayout =..|-..< +ConsLayout =..|...< ConsLayout =..-|... ConsLayout =....... ConsLayout =..^.... diff --git a/Lite Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt b/Lite Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt index 6e0f10149..a7c976407 100644 --- a/Lite Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt +++ b/Lite Controller/RUL0/D000_E000_Highway/E410_ParallelRamps.txt @@ -638,7 +638,7 @@ CheckType = E - groundhighway: 0x02040200 optional CheckType = F - groundhighway: 0x00040200, 0x00FFFFFF optional ConsLayout = ...... -ConsLayout = ..++... +ConsLayout = ..+.... ConsLayout = ..++.< ConsLayout = ...++. ConsLayout = ....+. diff --git a/Lite Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt b/Lite Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt index 609924ee8..72f463259 100644 --- a/Lite Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt +++ b/Lite Controller/RUL0/D000_E000_Highway/E8A0_CustomInterchanges.txt @@ -365,8 +365,8 @@ ConsLayout =.......||........ ConsLayout =......X||X....... ConsLayout =....XXX||XXX..... ConsLayout =...XXXX||XXXX.... -ConsLayout =...XX..||..XX.... -ConsLayout =..XXX..||..XXX..< +ConsLayout =...XX..||..XX...< +ConsLayout =..XXX..||..XXX... ConsLayout =-------##-------. ConsLayout =-------##-------. ConsLayout =.......||........ @@ -777,13 +777,13 @@ CheckType = k - groundhighway:0x00000103,0x0000ffff check CheckType = W - groundhighway:0x04020102 CheckType = Z - groundhighway:0x01020402 -ConsLayout =....\\......... -ConsLayout =....\\\........ -ConsLayout =-----##-------< -ConsLayout =-------##-----. -ConsLayout =.......\\\..... -ConsLayout =........\\..... -ConsLayout =......^........ +ConsLayout =...\\........ +ConsLayout =...\\\....... +ConsLayout =----##------< +ConsLayout =------##----. +ConsLayout =......\\\.... +ConsLayout =.......\\.... +ConsLayout =......^...... AutoTileBase = 0x5A0C9FF0 Costs = 500 @@ -1084,7 +1084,6 @@ ConsLayout =..X||X..... ConsLayout =..X||X..... ConsLayout =..X||X..... ConsLayout =..X||X..... -ConsLayout =..X||X..... ConsLayout =...||...... ConsLayout =...||...... ConsLayout =...^....... @@ -1181,8 +1180,8 @@ ConsLayout =.\\\XXXXXXXXXX///. ConsLayout =..\\XXXXXXXXXX//.. ConsLayout =..XXX.XXXXX..XXX.. ConsLayout =...XXXXXXXXXXXX... -ConsLayout =....XXXXXXXXXX...< ConsLayout =....XXXXXXXXXX.... +ConsLayout =....XXXXXXXXXX...< ConsLayout =.....XXXXXXXX..... ConsLayout =......XXXXXX...... ConsLayout =......XX||XX...... diff --git a/src/scripts/syntax-check-rul0.py b/src/scripts/syntax-check-rul0.py new file mode 100755 index 000000000..b14570f90 --- /dev/null +++ b/src/scripts/syntax-check-rul0.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 +# +# This script checks all the RUL0 files for errors such as sinkhole bugs.. +# If any are found, they are printed to stdout and the script exits with a non-zero return code. + +import sys +import os +import itertools + +SRC_DIRS = [ + "Controller/RUL0", + "Lite Controller/RUL0", +] + + +def drop_comments(lines): + for line in lines: + idx = line.find(";") + yield line if idx == -1 else line[:idx] + + +# create mapping of (x,y)-cell to char +def parse_layout(lines): + layout = [line[(line.index("=")+1):].strip() for line in drop_comments(lines)] + origin_x = ([l.index("^") for l in layout if "^" in l] or [0])[0] + origin_y = ([i for i, l in enumerate(layout) if "<" in l] or [0])[0] + cells = {(j-origin_x, i-origin_y): char + for i, row in enumerate(layout) + for j, char in enumerate(row) + if char not in ".^<" + } + return cells + + +def check_cons_layout(cell_lines, cons_lines): + cell_layout = parse_layout(l for _, l in cell_lines) + cons_layout = parse_layout(l for _, l in cons_lines) + bad_cells = [xy for xy in cons_layout.keys() if xy not in cell_layout] + if bad_cells: + cell_layout_str = "".join(f" {line_no}: {line}" for line_no, line in cell_lines) + cons_layout_str = "".join(f" {line_no}: {line}" for line_no, line in cons_lines) + raise Exception(f"Potential sinkhole bug in ConsLayout at cells {" ".join(map(str, bad_cells))}:\n{cell_layout_str} ---\n{cons_layout_str}") + + +def scan_rul0_file(lines): + def relevant_lines(): + for line_no, line in enumerate(lines, 1): + line = line.lstrip() + if line.startswith(";###RHD###"): # TODO for simplicity, we ignore LHD for now + line = line[10:] + if line.startswith("CellLayout") or line.startswith("ConsLayout"): + yield line_no, line + + grouped = list((b, list(it)) for b, it in itertools.groupby(relevant_lines(), key=lambda tup: tup[1].startswith("ConsLayout"))) + if grouped and grouped[0][0]: + yield "Found no matching CellLayout for first ConsLayout in file" + elif grouped and not grouped[-1][0]: + yield "Found no matching ConsLayout for last CellLayout in file" + else: + for ((_, cell_lines), (_, cons_lines)) in itertools.batched(grouped, 2): + try: + check_cons_layout(cell_lines, cons_lines) + except Exception as err: + yield str(err) + + +def main() -> int: + validated = 0 + errors = 0 + for src_dir in SRC_DIRS: + for (parent, dirs, files) in os.walk(src_dir): + for fname in files: + if not fname.endswith(".rul") and not fname.endswith(".txt"): + continue + msgs = [] + p = os.path.join(parent, fname) + with open(p, encoding='utf-8') as f: + validated += 1 + msgs.extend(scan_rul0_file(f)) + if msgs: + errors += len(msgs) + print(f"===> {p}") + for msg in msgs: + print(msg) + if errors > 0: + print(f"Finished with {errors} errors in RUL0 files.") + return 1 + else: + print(f"Successfully validated {validated} RUL0 files.") + return 0 + + +if __name__ == '__main__': + sys.exit(main())