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/0000_TuLEPS_CanAM/0460_FlexTurnLanes.txt b/Controller/RUL0/0000_TuLEPS_CanAM/0460_FlexTurnLanes.txt index d22d5042c..ee4d0ba20 100644 --- a/Controller/RUL0/0000_TuLEPS_CanAM/0460_FlexTurnLanes.txt +++ b/Controller/RUL0/0000_TuLEPS_CanAM/0460_FlexTurnLanes.txt @@ -146,8 +146,8 @@ CheckType = a - road: 0x02000200 ;###LHD###CheckType = b - road: 0x02000200 street: 0x00000304, 0xffffffff optional ConsLayout=... -ConsLayout=... -ConsLayout=.+< +ConsLayout=.+. +ConsLayout=..< ConsLayout=.^. AutoTileBase= 0x55387000 @@ -3115,8 +3115,8 @@ CopyFrom = 0x304B6 ;CellLayout=..^... ;CheckType = a - road: 0x02000200 -;###RHD###CheckType = b - road: 0x02000200 onewayroad: 0x00000304, 0xffffffff optional -;###LHD###CheckType = b - road: 0x02000200 onewayroad: 0x00000104, 0xffffffff optional +;;###RHD###CheckType = b - road: 0x02000200 onewayroad: 0x00000304, 0xffffffff optional +;;###LHD###CheckType = b - road: 0x02000200 onewayroad: 0x00000104, 0xffffffff optional ;CheckType = c - road: 0x02000200 onewayroad: 0x04000003, 0xffffffff optional ;CheckType = d - road: 0x02000200 onewayroad: 0x00030400, 0xffffffff optional @@ -3476,13 +3476,16 @@ CheckType = r - avenue: 0x04040402 road: 0x02020200, 0xffffffff optional CheckType = s - avenue: 0x04000404 road: 0x02000202, 0xffffffff optional ConsLayout=........... -ConsLayout=........... -ConsLayout=........... +ConsLayout=....+...... +;###LHD###ConsLayout=........... +;###LHD###ConsLayout=........... +;###LHD###ConsLayout=........... ConsLayout=........... ConsLayout=..........< ConsLayout=........... -ConsLayout=........... -ConsLayout=........... +;###RHD###ConsLayout=........... +;###RHD###ConsLayout=........... +;###RHD###ConsLayout=........... ConsLayout=........... ConsLayout=....^...... @@ -3727,14 +3730,18 @@ CheckType = r - avenue: 0x04040402 road: 0x02020200, 0xffffffff optional CheckType = s - avenue: 0x04000404 road: 0x02000202, 0xffffffff optional ConsLayout=........... -ConsLayout=........... -ConsLayout=........... -ConsLayout=........... -ConsLayout=........... +ConsLayout=....+...... +;###LHD###ConsLayout=........... +;###LHD###ConsLayout=........... +;###LHD###ConsLayout=........... +;###LHD###ConsLayout=........... ConsLayout=........... ConsLayout=..........< ConsLayout=........... -ConsLayout=........... +;###RHD###ConsLayout=........... +;###RHD###ConsLayout=........... +;###RHD###ConsLayout=........... +;###RHD###ConsLayout=........... ConsLayout=........... ConsLayout=....^...... @@ -4097,9 +4104,9 @@ CellLayout=.....a...... CellLayout=.....jk..... CellLayout=.....fg..... CellLayout=.....fg..... -CellLayout=.XohhbchhoY. -CellLayout=.XnhhrshhqY< -CellLayout=.XphhedhhpY. +CellLayout=..ohhbchho.. +CellLayout=..nhhrshhq.< +CellLayout=..phhedhhp.. CellLayout=.....fg..... CellLayout=.....fg..... CellLayout=.....lm..... 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..c8250dbd6 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 @@ -146,7 +146,10 @@ CheckType = k - highway:0x00000103,0x0000ffff check CheckType = l - highway:0x00030100 check CheckType = m - highway:0x03010000 check CheckType = n - highway:0x03000001,0xff0000ff check +CheckType = o - highway:0x00000301 check +CheckType = p - highway:0x03010000 check CheckType = q - highway:0x00010300,0x00ffff00 check +CheckType = r - highway:0x00000301 check CheckType = A - highway:0x02010003 CheckType = B - highway:0x03020100 CheckType = C - highway:0x02020202 @@ -154,17 +157,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 +219,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 +585,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 +701,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\\ @@ -1106,9 +1109,9 @@ ConsLayout =.\\.......... ConsLayout =.\\\......... ConsLayout =..\\\........ ConsLayout =...\\\....... -ConsLayout =....\\#...... +ConsLayout =....\\#/..... ConsLayout =.....###....< -ConsLayout =......#\\.... +ConsLayout =...../#\\.... ConsLayout =.......\\\... ConsLayout =........\\\.. ConsLayout =.........\\\. diff --git a/Controller/RUL0/3400_Symphony/3400_PSRamps.txt b/Controller/RUL0/3400_Symphony/3400_PSRamps.txt index 361580408..4402b31f8 100644 --- a/Controller/RUL0/3400_Symphony/3400_PSRamps.txt +++ b/Controller/RUL0/3400_Symphony/3400_PSRamps.txt @@ -412,7 +412,7 @@ ConsLayout =....... ConsLayout =....... ConsLayout =../|..< ConsLayout =../|... -ConsLayout =..|.... +ConsLayout =..||... ConsLayout =....... ConsLayout =...^... @@ -459,7 +459,7 @@ ConsLayout =....... ConsLayout =....... ConsLayout =..|\<.. ConsLayout =..|\... -ConsLayout =...|... +ConsLayout =..||... ConsLayout =....... ConsLayout =..^.... @@ -505,7 +505,7 @@ ConsLayout =....... ConsLayout =....... ConsLayout =../|..< ConsLayout =../|... -ConsLayout =..|.... +ConsLayout =..||... ConsLayout =....... ConsLayout =...^... @@ -550,7 +550,7 @@ ConsLayout =....... ConsLayout =....... ConsLayout =..|\<.. ConsLayout =..|\... -ConsLayout =...|... +ConsLayout =..||... ConsLayout =....... ConsLayout =..^.... diff --git a/Controller/RUL0/4000_RAM/4080_FARR-2-3.txt b/Controller/RUL0/4000_RAM/4080_FARR-2-3.txt index 5a908856e..80ccd282f 100644 --- a/Controller/RUL0/4000_RAM/4080_FARR-2-3.txt +++ b/Controller/RUL0/4000_RAM/4080_FARR-2-3.txt @@ -91,7 +91,7 @@ ConsLayout =..|..........< ConsLayout =..\\.......... ConsLayout =..\\.......... ConsLayout =..\\.......... -ConsLayout =...\.......... +ConsLayout =..\\.......... ConsLayout =.............. ConsLayout =..^........... diff --git a/Controller/RUL0/4000_RAM/4200_TTR.txt b/Controller/RUL0/4000_RAM/4200_TTR.txt index 68da765cb..1cc78bcc6 100644 --- a/Controller/RUL0/4000_RAM/4200_TTR.txt +++ b/Controller/RUL0/4000_RAM/4200_TTR.txt @@ -198,7 +198,7 @@ ConsLayout =..|..........< ConsLayout =..\\.......... ConsLayout =..\\.......... ConsLayout =..\\.......... -ConsLayout =...\.......... +ConsLayout =..\\.......... ConsLayout =.............. ConsLayout =..^........... diff --git a/Controller/RUL0/4000_RAM/4600_L2DTR.txt b/Controller/RUL0/4000_RAM/4600_L2DTR.txt index ac1154b07..f63686c9f 100644 --- a/Controller/RUL0/4000_RAM/4600_L2DTR.txt +++ b/Controller/RUL0/4000_RAM/4600_L2DTR.txt @@ -145,7 +145,7 @@ CheckType = z - rail: 0x00000002,0x00000000 check ConsLayout =.......... ConsLayout =...----..< -ConsLayout =.....--... +ConsLayout =....---... ConsLayout =.......... ConsLayout =....^..... @@ -578,7 +578,7 @@ CheckType = a - rail: 0x02000200 ConsLayout =.......... ConsLayout =...--....< ConsLayout =...---.... -CellLayout =.......... +ConsLayout =.......... ConsLayout =...^...... AutoTileBase = 0x53d7EB3A diff --git a/Controller/RUL0/5000_RHW/5000_Starters.txt b/Controller/RUL0/5000_RHW/5000_Starters.txt index b736db6ec..5f113a2c7 100644 --- a/Controller/RUL0/5000_RHW/5000_Starters.txt +++ b/Controller/RUL0/5000_RHW/5000_Starters.txt @@ -2032,7 +2032,7 @@ CellLayout =...^... CheckType = Z - dirtroad: 0x04040404 ConsLayout =....... -ConsLayout =......< +ConsLayout =...+..< ConsLayout =...^... AutoTileBase= 0x55387000 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/5080_NeighborConnectors.txt b/Controller/RUL0/5000_RHW/5080_NeighborConnectors.txt index d324c29fb..ae69183cd 100644 --- a/Controller/RUL0/5000_RHW/5080_NeighborConnectors.txt +++ b/Controller/RUL0/5000_RHW/5080_NeighborConnectors.txt @@ -37,7 +37,7 @@ CellLayout =...^... CheckType = Z - dirtroad: 0x00020002 ConsLayout =....... -ConsLayout =......< +ConsLayout =...+..< ConsLayout =....... ConsLayout =...^... @@ -560,7 +560,7 @@ CellLayout =...^... CheckType = Z - dirtroad: 0x00020002 ConsLayout =....... -ConsLayout =......< +ConsLayout =...+..< ConsLayout =....... ConsLayout =...^... diff --git a/Controller/RUL0/5000_RHW/5100_Ramps_SpecialCrossings.txt b/Controller/RUL0/5000_RHW/5100_Ramps_SpecialCrossings.txt index 217176d7e..2a1b2e711 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 =....^.... @@ -2830,9 +2830,9 @@ CheckType = f - dirtroad: 0x02000200 OneWayRoad: 0x01000001, 0xffffffff optional ConsLayout =....... ConsLayout =....... ConsLayout =..|.<.. -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/51F0_FlexRamps.txt b/Controller/RUL0/5000_RHW/51F0_FlexRamps.txt index a7a6e42ff..b800dfdf8 100644 --- a/Controller/RUL0/5000_RHW/51F0_FlexRamps.txt +++ b/Controller/RUL0/5000_RHW/51F0_FlexRamps.txt @@ -55,7 +55,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =....... ;ConsLayout =....... -ConsLayout =...|<.. +ConsLayout =..+|<.. ConsLayout =..||... ConsLayout =..||... ;ConsLayout =....... @@ -110,7 +110,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =....... ConsLayout =...\... -ConsLayout =...\\.< +ConsLayout =..+\\.< ConsLayout =...|... ConsLayout =....... ConsLayout =..^.... @@ -224,7 +224,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =...\... -ConsLayout =...\\.< +ConsLayout =..+\\.< ConsLayout =...|... ConsLayout =...\\.. ConsLayout =..^.... @@ -454,7 +454,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =...\... -ConsLayout =...\\.< +ConsLayout =..+\\.< ConsLayout =...|... ConsLayout =...\\.. ConsLayout =..^.... @@ -510,7 +510,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =....... ConsLayout =...\... -ConsLayout =...\\.< +ConsLayout =..+\\.< ConsLayout =...|... ConsLayout =....... ConsLayout =..^.... @@ -580,7 +580,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =...\... -ConsLayout =...\\.< +ConsLayout =..+\\.< ConsLayout =...|... ConsLayout =...\\.. ConsLayout =..^.... @@ -975,7 +975,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ;ConsLayout =....... -ConsLayout =...|<.. +ConsLayout =..+|<.. ConsLayout =..||... ConsLayout =..||... ;ConsLayout =....... @@ -1126,7 +1126,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ;ConsLayout =....... -ConsLayout =...|<.. +ConsLayout =..+|<.. ConsLayout =..||... ConsLayout =..||... ;ConsLayout =....... @@ -1685,7 +1685,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =....... -ConsLayout =...|<.. +ConsLayout =..+|<.. ConsLayout =..||... ConsLayout =..||... ConsLayout =....... @@ -1761,7 +1761,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... ConsLayout =....... -ConsLayout =...|<.. +ConsLayout =..+|<.. ConsLayout =....... ConsLayout =....... ConsLayout =....... diff --git a/Controller/RUL0/5000_RHW/5200_Curves.txt b/Controller/RUL0/5000_RHW/5200_Curves.txt index f0c4fa82e..77c9d85ff 100644 --- a/Controller/RUL0/5000_RHW/5200_Curves.txt +++ b/Controller/RUL0/5000_RHW/5200_Curves.txt @@ -2748,7 +2748,7 @@ PreviewEffect = preview_r1_r2_rhw2_flexmrc_001 CellLayout = ............. CellLayout = ..kcd........ CellLayout = ..jbaf....... -CellLayout = ..Zi.h......< +CellLayout = ..Zi........< CellLayout = ..^.......... ;senw diff --git a/Controller/RUL0/5000_RHW/5300_Transitions.txt b/Controller/RUL0/5000_RHW/5300_Transitions.txt index 07412b420..b9fd93e06 100644 --- a/Controller/RUL0/5000_RHW/5300_Transitions.txt +++ b/Controller/RUL0/5000_RHW/5300_Transitions.txt @@ -206,7 +206,6 @@ CellLayout = .+b+.. CellLayout = .+b+.< CellLayout = .bbb.. CellLayout = .b.b.. -;CellLayout = .b.b.. ; commented out by memo 2013/03/18 CellLayout = .c.d.. CellLayout = .^.... @@ -219,7 +218,7 @@ ConsLayout = ...... ConsLayout = .|||.. ConsLayout = .|||.. ConsLayout = .|||.< -ConsLayout = .|.|.. +ConsLayout = .|||.. ConsLayout = .|.|.. ConsLayout = .|.|.. ConsLayout = ...... @@ -539,7 +538,7 @@ ConsLayout = ..|||... ConsLayout = ..|||... ConsLayout = ..|||... ConsLayout = ..|||... -ConsLayout = ..|.|... +ConsLayout = ..|||... ConsLayout = ........ ConsLayout = ...^.... @@ -879,7 +878,7 @@ ConsLayout =..|||... ConsLayout =.|||||.. ConsLayout =.|||||.. ConsLayout =.|||||.. -ConsLayout =.||.||.. +ConsLayout =.|||||.. ConsLayout =........ ConsLayout =..^..... @@ -2407,10 +2406,10 @@ CheckType = b - dirtroad: 0x02000200 ConsLayout =..... ConsLayout =..... -ConsLayout =..|.< -ConsLayout =..|.. -ConsLayout =..|.. -ConsLayout =..|.. +ConsLayout =..||< +ConsLayout =..||. +ConsLayout =..||. +ConsLayout =..||. ConsLayout =..... ConsLayout =..^.. @@ -3549,7 +3548,7 @@ CheckType = b - dirtroad: 0x00020002 street: 0x04040101, 0xffffffff optional ConsLayout =........ ConsLayout =........ -ConsLayout =...---.< +ConsLayout =..+---.< ConsLayout =....--.. ConsLayout =.....--. ConsLayout =.....--. @@ -3591,7 +3590,7 @@ CheckType = b - dirtroad: 0x00020002 street: 0x03040401, 0xffffffff optional ConsLayout =........ ConsLayout =........ -ConsLayout =...---.< +ConsLayout =..+---.< ConsLayout =....--.. ConsLayout =.....--. ConsLayout =.....--. diff --git a/Controller/RUL0/5000_RHW/5600_Underpasses.txt b/Controller/RUL0/5000_RHW/5600_Underpasses.txt index 3154591f5..78cab0db9 100644 --- a/Controller/RUL0/5000_RHW/5600_Underpasses.txt +++ b/Controller/RUL0/5000_RHW/5600_Underpasses.txt @@ -35,7 +35,7 @@ PreviewEffect = preview_subroad_53e63700_ch CellLayout =... CellLayout =.Z< -CellLayout =.e. +CellLayout =... CellLayout =.c. CellLayout =.a. CellLayout =.a. @@ -54,13 +54,13 @@ CheckType = Z - dirtroad: 0x02020202 ConsLayout =... ConsLayout =.|< +ConsLayout =... ConsLayout =.|. ConsLayout =.|. ConsLayout =.|. ConsLayout =.|. ConsLayout =... ConsLayout =... -ConsLayout =... ConsLayout =.^. AutoTileBase= 0x55387000 @@ -742,7 +742,7 @@ CheckType = Z - road: 0x00000000 ConsLayout =....... ConsLayout =....... ;ConsLayout =....... -ConsLayout =...|<.. +ConsLayout =..+|<.. ConsLayout =..||... ConsLayout =..||... ;ConsLayout =....... diff --git a/Controller/RUL0/5000_RHW/5700_QuickChange.txt b/Controller/RUL0/5000_RHW/5700_QuickChange.txt index 1d71073d8..0e436c083 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 @@ -298,7 +298,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =............. ConsLayout =............. -ConsLayout =.........|<.. +ConsLayout =........+|<.. ConsLayout =............. ConsLayout =............. ConsLayout =............. @@ -424,7 +424,7 @@ CheckType = Z - dirtroad: 0x00000000 ConsLayout =............. ConsLayout =............. -ConsLayout =.........|<.. +ConsLayout =........+|<.. ConsLayout =............. ConsLayout =............. ConsLayout =............. @@ -558,7 +558,7 @@ CheckType = l - dirtroad: 0x02020000, 0xffffffff optional CheckType = Z - dirtroad: 0x00000000 ConsLayout =....... -ConsLayout =....... +ConsLayout =..+.... ConsLayout =..|.<.. ConsLayout =....... ConsLayout =....... 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/7900_MultiRadiusCurves.txt b/Controller/RUL0/7000_Road_NWM/7900_MultiRadiusCurves.txt index dcb3f4aa9..743ccb8a4 100644 --- a/Controller/RUL0/7000_Road_NWM/7900_MultiRadiusCurves.txt +++ b/Controller/RUL0/7000_Road_NWM/7900_MultiRadiusCurves.txt @@ -2015,7 +2015,7 @@ CheckType = y - avenue: 0x02000004, 0xFF0000FF optional CheckType = z - avenue: 0x00000103, 0x0000FFFF optional ConsLayout =||.. -ConsLayout =||.< +ConsLayout =||+< ConsLayout =||X. ConsLayout =||\. ConsLayout =X||X @@ -2083,7 +2083,7 @@ CheckType = y - avenue: 0x02000004, 0xFF0000FF optional CheckType = z - avenue: 0x00000103, 0x0000FFFF optional ConsLayout =.||.. -ConsLayout =.||.< +ConsLayout =+||.< ConsLayout =.||X. ConsLayout =.||\. ConsLayout =.X||X @@ -2151,7 +2151,7 @@ CheckType = w - avenue: 0x00000204, 0x0000FFFF optional ConsLayout =....... ConsLayout =-\\\... ConsLayout =-\\\\.. -ConsLayout =..\\\\< +ConsLayout =.+\\\\< ConsLayout =...\\\. ConsLayout =....\\. ConsLayout =.^..||. @@ -2212,7 +2212,7 @@ CheckType = y - avenue: 0x00020400, 0x00FFFF00 optional CheckType = x - avenue: 0x00040200, 0x00FFFF00 optional CheckType = w - avenue: 0x00000204, 0x0000FFFF optional -ConsLayout =......< +ConsLayout =.+....< ConsLayout =-\\\... ConsLayout =-\\\\.. ConsLayout =..\\\\. 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..e9c23c9c1 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 =..^... @@ -2445,7 +2445,7 @@ CheckType = c - road: 0x00000200, 0x0000ff00 check 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..91bfd8e60 100644 --- a/Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt +++ b/Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt @@ -305,8 +305,8 @@ CheckType = z - avenue: 0x00040200,0x00ffff00 check ConsLayout = \\........//. ConsLayout = \\\......///. ConsLayout = .\\\----///.. -ConsLayout = ..\\----//X.. -ConsLayout = ...\\..//.... +ConsLayout = ..\\\--///X.. +ConsLayout = ...\\\///.... ConsLayout = ....\##/....< ConsLayout = ....X||X..... ConsLayout = .....||...... @@ -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..893e37633 100644 --- a/Controller/RUL0/A000_Rail/A358_WideRadiusCurves.txt +++ b/Controller/RUL0/A000_Rail/A358_WideRadiusCurves.txt @@ -60,8 +60,8 @@ ConsLayout = \\\..........///. ConsLayout = .\\\........///.. ConsLayout = ..\\\......///... ConsLayout = ...\\\----///.... -ConsLayout = ....\\----//X.... -ConsLayout = .....\\..//...... +ConsLayout = ....\\\--///X.... +ConsLayout = .....\\\///...... ConsLayout = ......\##/......< ConsLayout = ......X||X....... ConsLayout = .......||........ @@ -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..35da96421 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 = .^.... @@ -2476,8 +2476,8 @@ CheckType = r - avenue: 0x00030100 CheckType = s - avenue: 0x01000003 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/C000_HSRP.txt b/Controller/RUL0/C000_Monorail/C000_HSRP.txt index 93e407be1..bd0c3df2c 100644 --- a/Controller/RUL0/C000_Monorail/C000_HSRP.txt +++ b/Controller/RUL0/C000_Monorail/C000_HSRP.txt @@ -695,7 +695,7 @@ CheckType = Z - monorail: 0x03010000 street: 0x00020002 CheckType = X - monorail: 0x00000301 street: 0x00020002 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf0C00 @@ -737,7 +737,7 @@ CheckType = Z - monorail: 0x03010000 road: 0x00020002 CheckType = X - monorail: 0x00000301 road: 0x00020002 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf0E00 @@ -779,7 +779,7 @@ CheckType = Z - monorail: 0x03010000 onewayroad: 0x00020002 CheckType = X - monorail: 0x00000301 onewayroad: 0x00020002 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf1000 @@ -821,7 +821,7 @@ CheckType = Z - monorail: 0x03010000 rail: 0x00020002 CheckType = X - monorail: 0x00000301 rail: 0x00020002 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf1200 @@ -864,8 +864,8 @@ CheckType = B - monorail: 0x00000301 avenue: 0x04020002 CheckType = Z - monorail: 0x03010000 avenue: 0x00020402 CheckType = X - monorail: 0x00000301 avenue: 0x00020402 -ConsLayout =...... -ConsLayout =..+..< +ConsLayout =..##.. +ConsLayout =.##..< ConsLayout =..^... AutoTileBase= 0x5ddf1400 @@ -909,7 +909,7 @@ CheckType = Z - monorail: 0x03010000 street: 0x00030100 CheckType = X - monorail: 0x00000301 street: 0x01000003 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf1A00 @@ -951,7 +951,7 @@ CheckType = Z - monorail: 0x03010000 road: 0x00030100 CheckType = X - monorail: 0x00000301 road: 0x01000003 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf1C00 @@ -993,7 +993,7 @@ CheckType = Z - monorail: 0x03010000 onewayroad: 0x00030100 CheckType = X - monorail: 0x00000301 onewayroad: 0x01000003 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf1E00 @@ -1035,7 +1035,7 @@ CheckType = Z - monorail: 0x03010000 rail: 0x00030100 CheckType = X - monorail: 0x00000301 rail: 0x01000003 ConsLayout =....... -ConsLayout =...+..< +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf2000 @@ -1077,8 +1077,8 @@ CheckType = A - monorail: 0x03010000 avenue: 0x01000003 CheckType = Z - monorail: 0x03010000 avenue: 0x00030100 CheckType = X - monorail: 0x00000301 avenue: 0x01030103 -ConsLayout =....... -ConsLayout =...+..< +ConsLayout =...X... +ConsLayout =..XX..< ConsLayout =...^... AutoTileBase= 0x5ddf2200 diff --git a/Controller/RUL0/C000_Monorail/C200_GHSR.txt b/Controller/RUL0/C000_Monorail/C200_GHSR.txt index 3a4b053af..91e7f26b0 100644 --- a/Controller/RUL0/C000_Monorail/C200_GHSR.txt +++ b/Controller/RUL0/C000_Monorail/C200_GHSR.txt @@ -544,8 +544,8 @@ CellLayout =...^... CheckType = b - monorail: 0x02000200 avenue: 0x00020402 CheckType = B - monorail: 0x02000200 avenue: 0x04020002 -ConsLayout =....... -ConsLayout =...+..< +ConsLayout =...#... +ConsLayout =...#..< ConsLayout =...^... AutoTileBase= 0x5dcf0400 @@ -604,8 +604,8 @@ CheckType = B - monorail: 0x02000200 highway: 0x04020002 CheckType = C - highway: 0x04000002 optional CheckType = c - highway: 0x00000402 optional -ConsLayout =....... -ConsLayout =...+..< +ConsLayout =...#... +ConsLayout =...#..< ConsLayout =...^... AutoTileBase= 0x5dcf0500 @@ -1101,7 +1101,7 @@ CheckType = c - monorail: 0x02000200 road: 0x00010100 optional ConsLayout =....... ConsLayout =...+..< -ConsLayout =....... +ConsLayout =...+... ConsLayout =...^... AutoTileBase= 0x5dcf1800 @@ -1159,7 +1159,7 @@ CheckType = b - monorail: 0x02000200 ConsLayout =....... ConsLayout =...+..< -ConsLayout =....... +ConsLayout =...+... ConsLayout =...^... AutoTileBase= 0x5dcf1800 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..3935beab9 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 @@ -976,9 +976,9 @@ CheckType = n - groundhighway:0x00000301 check CheckType = o - groundhighway:0x02010204 CheckType = p - groundhighway:0x02040201 -;onsLayout =......||..... -;onsLayout =......||...// -ConsLayout =.....X||XX/// +ConsLayout =............. +ConsLayout =......||..... +ConsLayout =.....X||XX//. ConsLayout =..XXXX||X///. ConsLayout =.XXXXX||///.. ConsLayout =XXX..X|#//... @@ -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..c8250dbd6 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 @@ -146,7 +146,10 @@ CheckType = k - highway:0x00000103,0x0000ffff check CheckType = l - highway:0x00030100 check CheckType = m - highway:0x03010000 check CheckType = n - highway:0x03000001,0xff0000ff check +CheckType = o - highway:0x00000301 check +CheckType = p - highway:0x03010000 check CheckType = q - highway:0x00010300,0x00ffff00 check +CheckType = r - highway:0x00000301 check CheckType = A - highway:0x02010003 CheckType = B - highway:0x03020100 CheckType = C - highway:0x02020202 @@ -154,17 +157,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 +219,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 +585,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 +701,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\\ @@ -1106,9 +1109,9 @@ ConsLayout =.\\.......... ConsLayout =.\\\......... ConsLayout =..\\\........ ConsLayout =...\\\....... -ConsLayout =....\\#...... +ConsLayout =....\\#/..... ConsLayout =.....###....< -ConsLayout =......#\\.... +ConsLayout =...../#\\.... ConsLayout =.......\\\... ConsLayout =........\\\.. ConsLayout =.........\\\. diff --git a/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt b/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt index 02ec5bfe4..49bb4e49c 100644 --- a/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt +++ b/Lite Controller/RUL0/9000_Avenue/9520_AvenueRoundabouts.txt @@ -305,8 +305,8 @@ CheckType = z - avenue: 0x00040200,0x00ffff00 check ConsLayout = \\........//. ConsLayout = \\\......///. ConsLayout = .\\\----///.. -ConsLayout = ..\\----//X.. -ConsLayout = ...\\..//.... +ConsLayout = ..\\\--///X.. +ConsLayout = ...\\\///.... ConsLayout = ....\##/....< ConsLayout = ....X||X..... ConsLayout = .....||...... @@ -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..1a4773519 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 @@ -976,9 +976,9 @@ CheckType = n - groundhighway:0x00000301 check CheckType = o - groundhighway:0x02010204 CheckType = p - groundhighway:0x02040201 -;onsLayout =......||..... -;onsLayout =......||...// -ConsLayout =.....X||XX/// +ConsLayout =............. +ConsLayout =......||..... +ConsLayout =.....X||XX//. ConsLayout =..XXXX||X///. ConsLayout =.XXXXX||///.. ConsLayout =XXX..X|#//... @@ -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..2b97071c2 --- /dev/null +++ b/src/scripts/syntax-check-rul0.py @@ -0,0 +1,134 @@ +#!/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. +# +# Minimum requirement: Python 3.12+ +# Further info: https://www.wiki.sc4devotion.com/index.php?title=RUL0 + +import sys +import os +import itertools +import re + +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(l for _, l in lines)] + markers_x = [line.index("^") for line in layout if "^" in line] + markers_y = [i for i, line in enumerate(layout) if "<" in line] + if len(markers_x) != 1 or len(markers_y) != 1: + raise Exception(f"Missing or incorrect origin markers '^'/'<' in layout starting at line {lines[0][0]}") + origin_x = markers_x[0] + origin_y = markers_y[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 parse_checktypes(lines): + definitions = [line[(line.index("=")+1):].strip() for line in drop_comments(l for _, l in lines)] + static_cells = {row[0]: "optional" not in row and "check" not in row + for row in definitions if row} + return static_cells + + +def _stringify_layout(lines): + return "".join(f" {line_no}: {line}" for line_no, line in lines) + + +def check_cons_layout(cell_lines, checktype_lines, cons_lines): + cell_layout = parse_layout(cell_lines) + cons_layout = parse_layout(cons_lines) + static_cells = parse_checktypes(checktype_lines) + undefined_cells = set(c for c in cell_layout.values() if c != '+' and c not in static_cells) + if undefined_cells: + raise Exception(f"Missing CheckType definition for cell {', '.join(undefined_cells)}:\n{_stringify_layout(cell_lines)}") + bad_cells = [xy for xy in cons_layout.keys() if xy not in cell_layout] # constraint != '.' but cell == '.' + if not bad_cells: + bad_cells = [xy for xy, c in cell_layout.items() + if static_cells.get(c) and + (xy not in cons_layout or cons_layout[xy] == '.')] # cell != '.' but constraint == '.' + if bad_cells: + raise Exception(f"Potential sinkhole bug in ConsLayout at cells {' '.join(map(str, bad_cells))}:\n{_stringify_layout(cell_lines)} ---\n{_stringify_layout(cons_lines)}") + + +_relevant_line_starts = ( + re.compile(r"^CellLayout", re.IGNORECASE), + re.compile(r"^CheckType", re.IGNORECASE), + re.compile(r"^ConsLayout", re.IGNORECASE), + re.compile(r"^\[HighwayIntersectionInfo"), + ) + + +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:] + for re_idx, pattern in enumerate(_relevant_line_starts): + if pattern.match(line): + yield line_no, line, re_idx + break + + grouped = [list(it) for heading, it in + itertools.groupby(relevant_lines(), key=lambda tup: tup[2] == 3) + if not heading] + for grouped_lines in grouped: + cell_lines = [(line_no, line) for line_no, line, re_idx in grouped_lines if re_idx == 0] + checktype_lines = [(line_no, line) for line_no, line, re_idx in grouped_lines if re_idx == 1] + cons_lines = [(line_no, line) for line_no, line, re_idx in grouped_lines if re_idx == 2] + if not cell_lines and not cons_lines: # checktype_lines might be non-empty in `CopyFrom` case + continue + elif not cell_lines or not checktype_lines or not cons_lines: + yield f"Found no matching CellLayout, ConsLayout or CheckType definitions starting at line {grouped_lines[0][0]}" + else: + try: + check_cons_layout(cell_lines, checktype_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())