![]() |
Routines |
| Prev: 25955 | Up: Map | Next: 26011 |
|
Used by the routines at ScrollPlayarea_Left and ScrollPlayarea_Right.
|
||||||||
| PrepareScrollData | 25956 | ADD A,A | C=A*4. | |||||
| 25957 | ADD A,A | |||||||
| 25958 | LD C,A | |||||||
| 25959 | EXX | Switch to the shadow registers. | ||||||
| 25960 | LD BC,1535 | Set a counter in B of 5 (the 255 in C isn't used). | ||||||
| 25963 | LD DE,30720 | DE=30720. | ||||||
| PrepareScrollData_Loop | 25966 | EXX | Switch back to the normal registers. | |||||
| 25967 | LD A,(DE) | Read the index byte. | ||||||
| 25968 | INC D | Move to the next byte. | ||||||
| 25969 | RRCA | Rotate the index byte right three times to extract the address components. | ||||||
| 25970 | RRCA | |||||||
| 25971 | RRCA | |||||||
| 25972 | LD L,A | Copy the result to L. | ||||||
| 25973 | AND %00011111 | Keep only bits 0-4. | ||||||
| 25975 | ADD A,128 | Add 128 to form the high byte of the graphics address in HL. | ||||||
| 25977 | LD H,A | |||||||
| 25978 | LD A,L | Restore the rotated value. | ||||||
| 25979 | AND %11100000 | Keep only bits 5-7. | ||||||
| 25981 | ADD A,C | Add the scroll offset from C. | ||||||
| 25982 | LD L,A | Complete the graphics address in HL. | ||||||
| 25983 | PUSH HL | Stash the graphics address on the stack. | ||||||
| 25984 | EXX | Switch to the shadow registers. | ||||||
| 25985 | POP HL | Restore the graphics address from the stack. | ||||||
| 25986 | LDI | Copy 4 bytes from the graphics line to the destination. | ||||||
| 25988 | LDI | |||||||
| 25990 | LDI | |||||||
| 25992 | LDI | |||||||
| 25994 | DJNZ PrepareScrollData_Loop | Decrease the row counter by one and loop back to PrepareScrollData_Loop until all the rows have been copied. | ||||||
| 25996 | LD A,(DE) | A=*DE. | ||||||
| 25997 | INC A | Increment A by one. | ||||||
| 25998 | LD (DE),A | Write A to *DE. | ||||||
| 25999 | INC E | Increment E by one. | ||||||
| 26000 | LD A,(DE) | A=*DE. | ||||||
| 26001 | EXX | Switch to the shadow registers. | ||||||
| 26002 | ADD A,B | A+=B. | ||||||
| 26003 | EXX | Switch to the shadow registers. | ||||||
| 26004 | LD (DE),A | Write A to *DE. | ||||||
| 26005 | LD E,2 | E=2. | ||||||
| 26007 | LD B,16 | B=16. | ||||||
| 26009 | EXX | Switch to the shadow registers. | ||||||
| 26010 | RET | Return. | ||||||
| Prev: 25955 | Up: Map | Next: 26011 |