Prev: 59068 Up: Map Next: 59183
59100: Print Colour Character
Prints one colour character at the current screen position. Identical clone of GoldfishGame_PrintColourUDG; the non-colour version is PrintUDG.
Input
A Character to print
Point HL' at this character's pixels and DE' at the current screen cell.
PrintColourCharacter 59100 EXX Switch to the shadow registers.
59101 LD E,A DE'=the character code*8.
59102 LD D,0
59104 SLA E
59106 RL D
59108 SLA E
59110 RL D
59112 SLA E
59114 RL D
59116 LD HL,(23606) HL'=*CHARS+DE'.
59119 ADD HL,DE
59120 LD DE,(23684) Advance *DF_CC and leave DE' on the cell just claimed.
59124 INC DE
59125 LD (23684),DE
59129 DEC DE
Copy the eight pixel rows into the screen buffer.
59130 LD B,8 B'=8.
PrintColourCharacter_Loop 59132 LD A,(HL) Copy one pixel row and move down one screen line.
59133 LD (DE),A
59134 INC HL
59135 INC D
59136 DJNZ PrintColourCharacter_Loop Decrease the row counter and loop back to PrintColourCharacter_Loop until all 8 rows are written.
Write *ATTR_T into the matching attribute cell.
59138 LD BC,(23688) BC'=*S_POSN.
59142 LD HL,22528 HL'=22528.
59145 DEC C Advance the print column in *S_POSN.
59146 LD (23688),BC
59150 INC C
59151 LD A,33 HL'+=33-C' (0-based column).
59153 SUB C
59154 LD E,A
59155 LD D,0
59157 ADD HL,DE
59158 LD A,24 E'=24-B' (0-based row).
59160 SUB B
59161 LD E,A
59162 SLA E Multiply the row by 32 and add it to the attribute address.
59164 SLA E
59166 SLA E
59168 SLA E
59170 RL D
59172 SLA E
59174 RL D
59176 ADD HL,DE
59177 LD A,(23695) Write *ATTR_T to that attribute cell.
59180 LD (HL),A
59181 EXX Switch back to the normal registers.
59182 RET Return.
Prev: 59068 Up: Map Next: 59183