Jet Set Willy: Routine at 38276

| Routines

38276: Check whether Willy has reached the toilet

Called by the routine at 35245 when Willy is on his way to the toilet.
38276 | LD A,(33824) | Pick up the number of the current room from 33824
38279 | CP 33 | Are we in The Bathroom?
38281 | RET NZ | Return if not
38282 | LD A,(34259) | Pick up the LSB of Willy's attribute buffer location from 34259
38285 | CP 188 | Is Willy's screen x-coordinate 28 (where the toilet is)?
38287 | RET NZ | Return if not
Willy has reached the toilet.
38288 | XOR A | Reset the minute counter at 34251 to 0 (so that we get to see Willy's head down the toilet for at least a whole game minute)
38289 | LD (34251),A
38292 | LD A,3 | Update the game mode indicator at 34271 to 3 (Willy's head is down the toilet)
38294 | LD (34271),A
38297 | RET |