On systems with FM hardware, port $f2 allows detection, and enabling, of the YM2413 FM chip. On some systems, it also allows disabling the SN76489 PSG chip.

Systems with FM hardware include:


Read or write when FM hardware not presentUndefined
ReadCounter (see below)Always 0Last value written, 0 by default
WriteNo effectSN76489 mute controlYM2413 mute control

Mute control

The SN76489 control only works on a Japanese Master System.

On the Mark III with FM unit, it has no effect: The FM unit disables PSG output when FM is enabled and vice versa. Bit 1 of whatever value is sent to the audio control port is forced to 0, so writing $02 and $03 has the same effect as writing $00 and $01 respectively. Thus, the use of the two sound chips is mutually exclusive on a Mark III with FM unit, you can't use them at the same time or mute them both like you can on the Japanese Master System.

The ability to read back the values written allows detection of the FM chip: see FM Chip Detection for example code.

If no YM2413 is present, reading from the audio control port returns varying results. It always returns %10 in the lowermost two bits on a non-japanese SMS. On a Mark III without FM unit, it returns the input from port 0. Writing to the audio control port has no effect if no YM2413 is present.

Homebrew YM2413 add-ons for original hardware may not support the SN76489 enable bit.


In this forum post, Charles MacDonald said:

Bits 7-5 of port $F2 return the high bits of a counter that is clocked by the C-Sync input into the 315-5297. The counter is 12 bits wide and counts up on each C-Sync pulse. The bits return are as follows:

D7 : Counter bit 11 
D6 : Counter bit 7 
D5 : Counter bit 3 


Return to top