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 %00000010 \ Section 0 = 000000 1 0 From 0 no check curve EQUB %00001110 \ Section 1 = 000011 1 0 From 3 no check curve EQUB %00011010 \ Section 2 = 000110 1 0 From 6 no check curve EQUB %00100010 \ Section 3 = 001000 1 0 From 8 no check curve EQUB %00101010 \ Section 4 = 001010 1 0 From 10 no check curve EQUB %00110010 \ Section 5 = 001100 1 0 From 12 no check curve EQUB %00110110 \ Section 6 = 001101 1 0 From 13 no check curve EQUB %00111111 \ Section 7 = 001111 1 1 From 15 no check straight EQUB %00111110 \ Section 8 = 001111 1 0 From 15 no check curve EQUB %01000110 \ Section 9 = 010001 1 0 From 17 no check curve EQUB %01010010 \ Section 10 = 010100 1 0 From 20 no check curve EQUB %01100010 \ Section 11 = 011000 1 0 From 24 no check curve EQUB %01101010 \ Section 12 = 011010 1 0 From 26 no check curve EQUB %01110110 \ Section 13 = 011101 1 0 From 29 no check curve EQUB %01111110 \ Section 14 = 011111 1 0 From 31 no check curve EQUB %10000100 \ Section 15 = 100001 0 0 From 33 check curve EQUB %10010001 \ Section 16 = 100100 0 1 From 36 check straight EQUB %10010010 \ Section 17 = 100100 1 0 From 36 no check curve EQUB %10100010 \ Section 18 = 101000 1 0 From 40 no check curve EQUB %10101010 \ Section 19 = 101010 1 0 From 42 no check curve EQUB %10101111 \ Section 20 = 101011 1 1 From 43 no check straight EQUB %10101110 \ Section 21 = 101011 1 0 From 43 no check curve EQUB %10110101 \ Section 22 = 101101 0 1 From 45 check straight EQUB %10110100 \ Section 23 = 101101 0 0 From 45 check curve EQUB %10111100 \ Section 24 = 101111 0 0 From 47 check curve EQUB %11000100 \ Section 25 = 110001 0 0 From 49 check curve EQUB %11001110 \ Section 26 = 110011 1 0 From 51 no check curve EQUB %11011010 \ Section 27 = 110110 1 0 From 54 no check curve EQUB %11100010 \ Section 28 = 111000 1 0 From 56 no check curve EQUB &00 \ This byte appears to be unused