| Routines

25080: Scroll the screen right 8 columns

Used by the routine at 28160.
25080 | LD B,8 | 8 columns will be scrolled on
25082 | PUSH BC | Save the column counter
25083 | LD HL,23198 | First shift the attributes one place to the right
25086 | LD DE,23199
25089 | LD BC,671
25092 | LDDR
25094 | CALL 63561 | Scroll the display file one character square to the right
25097 | DEC A | Adjust the leftmost column of the play area now on screen (held at 32767)
25098 | LD (32767),A
25101 | LD HL,5120 | H=20 (bottom row of the screen), L=0 (column at the far left)
25104 | PUSH HL |
25105 | CALL 24684 | Print the play area character square at row H, column L=0
25108 | POP HL |
25109 | DEC H | Next row up
25110 | JP P,25104 | Jump back until all 21 squares in the column have been printed
25113 | POP BC | Restore the column counter to B
25114 | DJNZ 25082 | Jump back until 8 columns have been scrolled on
The screen has been scrolled right 8 columns. Check whether any of the minor characters may be teleported without us noticing.
25116 | LD A,(32767) | A=leftmost column of the play area now on screen
25119 | LD B,4 | 4 little girls, starting with 186=little girl no. 4
25121 | LD H,186
25123 | CP 112 | Was the skool gate in the middle of the screen before scrolling?
25125 | JR Z,25134 | Jump if so (to consider teleporting little girls 4-7)
25127 | CP 72 | Was the boys' skool door in the middle of the screen before scrolling?
25129 | RET NZ | Return if not
25130 | LD H,183 | 183=little girl no. 1
The next section of code moves certain off-screen minor characters straight to their destination. Sneaky! This entry point is used by the routine at 25026 with H=190 (little boy no. 1).
25132 | LD B,3 |
This entry point is used by the routines at 25026 (with H=193, B=5) and 63309.
25134 | LD L,29 | Bit 3 of byte 29 is set if the character should be moved immediately to the next destination in his command list
25136 | BIT 3,(HL)
25138 | JR Z,25182 | Jump if this character should not be 'teleported'
25140 | RES 3,(HL) | Reset bit 3 now, so that this character is not considered for teleportation again during this lesson
25142 | DEC L | L=28
25143 | LD D,(HL) | Collect the address reached in the command list into DE
25144 | DEC L
25145 | LD E,(HL)
25146 | LD A,(DE) | A=LSB of this address
25147 | SUB 100 | Is this the address of the routine at 25700?
25149 | JR NZ,25182 | Jump if not
25151 | DEC L | L=26
25152 | INC DE | Point DE at the location coordinates (the parameters of 25700 in the command list)
25153 | INC DE
25154 | LD (HL),D | Store this address in bytes 25 and 26 of the character's buffer
25155 | DEC L
25156 | LD (HL),E
25157 | DEC L | L=24
25158 | LD (HL),A | Fill bytes 1-24 of the character's buffer with zeroes
25159 | DEC L
25160 | JR NZ,25158
25162 | LD A,(HL) | Set the character's animatory state to its base value (cancelling any midstride or knockout)
25163 | AND 248
25165 | LD (HL),A
25166 | INC L | L=1
25167 | CALL 25188 | Bring the location coordinates from the command list into bytes 1 and 2 of the buffer, effecting the teleportation
25170 | LD E,(HL) | Collect the character's new coordinates into DE
25171 | INC L
25172 | LD D,(HL)
25173 | LD L,5 | Copy these coordinates into bytes 5 and 6 of the buffer, which normally hold the character's destination; this is to let the routine at 25700 know it has nothing left to do
25175 | LD (HL),E
25176 | INC L
25177 | LD (HL),D
25178 | LD L,29 | Reset bit 0 of byte 29, cancelling any pending request to restart the command list
25180 | RES 0,(HL)
25182 | INC H | Next character
25183 | DJNZ 25134 | Jump back until all characters have been done
25185 | RET |