Prev: 29497 Up: Map Next: 29570
29499: Set Drawing Origin
Used by the routine at DrawFromOrigin.
Opcode 241 stores the source and destination from the picture record, patches the copy widths and loop stops, then copies pixels and attributes. The destination row counts down, so the rectangle is drawn upside down. ResetOrigin enters at SetOrigin_Copy.
Input
IX Picture record
SetOrigin 29499 LD A,(IX+1) Write the source column to *SourceOrigin and *DestinationOrigin.
29502 LD (29495),A
29505 LD (29497),A
29508 LD A,(IX+2) Write the source row to *SourceOrigin_Row.
29511 LD (29496),A
29514 LD A,(IX+3) Write the destination row to *DestinationOrigin_Height.
29517 LD (29498),A
29520 LD A,(IX+4) Self-modify the copy widths at 29465 and 29414.
29523 LD (29465),A
29526 LD (29414),A
29529 LD A,(IX+3) Subtract the source row from the destination row.
29532 SUB (IX+2)
29535 AND A Halve that span.
29536 RRA
This entry point is used by the routine at ResetOrigin.
Patch the loop stops and copy from the origin.
SetOrigin_Copy 29537 LD (29491),A Self-modify the loop stops at 29491 and 29434.
29540 LD (29434),A
29543 LD BC,(29495) Fetch *SourceOrigin.
29547 LD DE,(29497) Fetch *DestinationOrigin.
29551 PUSH BC Stash BC and DE on the stack.
29552 PUSH DE
Copy the pixels, then put the origins back.
29553 CALL CopyOrigin_Pixels Call CopyOrigin_Pixels.
29556 POP DE Restore DE and BC from the stack.
29557 POP BC
29558 LD (29495),BC Write BC to *SourceOrigin.
29562 LD (29497),DE Write DE to *DestinationOrigin.
Copy the attributes.
29566 CALL CopyOrigin_Attributes Call CopyOrigin_Attributes.
29569 RET Return.
Prev: 29497 Up: Map Next: 29570