Commit Graph
16 Commits
Author SHA1 Message Date
Johannes Schickel 9a0e2b7ee7 SCUMM: Fix compilation on AmigaOS4. 2012-12-14 21:18:56 +01:00
Torbjörn Andersson d3cf4d10f2 SCUMM: Handle note value 1 as "hold current note" in MI1 Mac
After listening to the original music in a Mac emulator (which
unfortunately doesn't handle the music very well), I can only
conclude that note value 1 means the note should continue playing.
At first I thought maybe it was supposed to fade the current note,
or perhaps change its volume, but I can't hear any traces of
either. So I'm going to assume it just means "hold the current
note", though for the life of me I cannot think of any valid
reason for such a command. So it may be wrong, but it sounds
closer to the emulator than it did before.
2012-11-24 01:39:16 +01:00
Torbjörn Andersson 076bcbc5c6 SCUMM: Added TODO comment about Mac MI1 music
Some notes in the main theme are very staccato, and this could
possibly explain why.
2012-11-23 06:54:25 +01:00
Torbjörn Andersson d06f69f94b SCUMM: Fix memory leak when loading old MI1 Mac savegames
I completely forgot to delete the dummy iMUSE object after using it
to skip over the old music save information. Thanks to Lordhoto for
pointing this out.
2012-11-23 06:01:30 +01:00
Torbjörn Andersson 9e995991e7 SCUMM: Fix crash when Macintosh instruments aren't available
Initialise _channel[] even when the instruments aren't available.
Otherwise, ScummVM will crash in a number of places including,
but not limited to, when loading savegames.
2012-11-19 07:18:05 +01:00
Torbjörn Andersson 94b0881427 SCUMM: Lock the sound resource while the music is playing
After some discussion on #scummvm, the player now locks the sound
resource while the music is playing. This prevents the resource
manager from expiring the resource, which at best could cause
music to restart where it shouldn't.. At worst, I guess it could
have crashed, but I never saw that happen.
2012-11-18 19:18:21 +01:00
Torbjörn Andersson 34a8b5049e SCUMM: Use more correct (I think) way of converting samples
It shouldn't make any real difference, but it's probably more
formally correct.
2012-11-18 17:56:13 +01:00
Torbjörn Andersson 4f18a92f5a SCUMM: Prevent music channels from drifting out of sync in Mac MI1
In looped music, prevent the music channels from drifting out of
sync over time. This was noticeable after a few minutes in the
SCUMM Bar. We do this by extending the last note (which is just
zeroes, so we didn't even use to play it) so that it has the
exact number of samples needed to make all channels the exact
same length. (This is calculated when the music is loaded, so it
does not need any extra data in the save games, thankfully.)

As a result, the getNextNote() is now responsible for converting
the duration to number of samples (out of necessity) and for
converting the note to a pitch modifier (out of symmetry). I made
several false starts before I realized how much easier it would
be this way.
2012-11-18 14:30:17 +01:00
Torbjörn Andersson ee65532a5e SCUMM: Avoid "pops" at the end of the note in Mac MI1/Loom music
At least on my computer, when the note ended abruptly there would
be an annoying "pop" at the end. This was particularly noticeable
at the end of the distaff notes in Loom. To get around this, fade
out the last 100 samples. There's nothing magical about 100 in
particular, but it's a nice even number and it should be short
enough that it's never a noticeable part of the note, even at low
sample rates.
2012-11-17 11:53:54 +01:00
Torbjörn Andersson 4626e21149 SCUMM: Remove commented out code.
It was the remains of an experiment and no longer serves a purpose.
2012-11-17 11:42:41 +01:00
Torbjörn Andersson b6a42e9faa SCUMM: Store sample rate in Mac MI1 / Loom savegames
This keeps the music from breaking when loading a savegame that was
made with a different sample rate than the current one. It also
breaks all savegames made in the past eight hours, but I don't think
it's necessary to maintain savegame compatibility within a pull
request, as long as it still works with savegames made before it.
2012-11-16 16:43:13 +01:00
Torbjörn Andersson f0c1d8dcc4 SCUMM: Add hack to preserve savegame compatibility with Mac MI1
For old savegames, we now use a "dummy" iMUSE objet to skip the old
iMUSE save state. I had hoped to be able to do this without making
any changes to the iMUSE code itself, but I was unable to.

Also added note about how the save state for the new music will not
quite work if the mixer output rate changes. Personally, I'm not
too worried about that. It breaks, but it shouldn't break badly.
2012-11-16 07:49:17 +01:00
Torbjörn Andersson f784d683e0 SCUMM: Save/load Mac music engine state for Loom and MI1
Note that while this removes _townsPlayer->saveLoadWithSerializer(s)
it really shouldn't break anything because _musicEngine also points
to the FM Towns player. Famous last words...
2012-11-15 22:23:44 +01:00
Torbjörn Andersson 0dcd4ba5a7 SCUMM: Move Mac player initialization to its own function
Apparently we cannot (portably) call virtual functions from the
constructor, so initialization has been moved to a separate function.
2012-11-14 21:20:40 +01:00
Torbjörn Andersson 0b63ea1d8d SCUMM: Hopefully fix warning
Excplicitly cast to int to avoid a warning that I don't get, but
which clone2727 does. At least, I hope it avoids the warning.
2012-11-14 20:54:25 +01:00
Torbjörn Andersson 148a6d3347 SCUMM: Move most of the Macintosh player code into its own class
The Monkey Island and Loom mac music is really quite similar. The
data layout is a bit different, but most of the code was easy to
separate into its own class. The Loom player doesn't do looped music
but I don't remember off-hand if it ever should.
2012-11-14 01:27:53 +01:00