Prev: 859A Up: Map Next: 8798
85E1: Baddy Sprite Blit
SpriteBlit_DataWidth 85E1 DEFW $0000
SpriteBlit_Data2 85E3 DEFB $00
This entry point is used by the routines at Vectors, SidheUpdate, 87BF and Action_FaceFunc.
SpriteBlit 85E4 PUSH IX Store sprite data pointer
85E6 LD L,(IX+$0B) Index to bitmap data. data_width+(i*4)
85E9 LD H,$00
85EB ADD HL,HL
85EC ADD HL,HL
85ED LD DE,BitmapData_Width
85F0 ADD HL,DE
85F1 LD A,(IX+$04)
85F4 AND A
85F5 JR Z,SpriteBlit_DataWidth_0
85F7 LD A,$AE
85F9 LD ($872D),A
85FC LD ($876A),A
85FF LD A,$A9
8601 LD ($8784),A
8604 JR SpriteBlit_DataWidth_1
SpriteBlit_DataWidth_0 8606 LD A,$B6
8608 LD ($872D),A
860B LD ($876A),A
860E LD A,$B1
8610 LD ($8784),A
8613 LD A,(CamDirection_DFD2)
8616 SUB (IX+$02)
8619 AND $03
861B SUB $02
861D XOR (HL)
861E AND $80
8620 JR Z,SpriteBlit_DataWidth_1
8622 PUSH HL
8623 LD L,(IX+$0B)
8626 LD H,$00
8628 CALL Vector_BitmapMirror
862B POP HL
SpriteBlit_DataWidth_1 862C LD A,(HL) Get bitmap width
862D AND $7F
862F LD ( s3),A
8632 LD E,A
8633 LD D,$00
8635 LD (SpriteBlit_DataWidth),DE
8639 DEC HL Get bitmap height
863A LD A,(HL)
863B AND $7F
863D LD ( s2),A
8640 DEC HL Get bitmap offset. $9436+(offset)
8641 LD D,(HL)
8642 DEC HL
8643 LD E,(HL)
8644 LD HL,BmpStart_E
8647 ADD HL,DE
8648 PUSH HL
8649 LD A,(CamDirection_DFD2)
864C BIT 0,A
864E JR Z,SpriteBlit_DataWidth_2
8650 LD HL,(ManData_PosPrimary_dfc3) Camera is E/W
8653 LD E,(IX+$05)
8656 LD D,(IX+$06)
8659 JR SpriteBlit_DataWidth_3
SpriteBlit_DataWidth_2 865B LD HL,(ManData_PosSecondary_dfc5) Camera is N/S
865E LD E,(IX+$07)
8661 LD D,(IX+$08)
SpriteBlit_DataWidth_3 8664 BIT 1,A Test camera for N/E or S/W
8666 JR NZ,SpriteBlit_DataWidth_4
8668 EX DE,HL Camera is S/W
SpriteBlit_DataWidth_4 8669 AND A
866A SBC HL,DE
866C LD DE,$0020
866F ADD HL,DE
8670 LD DE,(SpriteBlit_DataWidth)
8674 AND A
8675 SBC HL,DE
8677 JP P,SpriteBlit_DataWidth_5
867A LD A,$01
867C LD (SpriteBlit_Data2),A
867F LD E,L
8680 LD D,H
8681 LD A,L
8682 CPL
8683 LD C,A
8684 LD A,H
8685 CPL
8686 LD B,A
8687 INC BC
8688 INC BC
8689 SRA B
868B RR C
868D POP HL
868E ADD HL,BC
868F PUSH HL
8690 LD A,( s3)
8693 SUB C
8694 LD ( s3),A
8697 XOR A
8698 JR SpriteBlit_DataWidth_7
SpriteBlit_DataWidth_5 869A XOR A
869B LD (SpriteBlit_Data2),A
869E LD E,L
869F LD D,H
86A0 SRA H
86A2 RR L
86A4 LD BC,$0020
86A7 AND A
86A8 SBC HL,BC
86AA LD BC,(SpriteBlit_DataWidth)
86AE AND A
86AF ADC HL,BC
86B1 JP M,SpriteBlit_DataWidth_6
86B4 LD A,( s3)
86B7 SUB L
86B8 LD ( s3),A
86BB LD A,$02
86BD LD (SpriteBlit_Data2),A
SpriteBlit_DataWidth_6 86C0 LD A,E
86C1 AND $FE
86C3 RRA
SpriteBlit_DataWidth_7 86C4 LD L,(IX+$09)
86C7 LD H,$00
86C9 ADD HL,HL
86CA LD C,L
86CB LD B,H
86CC ADD HL,HL
86CD ADD HL,HL
86CE ADD HL,HL
86CF ADD HL,HL
86D0 ADD HL,BC
86D1 LD C,A
86D2 LD B,$00
86D4 ADD HL,BC
86D5 LD BC,OffScreen0
86D8 ADD HL,BC
86D9 LD A,(IX+$04)
86DC AND A
86DD JR NZ,SpriteBlit_DataWidth_10
86DF PUSH DE
86E0 LD (Baddy_OffscreenPtr),HL
86E3 LD A,( s3)
86E6 LD C,A
86E7 BIT 0,E
86E9 JR Z,SpriteBlit_DataWidth_8
86EB LD A,(SpriteBlit_Data2)
86EE BIT 1,A
86F0 JR NZ,SpriteBlit_DataWidth_8
86F2 INC C
SpriteBlit_DataWidth_8 86F3 LD A,( s2)
86F6 RLA
86F7 RLA
86F8 RLA
86F9 AND $F8
86FB LD B,A
86FC LD (BaddyWidth),BC
8700 LD DE,$F53A
8703 LD B,$00
SpriteBlit_DataWidth_9 8705 PUSH BC
8706 PUSH HL
8707 LDIR
8709 POP HL
870A LD BC,$0022
870D ADD HL,BC
870E POP BC
870F DEC A
8710 JR NZ,SpriteBlit_DataWidth_9
8712 LD HL,(Baddy_OffscreenPtr)
8715 POP DE
SpriteBlit_DataWidth_10 8716 BIT 0,E
8718 JP NZ,SpriteBlit_DataWidth_13
871B LD A,( s2)
871E RLA
871F RLA
8720 RLA
8721 AND $F8
8723 LD C,A
8724 LD A,( s3)
8727 LD B,A
8728 POP DE
SpriteBlit_DataWidth_11 8729 PUSH BC
872A PUSH HL
872B PUSH DE
SpriteBlit_DataWidth_12 872C LD A,(DE)
872D OR (HL)
872E LD (HL),A
872F INC HL
8730 INC DE
8731 DJNZ SpriteBlit_DataWidth_12
8733 POP DE
8734 LD HL,(SpriteBlit_DataWidth)
8737 ADD HL,DE
8738 EX DE,HL
8739 POP HL
873A LD BC,$0022
873D ADD HL,BC
873E POP BC
873F DEC C
8740 JR NZ,SpriteBlit_DataWidth_11
8742 POP IX
8744 RET
SpriteBlit_DataWidth_13 8745 LD A,( s2)
8748 RLA
8749 RLA
874A RLA
874B AND $F8
874D LD C,A
874E LD A,( s3)
8751 LD B,A
8752 EX DE,HL
8753 POP HL
SpriteBlit_DataWidth_14 8754 PUSH BC
8755 PUSH HL
8756 PUSH DE
8757 LD A,(SpriteBlit_Data2)
875A AND $01
875C JR Z,SpriteBlit_DataWidth_15
875E DEC HL
875F LD C,(HL)
8760 INC HL
8761 LD A,B
8762 AND A
8763 JR Z,SpriteBlit_DataWidth_16
8765 LD A,C
SpriteBlit_DataWidth_15 8766 RRD
8768 LD C,A
8769 LD A,(DE)
876A OR (HL)
876B LD (DE),A
876C LD A,C
876D RLD
876F INC HL
8770 INC DE
8771 LD A,C
8772 DJNZ SpriteBlit_DataWidth_15
8774 LD A,(SpriteBlit_Data2)
8777 BIT 1,A
8779 JR NZ,SpriteBlit_DataWidth_17
SpriteBlit_DataWidth_16 877B LD A,C
877C RLA
877D RLA
877E RLA
877F RLA
8780 AND $F0
8782 LD C,A
8783 LD A,(DE)
8784 OR C
8785 LD (DE),A
SpriteBlit_DataWidth_17 8786 POP DE
8787 LD HL,$0022
878A ADD HL,DE
878B EX DE,HL
878C POP BC
878D LD HL,(SpriteBlit_DataWidth)
8790 ADD HL,BC
8791 POP BC
8792 DEC C
8793 JR NZ,SpriteBlit_DataWidth_14
8795 POP IX
8797 RET
Prev: 859A Up: Map Next: 8798