Prev: 8C2D Up: Map Next: 8CEA
8C72: Create a door bitmap for opening / closing animation.
Used by the routine at EventDoorOpenClose.
Input
A Door animation frame index.
IX Door information
Output
Blits inner 'door' part of door image to memory.
Memory image if shifted for 4 pixel animation.
Door_CreateBitmap 8C72 PUSH AF
8C73 LD L,(IX+$02) Calculate address of bitmap info from index.
8C76 LD H,$00
8C78 ADD HL,HL
8C79 ADD HL,HL
8C7A LD DE,Bitmap_PtrTable
8C7D ADD HL,DE
8C7E LD E,(HL) Get address of bitmap.
8C7F INC HL
8C80 LD D,(HL)
8C81 LD HL,$0029 Offset to miss out the door frame part of image.
8C84 ADD HL,DE
8C85 LD DE,ScratchPad Use spare memory for blitting to.
8C88 CP $02
8C8A JR NC,Door_CreateBitmap_1
Door fully closed.
8C8C LD C,$C0
Door_CreateBitmap_0 8C8E LDI Blit two columns
8C90 LDI
8C92 LDI
8C94 INC HL Skip two columns (door frame)
8C95 INC HL
8C96 DEC C
8C97 JR NZ,Door_CreateBitmap_0
8C99 JR Door_CreateBitmap_6
Door_CreateBitmap_1 8C9B CP $04
8C9D JR NC,Door_CreateBitmap_3
Door one third open.
8C9F LD C,$90
8CA1 LD A,$FF
Door_CreateBitmap_2 8CA3 INC HL
8CA4 LDI Blit two columns
8CA6 LDI
8CA8 LD (DE),A Blit blank column
8CA9 INC DE
8CAA INC HL Skip two columns
8CAB INC HL
8CAC DEC C
8CAD JR NZ,Door_CreateBitmap_2
8CAF JR Door_CreateBitmap_6
Door_CreateBitmap_3 8CB1 CP $06
8CB3 JR NC,Door_CreateBitmap_5
Door two thirds open.
8CB5 LD C,$60
8CB7 LD A,$FF
Door_CreateBitmap_4 8CB9 INC HL Skip two columns
8CBA INC HL
8CBB LDI Blit one column
8CBD LD (DE),A Blank two columns
8CBE INC DE
8CBF LD (DE),A
8CC0 INC DE
8CC1 INC HL Skip two columns
8CC2 INC HL
8CC3 DEC C
8CC4 JR NZ,Door_CreateBitmap_4
8CC6 JR Door_CreateBitmap_6
Door fully open.
Door_CreateBitmap_5 8CC8 LD HL,ScratchPad Blank image.
8CCB INC DE
8CCC LD (HL),$FF
8CCE LD BC,$008F
8CD1 LDIR
Determine inbetween frame.
Door_CreateBitmap_6 8CD3 POP AF Get back animation count
8CD4 BIT 0,A If the frame index is even, finish.
8CD6 RET Z
8CD7 LD HL,ScratchPad_DoorBottom If the frame index is odd, shift the image 4 pixels.
8CDA LD B,$30
Shift door by a nibble
Door_CreateBitmap_7 8CDC LD A,$FF
8CDE RLD
8CE0 DEC HL
8CE1 RLD
8CE3 DEC HL
8CE4 RLD
8CE6 DEC HL
8CE7 DJNZ Door_CreateBitmap_7
Door_PreFrameTable 8CE9 RET
Prev: 8C2D Up: Map Next: 8CEA