![]() |
Routines |
| Prev: 31148 | Up: Map | Next: 31252 |
|
Used by the routine at 31254. Does nothing if the mouse is off-screen. Otherwise, for each female character that is facing the mouse and within five spaces to the left or right of it, either (a) makes her stand on a chair or start jumping if she isn't already, or (b) makes her stay on the chair or keep jumping for a little longer.
|
||||||||
| 31150 | LD A,(32767) | A=leftmost column of the play area on screen | ||||||
| 31153 | LD B,A | Copy this to B | ||||||
| 31154 | LD L,1 | Point HL at byte 1 of the mouse's buffer | ||||||
| 31156 | LD A,(HL) | A=mouse's x-coordinate | ||||||
| 31157 | LD E,A | Copy this to E | ||||||
| 31158 | SUB B | |||||||
| 31159 | INC A | |||||||
| 31160 | CP 32 | Is this mouse off-screen? | ||||||
| 31162 | RET NC | Return if so | ||||||
| 31163 | INC L | L=2 | ||||||
| 31164 | LD D,(HL) | D=mouse's y-coordinate | ||||||
| 31165 | LD H,183 | 183=little girl no. 1 | ||||||
| 31167 | LD B,7 | There are 7 little girls to check | ||||||
| 31169 | CALL 31181 | Make them start jumping if necessary | ||||||
| 31172 | LD H,204 | 204=MISS TAKE | ||||||
| 31174 | INC B | B=1 | ||||||
| 31175 | CALL 31181 | Make MISS TAKE start jumping if necessary | ||||||
| 31178 | LD H,209 | 209=HAYLEY | ||||||
| 31180 | INC B | B=1 | ||||||
|
At this point H holds the number of the first female character to check, and B the number of characters to check (for proximity to a mouse).
|
||||||||
| 31181 | LD L,2 | Point HL at byte 2 of the female character's buffer | ||||||
| 31183 | LD A,D | A=mouse's y-coordinate | ||||||
| 31184 | SUB (HL) | Subtract that of the female character under consideration | ||||||
| 31185 | JR Z,31197 | Jump if the female character is standing on the same floor as the mouse | ||||||
| 31187 | DEC A | Is the female character one level above the mouse? | ||||||
| 31188 | JR NZ,31248 | Jump ahead to consider the next character if not | ||||||
| 31190 | LD L,18 | Pick up the MSB of any uninterruptible subcommand routine address in bytes 17 and 18 of the character's buffer | ||||||
| 31192 | LD A,(HL) | |||||||
| 31193 | CP 121 | Is this character jumping (121=MSB of 31078 or 31092)? | ||||||
| 31195 | JR NZ,31248 | Jump ahead to consider the next character if not | ||||||
| 31197 | LD L,1 | Point HL at byte 1 of the character's buffer | ||||||
| 31199 | LD A,(HL) | A=female character's x-coordinate | ||||||
| 31200 | SUB E | Subtract that of the mouse | ||||||
| 31201 | LD L,0 | Point HL at byte 0 of the character's buffer | ||||||
| 31203 | JR Z,31225 | Jump if the girl is standing right where the mouse is | ||||||
| 31205 | JR NC,31217 | Jump if the girl is standing to the right of the mouse | ||||||
| 31207 | CP 251 | Is the girl within 5 spaces to the left of the mouse? | ||||||
| 31209 | JR C,31248 | Jump ahead to consider the next character if not | ||||||
| 31211 | BIT 7,(HL) | Is the female character facing left? | ||||||
| 31213 | JR Z,31248 | Jump ahead to consider the next character if so | ||||||
| 31215 | JR 31225 | |||||||
| 31217 | CP 6 | Is the girl within 5 spaces to the right of the mouse? | ||||||
| 31219 | JR NC,31248 | Jump ahead to consider the next character if not | ||||||
| 31221 | BIT 7,(HL) | Is the female character facing right? | ||||||
| 31223 | JR NZ,31248 | Jump ahead to consider the next character if so | ||||||
|
The female character is located within 5 spaces of the mouse, and is facing it. Figure out whether she's already jumping, or can start jumping.
|
||||||||
| 31225 | LD L,18 | Pick up the MSB of any uninterruptible subcommand routine address in bytes 17 and 18 of the female character's buffer | ||||||
| 31227 | LD A,(HL) | |||||||
| 31228 | CP 121 | Set the zero flag if the routine address is 31078 or 31092 (i.e. the character is already jumping) | ||||||
| 31230 | INC HL | Point HL at byte 19 of the character's buffer | ||||||
| 31231 | JR NZ,31237 | Jump if the character is not jumping | ||||||
| 31233 | SET 4,(HL) | Otherwise ensure this character continues jumping for a little longer by setting the counter in byte 19 to at least 16 | ||||||
| 31235 | JR 31248 | Jump ahead to consider the next character | ||||||
| 31237 | AND A | Is there an uninterruptible subcommand routine address other than 31078 or 31092 in bytes 17 and 18 of the character's buffer (meaning she is otherwise occupied)? | ||||||
| 31238 | JR NZ,31248 | Jump ahead to consider the next character if so | ||||||
|
The female character is not jumping at the moment. Make her start.
|
||||||||
| 31240 | LD (HL),21 | Set the delay parameter at byte 19 determining how long the female character will jump up and down | ||||||
| 31242 | DEC L | |||||||
| 31243 | LD (HL),121 | Place the address of the uninterruptible subcommand routine at 31092 into bytes 17 and 18 of the female character's buffer | ||||||
| 31245 | DEC L | |||||||
| 31246 | LD (HL),116 | |||||||
| 31248 | INC H | Next female character | ||||||
| 31249 | DJNZ 31181 | Jump back until all the characters have been checked | ||||||
| 31251 | RET | |||||||
| Prev: 31148 | Up: Map | Next: 31252 |