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 uses 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 %00010010 \ Section 1 = 000100 1 0 From 4 no check curve EQUB %00011111 \ Section 2 = 000111 1 1 From 7 no check straight EQUB %00011110 \ Section 3 = 000111 1 0 From 7 no check curve EQUB %00100010 \ Section 4 = 001000 1 0 From 8 no check curve EQUB %00100110 \ Section 5 = 001001 1 0 From 9 no check curve EQUB %00101110 \ Section 6 = 001011 1 0 From 11 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 %01001010 \ Section 9 = 010010 1 0 From 18 no check curve EQUB %01010110 \ Section 10 = 010101 1 0 From 21 no check curve EQUB %01011110 \ Section 11 = 010111 1 0 From 23 no check curve EQUB %01100111 \ Section 12 = 011001 1 1 From 25 no check straight EQUB %01100110 \ Section 13 = 011001 1 0 From 25 no check curve EQUB %01101110 \ Section 14 = 011011 1 0 From 27 no check curve EQUB %01110110 \ Section 15 = 011101 1 0 From 29 no check curve EQUB %10000010 \ Section 16 = 100000 1 0 From 32 no check curve EQUB %10000110 \ Section 17 = 100001 1 0 From 33 no check curve EQUB %10010110 \ Section 18 = 100101 1 0 From 37 no check curve EQUB %10100010 \ Section 19 = 101000 1 0 From 40 no check curve EQUB %10110010 \ Section 20 = 101100 1 0 From 44 no check curve EQUB %10111011 \ Section 21 = 101110 1 1 From 46 no check straight EQUB %10111010 \ Section 22 = 101110 1 0 From 46 no check curve EQUB %11001010 \ Section 23 = 110010 1 0 From 50 no check curve EQUB %11010010 \ Section 24 = 110100 1 0 From 52 no check curve EQUB %11011010 \ Section 25 = 110110 1 0 From 54 no check curve EQUB %11011110 \ Section 26 = 110111 1 0 From 55 no check curve EQUB &DA, &E2 \ These bytes appear to be unused EQUB &00