Skip to content

Commit

Permalink
Move config of mt32 code to its own function.
Browse files Browse the repository at this point in the history
Closes #22
  • Loading branch information
MaddTheSane committed Feb 10, 2021
1 parent fab032b commit ea36338
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Boxer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@
55E6A0C71C00C88A00285593 /* DDHidLib.framework in Copy Bundled Frameworks */ = {isa = PBXBuildFile; fileRef = 55E6A0AC1C00C80A00285593 /* DDHidLib.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
55E6A0CA1C00C88A00285593 /* BGHUDAppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55E6A09C1C00C7F900285593 /* BGHUDAppKit.framework */; };
55E6A0CB1C00C88A00285593 /* BGHUDAppKit.framework in Copy Bundled Frameworks */ = {isa = PBXBuildFile; fileRef = 55E6A09C1C00C7F900285593 /* BGHUDAppKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
55EA6CF625D4919E00945236 /* BXMIDIConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55EA6CF425D4919E00945236 /* BXMIDIConfig.cpp */; };
55EA6CF725D4919E00945236 /* BXMIDIConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55EA6CF425D4919E00945236 /* BXMIDIConfig.cpp */; };
55F4A93D256315FD00410099 /* program_ls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55F4A93B256315FD00410099 /* program_ls.cpp */; };
55F4A93E256315FD00410099 /* program_ls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55F4A93B256315FD00410099 /* program_ls.cpp */; };
55F8BC23201F9940004057D2 /* pci_bus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 55DEBB21201E875500F1092F /* pci_bus.cpp */; };
Expand Down Expand Up @@ -1135,6 +1137,8 @@
55E6A0971C00C7F900285593 /* BGHUDAppKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = BGHUDAppKit.xcodeproj; path = Vendor/BGHUDAppKit/BGHUDAppKit.xcodeproj; sourceTree = SOURCE_ROOT; };
55E6A09D1C00C80A00285593 /* DDHidLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = DDHidLib.xcodeproj; path = Vendor/DDHidLib/DDHidLib.xcodeproj; sourceTree = SOURCE_ROOT; };
55E6A0AD1C00C81D00285593 /* Boxer-MT32Emu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "Boxer-MT32Emu.xcodeproj"; path = "Vendor/MT32Emu/Boxer-MT32Emu.xcodeproj"; sourceTree = SOURCE_ROOT; };
55EA6CF425D4919E00945236 /* BXMIDIConfig.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BXMIDIConfig.cpp; sourceTree = "<group>"; };
55EA6CF525D4919E00945236 /* BXMIDIConfig.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = BXMIDIConfig.hpp; sourceTree = "<group>"; };
55F4A9302563157300410099 /* gui_msgs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gui_msgs.h; sourceTree = "<group>"; };
55F4A93A2563159F00410099 /* string_utils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = string_utils.h; sourceTree = "<group>"; };
55F4A93B256315FD00410099 /* program_ls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = program_ls.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3230,6 +3234,8 @@
9FD8BEE314FFF7660073B4EC /* BXExternalMIDIDevice+BXGeneralMIDISysexes.m */,
9F6C1CD814373AF600601ACB /* BXDummyMIDIDevice.h */,
9F6C1CD914373AF600601ACB /* BXDummyMIDIDevice.m */,
55EA6CF525D4919E00945236 /* BXMIDIConfig.hpp */,
55EA6CF425D4919E00945236 /* BXMIDIConfig.cpp */,
);
name = MIDI;
sourceTree = "<group>";
Expand Down Expand Up @@ -4175,6 +4181,7 @@
9F77219712B38C4400072AE8 /* drive_cache.cpp in Sources */,
55574805208FA8040045E635 /* ymdeltat.cpp in Sources */,
9F77219812B38C4400072AE8 /* drive_fat.cpp in Sources */,
55EA6CF625D4919E00945236 /* BXMIDIConfig.cpp in Sources */,
9F77219912B38C4400072AE8 /* drive_iso.cpp in Sources */,
9F77219A12B38C4400072AE8 /* drive_local.cpp in Sources */,
9F77219C12B38C4400072AE8 /* drive_virtual.cpp in Sources */,
Expand Down Expand Up @@ -4538,6 +4545,7 @@
9FD6AA0F16314A5B002B774E /* directlpt_linux.cpp in Sources */,
9FD6AA1116314A5B002B774E /* directlpt_win32.cpp in Sources */,
9FD6AA1316314A5B002B774E /* filelpt.cpp in Sources */,
55EA6CF725D4919E00945236 /* BXMIDIConfig.cpp in Sources */,
9FD6AA1516314A5B002B774E /* parport.cpp in Sources */,
9FD6AA1916314A5B002B774E /* printer_charmaps.cpp in Sources */,
9FD6AA1B16314A5B002B774E /* printer_redir.cpp in Sources */,
Expand Down
70 changes: 70 additions & 0 deletions Boxer/BXMIDIConfig.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// BXMIDIConfig.cpp
// Boxer
//
// Created by C.W. Betts on 2/10/21.
// Copyright © 2021 Alun Bestor and contributors. All rights reserved.
//

#include "BXMIDIConfig.hpp"
#include "string_utils.h"


static void mt32_init(MAYBE_UNUSED Section *secprop)
{}

static void init_mt32_dosbox_settings(Section_prop &sec_prop)
{
const char *mt32ReverseStereo[] = {"off", "on",0};
Prop_string *Pstring = sec_prop.Add_string("ReverseStereo",Property::Changeable::WhenIdle,"off");
Pstring->Set_values(mt32ReverseStereo);
Pstring->Set_help("Reverse stereo channels for MT-32 output");

const char *mt32DACModes[] = {"0", "1", "2", "3", "auto",0};
Pstring = sec_prop.Add_string("DAC",Property::Changeable::WhenIdle,"auto");
Pstring->Set_values(mt32DACModes);
Pstring->Set_help("MT-32 DAC input mode\n"
"Nice = 0 - default\n"
"Produces samples at double the volume, without tricks.\n"
"Higher quality than the real devices\n\n"

"Pure = 1\n"
"Produces samples that exactly match the bits output from the emulated LA32.\n"
"Nicer overdrive characteristics than the DAC hacks (it simply clips samples within range)\n"
"Much less likely to overdrive than any other mode.\n"
"Half the volume of any of the other modes, meaning its volume relative to the reverb\n"
"output when mixed together directly will sound wrong. So, reverb level must be lowered.\n"
"Perfect for developers while debugging :)\n\n"

"GENERATION1 = 2\n"
"Re-orders the LA32 output bits as in early generation MT-32s (according to Wikipedia).\n"
"Bit order at DAC (where each number represents the original LA32 output bit number, and XX means the bit is always low):\n"
"15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 XX\n\n"

"GENERATION2 = 3\n"
"Re-orders the LA32 output bits as in later generations (personally confirmed on my CM-32L - KG).\n"
"Bit order at DAC (where each number represents the original LA32 output bit number):\n"
"15 13 12 11 10 09 08 07 06 05 04 03 02 01 00 14\n\n");
const char *mt32reverbModes[] = {"0", "1", "2", "3", "auto",0};
Pstring = sec_prop.Add_string("reverbmode",Property::Changeable::WhenIdle,"auto");
Pstring->Set_values(mt32reverbModes);
Pstring->Set_help("MT-32 reverb mode");

const char *mt32reverbTimes[] = {"0", "1", "2", "3", "4", "5", "6", "7",0};
Prop_int *Pint = sec_prop.Add_int("reverbtime",Property::Changeable::WhenIdle,5);
Pint->Set_values(mt32reverbTimes);
Pint->Set_help("MT-32 reverb time");

const char *mt32reverbLevels[] = {"0", "1", "2", "3", "4", "5", "6", "7",0};
Pint = sec_prop.Add_int("reverblevel",Property::Changeable::WhenIdle,3);
Pint->Set_values(mt32reverbLevels);
Pint->Set_help("MT-32 reverb level");
}

void BXMIDIMT32_AddConfigSection(Config *conf)
{
assert(conf);
Section_prop *sec_prop = conf->AddSection_prop("mt32", &mt32_init);
assert(sec_prop);
init_mt32_dosbox_settings(*sec_prop);
}
17 changes: 17 additions & 0 deletions Boxer/BXMIDIConfig.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// BXMIDIConfig.hpp
// Boxer
//
// Created by C.W. Betts on 2/10/21.
// Copyright © 2021 Alun Bestor and contributors. All rights reserved.
//

#ifndef BXMIDIConfig_hpp
#define BXMIDIConfig_hpp

#include "control.h"
#include "midi.h"

extern void BXMIDIMT32_AddConfigSection(Config *conf);

#endif /* BXMIDIConfig_hpp */
2 changes: 1 addition & 1 deletion DOSBox-Staging
Submodule DOSBox-Staging updated 1 files
+18 −52 src/dosbox.cpp

0 comments on commit ea36338

Please sign in to comment.