![]() |
Routines |
| Prev: CEAB | Up: Map | Next: CFA7 |
|
Used by the routines at UpdateLightYears, DisplayObjectsCarried, CopyAreaToScreen and DrawChangedObjects.
Copies an area of the screen buffer to the screen, a line at a time.
|
||||||||||||||
|
Copy one line, then move up.
|
||||||||||||||
| CopyBlockToScreen | CF85 | PUSH BC | Stash BC, DE and HL on the stack. | |||||||||||
| CF86 | PUSH DE | |||||||||||||
| CF87 | PUSH HL | |||||||||||||
| CF88 | LD B,$00 | Set B to 00. | ||||||||||||
| CF8A | LDIR | Copy C bytes from HL to DE. | ||||||||||||
| CF8C | POP HL | Restore HL from the stack. | ||||||||||||
| CF8D | LD DE,$0020 | Move HL up by 0020 bytes. | ||||||||||||
| CF90 | ADD HL,DE | |||||||||||||
| CF91 | POP DE | Restore DE from the stack. | ||||||||||||
| CF92 | DEC D | Decrement D. | ||||||||||||
| CF93 | LD A,D | Fetch D and invert it. | ||||||||||||
| CF94 | CPL | |||||||||||||
| CF95 | AND %00000111 | Keep bits 0 to 2. | ||||||||||||
| CF97 | JR NZ,CopyBlockToScreen_Next | Jump to CopyBlockToScreen_Next if it is not zero. | ||||||||||||
| CF99 | LD A,E | Subtract 20 from E. | ||||||||||||
| CF9A | SUB $20 | |||||||||||||
| CF9C | LD E,A | |||||||||||||
| CF9D | JR C,CopyBlockToScreen_Next | Jump to CopyBlockToScreen_Next if carry is set. | ||||||||||||
| CF9F | LD A,D | Add 08 to D. | ||||||||||||
| CFA0 | ADD A,$08 | |||||||||||||
| CFA2 | LD D,A | |||||||||||||
| CopyBlockToScreen_Next | CFA3 | POP BC | Restore BC from the stack. | |||||||||||
| CFA4 | DJNZ CopyBlockToScreen | Jump to CopyBlockToScreen until B is zero. | ||||||||||||
| CFA6 | RET | Return. | ||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: CEAB | Up: Map | Next: CFA7 |