Prev: CB3E Up: Map Next: CB71
CB5B: Print a character and colour its cell
Prints with PRINT_CHAR and writes A' into the cell's attribute byte, which is at the same column and row in the attribute file: the third of the screen (bits 3-4 of H) picks the attribute page, and L is the same in both. A' is kept for the next character.
Input
A the code
HL the screen address of its top row
A' the colour
PRINT_CHAR_COLOURED CB5B CALL PRINT_CHAR print it
CB5E PUSH DE HL = the attribute address: page $58 plus the third
CB5F PUSH HL
CB60 LD A,H
CB61 RRCA
CB62 RRCA
CB63 RRCA
CB64 AND $03
CB66 LD H,A
CB67 LD DE,$5800
CB6A ADD HL,DE
CB6B EX AF,AF' colour it, keeping the colour in A'
CB6C LD (HL),A
CB6D EX AF,AF'
CB6E POP HL
CB6F POP DE
CB70 RET
Prev: CB3E Up: Map Next: CB71