Prev: 8E83 Up: Map Next: 8EF5
8EA3: Handles reset flag and death when required.
Used by the routine at _87c9.
Death_HandleFlag 8EA3 LD HL,Stat_ResetGame Update reset flag.
8EA6 INC (HL)
8EA7 CP $14
8EA9 JR NC,Death_HandleFlag_0 Have we hit the threshold?
8EAB LD A,(Stage_Compass) Reset hero to be facing the camera, stopping any movement.
8EAE XOR $02
8EB0 LD (Hero_LastDir),A
8EB3 LD A,$13
8EB5 JP $AFFD
Death_HandleFlag_0 8EB8 LD E,(HL)
8EB9 LD D,$00
8EBB LD HL,$8E6F
8EBE ADD HL,DE
8EBF LD A,(HL)
8EC0 CP $FF
8EC2 JR Z,Death_HandleFlag_2
8EC4 BIT 7,A
8EC6 JR Z,Death_HandleFlag_1
8EC8 LD A,(Hero_LastDir)
8ECB INC A
8ECC AND $03
8ECE LD (Hero_LastDir),A
Death_HandleFlag_1 8ED1 LD A,(HL)
8ED2 AND $7F
8ED4 JP $AFFD
Death_HandleFlag_2 8ED7 LD (Stat_ResetGame),A Set reset flag to finished.
8EDA LD HL,Hero_Pocket1
8EDD LD B,$04
Death_HandleFlag_3 8EDF LD A,(HL) Clear pockets except for either of the guns.
8EE0 LD (HL),$00
8EE2 CP $13
8EE4 JR Z,Death_HandleFlag_4
8EE6 CP $01
8EE8 JR NZ,Death_HandleFlag_5
Death_HandleFlag_4 8EEA LD (Hero_Pocket1),A
Death_HandleFlag_5 8EED INC HL
8EEE DJNZ Death_HandleFlag_3
8EF0 LD (HL),$01 Reset the pocket select flag.
8EF2 JP $AFFA
Prev: 8E83 Up: Map Next: 8EF5