Prev: 51601 Up: Map Next: 51674
51635: Copy Attributes
Not used. Copies attributes from the bytes that follow the width and height of an area, rather than filling the area with one value as FillAttributes does.
Input
DE Address of the area
HL Position (H is the pixel row and L is the pixel column)
CopyAttributes 51635 PUSH HL Stash HL on the stack.
51636 LD A,(DE) Read DE.
51637 LD B,A B=A.
51638 INC DE Advance DE.
51639 LD A,(DE) Read DE.
51640 LD C,A C=A.
51641 CALL AttributeAddress Call AttributeAddress.
51644 LD A,B A=B.
51645 LD (23580),A The width of the attribute area.
51648 INC DE Advance DE.
CopyAttributes_Row 51649 PUSH HL Stash HL on the stack.
51650 LD A,(23580) The width of the attribute area.
51653 LD B,A B=A.
CopyAttributes_Byte 51654 LD A,(DE) Read DE.
51655 LD (HL),A Write A where HL points.
51656 INC DE Advance DE.
51657 INC HL Advance HL.
51658 DJNZ CopyAttributes_Byte Decrease B and jump to CopyAttributes_Byte until none remain.
51660 POP HL Bring HL back off the stack.
51661 PUSH DE Stash DE on the stack.
51662 LD DE,32 DE=32.
51665 AND A Is A zero?
51666 SBC HL,DE Subtract DE and the carry from HL.
51668 POP DE Bring DE back off the stack.
51669 DEC C Step C back.
51670 JR NZ,CopyAttributes_Row Jump to CopyAttributes_Row if the zero flag is clear.
51672 POP HL Bring HL back off the stack.
51673 RET Return.
Prev: 51601 Up: Map Next: 51674