Prev: 9837 Up: Map Next: 9862
984B: Control Code 11: Set Paper Colour
ControlCode_SetPaperColour 984B LD HL,$F81E Set a pointer to Print_AttributeVariable in HL.
984E LD A,(HL) Fetch the current print attribute colour and store it in A.
984F AND %11000111 Mask off the current PAPER bits.
9851 LD (HL),A Write the value back to *Print_AttributeVariable.
9852 LD A,($F80C) Fetch the new PAPER colour from *PrintVariable_01.
9855 CP $08 Jump to Helper_Return if the new PAPER colour is invalid (08 or higher), valid ink values are between 00-07.
9857 JP NC,Helper_Return
985A ADD A,A Shift the colour value into bits 3-5 so it applies for PAPER.
985B ADD A,A
985C ADD A,A
985D OR (HL) Set the new PAPER value with the current print attribute colour held by *HL.
985E LD (HL),A Write the updated value back to *Print_AttributeVariable.
985F JP ControlCode_Return_1 Jump to ControlCode_Return_1.
Prev: 9837 Up: Map Next: 9862