vladikcomper / MegaPCM

An advanced DAC driver for the Sega Mega-Drive / Genesis games
MIT License
46 stars 2 forks source link
megadrive megapcm sega-genesis sega-mega-drive sound-driver

Mega PCM 2

Mega PCM 2 is a DAC sound driver for Sega Mega-Drive / Genesis. It offers the highest quality playback possible on the hardware, high sample rate (up to 32 kHz), pitch/volume effects and supports several sample formats (WAVE, raw PCM, compressed DPCM).

Unlike the majority of DAC drivers on the Mega-Drive with the infamous "scratchy" playback many games are known for, Mega PCM 2 outputs cleanest sounding samples on the hardware thanks to its buffering / DMA protection system.

Mega PCM runs primarily on the Z80 CPU and is DAC only. To take full advantage of Sega's sound chip and also use FM and PSG channels, you need to run it alongside the "main" M68K sound driver. Generally, Mega PCM can be integrated with any M68K sound driver. Currently, only SMPS integration is officially provided.

You may also see this demo of crystal-clear PCM playback @ 32 kHz recorded on real hardware.

Features

Installation and Documentation

Installation guides

Documentation

Examples

Building from source code

Linux

Make sure Wine is installed. Use the following commands to build:

make
make examples

Windows

You need to have GCC, Make and Python3 installed and availabe via PATH. The easiest way to get everything with one command is to use Chocolatey, but you may choose any other option that works for you:

choco install mingw python3 make

Once dependencies are installed, build process is the same as on Unix-like systems:

make
make examples

If you need to invoke make from individual directories however (not root), be sure to use make -f Makefile.win instead (the root Makefile does it automatically).

FreeBSD

Almost the same as Linux, however you need to make sure to use GNU version of Make.

Licensing

Mega PCM 2's main source code and its dependencies (src/ and lib-68k/directories) are fully free and open source and are provided under MIT license. See LICENSE file.

Source code for Mega PCM 2 implementation examples (examples/ directory) is also MIT-licensed, however, some included assets and disassembled "SMPS" sound driver may be proprietary and provided for educational purposes only.

Also included in this repo, but not distributed with Mega PCM 2 releases: