Routines |
Prev: BB57 | Up: Map | Next: BBCC |
Used by the routines at display_spell_info, routine06, routine13, lightning_spell, routine21, routine24, routine25, routine35, display_object_info, routine72 and routine73.
|
||||
wait_key_seed | BBB0 | PUSH HL | preserve HL, DE, BC | |
BBB1 | PUSH DE | |||
BBB2 | PUSH BC | |||
BBB3 | LD A,(computer_player_flag) | skip to end of routine if current player is not human | ||
BBB6 | OR A | |||
BBB7 | JR NZ,wait_key_seed_1 | |||
wait_key_seed_0 | BBB9 | PUSH BC | preserve BC | |
BBBA | CALL $028E | call KEY-SCAN in ROM to see if a key was pressed. | ||
BBBD | POP BC | restore BC | ||
BBBE | INC C | increment counter (used to set SEED later) | ||
BBBF | LD A,E | loop back to wait_key_seed_0 if no key was pressed | ||
BBC0 | INC A | |||
BBC1 | OR A | |||
BBC2 | JR Z,wait_key_seed_0 | |||
BBC4 | LD A,C | set SEED to the value of the counter | ||
BBC5 | LD ($5C76),A | |||
wait_key_seed_1 | BBC8 | POP BC | restore BC, DE, HL | |
BBC9 | POP DE | |||
BBCA | POP HL | |||
BBCB | RET | return |
Prev: BB57 | Up: Map | Next: BBCC |