Prev: $246B Up: Map Next: $2500
$24A7: Insert a pixel column into the speech bubble text window
Used by the routine at $246B.
Input
A Pixel column
$24A7 LDX #$08 X will count the 8 pixels in the pixel column.
$24A9 PHA Save the pixel column temporarily.
$24AA LDA #$CA Prepare to start drawing at the rightmost end of the first row of pixels in the second middle section speech bubble sprite at $CA80.
$24AC STA $53
$24AE LDA #$8E
$24B0 STA $52
$24B2 PLA Restore the pixel column to A.
$24B3 LDY #$00 Initialise Y for addressing the speech bubble sprite.
$24B5 ROL A Rotate a pixel from the pixel column into the carry flag.
$24B6 PHA Save the remainder of the pixel column temporarily.
$24B7 LDA ($52),Y Rotate a graphic byte in the speech bubble sprite, bringing the new pixel into bit 0, and the pixel that was in bit 7 into the carry flag.
$24B9 ROL A
$24BA STA ($52),Y
$24BC DEC $52 Move one byte to the left in the speech bubble sprite.
$24BE LDA ($52),Y Rotate this graphic byte, bringing the pixel from the previous byte into bit 0, and the pixel that was in bit 7 into the carry flag.
$24C0 ROL A
$24C1 STA ($52),Y
$24C3 DEC $52 Move one byte to the left in the speech bubble sprite.
$24C5 LDA ($52),Y Rotate this graphic byte, bringing the pixel from the previous byte into bit 0, and the pixel that was in bit 7 into the carry flag.
$24C7 ROL A
$24C8 STA ($52),Y
$24CA ROL A Rotate the carry flag into bit 0 of A and save it temporarily.
$24CB PHA
$24CC LDA $52 Subtract 62 from the sprite graphic address. This points it at the rightmost end of the corresponding row of pixels in the first middle section speech bubble sprite at $CA40.
$24CE SEC
$24CF SBC #$3E
$24D1 BCS $24D5
$24D3 DEC $53
$24D5 STA $52
$24D7 PLA Restore the carry flag that was saved in bit 0 of A.
$24D8 ROR A
$24D9 LDA ($52),Y Rotate a graphic byte in the speech bubble sprite, bringing the new pixel into bit 0, and the pixel that was in bit 7 into the carry flag.
$24DB ROL A
$24DC STA ($52),Y
$24DE DEC $52 Move one byte to the left in the speech bubble sprite.
$24E0 LDA ($52),Y Rotate this graphic byte, bringing the pixel from the previous byte into bit 0, and the pixel that was in bit 7 into the carry flag.
$24E2 ROL A
$24E3 STA ($52),Y
$24E5 DEC $52 Move one byte to the left in the speech bubble sprite.
$24E7 LDA ($52),Y Rotate this graphic byte, bringing the pixel from the previous byte into bit 0. The pixel that was in bit 7 is discarded.
$24E9 ROL A
$24EA STA ($52),Y
$24EC DEX Have we done all 8 bits in the pixel column yet?
$24ED BEQ $24FE Branch if so.
$24EF LDA $52 Add 69 to the sprite graphic address. This points it at the rightmost end of the next row of pixels down in the second middle section speech bubble sprite at $CA80.
$24F1 CLC
$24F2 ADC #$45
$24F4 BCC $24F8
$24F6 INC $53
$24F8 STA $52
$24FA PLA Restore the remainder of the pixel column to A.
$24FB JMP $24B5 Jump back to deal with the next pixel.
$24FE PLA Balance the stack before returning.
$24FF RTS
Prev: $246B Up: Map Next: $2500