Overview

The Master System includes a Pause button on the console body which is generally used to pause the game. Many would question placing it on the system rather than on the controller, but it was perhaps a bid to avoid breaking compatability of its standard DB9 controller port.

How it works

The Pause button is attached, via the I/O controler, to the Z80's NMI line. This means that when it is pressed, execution unconditionally jumps to offset $0066 within the Z80's address space. A routine there must deal with the event.

In general, the software will merely set a flag in RAM and return (retn) back to the interrupted code; the flag can then be dealt with at a suitable time.

Sample code

.org $0066
    push af
      ld a,1
      ld (PauseFlag),a
    pop af
    retn



Return to top
0.054s