| Routines

61882: Cycle a character buffer group backwards and scroll the screen left 8 columns

Used by the routines at 30822 and 60539. Cycles one of the character buffer groups in pages 215-221 backwards depending on the current leftmost column of the play area that is on screen (X=(32766)):
X | Character buffer group
--- | ---
0, 56, 112, 168 | 215
8, 64, 120, 176 | 216
16, 72, 128, 184 | 217
24, 80, 136, 192 | 218
32, 88, 144, 200 | 219
40, 96, 152, 208 | 220
48, 104, 160, 216 | 221
61882 | LD A,(32766) | 32766 holds X, the x-coordinate of the leftmost column of the play area on screen
61885 | SUB 56 | A=0, 8, 16, 24, 32, 40 or 48 (depending on the value of X)
61887 | JR NC,61885
61889 | ADD A,56
61891 | RRCA | A=215-221
61892 | RRCA
61893 | RRCA
61894 | ADD A,215
61896 | LD H,A | Point HL at the first byte of the first buffer in the group
61897 | LD L,0
61899 | LD DE,32608 | Copy the first buffer in the group (buffer 1) to 32608 temporarily
61902 | LD BC,25
61905 | LDIR
61907 | LD E,B | Point DE at the first byte of the first buffer in the group
61908 | LD D,H
61909 | LD C,100 | Move buffers 2-5 down into slots 1-4 (thus overwriting buffer 1)
61911 | LDIR
61913 | LD HL,32608 | Copy buffer 1 from its temporary storage location into slot 5
61916 | LD C,25
61918 | LDIR
61920 | JP 59406 | Scroll the screen left 8 columns (the routine at 30822 replaces this instruction with a RET)