Prev: 72D5 Up: Map Next: 7337
72FE: Copy Origin Pixels
Used by the routine at SetOrigin.
Copies pixel rows from SourceOrigin into DestinationOrigin until *DestinationOrigin_Height equals the stop patched by SetOrigin.
CopyOrigin_Pixels 72FE LD BC,($7337) Fetch *SourceOrigin.
7302 CALL PixelRow Call PixelRow.
7305 PUSH HL Stash the source pointer on the stack.
7306 LD BC,($7339) Fetch *DestinationOrigin.
730A CALL PixelRow Call PixelRow.
730D POP DE Copy the source pointer into DE (using the stack).
730E LD A,H Move the destination seven rows down.
730F ADD A,$07
7311 LD H,A
7312 LD B,$08 Count the 08 pixel rows to copy.
7314 EX DE,HL Switch the destination into DE.
Copy eight pixel rows.
CopyOrigin_PixelRow 7315 PUSH BC Stash the counters on the stack.
7316 PUSH DE
7317 PUSH HL
The width immediate is self-modified by SetOrigin and ResetOrigin.
7318 LD BC,$0000 Load that width.
731B LDIR Copy those bytes.
731D POP HL Restore the counters from the stack.
731E POP DE
731F POP BC
7320 INC H Step both pointers.
7321 DEC D
7322 DJNZ CopyOrigin_PixelRow Jump to CopyOrigin_PixelRow until eight pixel rows are done.
7324 LD A,($7338) Increment *SourceOrigin_Row.
7327 INC A
7328 LD ($7338),A
732B LD A,($733A) Decrement *DestinationOrigin_Height.
732E DEC A
732F LD ($733A),A
The stop immediate is self-modified by SetOrigin_Copy.
7332 CP $00 Jump to CopyOrigin_Pixels until *DestinationOrigin_Height equals that stop.
7334 JR NZ,CopyOrigin_Pixels
7336 RET Return.
Prev: 72D5 Up: Map Next: 7337