GGFM - Yamaha YM2413

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

FM sound is an add-on sound module for the Sega MasterSystem. The FM sound on the Sega Master System allowed for more complex and richer audio compared to the console's standard PSG sound. It offered a wider range of tones, including various instruments and musical effects, which enhanced the overall audio experience of games that utilized FM sound.

Since the Sega GameGear is also capable of running in Mastersystem games, it is also possible to retrofit the add-ons from the Mastersystem to the GameGear. For the past months I have been working on a FM sound add-on module that fits on top of the GameGear mainboard.
There are about 60 Mastersystem games that support this module, if you enjoy playing them on your GameGear - this module is a must!

The add-on board has been made based on the SMSFM module from Tim Worthington, a big thanks to him! Without his support this module wouldn't available.

Installation

High level steps for installation.
  1. In case of an original SEGA mainboard, verify if the solder on the cartridge slot is still flowing. Else reflow it with fresh solder and/or flux
  2. Place the adhesive tape on the GGFM board and stick it to the front / LCD side of mainboard. the pads should match with the cartridge slot.
  3. Reflow the cardridge pads; only the golden pads of the GGFM board are needed
  4. Follow the instructions for PSG mixing below
  5. Ensure all 3 DIP switches are in ON position

Enjoy FM sound!

DIP Switches

The GGFM board I have developed features three DIP switches that provide various options and functionalities:

  1. FM_EN - This switch allows you to enable / disable the FM sound chip
  2. FM_M - This switch allows you to turn off the auto-muting feature of the FM chip. The FM chip is quite noisy and therefor I have implemented a feature to mute it while it is not used.
  3. PSG_M - This switch allows you to turn off the auto-muting feature of the PSG chip. This is specifically needed for the game Outrun. In case you have not wired the PSG mixing feature, I recommend you to turn this switch off.

Volume adjustment

There is a little potentiometer which can be used to adjust the volume of the FM sound. You can adjust it while the GameGear is powered on and playing FM sound. A good game to test this is "Alex Kidd: The Lost Stars", it uses both FM and PSG sound effects. Please listen carefully, since increasing the volume too much will cause distortion.

Please take care not to exceed the limits of the potentiometer, you can easily break it!

PSG Mixing

I do not recommend to follow this step for a dual-ASIC VA0 GameGear. The dual-ASIC model gives some graphical glitches with Mastersystem games, specially with Outrun.

For the game Outrun it is needed to mix the PSG sound together with the FM sound. To make this possible I have added 3 pads on the GGFM board and included a small wire to connect to the PSG outputs.

The GGFM sound will work fine without this wiring, only the game Outrun will have additional noise from the PSG chip. If you decide not to use this, you bridge the 2 pads marked with "DISABLE PSG MIXING" and switch off DIP switch #3.

SEGA / SYF Dual-ASIC VA0 mainboard:

  • Remove R20 and R23
  • Locate IC6 marked with 358
  • Solder red wire to PSG right channel on IC6 pin 1-2 (they are bridged)
  • Solder white wire to PSG left channel on IC6 pin 6-7 (they are bridged)
  • Solder the shield to ground - IC6 pin 4

SEGA Single-ASIC VA1 mainboard:

  • Remove R52 and R54
  • Locate IC4 marked with 358
  • Solder red wire to PSG right channel on IC4 pin 1-2 (they are bridged)
  • Solder white wire to PSG left channel on IC4 pin 6-7 (they are bridged)
  • Solder the shield to ground - IC4 pin 4

SYF 315-5535 Single-ASIC mainboard (v1.5 and later):

  • Remove R52 and R54
  • Locate IC4 marked with 358
  • Solder red wire to PSG right channel on IC4 pin 6-7 (they are bridged)
  • Solder white wire to PSG left channel on IC4 pin 1-2 (they are bridged)
  • Solder the shield to ground - IC4 pin 4

SYF Mainboard v2.0 and later:

  • Switch "EXT-PSG-INT" switch to location INT
  • Bridge solderpads on GGFM towards Mainboard (L to L, G to G, R to R). Small wire will help

Gerber and CPLD code

In case you like to make your own board, you can download the gerber, BOM and PNP files here. Keep in mind the project has a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.

The CPLD binary (GGFM.pof) is added in the above ZIP file, you can program it using a Altera USB-Blaster and the Quartus Programmer (QuartusProgrammerSetup-13.0.1.232.exe).

The programmer software can be downloaded here - you need to navigate to "Additional software".

A clone USB-Blaster can be found here

A programmer converter cable (2.54mm to 1.27mm) can be found here

Since there are no designators on the board, you can use the following diagram for part placement.

CPLD source

% 
  GGFM v1.0 logic (AHDL)
  Based on SMSFM v2.2 by Tim Worthington 2015
  GameGear conversion by Mathijs Nilwik 2023
%

SUBDESIGN ggfm
(
 d0			: BIDIR;
 d1			: BIDIR;
 d2			: OUTPUT;
 a0			: INPUT;
 a1			: INPUT;
 a2			: INPUT;
 a6			: INPUT;
 a7			: INPUT;
 /rd			: INPUT;
 /wr			: INPUT;
 /reset			: INPUT;
 /ym_reset		: OUTPUT;
 /ym_cs			: OUTPUT;
 /iorq			: INPUT;
 /kbsel			: INPUT;
 /fm_enable	        : INPUT;
 /fm_mute_disable	: INPUT;
 /psg_mute_disable      : INPUT;
 /fm_mute		: OUTPUT; 
 /psg_mute		: OUTPUT;
)

VARIABLE
reg[1..0]		: DFF;
fm_addr			: NODE;
d_tri[2..0]		: TRI;
kbsel_int		: NODE;
fmsel_int		: NODE;

BEGIN
--FM
fmsel_int = !/fm_enable; -- input pin to enable or disable FM sound chip
kbsel_int = !/iorq and a6 and a7;
fm_addr = !a2 and kbsel_int and fmsel_int;

d0 = d_tri[0].out;
d1 = d_tri[1].out;
d2 = d_tri[2].out;

d_tri[0].in = reg[0].q;
d_tri[2..1].in = gnd;
d_tri[2..0].oe = !/rd and fm_addr;

-- the value of reg[] is set to default to 0 in the assignment editor
--reg[].clrn = /reset;

reg[].clk = a1 and !/wr and /rd and fm_addr;    
reg[0].d = d0;
reg[1].d = d1;

/ym_reset = /reset;
!/ym_cs = !a1 and !/wr and /rd and fm_addr;

-- Muting audio outputs
-- mute PSG chip when not used, audio output connected via 74HC4066
!/psg_mute = !reg[1].q and reg[0].q and !/psg_mute_disable; 
-- mute FM chip when not used, audio output connect via 74HC4066. 
/fm_mute = reg[0].q or /fm_mute_disable;

END;

BOM

Part number Manufacturer Description Value designator footprint LCSC Part number
CC0603KRX7R9BB104 YAGEO Capacitor 100nF C1 0603 C14663
6TPE680MI PANASONIC Tantalum Capacitor 680uF C11 CASE_D C79115
CC0603KRX7R9BB104 YAGEO Capacitor 100nF C12 0603 C14663
CC0603KRX7R9BB104 YAGEO Capacitor 100nF C13 0603 C14663
CC0603KRX7R9BB104 YAGEO Capacitor 100nF C14 0603 C14663
298D105X0025M2T Vishay Intertech Tantalum Capacitor 1uF C15 0603 C1952840
298D105X0025M2T Vishay Intertech Tantalum Capacitor 1uF C16 0603 C1952840
298D105X0025M2T Vishay Intertech Tantalum Capacitor 1uF C17 0603 C1952840
298D105X0025M2T Vishay Intertech Tantalum Capacitor 1uF C18 0603 C1952840
298D105X0025M2T Vishay Intertech Tantalum Capacitor 1uF C19 0603 C1952840
CC0603KRX7R9BB104 YAGEO Capacitor 100nF C2 0603 C14663
GRM1885C1H822JA01D Murata Electronics Capacitor 8.2nF C3 0603 C113812
CC0603KRX7R7BB105 YAGEO Capacitor 1uF C6 0603 C106248
CC0603KRX5R6BB106 YAGEO Capacitor 10uF C7 0603 C326057
CC0603KRX5R6BB106 YAGEO Capacitor 10uF C8 0603 C326057
CC0603KRX7R7BB105 YAGEO Capacitor 1uF C9 0603 C106248
PZ127VS-12-10-H10-A38 XFCN Connector PZ127VS-12-10-H10-A38 CN1 SMD C2935458
EPM3032ATC44-10N Intel/Altera CPLD EPM3032ATC44 IC1 TQFP-44 C500865
YM2413B-F Yamaha Integrated Circuits YM2413 IC2 SOP24
TL072CDR Texas Instruments Op-amp  TL072 IC3 SOIC-8 C67473
TLV74333PDBVR Texas Instruments Low dropout regulator TLV74333 IC4 SOT-23-5 C408972
74HC4066PW,118 Nexperia Analog switch 74HC4066P IC5 TSSOP14 C5650
RT0603FRE0710KL YAGEO Resistor 10K R1 0603 C469659
RT0603FRE0710KL YAGEO Resistor 10K R10 0603 C469659
RT0603FRE0710KL YAGEO Resistor 10K R11 0603 C469659
RT0603FRE071KL YAGEO Resistor 1K R12 0603 C375503
RT0603FRE071KL YAGEO Resistor 1K R13 0603 C375503
RT0603FRE071KL YAGEO Resistor 1K R14 0603 C375503
RT0603FRE071KL YAGEO Resistor 1K R15 0603 C375503
RT0603FRE0710KL YAGEO Resistor 10K R2 0603 C469659
RT0603FRE0710KL YAGEO Resistor 10K R3 0603 C469659
RC0603FR-0747KL YAGEO Resistor 47K R4 0603 C105579
RT0603FRE073K3L YAGEO Capacitor 3.3K R5 0603 C863782
RT0603FRE074K7L YAGEO Capacitor 4.7K R6 0603 C700513
RT0603FRE074K7L YAGEO Capacitor 4.7K R7 0603 C700513
RT0603FRE073K3L YAGEO Capacitor 3.3K R8 0603 C863782
RT0603FRE0710KL YAGEO Resistor 10K R9 0603 C469664
DSHP03TS-S XKB Connection Switch DSHP03TS-S SW1 SMD C319051
VG039NCHXTB204 HDK(Hokuriku Elec Industry) Variable resistor 200K VR1 SMD C128551
* the BOM is based on thick film resistors - thin film resistors are recommended for audio purpose. However, these have poor availability.