Prev: 959C Up: Map Next: 9615
95A8: Set up and blit a door.
Used by the routine at Bg_CalcAndDraw.
Input
IX Ptr current background door data.
Output
Bg_BlitDoor 95A8 LD A,(Bg_ColumnsLeft)
95AB CP $02
95AD JP NZ,Bg_BlitItemColumn
95B0 LD A,(IX+$00) Only door type $92 has a number, skip for rest.
95B3 CP $92
95B5 JR NZ,Bg_BlitDoor_0
95B7 LD A,(Bg_DoorNumber)
95BA AND A
95BB JR Z,Bg_BlitDoor_0
95BD LD HL,$0092 Blit next door number to bitmap $92.
95C0 CALL Door_DrawDigits
Bg_BlitDoor_0 95C3 LD DE,(_9689_coordsA)
95C7 INC DE
95C8 LD HL,Door_cache See if door already exists in list for current background.
95CB LD B,$06
Bg_BlitDoor_1 95CD LD A,(HL)
95CE INC HL
95CF CP E
95D0 JR NZ,Bg_BlitDoor_2
95D2 LD A,(HL)
95D3 CP D
95D4 JP Z,Bg_BlitItemColumn
Bg_BlitDoor_2 95D7 INC HL
95D8 INC HL
95D9 INC HL
95DA DJNZ Bg_BlitDoor_1
95DC LD BC,$0014
95DF LD A,(Hero_LastDirection) Is player facing left?
95E2 CP $02
95E4 JR NZ,Bg_BlitDoor_3
95E6 LD DE,$B199 Shift existing doors down the list. New door will be added to the start of list.
95E9 LD HL,$B195
95EC LDDR
95EE LD HL,Door_cache
95F1 JR Bg_BlitDoor_4
Bg_BlitDoor_3 95F3 LD HL,$B186 Shift existing doors up the list. New door will be added to the end of the list.
95F6 LD DE,Door_cache
95F9 LDIR
95FB LD HL,$B196
Bg_BlitDoor_4 95FE LD DE,(_9689_coordsA) Store position and door type into slot.
9602 INC DE
9603 LD (HL),E
9604 INC HL
9605 LD (HL),D
9606 INC HL
9607 LD A,(IX+$00)
960A LD (HL),A
960B INC HL
960C LD DE,(_NextBlock)
9610 LD A,(DE)
9611 LD (HL),A
9612 JP Bg_BlitItemColumn
Prev: 959C Up: Map Next: 9615