Prev: $16E9 Up: Map Next: $17E5
$176F: Check whether ERIC has jumped up to the safe or a shield
Used by the routine at $189D.
$176F JSR $322E Update the SRB for ERIC's current animatory state and location.
$1772 INC $26 Increment ERIC's animatory state at $26.
$1774 DEC $FB Decrement ERIC's y-coordinate at $FB.
$1776 JSR $322E Update the SRB for ERIC's new animatory state and location.
$1779 LDA $FC Pick up ERIC's x-coordinate from $FC and store a copy at $E9.
$177B STA $E9
$177D LDA $FB Pick up ERIC's y-coordinate from $FB and store a copy at $EA.
$177F STA $EA
$1781 LDA $26 Pick up ERIC's animatory state from $26.
$1783 ASL A Is ERIC facing left?
$1784 BCC $178A Branch if so.
$1786 INC $E9 ERIC is facing right. Adjust $E9 to get the x-coordinate of his hand.
$1788 INC $E9
$178A LDA #$0A Is ERIC's hand at x-coordinate 10 (where the safe is)?
$178C CMP $E9
$178E BEQ $1797 Branch if so.
$1790 LDX $E9 Pick up the coordinates of ERIC's hand.
$1792 LDY $EA
$1794 JMP $2BB0 Check whether ERIC has jumped up to a shield.
$1797 LDA #$09 Is ERIC on the middle floor?
$1799 CMP $EA
$179B BNE $1790 Branch if not.
ERIC has just jumped up to the safe.
$179D LDA $46 Pick up the game mode indicator from $46.
$179F CMP #$02 Are all the shields flashing?
$17A1 BNE $17E4 Return if not.
$17A3 LDA #$02 $02 is the identifier for the Exam Room blackboard.
$17A5 STA $57 Store this identifier at $57.
$17A7 TAY Transfer the blackboard identifier to Y.
$17A8 JSR $1421 Copy the blackboard's buffer into page 0.
$17AB LDA #$14 Character number $14 is ERIC.
$17AD CMP $1A Was ERIC the last person to write on this blackboard?
$17AF BNE $17D4 Branch if not to check the next blackboard.
$17B1 LDA $E2 Pick up the first character written on the board by ERIC and convert it to upper case.
$17B3 AND #$5F
$17B5 CMP $90 Does it match the first letter of the safe combination?
$17B7 BNE $17D4 Branch if not to check the next blackboard.
$17B9 LDA $E1 Pick up the second character written on the board by ERIC and convert it to upper case.
$17BB AND #$5F
$17BD CMP $91 Does it match the second letter of the safe combination?
$17BF BNE $17D4 Branch if not to check the next blackboard.
$17C1 LDA $E0 Pick up the third character written on the board by ERIC and convert it to upper case.
$17C3 AND #$5F
$17C5 CMP $92 Does it match the third letter of the safe combination?
$17C7 BNE $17D4 Branch if not to check the next blackboard.
$17C9 LDA $DF Pick up the fourth character written on the board by ERIC and convert it to upper case.
$17CB AND #$5F
$17CD CMP $93 Does it match the fourth letter of the safe combination?
$17CF BNE $17D4 Branch if not to check the next blackboard.
$17D1 JMP $17DD Jump forward.
$17D4 DEC $57 Move to the next blackboard.
$17D6 LDA $57 Pick up the blackboard identifier from $57.
$17D8 BMI $17E4 Return if we've checked every blackboard.
$17DA JMP $17A7 Otherwise jump back to check the next blackboard.
ERIC has just opened the safe.
$17DD LDA #$FF Set the safe status indicator at $D5 to $FF: the safe is flashing.
$17DF STA $D5
$17E1 JMP $2C37 Move to the next phase of the game.
$17E4 RTS
Prev: $16E9 Up: Map Next: $17E5