← 8E09 Quit confirmation prompt Map 8E63 → Poll the pause key (1)
8E25: Pause control (per-frame)
Freezes play on the pause key and shows the PAUSED banner.
The freeze is a busy-wait inside the frame chain. The balls, the inhabitants and the sound all hold still until the player resumes.
Key 1 both pauses and resumes: the first press pauses, the next press resumes.
The banner sits on the bat's side at character row 12, printed double-height in bright yellow on blue. Its column comes from the bat side.
The resume runs in three debounced phases. Spin while key 1 is still held, spin until it is pressed again, then spin while that press is held.
Blanks overprint the banner, with a black-paper attribute over the same cells.
handle_pause 8E25 CALL poll_pause_key Poll key 1; with it up, return at once and let the frame run.
8E28 OR A
8E29 RET Z
8E2A CALL sfx_key_blip Blip to acknowledge the pause.
8E2D LD A,(bat_side) Read the bat side: 0 selects the right edge, non-zero the left.
8E30 OR A
8E31 JR Z,pause_banner_right
8E33 LD HL,SCREEN_BASE+$882 Bat on the left: banner at column 2, row 12.
8E36 JR pause_draw_banner
pause_banner_right 8E38 LD HL,SCREEN_BASE+$896 Bat on the right: banner at column 22, row 12.
pause_draw_banner 8E3B PUSH HL Save the banner address for the later erase.
8E3C LD DE,msg_paused Print double-height PAUSED in bright yellow on blue.
8E3F LD C,$4E
8E41 CALL print_string_2x
pause_wait_release 8E44 CALL poll_pause_key Spin while key 1 is held: clear the pause press.
8E47 OR A
8E48 JR NZ,pause_wait_release
pause_wait_resume 8E4A CALL poll_pause_key Spin until key 1 is pressed again: the resume press.
8E4D OR A
8E4E JR Z,pause_wait_resume
8E50 CALL sfx_key_blip Blip to acknowledge the resume.
8E53 POP HL Recover the banner address.
8E54 LD DE,msg_paused_erase Overprint blanks to erase the banner (bright white ink on black paper).
8E57 LD C,$47
8E59 CALL print_string_2x
pause_resume_release 8E5C CALL poll_pause_key Spin while key 1 is held: clear the resume press, then return.
8E5F OR A
8E60 JR NZ,pause_resume_release
8E62 RET
← 8E09 Quit confirmation prompt Map 8E63 → Poll the pause key (1)
Fork me on GitHub