Ticket #8540: scummvm-atari-mint.patch
File scummvm-atari-mint.patch, 5.8 KB (added by , 18 years ago) |
---|
-
backends/midi/stmidi.cpp
diff -Naur scummvm/backends/midi/stmidi.cpp scummvm-mint/backends/midi/stmidi.cpp
old new 1 /* ScummVM - Scumm Interpreter 2 * Copyright (C) 2001 Ludvig Strigeus 3 * Copyright (C) 2001-2006 The ScummVM project 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 */ 19 20 /* 21 * Raw MIDI output for the Atari ST line of computers. 22 * Based on the ScummVM SEQ & CoreMIDI drivers. 23 * TODO: Get it working! 24 */ 25 26 #if defined MINT 27 28 #include <osbind.h> 29 #include "common/stdafx.h" 30 #include "sound/mpu401.h" 31 #include "common/util.h" 32 33 class MidiDriver_STMIDI : public MidiDriver_MPU401 { 34 public: 35 MidiDriver_STMIDI() : _isOpen (false) { } 36 int open(); 37 void close(); 38 void send(uint32 b); 39 void sysEx(const byte *msg, uint16 length); 40 41 private: 42 bool _isOpen; 43 }; 44 45 int MidiDriver_STMIDI::open() { 46 if ((_isOpen) && (!Bcostat(4))) 47 return MERR_ALREADY_OPEN; 48 _isOpen = true; 49 return 0; 50 } 51 52 void MidiDriver_STMIDI::close() { 53 MidiDriver_MPU401::close(); 54 _isOpen = false; 55 } 56 57 void MidiDriver_STMIDI::send(uint32 b) { 58 59 byte status_byte = (b & 0x000000FF); 60 byte first_byte = (b & 0x0000FF00) >> 8; 61 byte second_byte = (b & 0x00FF0000) >> 16; 62 63 warning("ST MIDI Packet sent"); 64 65 switch (b & 0xF0) { 66 case 0x80: // Note Off 67 case 0x90: // Note On 68 case 0xA0: // Polyphonic Key Pressure 69 case 0xB0: // Controller 70 case 0xE0: // Pitch Bend 71 Bconout(3, status_byte); 72 Bconout(3, first_byte); 73 Bconout(3, second_byte); 74 break; 75 case 0xC0: // Program Change 76 case 0xD0: // Aftertouch 77 Bconout(3, status_byte); 78 Bconout(3, first_byte); 79 break; 80 default: 81 fprintf(stderr, "Unknown : %08x\n", (int)b); 82 break; 83 } 84 } 85 86 void MidiDriver_STMIDI::sysEx (const byte *msg, uint16 length) { 87 if (length > 254) { 88 warning ("Cannot send SysEx block - data too large"); 89 return; 90 } 91 92 const byte *chr = msg; 93 warning("Sending SysEx Message"); 94 95 Bconout(3, '0xF0'); 96 for (; length; --length, ++chr) { 97 Bconout(3,((unsigned char) *chr & 0x7F)); 98 } 99 Bconout(3, '0xF7'); 100 } 101 102 MidiDriver *MidiDriver_STMIDI_create() { 103 return new MidiDriver_STMIDI(); 104 } 105 106 #endif -
backends/module.mk
diff -Naur scummvm/backends/module.mk scummvm-mint/backends/module.mk
old new 12 12 midi/morphos.o \ 13 13 midi/quicktime.o \ 14 14 midi/seq.o \ 15 midi/stmidi.o \ 15 16 midi/windows.o 16 17 17 18 MODULE_DIRS += \ -
common/hashmap.h
diff -Naur scummvm/common/hashmap.h scummvm-mint/common/hashmap.h
old new 98 98 template <class Key, class Val, class HashFunc = Hash<Key>, class EqualFunc = EqualTo<Key> > 99 99 class HashMap { 100 100 private: 101 #if defined (_WIN32_WCE) || defined (_MSC_VER) || defined (__SYMBIAN32__) || defined (PALMOS_MODE) 101 #if defined (_WIN32_WCE) || defined (_MSC_VER) || defined (__SYMBIAN32__) || defined (PALMOS_MODE) || defined (MINT) 102 102 //FIXME evc4, msvc6,msvc7 & GCC 2.9x doesn't like it as private member 103 103 public: 104 104 #endif -
configure
diff -Naur scummvm/configure scummvm-mint/configure
old new 810 810 os2-emx*) 811 811 DEFINES="$DEFINES -DUNIX" 812 812 ;; 813 mint*) 814 DEFINES="$DEFINES -DMINT -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE" 815 ;; 813 816 # given this is a shell script assume some type of unix 814 817 *) 815 818 echo "WARNING: could not establish system type, assuming unix like" -
sound/mididrv.cpp
diff -Naur scummvm/sound/mididrv.cpp scummvm-mint/sound/mididrv.cpp
old new 45 45 {"alsa", "ALSA", MD_ALSA, MDT_MIDI}, 46 46 #endif 47 47 48 #if defined(MINT) 49 {"stmidi", "Atari ST MIDI", MD_STMIDI, MDT_MIDI}, 50 #endif 51 48 52 #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) 49 53 {"seq", "SEQ", MD_SEQ, MDT_MIDI}, 50 54 #endif … … 242 246 #endif 243 247 #if defined(__MORPHOS__) 244 248 case MD_ETUDE: return MidiDriver_ETUDE_create(); 249 #endif 250 #if defined(MINT) 251 case MD_STMIDI: return MidiDriver_STMIDI_create(); 245 252 #endif 246 253 #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) 247 254 case MD_SEQ: return MidiDriver_SEQ_create(); -
sound/mididrv.h
diff -Naur scummvm/sound/mididrv.h scummvm-mint/sound/mididrv.h
old new 49 49 // Windows 50 50 MD_WINDOWS, 51 51 52 // Atari ST 53 MD_STMIDI, 54 52 55 // Linux 53 56 MD_ALSA, 54 57 MD_SEQ, … … 238 241 extern MidiDriver *MidiDriver_NULL_create(); 239 242 extern MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer); 240 243 extern MidiDriver *MidiDriver_WIN_create(); 244 extern MidiDriver *MidiDriver_STMIDI_create(); 241 245 extern MidiDriver *MidiDriver_SEQ_create(); 242 246 extern MidiDriver *MidiDriver_QT_create(); 243 247 extern MidiDriver *MidiDriver_CORE_create();