Prev: 9BEB Up: Map Next: AB55
AAEB: Draw 16 x 16 bitmap shifted to pixel position.
Input
A Bitmap index.
Output
BitmapX AAEB DEFB $00 Bitmap Position X
BitmapY AAEC DEFB $00 Bitmap position Y
AAED DEFB $00
Bitmap16Draw AAEE DI Draw an objects bitmap.
AAEF PUSH AF
AAF0 PUSH HL
AAF1 PUSH BC
AAF2 PUSH DE
AAF3 PUSH IX
AAF5 EXX
AAF6 LD L,A Get bitmap address from index.
AAF7 LD H,$00
AAF9 ADD HL,HL
AAFA ADD HL,HL
AAFB ADD HL,HL
AAFC ADD HL,HL
AAFD ADD HL,HL
AAFE LD DE,Bmp_Wally
AB01 ADD HL,DE
AB02 LD A,(BitmapX)
AB05 LD B,A
AB06 AND $07 Position in pixels, within character area.
AB08 INC A
AB09 LD ($AB32),A
AB0C LD A,B Get X position. (XXXXX000)
AB0D AND $F8
AB0F RRCA
AB10 RRCA
AB11 RRCA
AB12 LD ($AB26),A
AB15 EXX
AB16 LD HL,(BitmapY) Get correct row on DF
AB19 ADD HL,HL
AB1A LD DE,DF_lookup
AB1D ADD HL,DE
AB1E LD C,$10 Height of object bitmap
Bitmap16Draw_Row AB20 LD E,(HL) Get DF row
AB21 INC HL
AB22 LD D,(HL)
AB23 INC HL
AB24 PUSH HL
AB25 LD HL,$0000 Offset by X position (value set by code above)
AB28 ADD HL,DE
AB29 EXX
AB2A LD D,(HL) Get bitmap row
AB2B INC HL
AB2C LD E,(HL)
AB2D INC HL
AB2E PUSH DE
AB2F EXX
AB30 POP DE
AB31 LD B,$00 Amount to shift bitmap by. (Modified by above code).
AB33 DEC B
AB34 JR Z,BitmapX_1
AB36 XOR A
BitmapX_0 AB37 SRL D
AB39 RR E
AB3B RRA
AB3C DJNZ BitmapX_0
AB3E LD B,(HL) Merge with background.
AB3F XOR B
AB40 LD (HL),A
BitmapX_1 AB41 DEC HL
AB42 LD A,(HL)
AB43 XOR E
AB44 LD (HL),A
AB45 DEC HL
AB46 LD A,(HL)
AB47 XOR D
AB48 LD (HL),A
AB49 POP HL
AB4A DEC C
AB4B JP NZ,Bitmap16Draw_Row
AB4E POP IX
AB50 POP DE
AB51 POP BC
AB52 POP HL
AB53 POP AF
AB54 RET
Prev: 9BEB Up: Map Next: AB55