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 %00000000 \ Section 0 = 000000 0 0 From 0 check curve EQUB %00000100 \ Section 1 = 000001 0 0 From 1 check curve EQUB %00010010 \ Section 2 = 000100 1 0 From 4 no check curve EQUB %00011010 \ Section 3 = 000110 1 0 From 6 no check curve EQUB %00100110 \ Section 4 = 001001 1 0 From 9 no check curve EQUB %00101110 \ Section 5 = 001011 1 0 From 11 no check curve EQUB %00110110 \ Section 6 = 001101 1 0 From 13 no check curve EQUB %00111011 \ Section 7 = 001110 1 1 From 14 no check straight EQUB %00111010 \ Section 8 = 001110 1 0 From 14 no check curve EQUB %00111111 \ Section 9 = 001111 1 1 From 15 no check straight EQUB %00111110 \ Section 10 = 001111 1 0 From 15 no check curve EQUB %01001010 \ Section 11 = 010010 1 0 From 18 no check curve EQUB %01001110 \ Section 12 = 010011 1 0 From 19 no check curve EQUB %01010110 \ Section 13 = 010101 1 0 From 21 no check curve EQUB %01011010 \ Section 14 = 010110 1 0 From 22 no check curve EQUB %01011110 \ Section 15 = 010111 1 0 From 23 no check curve EQUB %01100000 \ Section 16 = 011000 0 0 From 24 check curve EQUB %01110010 \ Section 17 = 011100 1 0 From 28 no check curve EQUB %01111010 \ Section 18 = 011110 1 0 From 30 no check curve EQUB %01111110 \ Section 19 = 011111 1 0 From 31 no check curve EQUB %10000010 \ Section 20 = 100000 1 0 From 32 no check curve EQUB %10001110 \ Section 21 = 100011 1 0 From 35 no check curve EQUB %10010010 \ Section 22 = 100100 1 0 From 36 no check curve EQUB %10011110 \ Section 23 = 100111 1 0 From 39 no check curve EQUB %10100010 \ Section 24 = 101000 1 0 From 40 no check curve EQUB %10101010 \ Section 25 = 101010 1 0 From 42 no check curve EQUB %10101110 \ Section 26 = 101011 1 0 From 43 no check curve EQUB &D3, &D3 \ These bytes appear to be unused EQUB &D3