Skip to navigation


Graphics: SetLogicalColour

Name: SetLogicalColour [Show more] Type: Subroutine Category: Graphics Summary: Set a logical colour to a physical colour
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * SetColourToWhite calls SetLogicalColour

Arguments: X The logical colour to set Y The physical colour to map to the logical colour
.SetLogicalColour LDA #19 \ Start a VDU 19 command, which sets a logical colour to JSR OSWRCH \ a physical colour using the following format: \ \ VDU 19, logical, physical, 0, 0, 0 TXA \ Write the value in X, which is the logical colour JSR OSWRCH TYA \ Copy the physical colour from Y to A LDX #3 \ Set a counter in X to write the next four values, so \ the following loop writes: \ \ physical, 0, 0, 0 .setl1 JSR OSWRCH \ Write the value in A LDA #0 \ Set A to 0 to write the three zeroes DEX \ Decrement the loop counter BPL setl1 \ Loop back until we have written the whole VDU command RTS \ Return from the subroutine