Prev: 52453 Up: Map Next: 52515
52492: Check Rotate Key
Used by the routine at HandleSheriff.
Rotates the view when the rotate control is pressed and then released. RotateKeyFlag is set while it is held, and on release the lowest bit of ViewRotation is flipped.
Input
E The controls
Set RotateKeyFlag while the rotate control is held.
CheckRotateKey 52492 LD HL,41558 Point HL at RotateKeyFlag.
52495 BIT 5,E Jump to CheckRotateKey_Released if rotate is not pressed.
52497 JR Z,CheckRotateKey_Released
52499 LD (HL),1 Set RotateKeyFlag and return.
52501 RET
Flip ViewRotation when the control is released.
CheckRotateKey_Released 52502 LD A,(HL) Return if the control was not held.
52503 AND A
52504 RET Z
52505 LD (HL),0 Clear RotateKeyFlag.
52507 LD HL,41576 Point HL at ViewRotation.
52510 LD A,(HL) Fetch ViewRotation.
52511 XOR %00000001 Flip the lowest bit.
52513 LD (HL),A Set ViewRotation and return.
52514 RET
View the equivalent code in;
Prev: 52453 Up: Map Next: 52515