Prev: 63492 Up: Map Next: 63668
63539: Shift Sprite Left
Used by the routine at Draw_Entity.
Draws a left-facing entity by shifting each tile left.
Advance_Entity_Target 63539 AND %01111111 Keep only bits 0-6.
63541 LD (23695),A Write the colour to *ATTR_T.
63544 LD A,(63767) Add 8 to the shift count at 63767 and write it to 63600.
63547 ADD A,8
63549 LD (63600),A
63552 LD DE,(23606) DE=*CHARS.
63556 LD HL,(63798) Copy the stored stride from 63798 into the add at 63630.
63559 LD (63630),HL
63562 XOR A Clear the self-modified OR at Advance_Entity_Merge.
63563 LD H,A
63564 LD (63617),A
63567 LD A,(IX+6) Point HL at the last source tile of this frame.
63570 ADD A,(IX+4)
63573 DEC A
63574 LD L,A
63575 ADD HL,HL
63576 ADD HL,HL
63577 ADD HL,HL
63578 ADD HL,DE
63579 LD E,(IX+4) DE=the sprite width and height.
63582 LD D,(IX+5)
63585 PUSH HL Copy HL to IX (using the stack).
63586 POP IX
63588 LD HL,23742 HL=23742.
Advance_Entity_Continue 63591 PUSH IX Stash the source pointer and remaining size.
63593 PUSH DE
Advance_Entity_Continue2 63594 PUSH IX Stash the source pointer on the stack.
63596 LD B,8 B=8.
Advance_Entity_Target2 63598 PUSH BC Stash the row count.
Advance_Entity_ShiftCount 63599 LD B,255 B=the shift count (self-modified).
63601 LD C,(IX+0) Load the next source byte.
63604 XOR A
63605 LD E,A
Advance_Entity_Target3 63606 SLA C Shift one source bit into the overflow bytes.
63608 RR A
63610 RR E
63612 DJNZ Advance_Entity_Target3
63614 LD (IY+0),E Write the overflow bits to the next column.
Advance_Entity_Merge 63617 NOP Self-modified: NOP or OR (HL).
63618 LD (HL),A Write the rotated byte.
63619 INC HL Advance the destination and source pointers.
63620 INC IX
63622 INC IY
63624 POP BC Restore the row count from the stack.
63625 DJNZ Advance_Entity_Target2 Decrease the count and loop back to Advance_Entity_Target2.
63627 POP IX Restore the source pointer from the stack.
Advance_Entity_Stride 63629 LD BC,0 BC=the stored stride (self-modified).
63632 ADD IX,BC Advance to the next source column and loop back to Advance_Entity_Continue2.
63634 DEC D
63635 JR NZ,Advance_Entity_Continue2
63637 LD A,182 Write OR (HL) into *Advance_Entity_Merge.
63639 LD (63617),A
63642 XOR A A=0.
63643 LD B,8 B=8.
Advance_Entity_Target4 63645 LD (HL),A Clear one overflow byte and loop back to Advance_Entity_Target4.
63646 LD (IY+0),A
63649 INC HL
63650 INC IY
63652 DJNZ Advance_Entity_Target4
63654 POP DE Step back one source character and loop back to Advance_Entity_Continue, then jump to Draw_Entity_Target4.
63655 POP IX
63657 LD BC,65528
63660 ADD IX,BC
63662 DEC E
63663 JR NZ,Advance_Entity_Continue
63665 JP Draw_Entity_Target4
Prev: 63492 Up: Map Next: 63668