Prev: B77B Up: Map Next: B7F9
B7BA: Draw Sprite Block To Screen
Used by the routines at Controller_Tile and E329.
Input
DE Screen Buffer Co-ordinates
HL Sprite data
A Sprite ID
C Sprite attribute value
DrawSprite B7BA PUSH AF Stash AF, HL, BC and DE on the stack.
B7BB PUSH HL
B7BC PUSH BC
B7BD PUSH DE
B7BE EX DE,HL Exchange the DE and HL registers.
B7BF PUSH HL Stash HL on the stack.
B7C0 LD D,$58 D=58.
B7C2 LD E,L E=L.
B7C3 LD L,H L=H.
B7C4 LD H,$00 H=00.
B7C6 ADD HL,HL HL=(HL*20)+DE.
B7C7 ADD HL,HL
B7C8 ADD HL,HL
B7C9 ADD HL,HL
B7CA ADD HL,HL
B7CB ADD HL,DE
B7CC LD (HL),C Write C to *HL.
B7CD POP HL Restore HL from the stack.
B7CE LD L,H L=H.
B7CF LD D,$00 D=00.
B7D1 LD H,D H=D.
B7D2 PUSH DE Stash DE on the stack.
B7D3 ADD HL,HL HL*=10.
B7D4 ADD HL,HL
B7D5 ADD HL,HL
B7D6 ADD HL,HL
B7D7 LD DE,$81F8 HL+=ScreenBuffer_Locations.
B7DA ADD HL,DE
B7DB LD E,(HL) E=*HL.
B7DC INC HL Increment HL by one.
B7DD LD D,(HL) D=*HL.
B7DE EX DE,HL Switch the DE and HL registers.
B7DF POP DE Restore DE from the stack.
B7E0 ADD HL,DE HL+=DE.
B7E1 EX DE,HL Switch the DE and HL registers.
B7E2 LD L,A Create an offset in HL.
B7E3 LD H,$00
B7E5 ADD HL,HL HL*=08.
B7E6 ADD HL,HL
B7E7 ADD HL,HL
This is modified from B872.
B7E8 LD BC,$DFDC HL+=Font.
B7EB ADD HL,BC
B7EC LD B,$08 B=08 (counter).
DrawSprite_Loop B7EE LD A,(HL) Copy a byte from *HL and write it to *DE.
B7EF LD (DE),A
B7F0 INC HL Increment HL by one.
B7F1 INC D Increment D by one.
B7F2 DJNZ DrawSprite_Loop Decrease counter by one and loop back to DrawSprite_Loop until counter is zero.
B7F4 POP DE Restore DE, BC, HL and AF from the stack.
B7F5 POP BC
B7F6 POP HL
B7F7 POP AF
B7F8 RET Return.
Prev: B77B Up: Map Next: B7F9