Prev: 29376 Up: Map Next: 29438
29397: Copy Origin Attributes
Used by the routine at SetOrigin.
Copies attribute rows from SourceOrigin into DestinationOrigin until *DestinationOrigin_Height equals the stop patched by SetOrigin. SetOrigin and ResetOrigin also patch the width copied on each row.
CopyOrigin_Attributes 29397 LD BC,(29495) Fetch *SourceOrigin.
29401 CALL AttributeRow Call AttributeRow.
29404 PUSH HL Stash the source pointer on the stack.
29405 LD BC,(29497) Fetch *DestinationOrigin.
29409 CALL AttributeRow Call AttributeRow.
29412 POP DE Copy the source pointer into DE (using the stack).
The width immediate is self-modified by SetOrigin and ResetOrigin.
29413 LD BC,0 Load that width.
29416 EX DE,HL Point HL at the source and DE at the destination.
29417 LDIR Copy one attribute row.
Step to the next row.
29419 LD A,(29496) Increment *SourceOrigin_Row.
29422 INC A
29423 LD (29496),A
29426 LD A,(29498) Decrement *DestinationOrigin_Height.
29429 DEC A
29430 LD (29498),A
The stop immediate is self-modified by SetOrigin_Copy.
29433 CP 0 Jump to CopyOrigin_Attributes until *DestinationOrigin_Height equals that stop.
29435 JR NZ,CopyOrigin_Attributes
29437 RET Return.
Prev: 29376 Up: Map Next: 29438