Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BWSB General Digital Music (GDM) module loader. #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AliceLR
Copy link
Contributor

@AliceLR AliceLR commented Jun 10, 2021

This patch adds a loader for the GDM module format, which was the internal module format of Bells, Whistles, and Sound Boards. Due to the usage of BWSB as the module library of MegaZeux from 1996 through 2004, hundreds of GDM modules exist, many without their corresponding original MOD/S3M/etc files. When MegaZeux switched to libmodplug in late 2004, for some reason that I'm sure made sense, the devs at the time wrote a GDM→S3M converter instead of a GDM loader for libmodplug. So, from the MegaZeux project, here's a brand new GDM loader 17 years late. :-)

While libopenmpt, libxmp, and MikMod all have very good support for GDM, some notable projects such as SDL_mixer and VLC use libmodplug, which doesn't support GDM without this patch. Full disclosure, while I implemented this loader almost entirely off of MenTaLguY's GDM.TXT document, some of my knowledge of specific quirks of the format comes from having checked 2GDM/BWSB and working with other GDM loaders in the past. The main places I used this knowledge (16-bit samples hack and unsupported sample flags; quirks in effects conversion) I commented, and I'm not sure there's a reasonable alternative way of implementing these sections.

Test modules:

I'm going to go ahead and mark this as a draft since I'm still testing it.

@AliceLR AliceLR marked this pull request as draft June 10, 2021 23:03
@sezero
Copy link
Contributor

sezero commented Jun 19, 2021

I converted this so that it applies and builds/works with SDL_sound
(https://hg.icculus.org/icculus/SDL_sound/), seems to work fine with
the files you attached: SDL_sound.patch.txt (not yet applied.)
If you see any gotchas in there, please tell me.

@AliceLR
Copy link
Contributor Author

AliceLR commented Jun 19, 2021

The conversion of the loader itself looks fine to me. The only thing "wrong" I noticed is it looks like their CMakeLists.txt and Makefile.os2 have the rest of the loaders in alphabetical order... :)

This loader has been pretty thoroughly fuzzed and I think I'm done tweaking it, so I'll go ahead and mark it ready for review as well.

@AliceLR AliceLR marked this pull request as ready for review June 19, 2021 11:39
Copy link
Contributor

@sezero sezero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This work OK for me.

sezero added a commit to libsdl-org/SDL_mixer that referenced this pull request Jun 20, 2021
@sezero
Copy link
Contributor

sezero commented Jun 20, 2021

Applied this to SDL_mixer, SDL_sound, and to my libmodplug fork.

sezero pushed a commit to sezero/libmodplug that referenced this pull request Jun 20, 2021
icculus pushed a commit to icculus/SDL_sound that referenced this pull request Jun 28, 2021
icculus pushed a commit to icculus/SDL_sound that referenced this pull request Jun 28, 2021
icculus pushed a commit to icculus/SDL_sound that referenced this pull request Jun 28, 2021
icculus pushed a commit to icculus/SDL_sound that referenced this pull request Jun 28, 2021
@sezero
Copy link
Contributor

sezero commented Jan 30, 2022

Is there any chance that this gets in ?

@Konstanty
Copy link
Owner

Is there any chance that this gets in ?

Yes, this is a great addition, however will need a version update - trying to get all the fixes in first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants