Ticket #8895: atari-mint-scummvm-07072008.patch
File atari-mint-scummvm-07072008.patch, 10.1 KB (added by , 16 years ago) |
---|
-
configure
1065 1065 ;; 1066 1066 mint*) 1067 1067 DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE" 1068 LIBS="$LIBS -lsocket"1069 1068 ;; 1070 1069 amigaos*) 1071 1070 # TODO: anything to be added here? -
sound/mididrv.h
51 51 // Windows 52 52 MD_WINDOWS, 53 53 54 // Atari ST 55 MD_STMIDI, 56 54 57 // Linux 55 58 MD_ALSA, 56 59 MD_SEQ, … … 271 274 extern MidiDriver *MidiDriver_NULL_create(Audio::Mixer *mixer); 272 275 extern MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer); 273 276 extern MidiDriver *MidiDriver_WIN_create(Audio::Mixer *mixer); 277 extern MidiDriver *MidiDriver_STMIDI_create(Audio::Mixer *mixer); 274 278 extern MidiDriver *MidiDriver_SEQ_create(Audio::Mixer *mixer); 275 279 extern MidiDriver *MidiDriver_TIMIDITY_create(Audio::Mixer *mixer); 276 280 extern MidiDriver *MidiDriver_QT_create(Audio::Mixer *mixer); -
sound/mididrv.cpp
46 46 {"alsa", "ALSA", MD_ALSA, MDT_MIDI}, 47 47 #endif 48 48 49 #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) 49 #if defined(__MINT__) 50 {"stmidi", "Atari ST MIDI", MD_STMIDI, MDT_MIDI}, 51 #endif 52 53 #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) && !defined(__MINT__) 50 54 {"seq", "SEQ", MD_SEQ, MDT_MIDI}, 51 55 #endif 52 56 … … 247 251 #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) 248 252 case MD_WINDOWS: return MidiDriver_WIN_create(g_system->getMixer()); 249 253 #endif 250 #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) 254 #if defined(__MINT__) 255 case MD_STMIDI: return MidiDriver_STMIDI_create(g_system->getMixer()); 256 #endif 257 #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) && !defined(__MINT__) 251 258 case MD_SEQ: return MidiDriver_SEQ_create(g_system->getMixer()); 252 259 #endif 253 260 #if defined(UNIX) -
backends/midi/seq.cpp
28 28 * both the QuickTime support and (vkeybd http://www.alsa-project.org/~iwai/alsa.html) 29 29 */ 30 30 31 #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) 31 #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) && !defined(__MINT__) 32 32 33 33 #include "common/util.h" 34 34 #include "sound/musicplugin.h" -
backends/midi/stmidi.cpp
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 * Atari code by Keith Scroggins 24 * We, unfortunately, could not use the SEQ driver because the /dev/midi under 25 * FreeMiNT (and hence in libc) is considered to be a serial port for machine 26 * access. So, we just use OS calls then to send the data to the MIDI ports 27 * directly. The current implementation is sending 1 byte at a time because 28 * in most cases we are only sending up to 3 bytes, I believe this saves a few 29 * cycles. I might change so sysex messages are sent the other way later. 30 */ 31 32 #if defined __MINT__ 33 34 #include <osbind.h> 35 #include "sound/mpu401.h" 36 #include "common/util.h" 37 #include "sound/musicplugin.h" 38 39 class MidiDriver_STMIDI : public MidiDriver_MPU401 { 40 public: 41 MidiDriver_STMIDI() : _isOpen (false) { } 42 int open(); 43 void close(); 44 void send(uint32 b); 45 void sysEx(const byte *msg, uint16 length); 46 47 private: 48 bool _isOpen; 49 }; 50 51 int MidiDriver_STMIDI::open() { 52 if ((_isOpen) && (!Bcostat(4))) 53 return MERR_ALREADY_OPEN; 54 warning("ST Midi Port Open"); 55 _isOpen = true; 56 return 0; 57 } 58 59 void MidiDriver_STMIDI::close() { 60 MidiDriver_MPU401::close(); 61 _isOpen = false; 62 } 63 64 void MidiDriver_STMIDI::send(uint32 b) { 65 66 byte status_byte = (b & 0x000000FF); 67 byte first_byte = (b & 0x0000FF00) >> 8; 68 byte second_byte = (b & 0x00FF0000) >> 16; 69 70 // warning("ST MIDI Packet sent"); 71 72 switch (b & 0xF0) { 73 case 0x80: // Note Off 74 case 0x90: // Note On 75 case 0xA0: // Polyphonic Key Pressure 76 case 0xB0: // Controller 77 case 0xE0: // Pitch Bend 78 Bconout(3, status_byte); 79 Bconout(3, first_byte); 80 Bconout(3, second_byte); 81 break; 82 case 0xC0: // Program Change 83 case 0xD0: // Aftertouch 84 Bconout(3, status_byte); 85 Bconout(3, first_byte); 86 break; 87 default: 88 fprintf(stderr, "Unknown : %08x\n", (int)b); 89 break; 90 } 91 } 92 93 void MidiDriver_STMIDI::sysEx (const byte *msg, uint16 length) { 94 if (length > 254) { 95 warning ("Cannot send SysEx block - data too large"); 96 return; 97 } 98 99 const byte *chr = msg; 100 warning("Sending SysEx Message"); 101 102 Bconout(3, '0xF0'); 103 for (; length; --length, ++chr) { 104 Bconout(3,((unsigned char) *chr & 0x7F)); 105 } 106 Bconout(3, '0xF7'); 107 } 108 109 // Plugin interface 110 111 class StMidiMusicPlugin : public MusicPluginObject { 112 public: 113 const char *getName() const { 114 return "STMIDI"; 115 } 116 117 const char *getId() const { 118 return "stmidi"; 119 } 120 121 MusicDevices getDevices() const; 122 PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) 123 const; 124 }; 125 126 MusicDevices StMidiMusicPlugin::getDevices() const { 127 MusicDevices devices; 128 // TODO: Return a different music type depending on the configuration 129 // TODO: List the available devices 130 devices.push_back(MusicDevice(this, "", MT_GM)); 131 return devices; 132 } 133 134 PluginError StMidiMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { 135 *mididriver = new MidiDriver_STMIDI(); 136 137 return kNoError; 138 } 139 140 MidiDriver *MidiDriver_STMIDI_create(Audio::Mixer *mixer) { 141 MidiDriver *mididriver; 142 143 StMidiMusicPlugin p; 144 p.createInstance(mixer, &mididriver); 145 146 return mididriver; 147 } 148 149 //#if PLUGIN_ENABLED_DYNAMIC(STMIDI) 150 //REGISTER_PLUGIN_DYNAMIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin); 151 //#else 152 REGISTER_PLUGIN_STATIC(STMIDI, PLUGIN_TYPE_MUSIC, StMidiMusicPlugin); 153 //#endif 154 155 #endif -
backends/platform/sdl/graphics.cpp
30 30 #include "graphics/scaler.h" 31 31 #include "graphics/surface.h" 32 32 33 #ifdef __MINT__ 34 #include "backends/timer/default/default-timer.h" 35 #endif 36 33 37 static const OSystem::GraphicsMode s_supportedGraphicsModes[] = { 34 38 {"1x", "Normal (no scaling)", GFX_NORMAL}, 35 39 {"2x", "2x", GFX_DOUBLESIZE}, … … 511 515 512 516 Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends 513 517 518 #ifdef __MINT__ 519 if (_timer != NULL) 520 ((DefaultTimerManager *)_timer)->handler(); 521 #endif 522 514 523 internUpdateScreen(); 515 524 } 516 525 -
backends/platform/sdl/sdl.cpp
210 210 } 211 211 212 212 void OSystem_SDL::delayMillis(uint msecs) { 213 #ifdef __MINT__ 214 int tw = getMillis(); 215 if (_timer != NULL) { 216 ((DefaultTimerManager *)_timer)->handler(); 217 while (tw + msecs >= getMillis()) { 218 ((DefaultTimerManager *)_timer)->handler(); 219 } 220 } 221 #endif 213 222 SDL_Delay(msecs); 214 223 } 215 224 -
backends/platform/sdl/events.cpp
27 27 #include "common/util.h" 28 28 #include "common/events.h" 29 29 30 #ifdef __MINT__ 31 #include "backends/timer/default/default-timer.h" 32 #endif 33 30 34 // FIXME move joystick defines out and replace with confile file options 31 35 // we should really allow users to map any key to a joystick button 32 36 #define JOY_DEADZONE 3200 … … 177 181 int axis; 178 182 byte b = 0; 179 183 184 #ifdef __MINT__ 185 if (_timer != NULL) 186 ((DefaultTimerManager *)_timer)->handler(); 187 #endif 188 180 189 handleKbdMouse(); 181 190 182 191 // If the screen mode changed, send an Common::EVENT_SCREEN_CHANGED -
backends/module.mk
17 17 midi/coremidi.o \ 18 18 midi/quicktime.o \ 19 19 midi/seq.o \ 20 midi/stmidi.o \ 20 21 midi/timidity.o \ 21 22 midi/dmedia.o \ 22 23 midi/windows.o \ -
base/plugins.cpp
154 154 #if defined(UNIX) && defined(USE_ALSA) 155 155 LINK_PLUGIN(ALSA) 156 156 #endif 157 #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) 157 #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) && !defined(__MINT__) 158 158 LINK_PLUGIN(SEQ) 159 159 #endif 160 #if defined(__MINT__) 161 LINK_PLUGIN(STMIDI) 162 #endif 160 163 #if defined(IRIX) 161 164 LINK_PLUGIN(DMEDIA) 162 165 #endif