Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Adjust music volume slider to match vanilla Doom #531

Merged
merged 1 commit into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion prboom2/src/MUSIC/portmidiplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ static int mastervol;

static void set_mastervol (unsigned long when)
{
int vol = mastervol * pm_volume / 15;
int vol = mastervol * pm_volume * 8 / 100;
if (vol > 16383)
vol = 16383;
unsigned char data[] = {0xf0, 0x7f, 0x7f, 0x04, 0x01, vol & 0x7f, vol >> 7, 0xf7};
Pm_WriteSysEx(pm_stream, when, data);
}
Expand Down
4 changes: 3 additions & 1 deletion prboom2/src/e6y.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,9 @@ void I_midiOutSetVolumes(int volume)
volume = 15;
if (volume < 0)
volume = 0;
calcVolume = (65535 * volume / 15);
calcVolume = 65535 * volume * 8 / 100;
if (calcVolume > 65535)
calcVolume = 65535;

//SDL_LockAudio(); // this function doesn't touch anything the audio callback touches

Expand Down