Prev: 9BCD Up: Map Next: 9C26
9BCE: Blit bitmap, at (Y,X), aligning to nearest character position.
Used by the routines at Room_Initialise and People_Main.
Input
L Index of bitmap.
A Attribute colour.
B Y position, in pixels.
C X position, in pixels.
Output
Bmp_BlitAtCharPos 9BCE PUSH IX
9BD0 LD ( Temp_blit_attr),A Store colour.
9BD3 LD A,B Store Y position.
9BD4 LD (TempAl),A
9BD7 LD A,C Store X position.
9BD8 LD (TempAh),A
9BDB CALL Bitmap_CopyFrame Cache info on bitmap being blitted.
9BDE LD A,(HL) Store the width.
9BDF AND $7F
9BE1 LD (TempBh),A
9BE4 DEC HL
9BE5 LD A,(HL) Store the height.
9BE6 AND $7F
9BE8 LD (TempBl),A
9BEB LD HL,(Bitmap_InfoCache)
9BEE LD IX,TempAl
9BF2 LD B,(IX+$02) Height of bitmap in chars.
Bmp_BlitAtCharPos_0 9BF5 PUSH BC
9BF6 PUSH HL
9BF7 CALL YX_toAddr Get DF / ATTR address based on X/Y coords.
9BFA EX (SP),HL Swap stack content (holds bitmap address) with DF.
9BFB LD A,( Temp_blit_attr) See if any colour is required.
9BFE AND A
9BFF JR Z,Bmp_BlitAtCharPos_2
9C01 LD B,(IX+$03) Width.
Bmp_BlitAtCharPos_1 9C04 LD (DE),A Colour a single line, width of sprite in chars.
9C05 INC DE
9C06 DJNZ Bmp_BlitAtCharPos_1
Bmp_BlitAtCharPos_2 9C08 LD A,$08 8 scans per one char.
9C0A POP DE Get DF address.
Bmp_BlitAtCharPos_3 9C0B PUSH DE
9C0C LD C,(IX+$03) Width.
9C0F LD B,$00
9C11 LDIR Blit next scan of bitmap.
9C13 POP DE Next scan down.
9C14 INC D
9C15 DEC A
9C16 JR NZ,Bmp_BlitAtCharPos_3
9C18 LD A,$08
9C1A ADD A,(IX+$00) Next character row down.
9C1D LD (IX+$00),A
9C20 POP BC Next character row.
9C21 DJNZ Bmp_BlitAtCharPos_0
9C23 POP IX
9C25 RET
Prev: 9BCD Up: Map Next: 9C26