Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Introduced ControlROMFeatureSet to define control ROM features alon…
…g with other properties in ROMInfo

- Currently ControlROMFeatureSet includes only reverb ROM type which should correspond the hardware unit revision depending on the control ROM version
  • Loading branch information
sergm committed Jun 1, 2014
1 parent 19c5db5 commit 71ae492
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
24 changes: 17 additions & 7 deletions mt32emu/src/ROMInfo.cpp
Expand Up @@ -20,15 +20,18 @@

namespace MT32Emu {

static const ControlROMFeatureSet MT32_COMPATIBLE(true);
static const ControlROMFeatureSet CM32L_COMPATIBLE(false);

// Known ROMs
static const ROMInfo CTRL_MT32_V1_04 = {65536, "5a5cb5a77d7d55ee69657c2f870416daed52dea7", ROMInfo::Control, "ctrl_mt32_1_04", "MT-32 Control v1.04", ROMInfo::Full, NULL, NULL};
static const ROMInfo CTRL_MT32_V1_05 = {65536, "e17a3a6d265bf1fa150312061134293d2b58288c", ROMInfo::Control, "ctrl_mt32_1_05", "MT-32 Control v1.05", ROMInfo::Full, NULL, NULL};
static const ROMInfo CTRL_MT32_V1_06 = {65536, "a553481f4e2794c10cfe597fef154eef0d8257de", ROMInfo::Control, "ctrl_mt32_1_06", "MT-32 Control v1.06", ROMInfo::Full, NULL, NULL};
static const ROMInfo CTRL_MT32_V1_07 = {65536, "b083518fffb7f66b03c23b7eb4f868e62dc5a987", ROMInfo::Control, "ctrl_mt32_1_07", "MT-32 Control v1.07", ROMInfo::Full, NULL, NULL};
static const ROMInfo CTRL_MT32_BLUER = {65536, "7b8c2a5ddb42fd0732e2f22b3340dcf5360edf92", ROMInfo::Control, "ctrl_mt32_bluer", "MT-32 Control BlueRidge", ROMInfo::Full, NULL, NULL};
static const ROMInfo CTRL_MT32_V1_04 = {65536, "5a5cb5a77d7d55ee69657c2f870416daed52dea7", ROMInfo::Control, "ctrl_mt32_1_04", "MT-32 Control v1.04", ROMInfo::Full, NULL, &MT32_COMPATIBLE};
static const ROMInfo CTRL_MT32_V1_05 = {65536, "e17a3a6d265bf1fa150312061134293d2b58288c", ROMInfo::Control, "ctrl_mt32_1_05", "MT-32 Control v1.05", ROMInfo::Full, NULL, &MT32_COMPATIBLE};
static const ROMInfo CTRL_MT32_V1_06 = {65536, "a553481f4e2794c10cfe597fef154eef0d8257de", ROMInfo::Control, "ctrl_mt32_1_06", "MT-32 Control v1.06", ROMInfo::Full, NULL, &MT32_COMPATIBLE};
static const ROMInfo CTRL_MT32_V1_07 = {65536, "b083518fffb7f66b03c23b7eb4f868e62dc5a987", ROMInfo::Control, "ctrl_mt32_1_07", "MT-32 Control v1.07", ROMInfo::Full, NULL, &MT32_COMPATIBLE};
static const ROMInfo CTRL_MT32_BLUER = {65536, "7b8c2a5ddb42fd0732e2f22b3340dcf5360edf92", ROMInfo::Control, "ctrl_mt32_bluer", "MT-32 Control BlueRidge", ROMInfo::Full, NULL, &MT32_COMPATIBLE};

static const ROMInfo CTRL_CM32L_V1_00 = {65536, "73683d585cd6948cc19547942ca0e14a0319456d", ROMInfo::Control, "ctrl_cm32l_1_00", "CM-32L/LAPC-I Control v1.00", ROMInfo::Full, NULL, NULL};
static const ROMInfo CTRL_CM32L_V1_02 = {65536, "a439fbb390da38cada95a7cbb1d6ca199cd66ef8", ROMInfo::Control, "ctrl_cm32l_1_02", "CM-32L/LAPC-I Control v1.02", ROMInfo::Full, NULL, NULL};
static const ROMInfo CTRL_CM32L_V1_00 = {65536, "73683d585cd6948cc19547942ca0e14a0319456d", ROMInfo::Control, "ctrl_cm32l_1_00", "CM-32L/LAPC-I Control v1.00", ROMInfo::Full, NULL, &CM32L_COMPATIBLE};
static const ROMInfo CTRL_CM32L_V1_02 = {65536, "a439fbb390da38cada95a7cbb1d6ca199cd66ef8", ROMInfo::Control, "ctrl_cm32l_1_02", "CM-32L/LAPC-I Control v1.02", ROMInfo::Full, NULL, &CM32L_COMPATIBLE};

static const ROMInfo PCM_MT32 = {524288, "f6b1eebc4b2d200ec6d3d21d51325d5b48c60252", ROMInfo::PCM, "pcm_mt32", "MT-32 PCM ROM", ROMInfo::Full, NULL, NULL};
static const ROMInfo PCM_CM32L = {1048576, "289cc298ad532b702461bfc738009d9ebe8025ea", ROMInfo::PCM, "pcm_cm32l", "CM-32L/CM-64/LAPC-I PCM ROM", ROMInfo::Full, NULL, NULL};
Expand Down Expand Up @@ -106,4 +109,11 @@ const ROMInfo* ROMImage::getROMInfo() const {
return romInfo;
}

ControlROMFeatureSet::ControlROMFeatureSet(bool useDefaultReverbMT32Compatible) : defaultReverbMT32Compatible(useDefaultReverbMT32Compatible) {
}

bool ControlROMFeatureSet::isDefaultReverbMT32Compatible() const {
return defaultReverbMT32Compatible;
}

}
13 changes: 12 additions & 1 deletion mt32emu/src/ROMInfo.h
Expand Up @@ -23,6 +23,8 @@

namespace MT32Emu {

struct ControlROMFeatureSet;

// Defines vital info about ROM file to be used by synth and applications

struct ROMInfo {
Expand All @@ -34,7 +36,7 @@ struct ROMInfo {
const char *description;
enum PairType {Full, FirstHalf, SecondHalf, Mux0, Mux1} pairType;
ROMInfo *pairROMInfo;
void *controlROMInfo;
const ControlROMFeatureSet *controlROMFeatures;

// Returns a ROMInfo struct by inspecting the size and the SHA1 hash
static const ROMInfo* getROMInfo(File *file);
Expand Down Expand Up @@ -72,6 +74,15 @@ class ROMImage {
const ROMInfo *getROMInfo() const;
};

struct ControlROMFeatureSet {
private:
unsigned int defaultReverbMT32Compatible : 1;

public:
ControlROMFeatureSet(bool defaultReverbMT32Compatible);
bool isDefaultReverbMT32Compatible() const;
};

}

#endif

1 comment on commit 71ae492

@bluegr
Copy link
Contributor

@bluegr bluegr commented on 71ae492 Jul 10, 2014

Choose a reason for hiding this comment

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

This commit is odd, as it introduces a struct that is essentially a boolean... Also, it produces warnings that a global constructor is needed.

Here's a link to a discussion on the associated ScummVM commit:
scummvm/scummvm@8c5f675

I've made a patch to simplify the code and remove the warning here:
http://pastie.org/9372949

However, I'm unsure of what the original author wants to do... are more fields going to be added to that struct? If not, there's no real point keeping it around, IMHO.

Please sign in to comment.