Skip to navigation

Revs on the BBC Micro

Extra tracks: trackSubConfig

Name: trackSubConfig [Show more] Type: Variable Category: Extra tracks Summary: Configuration data for each section that defines the sub-section numbers, and horizon calculations
Context: See this variable in context in the source code References: This variable is used as follows: * HookSectionFrom calls trackSubConfig

Each section has a trackSubConfig value that contains the following data: * Bits 2 to 7 = the number of the first sub-section in this section * Bit 1 = if this is set, then in the horizon calculations, we skip the check that sets horizonLine to 7 * Bit 0 = if this is set, then the segment vectors for this section are generated as a straight track rather than using the curve tables (this bit is only set for straight sections) In the last one, if bit 0 is set then bit 7 of subSection gets set. This makes us skip the first part of the SetSegmentVector routine, which means we do not update the yaw angle or track height before calculating the segment vector. This means we reuse the segment vector from the end of the previous section for generating this track section. This is only done for straight sections, and the main game code draws straight sections by simply adding the same track segment vector for each segment in the straight, so setting bit 0 of a section's trackSubConfig ensures that it heads off in a straight line in the exact same direction as the tail end of the preceding section.
.trackSubConfig EQUB %00000001 \ Section 0 = 000000 0 1 From 0 check straight EQUB %00000000 \ Section 1 = 000000 0 0 From 0 check curve EQUB %00010100 \ Section 2 = 000101 0 0 From 5 check curve EQUB %00100000 \ Section 3 = 001000 0 0 From 8 check curve EQUB %00101000 \ Section 4 = 001010 0 0 From 10 check curve EQUB %00110000 \ Section 5 = 001100 0 0 From 12 check curve EQUB %01000000 \ Section 6 = 010000 0 0 From 16 check curve EQUB %01001000 \ Section 7 = 010010 0 0 From 18 check curve EQUB %01010000 \ Section 8 = 010100 0 0 From 20 check curve EQUB %01101000 \ Section 9 = 011010 0 0 From 26 check curve EQUB %01110000 \ Section 10 = 011100 0 0 From 28 check curve EQUB %01111000 \ Section 11 = 011110 0 0 From 30 check curve EQUB %10001100 \ Section 12 = 100011 0 0 From 35 check curve EQUB %10010001 \ Section 13 = 100100 0 1 From 36 check straight EQUB %10010000 \ Section 14 = 100100 0 0 From 36 check curve EQUB %10010100 \ Section 15 = 100101 0 0 From 37 check curve EQUB %10100001 \ Section 16 = 101000 0 1 From 40 check straight EQUB %10100000 \ Section 17 = 101000 0 0 From 40 check curve EQUB %10101000 \ Section 18 = 101010 0 0 From 42 check curve EQUB %10110000 \ Section 19 = 101100 0 0 From 44 check curve EQUB %10111100 \ Section 20 = 101111 0 0 From 47 check curve EQUB %11000100 \ Section 21 = 110001 0 0 From 49 check curve EQUB %11010100 \ Section 22 = 110101 0 0 From 53 check curve EQUB %11011000 \ Section 23 = 110110 0 0 From 54 check curve EQUB %11011100 \ Section 24 = 110111 0 0 From 55 check curve EQUB &DA, &DE \ These bytes appear to be unused EQUB &DA, &E2 EQUB &00