Routines 
Prev: $0B3B  Up: Map  Next: $0C31 


$0BAC  LDA $FB  Pick up the character's ycoordinate from $FB.  
$0BAE  SEC  Subtract 3 to get the minimum ycoordinate.  
$0BAF  SBC #$03  
$0BB1  BPL $0BB5  Branch unless the result is negative.  
$0BB3  LDA #$00  The minimum ycoordinate will be 0.  
$0BB5  STA $73  Store the minimum ycoordinate at $73.  
$0BB7  LDA $FB  Pick up the character's ycoordinate from $FB.  
$0BB9  CLC  Add 3 to get the maximum ycoordinate and store the result at $74.  
$0BBA  ADC #$03  
$0BBC  STA $74  
$0BBE  LDA $FB  Pick up the character's ycoordinate from $FB.  
$0BC0  CMP #$04  Is the character on the top floor?  
$0BC2  BCC $0C05  Branch if so.  
$0BC4  CMP #$0B  Is the character between the middle and top floors?  
$0BC6  BCC $0BE2  Branch if so.  
The character is between the bottom and middle floors.


$0BC8  LDA $FC  Pick up the character's xcoordinate from $FC.  
$0BCA  CLC  Add 10 to get the maximum xcoordinate and store the result at $76.  
$0BCB  ADC #$0A  
$0BCD  STA $76  
$0BCF  LDA $FC  Pick up the character's xcoordinate from $FC.  
$0BD1  SEC  Subtract 10 from A to get the minimum xcoordinate and store the result at $75.  
$0BD2  SBC #$0A  
$0BD4  STA $75  
$0BD6  BMI $0BDB  Branch if the result was negative.  
$0BD8  JMP $0C30  Return.  
$0BDB  LDA #$00  Store 0 (the minimum xcoordinate) at $75.  
$0BDD  STA $75  
$0BDF  JMP $0C30  Return.  
The character is between the middle and top floors.


$0BE2  LDA $FC  Pick up the character's xcoordinate from $FC.  
$0BE4  CMP #$26  Is he to the left of the Exam Room wall?  
$0BE6  BCC $0BFA  Branch if so.  
$0BE8  CLC  Add 10 to the character's xcoordinate and store it at $76. This is the maximum xcoordinate.  
$0BE9  ADC #$0A  
$0BEB  STA $76  
$0BED  LDA $FC  Pick up the character's xcoordinate from $FC.  
$0BEF  CMP #$30  Is the character's xcoordinate greater than 47?  
$0BF1  BCS $0BD1  Branch if so.  
$0BF3  LDA #$26  Store the xcoordinate of the Exam Room wall (38) at $75: teachers can't see through it into the White Room.  
$0BF5  STA $75  
$0BF7  JMP $0C30  Return.  
$0BFA  CMP #$1C  Is the character's xcoordinate less than 28?  
$0BFC  BCC $0C28  Branch if so.  
$0BFE  LDA #$25  Store the xcoordinate of the White Room wall (37) at $76: teachers can't see through it into the Exam Room.  
$0C00  STA $76  
$0C02  JMP $0BD1  Jump back. (This is a bug. The jump should be to $0BCF instead.)  
The character is on the top floor.


$0C05  LDA $FC  Pick up the character's xcoordinate from $FC.  
$0C07  CMP #$39  Is the character to the left of the Map Room wall?  
$0C09  BCC $0C1D  Branch if so.  
$0C0B  CLC  Add 10 to the character's xcoordinate and store it at $76. This is the maximum xcoordinate.  
$0C0C  ADC #$0A  
$0C0E  STA $76  
$0C10  LDA $FC  Pick up the character's xcoordinate from $FC.  
$0C12  CMP #$43  Is the character's xcoordinate 67 or more?  
$0C14  BCS $0BD1  Branch if so.  
$0C16  LDA #$39  Store the xcoordinate of the Map Room wall (57) at $75: teachers can't see through it into the Reading Room.  
$0C18  STA $75  
$0C1A  JMP $0C30  Return.  
$0C1D  CMP #$2F  Is the character's xcoordinate less than 47?  
$0C1F  BCC $0C28  Branch if so.  
$0C21  LDA #$38  Store the xcoordinate of the Reading Room wall (56) at $76: teachers can't see through it into the Map Room.  
$0C23  STA $76  
$0C25  JMP $0BD1  Jump back. (This is a bug. The jump should be to $0BCF instead.)  
$0C28  CLC  Add 10 to the character's xcoordinate and store it at $76. This is the maximum xcoordinate.  
$0C29  ADC #$0A  
$0C2B  STA $76  
$0C2D  JMP $0BD1  Jump back. (This is a bug. The jump should be to $0BCF instead.)  
$0C30  RTS 
Prev: $0B3B  Up: Map  Next: $0C31 