Prev: CCE5 Up: Map Next: CD23
CD0C: 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 CD0C LD HL,$A256 Point HL at RotateKeyFlag.
CD0F BIT 5,E Jump to CheckRotateKey_Released if rotate is not pressed.
CD11 JR Z,CheckRotateKey_Released
CD13 LD (HL),$01 Set RotateKeyFlag and return.
CD15 RET
Flip ViewRotation when the control is released.
CheckRotateKey_Released CD16 LD A,(HL) Return if the control was not held.
CD17 AND A
CD18 RET Z
CD19 LD (HL),$00 Clear RotateKeyFlag.
CD1B LD HL,$A268 Point HL at ViewRotation.
CD1E LD A,(HL) Fetch ViewRotation.
CD1F XOR %00000001 Flip the lowest bit.
CD21 LD (HL),A Set ViewRotation and return.
CD22 RET
View the equivalent code in;
Prev: CCE5 Up: Map Next: CD23