Prev: 7B43 Up: Map Next: 7BDC
7B47: Routine at 7B47
Used by the routines at Vectors and BackgroundAnimate.
Input
A _todo
L Index to Bitmap Data
B Y position (in pixels).
C X position (in pixels).
BlitBitmap_7B47 7B47 PUSH IX
7B49 LD (Temp_A),A
7B4C LD A,B
7B4D LD ( s0),A
7B50 LD A,C
7B51 LD ( s1),A
7B54 LD H,$00 (Bitmap Data Index)*4(size) + Start Address
7B56 ADD HL,HL
7B57 ADD HL,HL
7B58 LD BC, BitmapData_E
7B5B ADD HL,BC
7B5C LD E,(HL) Get bitmap offset address
7B5D INC HL
7B5E LD D,(HL)
7B5F INC HL
7B60 LD A,(HL) Get bitmaps height (in chars)
7B61 LD (Temp_H),A
7B64 AND $7F Mask off flag for true height in chars.
7B66 LD ( s2),A
7B69 INC HL
7B6A LD A,(HL) Get width (in char blocks)
7B6B AND $7F
7B6D LD C,A
7B6E LD B,$00
7B70 LD (Temp_W),BC
7B74 LD ( s3),A
7B77 LD HL,BmpStart_E Get true bitmap address.
7B7A ADD HL,DE
7B7B LD IX, s0
7B7F LD B,(IX+$02)
Draw
BlitBitmap_7B47_0 7B82 PUSH BC
7B83 PUSH HL
7B84 CALL Vector_PosToScr
7B87 EX (SP),HL
7B88 PUSH HL
7B89 LD A,(Temp_A)
7B8C AND A
7B8D JR Z,BlitBitmap_7B47_2
7B8F LD B,(IX+$03)
BlitBitmap_7B47_1 7B92 LD (DE),A
7B93 INC DE
7B94 DJNZ BlitBitmap_7B47_1
7B96 LD A,(Temp_H)
7B99 BIT 7,A
7B9B JR NZ,BlitBitmap_7B47_4
7B9D JR BlitBitmap_7B47_3
BlitBitmap_7B47_2 7B9F LD A,(Temp_H)
7BA2 BIT 7,A
7BA4 JR NZ,BlitBitmap_7B47_4
7BA6 LD C,(IX+$03) Get number of columns to draw and blit 1 scan of bitmap
7BA9 LD B,$00
7BAB LDIR
BlitBitmap_7B47_3 7BAD LD HL,(Temp_W)
7BB0 POP BC
7BB1 ADD HL,BC
7BB2 LD A,$08
7BB4 POP DE
7BB5 JR BlitBitmap_7B47_5
BlitBitmap_7B47_4 7BB7 POP HL Get next bitmap address.
7BB8 LD A,$08 Draw for 8 scan lines down.
7BBA POP DE Get next screen address to blit to.
Draw a block
BlitBitmap_7B47_5 7BBB PUSH DE
7BBC PUSH HL
7BBD LD C,(IX+$03) Get number of columns to blit.
7BC0 LD B,$00
7BC2 LDIR Blit
7BC4 LD HL,(Temp_W)
7BC7 POP BC
7BC8 ADD HL,BC Get number of bytes per column and move onto next bitmap line.
7BC9 POP DE Get previous screen address and move down a scan.
7BCA INC D
7BCB DEC A
7BCC JR NZ,BlitBitmap_7B47_5
7BCE LD A,$08 Update Y position to next block down (8 scans)
7BD0 ADD A,(IX+$00)
7BD3 LD (IX+$00),A
7BD6 POP BC Number of blocks left to draw.
7BD7 DJNZ BlitBitmap_7B47_0
7BD9 POP IX
7BDB RET
Prev: 7B43 Up: Map Next: 7BDC