Replaces a home-made scaling algorithm with Sierra's algorithm.
Views should now be scaled the same as in the original interpreter.
Discrepancies were particularly noticeable when scaling down.
Examples:
ego in KQ6 after entering room 210 from 240.
ego in LSL6 after entering room 860 from 230.
Rename updateCallback51(), updateCallback52(), and updateCallback53()
to update_setRhythmLevel2(), update_changeRhythmLevel1(), and
update_setRhythmLevel1(), respectively. Name the variables
_unkValue6, _unkValue7, _unkValue8, _unkValue9, _unkValue10,
_unkValue11, _unkValue12, _unkValue13, _unkValue14, _unkValue15,
_unkValue16, _unkValue17, _unkValue18, _unkValue19, _unkValue20
that hold volume levels for the rhythm instruments.
Note that while update_setRhythmLevel1() behaves as expected (it
sets ExtraLevel1 for a subset of the rhythm intruments and updates
the total level in the OPL chip to the sum of the 3 driver levels)
the other two methods look a bit unusual: update_setRhythmLevel2()
changes ExtraLevel2, but then adds the new value _twice_ to the
total level, and update_changeRhythmLevel1() increases the total
level and stores the new total in ExtraLevel1.
The method adds a random number of selectable magnitude to the
current octave and/or F-number. (The "note on" status is preserved
unless the octave field overflows.) Rename the method and clean up
its code.
Name methods updateCallback23() and updateCallback24() as well as
variables _unkValue1, _unkValue2, _unkValue4, and _unkValue5. These
can be used to set up a divider for a global "beat" counter and wait
for the rising edge of a counter bit, respectively. Add comments to
describe the functionality.
Rename unk18, unk19, unk20, unk21, unk22, and offset to indicate
their purpose and that they are related to secondaryEffect1().
The method itself is not renamed since I don't have a good name
for it. It modulates an instrument parameter register with data
read from a chunk of the _soundData[] buffer. Once we have a good
name for it, the variable names should be shortened, too.
Rename primaryEffect2() to primaryEffectVibrato() (related update
callbacks likewise). Name the channel fields unk32, unk33, unk34,
unk35, unk36, unk37, unk38, and unk41 that are used to control
this effect and some local variables in the affected methods.
Update related comments.
Rename primaryEffect1() to primaryEffectSlide() to indicate it's
a frequency slide effect. Also rename for the related update
callbacks accordingly. Name the channel fields unk29, unk30, unk31
used for this effect. Use proper names for primaryEffectSlide()'s
local variables and clarify code a bit.
* Replace some conditional code with CLIP().
* Replace a bunch of 0 with nullptr.
* Change control structures in a few places to make code shorter
and easier to read; reduces nesting level. No functional change.
* Make Channel::unk30 signed and remove local alias unk3 in
primaryEffect1(). Likewise for Channel::unk37 and unk1 in
primaryEffect2(); use - operator to replace bit twiddling.
* Get rid of setupParserOpcodeTable(). Make the table and its size
static const members. Add _unkTable2Size and use it instead of
hardcoded number. (Note that the size members wouldn't be necessary
at all if the tables were defined earlier.)