diff options
author | Eugene Sandulenko | 2012-02-09 11:20:45 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2012-02-09 11:31:03 +0200 |
commit | 030e155eeb7f82dc89315dbefa43e09a411c6110 (patch) | |
tree | 3b941d9841735fcc9878ab0663406d6be7a025aa /audio/softsynth/mt32.cpp | |
parent | 06b52994619fb9a7ef9e54e50b5cc67d07f6a0a0 (diff) | |
download | scummvm-rg350-030e155eeb7f82dc89315dbefa43e09a411c6110.tar.gz scummvm-rg350-030e155eeb7f82dc89315dbefa43e09a411c6110.tar.bz2 scummvm-rg350-030e155eeb7f82dc89315dbefa43e09a411c6110.zip |
MT32: Update MT-32 emulator to latest Munt code
Several changes against original code were made. They were intentionally
kept to the minimum
Diffstat (limited to 'audio/softsynth/mt32.cpp')
-rw-r--r-- | audio/softsynth/mt32.cpp | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp index eabde21296..c319457ae2 100644 --- a/audio/softsynth/mt32.cpp +++ b/audio/softsynth/mt32.cpp @@ -84,42 +84,6 @@ public: int getRate() const { return _outputRate; } }; -class MT32File : public MT32Emu::File { - Common::File _in; - Common::DumpFile _out; -public: - bool open(const char *filename, OpenMode mode) { - if (mode == OpenMode_read) - return _in.open(filename); - else - return _out.open(filename); - } - void close() { - _in.close(); - _out.close(); - } - size_t read(void *in, size_t size) { - return _in.read(in, size); - } - bool readBit8u(MT32Emu::Bit8u *in) { - byte b = _in.readByte(); - if (_in.eos()) - return false; - *in = b; - return true; - } - size_t write(const void *in, size_t size) { - return _out.write(in, size); - } - bool writeBit8u(MT32Emu::Bit8u out) { - _out.writeByte(out); - return !_out.err(); - } - bool isEOF() { - return _in.isOpen() && _in.eos(); - } -}; - static int eatSystemEvents() { Common::Event event; Common::EventManager *eventMan = g_system->getEventManager(); @@ -206,9 +170,9 @@ static void drawMessage(int offset, const Common::String &text) { g_system->updateScreen(); } -static MT32Emu::File *MT32_OpenFile(void *userData, const char *filename, MT32Emu::File::OpenMode mode) { - MT32File *file = new MT32File(); - if (!file->open(filename, mode)) { +static Common::File *MT32_OpenFile(void *userData, const char *filename) { + Common::File *file = new Common::File(); + if (!file->open(filename)) { delete file; return NULL; } |