Prev: $1C8D Up: Map Next: $1CB4
$1C8E: Check whether a character is on a staircase
This corresponds to $6648 in the ZX Spectrum version.
Used by the routines at $0C3F, $1468, $16D0, $1B2E, $270D, $2873, $2CA5, $34B5, $350B, $3558, $359E and $365C. Returns with the carry flag set if the character is on a staircase, and with A (and $12) holding one of the following values:
A Meaning
$00 The character is on the bottom floor.
$01 The character is on the middle floor.
$02 The character is on the top floor.
$FF The character is on a staircase.
$1C8E LDA $FB Pick up the character's y-coordinate from $FB.
$1C90 CMP #$03 Is the character on the top floor?
$1C92 BNE $1C9A Branch if not.
$1C94 CLC Clear the carry flag: the character is not on a staircase.
$1C95 LDA #$02 A=$02: the character is on the top floor.
$1C97 JMP $1CB1 Jump forward.
$1C9A CMP #$0A Is the character on the middle floor?
$1C9C BNE $1CA4 Branch if not.
$1C9E CLC Clear the carry flag: the character is not on a staircase.
$1C9F LDA #$01 A=$01: the character is on the middle floor.
$1CA1 JMP $1CB1 Jump forward.
$1CA4 CMP #$11 Is the character on the bottom floor?
$1CA6 BNE $1CAE Branch if not.
$1CA8 CLC Clear the carry flag: the character is not on a staircase.
$1CA9 LDA #$00 A=$00: the character is on the bottom floor.
$1CAB JMP $1CB1 Jump forward.
$1CAE SEC Set the carry flag: the character is on a staircase.
$1CAF LDA #$FF A=$FF: the character is on a staircase.
$1CB1 STA $12 Store the location indicator at $12.
$1CB3 RTS
Prev: $1C8D Up: Map Next: $1CB4