![]() |
Routines |
Prev: 6563 | Up: Map | Next: 659B |
Used by the routines at ScrollPlayarea_Left and ScrollPlayarea_Right.
|
||||||||
PrepareScrollData | 6564 | ADD A,A | C=A*04. | |||||
6565 | ADD A,A | |||||||
6566 | LD C,A | |||||||
6567 | EXX | Switch to the shadow registers. | ||||||
6568 | LD BC,$05FF | Set a counter in B of 05 (the FF in C isn't used). | ||||||
656B | LD DE,$7800 | DE=7800. | ||||||
PrepareScrollData_Loop | 656E | EXX | Switch back to the normal registers. | |||||
656F | LD A,(DE) | Read the index byte. | ||||||
6570 | INC D | Move to the next byte. | ||||||
6571 | RRCA | Rotate the index byte right three times to extract the address components. | ||||||
6572 | RRCA | |||||||
6573 | RRCA | |||||||
6574 | LD L,A | Copy the result to L. | ||||||
6575 | AND %00011111 | Keep only bits 0-4. | ||||||
6577 | ADD A,$80 | Add 80 to form the high byte of the graphics address in HL. | ||||||
6579 | LD H,A | |||||||
657A | LD A,L | Restore the rotated value. | ||||||
657B | AND %11100000 | Keep only bits 5-7. | ||||||
657D | ADD A,C | Add the scroll offset from C. | ||||||
657E | LD L,A | Complete the graphics address in HL. | ||||||
657F | PUSH HL | Stash the graphics address on the stack. | ||||||
6580 | EXX | Switch to the shadow registers. | ||||||
6581 | POP HL | Restore the graphics address from the stack. | ||||||
6582 | LDI | Copy 04 bytes from the graphics line to the destination. | ||||||
6584 | LDI | |||||||
6586 | LDI | |||||||
6588 | LDI | |||||||
658A | DJNZ PrepareScrollData_Loop | Decrease the row counter by one and loop back to PrepareScrollData_Loop until all the rows have been copied. | ||||||
658C | LD A,(DE) | A=*DE. | ||||||
658D | INC A | Increment A by one. | ||||||
658E | LD (DE),A | Write A to *DE. | ||||||
658F | INC E | Increment E by one. | ||||||
6590 | LD A,(DE) | A=*DE. | ||||||
6591 | EXX | Switch to the shadow registers. | ||||||
6592 | ADD A,B | A+=B. | ||||||
6593 | EXX | Switch to the shadow registers. | ||||||
6594 | LD (DE),A | Write A to *DE. | ||||||
6595 | LD E,$02 | E=02. | ||||||
6597 | LD B,$10 | B=10. | ||||||
6599 | EXX | Switch to the shadow registers. | ||||||
659A | RET | Return. |
Prev: 6563 | Up: Map | Next: 659B |