Prev: 9E98 Up: Map Next: 9EE4
9EB2: Cutting wire
This locks out player controls while the wire fence is being cut open.
Used by the routine at process_player_input.
cutting_wire 9EB2 LD HL,$A12F How much longer do we have to wait until the wire cutting is complete?
9EB5 LD A,($A145)
9EB8 SUB (HL)
9EB9 JR Z,cutting_wire_complete Jump if the countdown reached zero
9EBB CP $04 Return if greater than 3
9EBD RET NC
9EBE LD A,($800E) Read current direction
9EC1 LD HL,$9EE0 Point at cutting_wire_new_inputs
9EC4 AND $03 Mask off direction part
9EC6 ADD A,L Look that up in cutting_wire_new_inputs
9EC7 LD L,A
9EC8 JR NC,cutting_wire_0
9ECA INC H
cutting_wire_0 9ECB LD A,(HL)
9ECC LD ($800D),A Save new input
9ECF RET Return
Countdown reached zero: Snip the wire.
cutting_wire_complete 9ED0 LD HL,$800E Point HL at hero's direction field
Bug: An LD A,(HL) instruction is missing here. A is always zero at this point from above, so $800E is always set to zero. The hero will always face top-left (direction_TOP_LEFT is 0) after breaking through a fence. Note that the DOS x86 version moves zero into $800E - it has no AND - hardcoding the bug.
9ED3 AND $03
9ED5 LD (HL),A
9ED6 DEC L Set vischar.input to input_KICK
9ED7 LD (HL),$80
9ED9 LD A,$18 Set vischar height to 24
9EDB LD ($8013),A
9EDE JR clear_lockpick_wirecut_flags_and_return Jump to clear_lockpick_wirecut_flags_and_return
New inputs table.
cutting_wire_new_inputs 9EE0 DEFB $84 input_UP + input_LEFT + input_KICK
9EE1 DEFB $87 input_UP + input_RIGHT + input_KICK
9EE2 DEFB $88 input_DOWN + input_RIGHT + input_KICK
9EE3 DEFB $85 input_DOWN + input_LEFT + input_KICK
Prev: 9E98 Up: Map Next: 9EE4