Prev: E6BC Up: Map Next: E72F
E6DC: 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 E6DC EXX Switch to the shadow registers.
E6DD LD E,A DE'=the character code*08.
E6DE LD D,$00
E6E0 SLA E
E6E2 RL D
E6E4 SLA E
E6E6 RL D
E6E8 SLA E
E6EA RL D
E6EC LD HL,($5C36) HL'=*CHARS+DE'.
E6EF ADD HL,DE
E6F0 LD DE,($5C84) Advance *DF_CC and leave DE' on the cell just claimed.
E6F4 INC DE
E6F5 LD ($5C84),DE
E6F9 DEC DE
Copy the eight pixel rows into the screen buffer.
E6FA LD B,$08 B'=08.
PrintColourCharacter_Loop E6FC LD A,(HL) Copy one pixel row and move down one screen line.
E6FD LD (DE),A
E6FE INC HL
E6FF INC D
E700 DJNZ PrintColourCharacter_Loop Decrease the row counter and loop back to PrintColourCharacter_Loop until all 08 rows are written.
Write *ATTR_T into the matching attribute cell.
E702 LD BC,($5C88) BC'=*S_POSN.
E706 LD HL,$5800 HL'=5800.
E709 DEC C Advance the print column in *S_POSN.
E70A LD ($5C88),BC
E70E INC C
E70F LD A,$21 HL'+=21-C' (0-based column).
E711 SUB C
E712 LD E,A
E713 LD D,$00
E715 ADD HL,DE
E716 LD A,$18 E'=18-B' (0-based row).
E718 SUB B
E719 LD E,A
E71A SLA E Multiply the row by 20 and add it to the attribute address.
E71C SLA E
E71E SLA E
E720 SLA E
E722 RL D
E724 SLA E
E726 RL D
E728 ADD HL,DE
E729 LD A,($5C8F) Write *ATTR_T to that attribute cell.
E72C LD (HL),A
E72D EXX Switch back to the normal registers.
E72E RET Return.
Prev: E6BC Up: Map Next: E72F