aboutsummaryrefslogtreecommitdiff
path: root/morphos/morphos_sound.cpp
diff options
context:
space:
mode:
authorRuediger Hanke2002-05-26 16:37:41 +0000
committerRuediger Hanke2002-05-26 16:37:41 +0000
commiteb42e28c0a1b5084a6ef5782252ed137540e9529 (patch)
tree2e9bb30ec68bc8a99ab154a4fe38fc83c954740c /morphos/morphos_sound.cpp
parent073d8db474bd7bf74202712064a1a682ca4191eb (diff)
downloadscummvm-rg350-eb42e28c0a1b5084a6ef5782252ed137540e9529.tar.gz
scummvm-rg350-eb42e28c0a1b5084a6ef5782252ed137540e9529.tar.bz2
scummvm-rg350-eb42e28c0a1b5084a6ef5782252ed137540e9529.zip
Various changes in MorphOS interface
svn-id: r4386
Diffstat (limited to 'morphos/morphos_sound.cpp')
-rw-r--r--morphos/morphos_sound.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/morphos/morphos_sound.cpp b/morphos/morphos_sound.cpp
index da74f786ac..64ed693049 100644
--- a/morphos/morphos_sound.cpp
+++ b/morphos/morphos_sound.cpp
@@ -56,35 +56,38 @@ static struct MsgPort *MusicTimerMsgPort = NULL;
bool init_morphos_music( ULONG MidiUnit )
{
- MidiUnit = ScummMidiUnit; // Ugly fix, but ...
- ScummMidiPort = CreateMsgPort();
- if( ScummMidiPort )
+ if( ScummMusicDriver && !stricmp( ScummMusicDriver, "-eamidi" ) ) // just as ugly as the line below ...
{
- ScummMidiRequest = (struct IOMidiRequest *)CreateIORequest( ScummMidiPort, sizeof( struct IOMidiRequest ) );
- if( ScummMidiRequest )
+ MidiUnit = ScummMidiUnit; // Ugly fix, but ...
+ ScummMidiPort = CreateMsgPort();
+ if( ScummMidiPort )
{
- ScummMidiRequest->amr_Version = 2;
- if( OpenDevice( "amidi.device", MidiUnit, (struct IORequest *)ScummMidiRequest, AMIDIF_MIDISERVER ) )
+ ScummMidiRequest = (struct IOMidiRequest *)CreateIORequest( ScummMidiPort, sizeof( struct IOMidiRequest ) );
+ if( ScummMidiRequest )
+ {
+ ScummMidiRequest->amr_Version = 2;
+ if( OpenDevice( "amidi.device", MidiUnit, (struct IORequest *)ScummMidiRequest, AMIDIF_MIDISERVER ) )
+ {
+ DeleteIORequest( (struct IORequest *)ScummMidiRequest );
+ DeleteMsgPort( ScummMidiPort );
+ ScummMidiRequest = NULL;
+ ScummMidiPort = NULL;
+ }
+ }
+ else
{
- DeleteIORequest( (struct IORequest *)ScummMidiRequest );
DeleteMsgPort( ScummMidiPort );
- ScummMidiRequest = NULL;
ScummMidiPort = NULL;
}
}
- else
+
+ if( !ScummMidiRequest )
{
- DeleteMsgPort( ScummMidiPort );
- ScummMidiPort = NULL;
+ warning( "Could not open AMidi - music will not play" );
+ return false;
}
}
- if( !ScummMidiRequest )
- {
- warning( "Could not open AMidi - music will not play" );
- return false;
- }
-
MusicTimerMsgPort = CreateMsgPort();
if( MusicTimerMsgPort )
{