Skip to navigation

Revs on the BBC Micro

Text: SetRowColours

Name: SetRowColours [Show more] Type: Subroutine Category: Text Summary: Set the foreground and background colours for a table row
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * PrintDriverTable calls SetRowColours

Arguments: Y Table row number colourScheme Colour scheme: 0, 4, 8
.SetRowColours TYA \ Set X = colourScheme if Y is even AND #1 \ = colourScheme + 1 if Y is odd CLC \ ADC colourScheme \ So X is now one of the following, depending on the TAX \ colour scheme and whether the row number is even or \ odd: \ \ * Scheme 0: 0 (even) or 1 (odd) \ * Scheme 4: 4 (even) or 5 (odd) \ * Scheme 8: 8 (even) or 9 (odd) \ \ We now fetch the colour palette from the rowColours \ table using the following offsets: \ \ * Scheme 0: 0 on 2 (even) or 1 on 3 (odd) \ * Scheme 4: 4 on 6 (even) or 5 on 7 (odd) \ * Scheme 8: 8 on 10 (even) or 9 on 11 (odd) LDA rowColours,X \ Set the configurable foreground colour in token 31 to STA token31+5 \ the X-th entry in the rowColours table LDA rowColours+2,X \ Set the configurable background colour in token 31 to STA token31+3 \ the X+2-th entry in the rowColours table RTS \ Return from the subroutine