Prev: DAB7 Up: Map Next: DB89
DB68: 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 DB68 LD HL,$BBBD Find the flag for the key being held.
DB6B BIT 5,E Jump to CheckRotateKey_Released unless the key is pressed.
DB6D JR Z,CheckRotateKey_Released
DB6F LD (HL),$01 Flag that the key is being held, and return.
DB71 RET
CheckRotateKey_Released DB72 LD A,(HL) Return if the key was not being held.
DB73 AND A
DB74 RET Z
Flip the view and redraw the compass.
DB75 LD (HL),$00 Flag that the key is no longer being held.
DB77 LD HL,$BBBA Flip the rotation of the view.
DB7A LD A,(HL)
DB7B XOR $01
DB7D LD (HL),A
DB7E LD A,($BC94) Give the player a turn counter of at least two.
DB81 OR $02
DB83 LD ($BC94),A
DB86 JP DrawCompassText Jump to DrawCompassText.
View the equivalent code in;
Prev: DAB7 Up: Map Next: DB89