aboutsummaryrefslogtreecommitdiff
path: root/sound/gmidi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sound/gmidi.cpp')
-rw-r--r--sound/gmidi.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/sound/gmidi.cpp b/sound/gmidi.cpp
index 02efadfde9..397a457fb2 100644
--- a/sound/gmidi.cpp
+++ b/sound/gmidi.cpp
@@ -1,4 +1,4 @@
-/* ScummVM - Scumm Interpreter
+ /* ScummVM - Scumm Interpreter
* Copyright (C) 2001 The ScummVM project
*
* This program is free software; you can redistribute it and/or
@@ -22,8 +22,13 @@
* Timidity support by Lionel Ulmer <lionel.ulmer@free.fr>
* QuickTime support by Florent Boudet <flobo@ifrance.com>
* Raw output support by Michael Pearce
+ * MorphOS support by Ruediger Hanke
*/
+#ifdef __MORPHOS__
+#include <devices/timer.h>
+#endif
+
#include "stdafx.h"
#include "scumm.h"
@@ -53,6 +58,8 @@ void MidiDriver::midiInit() {
case MIDI_QTMUSIC:
midiInitQuicktime();
break;
+ case MIDI_AMIDI:
+ break;
default:
DeviceType = 0;
midiInitNull();
@@ -82,6 +89,9 @@ void MidiDriver::MidiOut(int b) {
case MIDI_QTMUSIC:
MidiOutQuicktime(_mo, b);
break;
+ case MIDI_AMIDI:
+ MidiOutMorphOS(_mo, b);
+ break;
default:
error("Invalid midi device type ");
break;
@@ -136,7 +146,7 @@ int MidiDriver::open_sequencer_device() {
/*********** Timidity */
int MidiDriver::connect_to_timidity(int port) {
int s = 0;
-#if !defined(__APPLE__CW) // No socket support on Apple Carbon
+#if !defined(__APPLE__CW) && !defined(__MORPHOS__) // No socket support on Apple Carbon or Morphos
struct hostent *serverhost;
struct sockaddr_in sadd;
@@ -338,6 +348,25 @@ void MidiDriver::MidiOutQuicktime(void *a, int b) {
#endif
}
+/*********** MorphOS */
+void MidiDriver::MidiOutMorphOS(void *a, int b) {
+#ifdef __MORPHOS__
+ if( ScummMidiRequest ) {
+ ULONG midi_data = b; // you never know about an int's size ;-)
+ ScummMidiRequest->amr_Std.io_Command = CMD_WRITE;
+ ScummMidiRequest->amr_Std.io_Data = &midi_data;
+ ScummMidiRequest->amr_Std.io_Length = 4;
+ DoIO( (struct IORequest *)ScummMidiRequest );
+ }
+#endif
+}
+
+
+
+
+
+
+
void MidiDriver::midiInitNull() {warning("Music not enabled - MIDI support selected with no MIDI driver available. Try Adlib");}