Sega Master System / Mark III / Game Gear
Systems with FM hardware include:
|Read or write when FM hardware not present||Undefined|
|Read||Counter (see below)||Always 0||Last value written, 0 by default|
|Write||No effect||SN76489 mute control||YM2413 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 always returns %10 in the lowermost two bits. Writing to it has no effect.
Homebrew YM2413 add-ons for original hardware may not support the SN76489 enable bit.
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