Prev: 55991 Up: Map Next: 56201
56168: Check Rotate Key
Used by the routine at UpdatePlayerLegs.
Turns the view around when the key to turn the view has been pressed and then released. The view is turned by flipping the rotation flag at ViewRotatedFlag, and the player is given a short turn counter. The compass is redrawn.
Input
E Controls
Wait until the key has been pressed and then released.
CheckRotateKey 56168 LD HL,48061 Find the flag for the key being held.
56171 BIT 5,E Jump to CheckRotateKey_Released unless the key is pressed.
56173 JR Z,CheckRotateKey_Released
56175 LD (HL),1 Flag that the key is being held, and return.
56177 RET
CheckRotateKey_Released 56178 LD A,(HL) Return if the key was not being held.
56179 AND A
56180 RET Z
Flip the view and redraw the compass.
56181 LD (HL),0 Flag that the key is no longer being held.
56183 LD HL,48058 Flip the rotation of the view.
56186 LD A,(HL)
56187 XOR 1
56189 LD (HL),A
56190 LD A,(48276) Give the player a turn counter of at least two.
56193 OR 2
56195 LD (48276),A
56198 JP DrawCompassText Jump to DrawCompassText.
View the equivalent code in;
Prev: 55991 Up: Map Next: 56201