Prev: 54079 Up: Map Next: 54182
54099: Goldfish Game: Print Colour UDG
Input
A Character to print
Identical clone of PrintColourCharacter.
Compare against the non-colour version at PrintUDG.
GoldfishGame_PrintColourUDG 54099 EXX Switch to the shadow registers.
54100 LD E,A DE'=A*8.
54101 LD D,0
54103 SLA E
54105 RL D
54107 SLA E
54109 RL D
54111 SLA E
54113 RL D
54115 LD HL,(23606) HL'=*CHARS+DE'.
54118 ADD HL,DE
54119 LD DE,(23684) Increment *DF_CC by one.
54123 INC DE
54124 LD (23684),DE
54128 DEC DE Decrease DE' by one.
All character blocks are 1 x 8 bytes.
Copy the data from the current character set to the screen buffer.
54129 LD B,8 B'=8 (byte counter).
PrintColourUDG_Loop 54131 LD A,(HL) A=*HL'.
54132 LD (DE),A Write A to *DE'.
54133 INC HL Increment HL' by one.
54134 INC D Increment D' by one.
54135 DJNZ PrintColourUDG_Loop Decrease counter by one and loop back to PrintColourUDG_Loop until counter is zero.
Calculate the attribute buffer position.
54137 LD BC,(23688) BC'=*S_POSN.
54141 LD HL,22528 HL'=22528 (attribute buffer location).
54144 DEC C Decrease C' by one.
54145 LD (23688),BC Write BC' to *S_POSN.
54149 INC C Increment C' by one.
54150 LD A,33 E'=33-C'.
54152 SUB C
54153 LD E,A
54154 LD D,0 D'=0.
54156 ADD HL,DE HL'+=DE'.
54157 LD A,24 E'=24-B'.
54159 SUB B
54160 LD E,A
54161 SLA E Shift E' left four positions (with carry).
54163 SLA E
54165 SLA E
54167 SLA E
54169 RL D Rotate D' left.
54171 SLA E Shift E' left (with carry).
54173 RL D Rotate D' left.
54175 ADD HL,DE HL'+=DE'.
54176 LD A,(23695) A=*ATTR_T.
54179 LD (HL),A Write A to *HL'.
54180 EXX Switch back to the normal registers.
54181 RET Return.
Prev: 54079 Up: Map Next: 54182