| Routines

59368: Move a row of the screen left, right, up or down

Used by the routines at 59406 (to move a row left), 59461 (to move a row right), 59516 (to move a row up) and 59575 (to move a row down).
Input
DE | Destination attribute file address
HL | Source attribute file address
59368 | XOR A | Set A=0 initially to indicate that we are copying a row of attribute bytes first
59369 | PUSH HL | Save the source attribute file address
59370 | PUSH DE | Save the destination attribute file address
59371 | LD BC,31 | The operand of this instruction is set to 31 by the routines at 59406 and 59461, and to 32 by the routines at 59516, 59575 and 64618
59374 | LDDR | This instruction is set to LDIR by the routines at 59406, 59516, 59575 and 64618, and to LDDR by the routine at 59461; it copies the source row of attribute bytes or pixels to the destination row
59376 | POP DE | Restore the destination attribute file address to DE
59377 | POP HL | Restore the source attribute file address to HL
59378 | AND A | Have we just copied a row of attribute bytes?
59379 | JR Z,59387 | Jump if so to point DE and HL at the corresponding display file bytes
59381 | INC D | Otherwise point DE and HL at the next destination and source rows of pixels
59382 | INC H
59383 | DEC A | Have we copied 8 rows of pixels yet?
59384 | JR NZ,59369 | Jump back if not
59386 | RET |
59387 | LD A,H | Set HL to the display file address that corresponds to the source attribute file address
59388 | AND 11
59390 | ADD A,A
59391 | ADD A,A
59392 | ADD A,A
59393 | LD H,A
59394 | LD A,D | Set DE to the display file address that corresponds to the destination attribute file address
59395 | AND 11
59397 | ADD A,A
59398 | ADD A,A
59399 | ADD A,A
59400 | LD D,A
59401 | LD A,8 | There are 8 rows of pixels to copy
59403 | JR 59369 | Jump back to copy them