Prev: 53871 Up: Map Next: 53929
53886: If character has a disallowed x-coordinate in the "barrier room" then return twice
Used by the routine at 53731.
Input
A A character's x-coordinate
HL Pointer to character's x-coordinate in characters' current positions table at 25244
Output
A A character's x-coordinate (same as input)
HL Pointer to character's x-coordinate in characters' current positions table at 25244 (same as input)
53886 PUSH HL Store HL (pointer to character's x-coordinate)
53887 PUSH AF Store AF (A = character's x-coordinate)
53888 LD E,A Load x-coordinate into A
53889 DEC HL Move HL back to character's current room
53890 LD A,(HL) If character's room is not 9 (barrier room on Murphy's Moon)...
53891 CP 9 ...
53893 JP NZ,53922 ...then skip ahead to 53922
53896 LD A,(23403) If barriers-removed flag is set...
53899 AND 1 ...
53901 JP NZ,53922 ...then skip ahead to 53922
53904 LD HL,53929 Point HL at list of disallowed character x-coordinates in barrier room (Murphy's Moon)
53907 LD A,E Load A with character's x-coordinate
53908 CP (HL) If character's x-coordinate is the same as the current disallowed x-coordinate...
53909 JP Z,53925 ...then skip ahead to 53925
53912 EX AF,AF' Swap AF and AF'
53913 LD A,(HL) Load A with current x-coordinate entry...
53914 CP 255 ...and if this is 255 (end marker)...
53916 JR Z,53922 ...then skip ahead to 53922
53918 EX AF,AF' Swap AF and AF'
53919 INC HL Advance HL to next x-coordinate entry
53920 JR 53908 Loop back to 53908
53922 POP AF Restore AF (A = character's x-coordinate)
53923 POP HL Restore HL (pointer to character's x-coordinate)
53924 RET Return
53925 POP AF Restore AF (A = character's x-coordinate)
53926 POP HL Restore HL (pointer to character's x-coordinate)
53927 POP AF Remove return address from top of stack...
53928 RET ...and return to routine that called the routine that called this one
Prev: 53871 Up: Map Next: 53929