{"id":13407214,"url":"https://github.com/superctr/MDSDRV","last_synced_at":"2025-03-14T11:31:12.006Z","repository":{"id":52447682,"uuid":"187979625","full_name":"superctr/MDSDRV","owner":"superctr","description":"Sound driver for Sega Mega Drive","archived":false,"fork":false,"pushed_at":"2023-06-14T04:59:17.000Z","size":3734,"stargazers_count":62,"open_issues_count":8,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-07-31T20:26:57.355Z","etag":null,"topics":["68000","genesis","megadrive","mml","music-macro-language","sgdk","z80"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/superctr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-05-22T06:49:29.000Z","updated_at":"2024-07-11T00:10:42.000Z","dependencies_parsed_at":"2024-01-13T17:12:04.299Z","dependency_job_id":"cb18e032-c724-47e1-9afe-ce283f9fea38","html_url":"https://github.com/superctr/MDSDRV","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superctr%2FMDSDRV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superctr%2FMDSDRV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superctr%2FMDSDRV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superctr%2FMDSDRV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superctr","download_url":"https://codeload.github.com/superctr/MDSDRV/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243569414,"owners_count":20312420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["68000","genesis","megadrive","mml","music-macro-language","sgdk","z80"],"created_at":"2024-07-30T20:00:30.214Z","updated_at":"2025-03-14T11:31:11.997Z","avatar_url":"https://github.com/superctr.png","language":"C","funding_links":[],"categories":["Uncategorized","Sound and Music"],"sub_categories":["Uncategorized","Tutorials"],"readme":"MDSDRV\n======\nA sound driver for Sega Mega Drive/Genesis.\n\n## Features\n- Runs on the 68000 with the Z80 controlling PCM playback.\n- 16 monophonic tracks that can be used for BGM or sound effects.\n\tEach track can be assigned to a channel with 4 levels of priority.\n- Can use any combination of FM, PSG and PCM sound sources.\n- FM3 special mode:\n\t- Can assign each or a pair of FM3 operators to one or more\n\t\tseparate tracks with volume control.\n- PCM playback modes:\n\t- 2 channel PCM playback at ~17.5 kHz with volume control\n\t- 3 channel PCM playback at ~13.3 kHz with volume control\n\t- Samples can play at 8 different sampling rates independent of\n\t\tthe mixing rate\n- Compact sequence format\n\t- Sound data can be compiled from MML files using `ctrmml`\n- Various effects supported:\n\t- PSG volume envelopes\n\t- Pitch envelopes\n\t- Portamento\n\t- Fade in/out\n\t- Song volume and tempo control\n- Macro tables\n\t- Allows for channel parameters and registers to be modified\n\t\tautomatically as a note is playing.\n- Equal temperament scale with 256 steps per semitone, allowing for\n\teasy detune or pitch slide effects.\n- Unencumbered source code\n- Fully position-independent code - supports any assembler or toolchain\n\tby including the binary blob.\n- Uses approximately 1 kb (1024 bytes) of RAM.\n- Integration with SGDK\n\n### Upcoming features\n- System C2 support is currently in the experimental `c2` branch.\n\n## How to use\nFeel free to join the [Discord server](https://discord.com/invite/BPwM6PJv7T)\nif you have any questions or feedback.\n\n### Composing sound data\n[mmlgui](https://github.com/superctr/mmlgui) provides an easy way\nto compose music and sound effects using Music Macro Language (MML).\n\nFor information on the MML dialect, see\n[here](https://github.com/superctr/ctrmml/blob/master/mml_ref.md).\n\n### Compiling sound data\nThe `mdslink` tool of [ctrmml](https://github.com/superctr/ctrmml)\nis capable of building the sound data files (`mdsseq.bin` and\n`mdspcm.bin`).\n\n\t# creates 'mdsseq.bin' and 'mdspcm.bin'\n\tmdslink -o mdsseq.bin mdspcm.bin mymusic.mml ...\n\nSound data files can be in MML (Music Macro Language) or MDS formats.\nFor information on the MDS binary format, see\n[mdsseq.md](doc/mdsseq.md).\n\n### Building MDSDRV\nAll required tools for building are already in the repository, you just\nneed to run `build.bat`. These are Windows executables, so for other\noperating systems, `wine` is required.\n\n\t# creates `main.bin` (test ROM) and `mdsdrv.bin` (sound driver blob)\n\twine /c build.bat\n\nAlternatively, if you use a Unix-like system and `sjasmplus`, `salvador`,\nand `mdslink` are installed to your `PATH`, you can use the `Makefile`\nto build MDSDRV. Note that you still need `wine` to run `asm68k.exe`.\n\n\t# creates `mdsdrv.bin` (sound driver blob)\n\tmake mdsdrv\n\n\t# creates `main.bin` (test ROM)\n\tmake demo\n\nTo quickly generate a ROM (in Windows) with a single song, you can drag\nand drop a .MDS or .MML file into \"quickrom.bat\"\n\n### Using MDSDRV\nOnce compiled, using MDSDRV should be as easy as including the binary\nfiles (`mdsdrv.bin`, `mdsseq.bin`, `mdspcm.bin`) in your project, and\ncalling the correct addresses inside the `mdsdrv.bin` blob.\n\n#### File listing\n- `main.bin` is the sound test ROM. It is built from  `main.68k`.\n- `out/mdsdrv.bin` is the sound driver binary. It is built from\n\t`blob.68k`.\n- `out/mdsseq.bin` is the compiled sequence data. It is built from\n\tmusic and sound effect files using `mdslink`.\n- `out/mdspcm.bin` contains PCM sample data. It is also built using\n\t`mdslink`.\n\n#### SGDK test project\n- See [sample/sgdk](sample/sgdk/README.md).\n\nIf the SGDK environment variables are set, calling `build.bat` or\n`make sgdk-demo` should automatically build the SGDK test program.\n\n#### Interfaces\n- See [api.md](doc/api.md)\n\n#### Sound data reference\n- See [mdsseq.md](doc/mdsseq.md)\n\n#### Precautions when using DMA\n- See [dma.md](doc/dma.md)\n\nThe Z80 code has a protection mechanism against reading ROM\nduring DMA transfers. Please read [dma.md](doc/dma.md) for information\nhow to use it.\n\n## Copyright\n\u0026copy; 2019-2022 Ian Karlsson.\n\nMDSDRV is licensed under the terms of the [zlib license](COPYING).\n\n### Other programs included in this repository\n`mdslink` is part of [ctrmml](https://github.com/superctr/ctrmml) and\nis licensed under the terms of the GPLv2. But all code is written by me\nand I give myself permission to use it here :).\n\n`asm68k` is owned by SN Systems and is non-free. However it was last\nreleased 25 years ago. I hope to move away from using it soon. The code\ndoes however currently still use a lot of specific directives, and I\nprefer its listing outputs for debugging... Please bear with me as I\ntry to find a good replacement.\n\n`sjasmplus` is licensed under the zlib license. The version included in\nthis repository has been downloaded from the\n[Github repository](https://github.com/sjasmplus/sjasmplus).\n\n`salvador` is released under the zlib license. The version included in\nthis repository has been compiled from the source code in the\n[Github repository](https://github.com/emmanuel-marty/salvador).\n\n## Special thanks\n- Sik: for making suggestions and giving inspiration for the Z80 driver.\n- Yuzo Koshiro: For creating the MUCOM88 driver which was an\n\tinspiration to this project.\n- All beta testers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperctr%2FMDSDRV","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperctr%2FMDSDRV","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperctr%2FMDSDRV/lists"}