Prev: BD15 Up: Map Next: BD3E
BD23: The menu loop
Used by the routine at check_for_start_game.
One pass: redraws the menu (only its attributes change on screen after the first time), plays the tune if it has not played yet, and reads keys 1 to 5 into E. The control byte is kept in A through the key tests that follow and saved in $5BA6 first, so that check_for_start_game can click when it changes.
menu_loop BD23 CALL display_menu
BD26 LD DE,menu_tune menu_tune; $5BD1 makes this a no-op after the first pass
BD29 CALL play_audio_wait_key
BD2C LD A,$F7 half-row $F7 is 1 2 3 4 5, key 1 in bit 0
BD2E CALL read_port
BD31 LD E,A
BD32 LD A,($5BA4) A = control byte; remember it as it was
BD35 LD ($5BA6),A
BD38 BIT 0,E key 1: method 0, keyboard
BD3A JR Z,check_for_kempston_joystick
BD3C AND $F9
Prev: BD15 Up: Map Next: BD3E