Ticket #8540: scummvm-atari-mint.patch

File scummvm-atari-mint.patch, 5.8 KB (added by SF/keithscr, 18 years ago)

Diff file for patches....

  • 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
     33class MidiDriver_STMIDI : public MidiDriver_MPU401 {
     34public:
     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
     41private:
     42        bool _isOpen;
     43};
     44
     45int MidiDriver_STMIDI::open() {
     46        if ((_isOpen) && (!Bcostat(4)))
     47                return MERR_ALREADY_OPEN;
     48        _isOpen = true;
     49        return 0;
     50}
     51
     52void MidiDriver_STMIDI::close() {
     53        MidiDriver_MPU401::close();
     54        _isOpen = false;
     55}
     56
     57void 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
     86void 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
     102MidiDriver *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  
    1212        midi/morphos.o \
    1313        midi/quicktime.o \
    1414        midi/seq.o \
     15        midi/stmidi.o \
    1516        midi/windows.o
    1617
    1718MODULE_DIRS += \
  • common/hashmap.h

    diff -Naur scummvm/common/hashmap.h scummvm-mint/common/hashmap.h
    old new  
    9898template <class Key, class Val, class HashFunc = Hash<Key>, class EqualFunc = EqualTo<Key> >
    9999class HashMap {
    100100private:
    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)
    102102//FIXME evc4, msvc6,msvc7 & GCC 2.9x doesn't like it as private member
    103103public:
    104104#endif
  • configure

    diff -Naur scummvm/configure scummvm-mint/configure
    old new  
    810810                os2-emx*)
    811811                        DEFINES="$DEFINES -DUNIX"
    812812                        ;;
     813                mint*)
     814                        DEFINES="$DEFINES -DMINT -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
     815                        ;;
    813816                # given this is a shell script assume some type of unix
    814817                *)
    815818                        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  
    4545        {"alsa", "ALSA", MD_ALSA, MDT_MIDI},
    4646#endif
    4747
     48#if defined(MINT)
     49        {"stmidi", "Atari ST MIDI", MD_STMIDI, MDT_MIDI},
     50#endif
     51
    4852#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__)
    4953        {"seq", "SEQ", MD_SEQ, MDT_MIDI},
    5054#endif
     
    242246#endif
    243247#if defined(__MORPHOS__)
    244248        case MD_ETUDE:     return MidiDriver_ETUDE_create();
     249#endif
     250#if defined(MINT)
     251        case MD_STMIDI:    return MidiDriver_STMIDI_create();
    245252#endif
    246253#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__)
    247254        case MD_SEQ:       return MidiDriver_SEQ_create();
  • sound/mididrv.h

    diff -Naur scummvm/sound/mididrv.h scummvm-mint/sound/mididrv.h
    old new  
    4949        // Windows
    5050        MD_WINDOWS,
    5151
     52        // Atari ST
     53        MD_STMIDI,
     54
    5255        // Linux
    5356        MD_ALSA,
    5457        MD_SEQ,
     
    238241extern MidiDriver *MidiDriver_NULL_create();
    239242extern MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer);
    240243extern MidiDriver *MidiDriver_WIN_create();
     244extern MidiDriver *MidiDriver_STMIDI_create();
    241245extern MidiDriver *MidiDriver_SEQ_create();
    242246extern MidiDriver *MidiDriver_QT_create();
    243247extern MidiDriver *MidiDriver_CORE_create();