← C207 Redraw the options screen, then poll Q to quit Map C2A3 → Busy-wait delay of BC iterations
C21C: Draw the options screen
Renders the whole options screen from the current option values. It draws the "OPTIONS" heading, the "Q returns" line and the "LOAD LEVELS" prompt. One line per option shows its value.
Reads the bat side, the sound-effects flag and the control type to choose each line's text. Side effect: makes the sound primitive play or mute to match the sound-effects flag.
draw_options_menu C21C LD HL,SCREEN_BASE+$2B "OPTIONS" heading in double height, bright yellow on blue
C21F LD DE,options_text
C222 LD C,$4E
C224 CALL print_string_2x
C227 LD HL,SCREEN_BASE+$10E3 The "Q" RETURNS TO MAIN MENU line in bright white on black, the attribute reused by every line below until reset
C22A LD DE,opt_return
C22D LD C,$47
C22F CALL print_string
C232 LD HL,opt_bat_side_cell Bat-side line
C235 LD A,(bat_side) A non-zero bat side selects "BAT IS ON THE - LEFT".
C238 OR A
C239 JR Z,draw_options_menu_0
C23B LD DE,opt_bat_left
C23E JR draw_options_menu_1
draw_options_menu_0 C240 LD DE,opt_bat_right Bat side 0 selects "BAT IS ON THE - RIGHT".
draw_options_menu_1 C243 CALL print_string Print whichever was chosen.
C246 LD HL,opt_sound_cell Sound line
C249 LD A,(sound_fx) Sound effects: mute them on 0, and enable them on any other value.
C24C OR A
C24D JR Z,draw_options_menu_2
C24F LD A,$3E Sound on: write the "LD A,n" opcode over the first byte, to restore its normal "LD A,$10" so the speaker primitive runs; pick the "SOUND FX - ON" text.
C251 LD (sound_blip),A
C254 LD DE,opt_sound_on
C257 JR draw_options_menu_3
draw_options_menu_2 C259 LD A,$C9 Sound off: write the RET opcode over the first byte so the primitive returns at once and stays silent; pick the "SOUND FX - OFF" text.
C25B LD (sound_blip),A
C25E LD DE,opt_sound_off
draw_options_menu_3 C261 CALL print_string Render the sound line (the on and off paths merge here).
C264 LD HL,opt_ball_speed_cell Print the ball-speed line. The speed handler writes the speed digit (1–6) into the string.
C267 LD DE,opt_ball_speed
C26A CALL print_string
C26D LD HL,opt_bat_ctrl_head "BAT CONTROL TYPE" header in bright white on red
C270 LD DE,opt_bat_control
C273 LD C,$57
C275 CALL print_string
C278 LD HL,opt_bat_ctrl_value Bat-control value line
C27B LD A,(bat_control_type) Control type: the first direct-control type selects "DUAL SPEED SLOW - n". The option handlers write each digit n into its string.
C27E OR A
C27F JR Z,draw_options_menu_5
C281 CP $01
C283 JR NZ,draw_options_menu_4
C285 LD DE,opt_dual_slow
C288 JR draw_options_menu_6
draw_options_menu_4 C28A LD DE,opt_dual_fast The second direct-control type selects "DUAL SPEED FAST - n".
C28D JR draw_options_menu_6
draw_options_menu_5 C28F LD DE,opt_inertia Inertia control selects "INERTIA - n".
draw_options_menu_6 C292 LD C,$47 Print whichever was chosen.
C294 CALL print_string
C297 LD HL,opt_load_levels_cell Print the "LOAD LEVELS" prompt. Fire on this line loads the level set from tape.
C29A LD DE,msg_load_levels
C29D LD C,$47
C29F CALL print_string
C2A2 RET
← C207 Redraw the options screen, then poll Q to quit Map C2A3 → Busy-wait delay of BC iterations
Fork me on GitHub