All Projects → superctr → MDSDRV

superctr / MDSDRV

Licence: Zlib license
Sound driver for Sega Mega Drive

Programming Languages

c
50402 projects - #5 most used programming language
assembly
5116 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to MDSDRV

GenDumper
An open-source Sega Genesis / Mega Drive cart dumper
Stars: ✭ 40 (-9.09%)
Mutual labels:  genesis, megadrive
gimp-rom-bin
GIMP plug-in to read/write SNES / NES / GB / GBA / NGP / MD / etc ROM image, tile and sprite files
Stars: ✭ 54 (+22.73%)
Mutual labels:  genesis, megadrive
MegaDrivePlusPlus
Universal Region mod, 50/60 Hz switch and In-Game-Reset (IGR) for Sega Mega Drive (AKA Genesis)
Stars: ✭ 100 (+127.27%)
Mutual labels:  genesis, megadrive
helios
A Java-based Sega Mega Drive/Genesis emulator. And other systems too.
Stars: ✭ 14 (-68.18%)
Mutual labels:  genesis, megadrive
sonic-gms2
A GameMaker Studio 2 template project used for constructing games based on the Sonic the Hedgehog series.
Stars: ✭ 18 (-59.09%)
Mutual labels:  genesis, megadrive
apultra
Free open-source compressor for apLib with 5-7% better ratios
Stars: ✭ 84 (+90.91%)
Mutual labels:  z80, 68000
LibGenesis
An API workaround the library genesis platform to enable query search
Stars: ✭ 46 (+4.55%)
Mutual labels:  genesis
ArduZ80
The first Z80 emulation library for Arduino
Stars: ✭ 44 (+0%)
Mutual labels:  z80
Collapseos
Bootstrap post-collapse technology
Stars: ✭ 4,263 (+9588.64%)
Mutual labels:  z80
zx-spec
A unit testing framework for Sinclair ZX Spectrum assembly
Stars: ✭ 32 (-27.27%)
Mutual labels:  z80
perihelion-m68k-tutorials
68000 assembly tutorials for Atari ST by perihelion of poSTmortem
Stars: ✭ 31 (-29.55%)
Mutual labels:  68000
TMS9918A
TMS9918A video card for RC2014
Stars: ✭ 104 (+136.36%)
Mutual labels:  z80
ostrich
A Game Boy Sound System player for macOS, written in Swift
Stars: ✭ 37 (-15.91%)
Mutual labels:  z80
jetpac-disassembly
JETPAC: annotated source code disassembly of this classic 8-bit game (1983, ZX Spectrum)
Stars: ✭ 36 (-18.18%)
Mutual labels:  z80
jsGBC
👾 A GameBoy Color Emulator written in JavaScript
Stars: ✭ 44 (+0%)
Mutual labels:  z80
Awesome Cpus
All CPU and MCU documentation in one place
Stars: ✭ 1,602 (+3540.91%)
Mutual labels:  z80
GODLIB
Library for creating Atari ST software
Stars: ✭ 29 (-34.09%)
Mutual labels:  68000
msx diagnostics
Tool written in Z80 assembler to test the MSX hardware basics.
Stars: ✭ 34 (-22.73%)
Mutual labels:  z80
MSXPi
Interface for MSX to Connect and use Raspberry Pi resources
Stars: ✭ 61 (+38.64%)
Mutual labels:  z80
mml-book-chinese
mml-book-chinese《Mathematics For Machine Learning》机器学习中的数学 中文版
Stars: ✭ 113 (+156.82%)
Mutual labels:  mml

MDSDRV

A sound driver for Sega Mega Drive/Genesis.

Features

  • Runs on the 68000 with the Z80 controlling PCM playback.
  • 16 monophonic tracks that can be used for BGM or sound effects. Each track can be assigned to a channel with 4 levels of priority.
  • Can use any combination of FM, PSG and PCM sound sources.
  • FM3 special mode:
    • Can assign each or a pair of FM3 operators to one or more separate tracks with volume control.
  • PCM playback modes:
    • 2 channel PCM playback at ~17.5 kHz with volume control
    • 3 channel PCM playback at ~13.3 kHz with volume control
    • Samples can play at 8 different sampling rates independent of the mixing rate
  • Compact sequence format
    • Sound data can be compiled from MML files using ctrmml
  • Various effects supported:
    • PSG volume envelopes
    • Pitch envelopes
    • Portamento
    • Fade in/out
    • Song volume and tempo control
  • Macro tables
    • Allows for channel parameters and registers to be modified automatically as a note is playing.
  • Equal temperament scale with 256 steps per semitone, allowing for easy detune or pitch slide effects.
  • Unencumbered source code
  • Fully position-independent code - supports any assembler or toolchain by including the binary blob.
  • Uses approximately 1 kb (1024 bytes) of RAM.
  • Integration with SGDK

Upcoming features

  • System C2 support is currently in the experimental c2 branch.

How to use

Feel free to join the Discord server if you have any questions or feedback.

Composing sound data

mmlgui provides an easy way to compose music and sound effects using Music Macro Language (MML).

For information on the MML dialect, see here.

Compiling sound data

The mdslink tool of ctrmml is capable of building the sound data files (mdsseq.bin and mdspcm.bin).

# creates 'mdsseq.bin' and 'mdspcm.bin'
mdslink -o mdsseq.bin mdspcm.bin mymusic.mml ...

Sound data files can be in MML (Music Macro Language) or MDS formats. For information on the MDS binary format, see mdsseq.md.

Building MDSDRV

All required tools for building are already in the repository, you just need to run build.bat. These are Windows executables, so for other operating systems, wine is required.

# creates `main.bin` (test ROM) and `mdsdrv.bin` (sound driver blob)
wine /c build.bat

To quickly generate a ROM (in Windows) with a single song, you can drag and drop a .MDS or .MML file into "quickrom.bat"

Using MDSDRV

Once compiled, using MDSDRV should be as easy as including the binary files (mdsdrv.bin, mdsseq.bin, mdspcm.bin) in your project, and calling the correct addresses inside the mdsdrv.bin blob.

File listing

  • main.bin is the sound test ROM. It is built from main.68k.
  • out/mdsdrv.bin is the sound driver binary. It is built from blob.68k.
  • out/mdsseq.bin is the compiled sequence data. It is built from music and sound effect files using mdslink.
  • out/mdspcm.bin contains PCM sample data. It is also built using mdslink.

SGDK test project

If the SGDK environment variables are set, calling build.bat should automatically build the SGDK test program.

Interfaces

Sound data reference

Precautions when using DMA

The Z80 code has a protection mechanism against reading ROM during DMA transfers. Please read dma.md for information how to use it.

Copyright

© 2019-2022 Ian Karlsson.

MDSDRV is licensed under the terms of the zlib license.

Other programs included in this repository

mdslink is part of ctrmml and is licensed under the terms of the GPLv2. But all code is written by me and I give myself permission to use it here :).

asm68k is owned by SN Systems and is non-free. However it was last released 25 years ago. I hope to move away from using it soon. The code does however currently still use a lot of specific directives, and I prefer its listing outputs for debugging... Please bear with me as I try to find a good replacement.

sjasmplus is licensed under the zlib license. The version included in this repository has been downloaded from the Github repository.

salvador is released under the zlib license. The version included in this repository has been compiled from the source code in the Github repository.

Special thanks

  • Sik: for making suggestions and giving inspiration for the Z80 driver.
  • Yuzo Koshiro: For creating the MUCOM88 driver which was an inspiration to this project.
  • All beta testers.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].