Prev: 7AC6 Up: Map Next: 7B36
7AC9: Process player input - fire
This checks for the input events triggered by the fire button: 'pick up', 'drop' and 'use'.
Used by the routine at process_player_input.
Input
A Input event (type: input_t).
process_player_input_fire 7AC9 CP $0A Is the input event fire + up?
7ACB JP NZ,process_player_input_fire_0 Test for the next input event if not
7ACE CALL pick_up_item Call pick_up_item if so
7AD1 JR check_for_pick_up_keypress_exit Then return
process_player_input_fire_0 7AD3 CP $0B Is the input event fire + down?
7AD5 JP NZ,process_player_input_fire_1 Test for the next input event if not
7AD8 CALL drop_item Call drop_item if so
7ADB JR check_for_pick_up_keypress_exit Then return
process_player_input_fire_1 7ADD CP $0C Is the input event fire + left?
7ADF JP NZ,process_player_input_fire_2 Test for the next input event if not
7AE2 CALL use_item_A Call use_item_A if so
7AE5 JR check_for_pick_up_keypress_exit Then return
process_player_input_fire_2 7AE7 CP $0F Is the input event fire + right?
7AE9 JP NZ,check_for_pick_up_keypress_exit Test for the next input event if not
7AEC CALL use_item_B Call use_item_B if so
check_for_pick_up_keypress_exit 7AEF RET Return
Use item 'B'.
use_item_B 7AF0 LD A,($8216) Fetch the second held item
7AF3 JR use_item_common Jump over item 'A' case
Use item 'A'.
use_item_A 7AF5 LD A,($8215) Fetch the first held item
Use item common.
use_item_common 7AF8 CP $FF Is the item in A item_NONE? ($FF)
7AFA RET Z Return if so
7AFB JR process_player_input_fire_3 Bug: Pointless jump to adjacent instruction
process_player_input_fire_3 7AFD ADD A,A Point HL at the A'th entry of item_actions_jump_table
7AFE LD C,A
7AFF LD B,$00
7B01 LD HL,$7B16
7B04 ADD HL,BC
7B05 LD A,(HL) Fetch the jump table destination address
7B06 INC HL
7B07 LD H,(HL)
7B08 LD L,A
7B09 PUSH HL Stack the jump table destination address
7B0A LD DE,$81A4 Copy X,Y and height from the hero's position into saved_pos
7B0D LD HL,$800F
7B10 LD BC,$0006
7B13 LDIR
7B15 RET Jump to the stacked destination address
Item actions jump table.
item_actions_jump_table 7B16 DEFW action_wiresnips
7B18 DEFW action_shovel
7B1A DEFW action_lockpick
7B1C DEFW action_papers
7B1E DEFW check_for_pick_up_keypress_exit Return
7B20 DEFW action_bribe
7B22 DEFW action_uniform
7B24 DEFW check_for_pick_up_keypress_exit Return
7B26 DEFW action_poison
7B28 DEFW action_red_key
7B2A DEFW action_yellow_key
7B2C DEFW action_green_key
7B2E DEFW action_red_cross_parcel
7B30 DEFW check_for_pick_up_keypress_exit Return
7B32 DEFW check_for_pick_up_keypress_exit Return
7B34 DEFW check_for_pick_up_keypress_exit Return
Prev: 7AC6 Up: Map Next: 7B36