Routines

25080: Scroll screen right


Used by routine at 28160

25080 0608 LD B,8 8 columns will be scrolled on
25082 C5 PUSH BC
25083 219E5A LD HL,23198 Fist shift the attributes one place to the right
25086 119F5A LD DE,23199
25089 019F02 LD BC,671
25092 EDB8 LDDR
25094 CD49F8 CALL 63561 Scroll display file one character square to the right
25097 3D DEC A A=column of play area now at far left of screen
25098 32FF7F LD (32767),A
25101 210014 LD HL,5120 H=20 (+1=21 rows on screen), L=0 (column at far left)
25104 E5 PUSH HL
25105 CD6C60 CALL 24684 Print a play area character square in the column at the far left
25108 E1 POP HL
25109 25 DEC H
25110 F21062 JP P,25104 Jump back until all 21 squares in the column have been printed
25113 C1 POP BC
25114 10DE DJNZ 25082 Jump back until 8 columns have been scrolled on
25116 3AFF7F LD A,(32767) A=column of play area now at far left of screen
25119 0604 LD B,4
25121 26BA LD H,186 186=little girl no. 4
25123 FE70 CP 112 112: Was the skool gate in the middle of the screen before scrolling?
25125 2807 JR Z,25134 Jump if so
25127 FE48 CP 72 72: Was the boys' skool door in the middle of the screen before scrolling?
25129 C0 RET NZ Return if not
25130 26B7 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:
25132 0603 LD B,3

This entry point is used by the routines at 25026 (with H=193, B=5) and 63309:
25134 2E1D LD L,29 Bit 3 at byte 29 is set if the character should be moved immediately to the next destination in his table of A&P
25136 CB5E BIT 3,(HL)
25138 282A JR Z,25182 Jump if this character should not be "teleported"
25140 CB9E RES 3,(HL)
25142 2D DEC L L=28
25143 56 LD D,(HL) Pick up the address reached in the table of A&P in DE
25144 2D DEC L
25145 5E LD E,(HL)
25146 1A LD A,(DE) A=LSB of routine address in table of A&P
25147 D664 SUB 100 Is this the address of the "Go to..." routine (25700)?
25149 201F JR NZ,25182 Jump if not
25151 2D DEC L L=26
25152 13 INC DE
25153 13 INC DE DE now points to where location coordinates are held
25154 72 LD (HL),D Store this address in bytes 25 and 26 of the buffer
25155 2D DEC L
25156 73 LD (HL),E
25157 2D DEC L
25158 77 LD (HL),A Fill bytes 1-24 of the character's buffer with zeroes
25159 2D DEC L
25160 20FC JR NZ,25158
25162 7E LD A,(HL) A=character's animatory state
25163 E6F8 AND 248 Cancel any midstride
25165 77 LD (HL),A
25166 2C INC L L=1
25167 CD6462 CALL 25188 Bring location from table of A&P into bytes 1 and 2 of the buffer
25170 5E LD E,(HL) E=character's new x-coordinate
25171 2C INC L
25172 56 LD D,(HL) D=character's new y-coordinate
25173 2E05 LD L,5 Copy these coordinates into bytes 5 and 6 of the buffer
25175 73 LD (HL),E
25176 2C INC L
25177 72 LD (HL),D
25178 2E1D LD L,29
25180 CB86 RES 0,(HL) Signal: no need to restart table of A&P
25182 24 INC H Next character
25183 10CD DJNZ 25134 Jump back until all characters have been done
25185 C9 RET