Prev: BB57 Up: Map Next: BBCC
BBB0: wait for a key and set SEED based on how long no key is pressed
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