diff options
author | Johannes Schickel | 2012-09-30 21:17:04 +0200 |
---|---|---|
committer | Johannes Schickel | 2012-09-30 21:17:04 +0200 |
commit | 8eeb3f2bf9857ab8ef082689ed2c064a474164c0 (patch) | |
tree | 07da4068847fcf71da036d4d4d12add1ebc69f23 /audio | |
parent | c2d39e91527450f9e592fc06a533ac3b183fa91c (diff) | |
download | scummvm-rg350-8eeb3f2bf9857ab8ef082689ed2c064a474164c0.tar.gz scummvm-rg350-8eeb3f2bf9857ab8ef082689ed2c064a474164c0.tar.bz2 scummvm-rg350-8eeb3f2bf9857ab8ef082689ed2c064a474164c0.zip |
AUDIO: Give AdLibSetParam's members more descriptive names.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/softsynth/adlib.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp index d71dca1a30..a892e2ef07 100644 --- a/audio/softsynth/adlib.cpp +++ b/audio/softsynth/adlib.cpp @@ -224,7 +224,10 @@ struct AdLibVoice { }; struct AdLibSetParams { - byte a, b, c, d; + byte registerBase; + byte shift; + byte mask; + byte inversion; }; static const byte g_operator1Offsets[9] = { @@ -1248,10 +1251,10 @@ void MidiDriver_ADLIB::adlibSetParam(int channel, byte param, int value) { } as = &g_setParamTable[param]; - if (as->d) - value = as->d - value; - reg += as->a; - adlibWrite(reg, (adlibGetRegValue(reg) & ~as->c) | (((byte)value) << as->b)); + if (as->inversion) + value = as->inversion - value; + reg += as->registerBase; + adlibWrite(reg, (adlibGetRegValue(reg) & ~as->mask) | (((byte)value) << as->shift)); } void MidiDriver_ADLIB::adlibKeyOnOff(int channel) { @@ -1591,11 +1594,11 @@ int MidiDriver_ADLIB::adlibGetRegValueParam(int chan, byte param) { } as = &g_setParamTable[param]; - val = adlibGetRegValue(channel + as->a); - val &= as->c; - val >>= as->b; - if (as->d) - val = as->d - val; + val = adlibGetRegValue(channel + as->registerBase); + val &= as->mask; + val >>= as->shift; + if (as->inversion) + val = as->inversion - val; return val; } |