Prev: 9B21 Up: Map Next: 9BCD
9B9E: Blits an character bitmap to memory.
Used by the routine at People_Main.
Input
HL Address of bitmap to draw to.
DE Number of bytes offset within bitmap to draw to.
BC Number of bytes to skip after each scan line blit.
A Character index of letter to blit.
Output
The letters are either upper case ROM bitmap or lower case game defined bitmap.
The memory is normally another bitmap and the letter is blitted to an offset.
Char_BlitToMemory 9B9E ADD HL,DE Offset bitmap address by given number of bytes.
9B9F LD DE,$3C00 Use the ROM character set for upper case.
9BA2 CP $60
9BA4 JR C,Char_BlitToMemory_0
9BA6 LD DE,Charset_Start Use the defined character set for lower case letters.
Char_BlitToMemory_0 9BA9 PUSH HL
9BAA LD L,A Convert letter index into bitmap address.
9BAB LD H,$00
9BAD ADD HL,HL
9BAE ADD HL,HL
9BAF ADD HL,HL
9BB0 ADD HL,DE
9BB1 EX DE,HL
9BB2 POP HL
9BB3 DEC BC
9BB4 LD A,$08 Number of scans for a letter.
Char_BlitToMemory_1 9BB6 EX AF,AF'
9BB7 LD A,(DE) Blit letter bitmap into memory by shifting its bits so that the left of the letter appears in the left part of the badge and the right part of the letter in the right.
9BB8 RRD
9BBA RRA
9BBB RRA
9BBC RRA
9BBD RRA
9BBE RLD
9BC0 INC HL
9BC1 RLD
9BC3 LD A,(HL)
9BC4 RRD
9BC6 ADD HL,BC Move onto the next scan down within the memory bitmap.
9BC7 INC DE Next scan for letter.
9BC8 EX AF,AF'
9BC9 DEC A
9BCA JR NZ,Char_BlitToMemory_1
9BCC RET
Prev: 9B21 Up: Map Next: 9BCD