![]() |
Routines |
| Prev: 29397 | Up: Map | Next: 29495 |
|
Used by the routine at SetOrigin.
Copies pixel rows from SourceOrigin into DestinationOrigin until *DestinationOrigin_Height equals the stop patched by SetOrigin.
|
||||
| CopyOrigin_Pixels | 29438 | LD BC,(29495) | Fetch *SourceOrigin. | |
| 29442 | CALL PixelRow | Call PixelRow. | ||
| 29445 | PUSH HL | Stash the source pointer on the stack. | ||
| 29446 | LD BC,(29497) | Fetch *DestinationOrigin. | ||
| 29450 | CALL PixelRow | Call PixelRow. | ||
| 29453 | POP DE | Copy the source pointer into DE (using the stack). | ||
| 29454 | LD A,H | Move the destination seven rows down. | ||
| 29455 | ADD A,7 | |||
| 29457 | LD H,A | |||
| 29458 | LD B,8 | Count the 8 pixel rows to copy. | ||
| 29460 | EX DE,HL | Switch the destination into DE. | ||
|
Copy eight pixel rows.
|
||||
| CopyOrigin_PixelRow | 29461 | PUSH BC | Stash the counters on the stack. | |
| 29462 | PUSH DE | |||
| 29463 | PUSH HL | |||
|
The width immediate is self-modified by SetOrigin and ResetOrigin.
|
||||
| 29464 | LD BC,0 | Load that width. | ||
| 29467 | LDIR | Copy those bytes. | ||
| 29469 | POP HL | Restore the counters from the stack. | ||
| 29470 | POP DE | |||
| 29471 | POP BC | |||
| 29472 | INC H | Step both pointers. | ||
| 29473 | DEC D | |||
| 29474 | DJNZ CopyOrigin_PixelRow | Jump to CopyOrigin_PixelRow until eight pixel rows are done. | ||
| 29476 | LD A,(29496) | Increment *SourceOrigin_Row. | ||
| 29479 | INC A | |||
| 29480 | LD (29496),A | |||
| 29483 | LD A,(29498) | Decrement *DestinationOrigin_Height. | ||
| 29486 | DEC A | |||
| 29487 | LD (29498),A | |||
|
The stop immediate is self-modified by SetOrigin_Copy.
|
||||
| 29490 | CP 0 | Jump to CopyOrigin_Pixels until *DestinationOrigin_Height equals that stop. | ||
| 29492 | JR NZ,CopyOrigin_Pixels | |||
| 29494 | RET | Return. | ||
| Prev: 29397 | Up: Map | Next: 29495 |