Prev: 6BD2 Up: Map Next: 6BED
6BDB: Maskable interrupt handler (IM 2)
Frame interrupt handler triggered ~50 times/second. Installed via IM 2 at game startup (see init). Uses RETN instead of RETI (functionally equivalent).
The handler performs three functions each frame:
  • Increment interrupt counter (int_counter)
  • Check H key for pause (jumps to pause)
  • Process control flags for sound effects (falls through to handle_controls)
Note: The game tick counter (state_tick) is incremented in the main loop (main_loop), not here. int_counter is used for system timing, state_tick for game logic.
int_handler 6BDB DI Disable interrupts and save registers.
6BDC PUSH HL
6BDD PUSH DE
6BDE PUSH BC
6BDF PUSH AF
6BE0 LD HL,$5C78 Increment interrupt counter.
6BE3 INC (HL)
6BE4 LD A,$BF Check H key for pause.
6BE6 IN A,($FE)
6BE8 BIT 4,A
6BEA JP Z,pause
Prev: 6BD2 Up: Map Next: 6BED