Prev: 26895 Up: Map Next: 26996
26987: Get Robbie Direction
Used by the routines at FireRepellentSpray, FireStreamer and FireWeapon.
Used when a weapon is fired. This gets the X position of Robbie and tests bit 0 of State_Robbie_Flags, which decides the direction of the weapon: the weapon is fired to the right when the bit is clear.
Input
DE State_Robbie_Colour (the colour of Robbie)
Output
A The X position of Robbie
DE State_Robbie_Pos_X (the X position of Robbie)
F The zero flag is set if the weapon goes to the right
GetRobbieDirection 26987 INC DE Move DE onto State_Robbie_Flags.
26988 LD A,(DE) A=the direction byte of Robbie.
26989 DEC DE Move DE back onto the X position of Robbie.
26990 DEC DE
26991 DEC DE
26992 AND %00000001 Keep only bit 0.
26994 LD A,(DE) A=the X position of Robbie.
26995 RET Return.
Prev: 26895 Up: Map Next: 26996