Thanks AWJ. I must have read a wrong opcode description. "RLA" rotate A through carry.
But the command "RL C" will also rotate through carry, so the carry is "mixed" with both values.
Lets play this through:
First logo byte is CEh, so sub is called with
A=1100 1110
C=A = 1100 1110
assume carry=0
(register shown after the corresponding RL command. The carry is given after the comma)
1. iteration of loop
C=1001 1100, 1
A=1001 1101, 1
C=1001 1101, 1
A=0011 1011, 0
2. iteration of loop
C=0011 1010, 1
A=0111 0111, 0
C=0011 1010, 1
A=1110 1111, 0
3. iteration of loop
C=0111 0100, 0
A=1101 1110, 1
C=0111 0101, 0
A=1011 1100, 1
4. iteration of loop
C=1110 1011, 0
A=0111 1000, 1
C=1110 1011, 0
A=1111 0000, 0
So indeed, the bits of the first nibble are doubled and fill up the whole byte of A. This is written to address in HL and HL+2, which makes up the "color" in 2bpp mode. So the color is always 11 or 00 which means black or white.
The next call goes on line after the first, to address 96h. Here carry, A and C register are untouched from previous loop. But what happens with the lower nibble of the source logo byte CE?