Merge remote branch 'upstream/master' into t7g-ios

Conflicts:
	engines/groovie/script.cpp
This commit is contained in:
Matthew Hoops 2011-05-31 14:16:29 -04:00
commit aa49b38c5a
2939 changed files with 10306 additions and 16546 deletions

71
AUTHORS
View file

@ -19,7 +19,7 @@ ScummVM Team
Jonathan Gray - (retired) Jonathan Gray - (retired)
Vincent Hamm - (retired) Vincent Hamm - (retired)
Max Horn Max Horn
Travis Howell Travis Howell - (retired)
Pawel Kolodziejski - Codecs, iMUSE, Smush, etc. Pawel Kolodziejski - Codecs, iMUSE, Smush, etc.
Gregory Montoir Gregory Montoir
Eugene Sandulenko - FT INSANE, MM NES, MM C64, game detection, Eugene Sandulenko - FT INSANE, MM NES, MM C64, game detection,
@ -28,7 +28,7 @@ ScummVM Team
HE: HE:
Jonathan Gray - (retired) Jonathan Gray - (retired)
Travis Howell Travis Howell - (retired)
Gregory Montoir Gregory Montoir
Eugene Sandulenko Eugene Sandulenko
@ -45,40 +45,18 @@ ScummVM Team
AGOS: AGOS:
Torbjorn Andersson Torbjorn Andersson
Paul Gilbert Paul Gilbert
Travis Howell Travis Howell - (retired)
Oliver Kiehl - (retired) Oliver Kiehl - (retired)
Ludvig Strigeus - (retired) Ludvig Strigeus - (retired)
BASS: Cine:
Robert Goeffringmann - (retired)
Oliver Kiehl - (retired)
Joost Peters
Broken Sword:
Fabio Battaglia - PSX version support
Thierry Crozat - Mac version support
Robert Goeffringmann - (retired)
Broken Sword II:
Torbjorn Andersson
Fabio Battaglia - PSX version support
Jonathan Gray - (retired)
Broken Sword 2.5:
Eugene Sandulenko
Filippos Karapetis
Max Horn
Paul Gilbert
Torbjorn Andersson
Cinematique evo 1:
Vincent Hamm - (retired) Vincent Hamm - (retired)
Pawel Kolodziejski Pawel Kolodziejski
Gregory Montoir Gregory Montoir
Kari Salminen Kari Salminen
Eugene Sandulenko Eugene Sandulenko
Cinematique evo 2: CruisE:
Paul Gilbert Paul Gilbert
Vincent Hamm - (retired) Vincent Hamm - (retired)
@ -90,11 +68,6 @@ ScummVM Team
Filippos Karapetis Filippos Karapetis
Pawel Kolodziejski Pawel Kolodziejski
FOTAQ:
David Eriksson - (retired)
Gregory Montoir
Joost Peters
Gob: Gob:
Torbjorn Andersson Torbjorn Andersson
Arnaud Boutonne Arnaud Boutonne
@ -118,7 +91,7 @@ ScummVM Team
Gregory Montoir Gregory Montoir
Johannes Schickel Johannes Schickel
Last Express: Lastexpress:
Matthew Hoops Matthew Hoops
Jordi Vilalta Prat Jordi Vilalta Prat
Julien Templier Julien Templier
@ -147,6 +120,11 @@ ScummVM Team
Parallaction: Parallaction:
peres peres
Queen:
David Eriksson - (retired)
Gregory Montoir
Joost Peters
SAGA: SAGA:
Torbjorn Andersson Torbjorn Andersson
Filippos Karapetis Filippos Karapetis
@ -164,6 +142,28 @@ ScummVM Team
Jordi Vilalta Prat Jordi Vilalta Prat
Lars Skovlund Lars Skovlund
Sky:
Robert Goeffringmann - (retired)
Oliver Kiehl - (retired)
Joost Peters
Sword1:
Fabio Battaglia - PSX version support
Thierry Crozat - Mac version support
Robert Goeffringmann - (retired)
Sword2:
Torbjorn Andersson
Fabio Battaglia - PSX version support
Jonathan Gray - (retired)
Sword25:
Eugene Sandulenko
Filippos Karapetis
Max Horn
Paul Gilbert
Torbjorn Andersson
TeenAgent: TeenAgent:
Robert Megone - Help with callback rewriting Robert Megone - Help with callback rewriting
Vladimir Menshakov Vladimir Menshakov
@ -222,7 +222,8 @@ ScummVM Team
PocketPC / WinCE: PocketPC / WinCE:
Nicolas Bacca - (retired) Nicolas Bacca - (retired)
Kostas Nakos Ismail Khatib
Kostas Nakos - (retired)
PlayStation 2: PlayStation 2:
Robert Goeffringmann - (retired) Robert Goeffringmann - (retired)
@ -357,7 +358,7 @@ Other contributions
Markus Strangl Markus Strangl
Win32: Win32:
Travis Howell Travis Howell - (retired)
Win64: Win64:
Chris Gray - (retired) Chris Gray - (retired)

17
COPYING
View file

@ -1,8 +1,8 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to the GNU Lesser General Public License instead.) You can apply it to
your programs, too. your programs, too.
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not
@ -303,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License along
along with this program; if not, write to the Free Software with this program; if not, write to the Free Software Foundation, Inc.,
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. Public License instead of this License.

View file

@ -40,10 +40,10 @@ Travis Howell
Janne Huttunen Janne Huttunen
Felix Jakschitsch Felix Jakschitsch
Jeroen Janssen Jeroen Janssen
Willem Jan Palenstijn
Florian Kagerer Florian Kagerer
Filippos Karapetis Filippos Karapetis
Andreas Karlsson Andreas Karlsson
Ismail Khatib
Oliver Kiehl Oliver Kiehl
Martin Kiewitz Martin Kiewitz
Pawel Kolodziejski Pawel Kolodziejski
@ -58,6 +58,7 @@ Gregory Montoir
Kostas Nakos Kostas Nakos
Mikesch Nepomuk Mikesch Nepomuk
Nicolas Noble Nicolas Noble
Willem Jan Palenstijn
Lars Persson Lars Persson
Joost Peters Joost Peters
Tim Phillips Tim Phillips

View file

@ -1,5 +1,3 @@
# $URL$
# $Id$
####################################################################### #######################################################################
# Default compilation parameters. Normally don't edit these # # Default compilation parameters. Normally don't edit these #

View file

@ -1,8 +1,6 @@
# This file is used by Makefile and declares common build rules, # This file is used by Makefile and declares common build rules,
# a list of common object files etc. # a list of common object files etc.
# #
# $URL$
# $Id$
###################################################################### ######################################################################
# The default build target: just build the scummvm executable # The default build target: just build the scummvm executable

4
NEWS
View file

@ -5,7 +5,7 @@ For a more comprehensive changelog of the latest experimental code, see:
SDL ports: SDL ports:
- Added support for OpenGL (GSoC Task). - Added support for OpenGL (GSoC Task).
1.3.0 (????-??-??) 1.3.0 (2011-05-28)
New Games: New Games:
- Added support for Backyard Baseball. - Added support for Backyard Baseball.
- Added support for Backyard Baseball 2001. - Added support for Backyard Baseball 2001.
@ -1123,7 +1123,7 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added MMX i386 assembler versions of the HQ2x and HQ3x scalers. - Added MMX i386 assembler versions of the HQ2x and HQ3x scalers.
- Added 'Extra Path' option allows for a searching an additional datafile - Added 'Extra Path' option allows for a searching an additional datafile
location (for reencoded cutscenes and the like). location (for reencoded cutscenes and the like).
- Disabled Alt-x and Ctrl-z quit keys in favour of Ctrl-q on unix like - Disabled Alt-x and Ctrl-z quit keys in favor of Ctrl-q on unix like
operating systems, like Linux (exception: Mac OS X still uses Cmd-q). operating systems, like Linux (exception: Mac OS X still uses Cmd-q).
- Separate smaller font for the console, allowing for more visible - Separate smaller font for the console, allowing for more visible
information, for example in the SCUMM debugger. information, for example in the SCUMM debugger.

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/debug.h" #include "common/debug.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_AUDIOSTREAM_H #ifndef SOUND_AUDIOSTREAM_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/stream.h" #include "common/stream.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/* /*

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// Disable symbol overrides for FILE as that is used in FLAC headers // Disable symbol overrides for FILE as that is used in FLAC headers
@ -306,7 +303,7 @@ int FLACStream::readBuffer(int16 *buffer, const int numSamples) {
const uint numChannels = getChannels(); const uint numChannels = getChannels();
if (numChannels == 0) { if (numChannels == 0) {
warning("FLACStream: Stream not successfully initialised, cant playback"); warning("FLACStream: Stream not successfully initialized, cant playback");
return -1; // streaminfo wasnt read! return -1; // streaminfo wasnt read!
} }

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/decoders/iff_sound.h" #include "audio/decoders/iff_sound.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/* /*

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/decoders/mp3.h" #include "audio/decoders/mp3.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// Based off ffmpeg's QDM2 decoder // Based off ffmpeg's QDM2 decoder

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// Only compile if Mohawk is enabled or if we're building dynamic modules // Only compile if Mohawk is enabled or if we're building dynamic modules

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef AUDIO_QDM2DATA_H #ifndef AUDIO_QDM2DATA_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/endian.h" #include "common/endian.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_RAW_H #ifndef SOUND_RAW_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/decoders/vag.h" #include "audio/decoders/vag.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/debug.h" #include "common/debug.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// Disable symbol overrides for FILE and fseek as those are used in the // Disable symbol overrides for FILE and fseek as those are used in the

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**
@ -36,6 +33,7 @@
* - scumm * - scumm
* - sword1 * - sword1
* - sword2 * - sword2
* - sword25
* - touche * - touche
* - tucker * - tucker
*/ */

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/debug.h" #include "common/debug.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "audio/fmopl.h" #include "audio/fmopl.h"

View file

@ -17,16 +17,16 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#ifndef SOUND_FMOPL_H #ifndef SOUND_FMOPL_H
#define SOUND_FMOPL_H #define SOUND_FMOPL_H
#include "common/scummsys.h" #include "common/scummsys.h"
#include "common/str.h"
namespace Common {
class String;
}
namespace OPL { namespace OPL {

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/config-manager.h" #include "common/config-manager.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_MIDIDRV_H #ifndef SOUND_MIDIDRV_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/midiparser.h" #include "audio/midiparser.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/// \brief Declarations related to the MidiParser class /// \brief Declarations related to the MidiParser class

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/midiparser.h" #include "audio/midiparser.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/midiparser.h" #include "audio/midiparser.h"
@ -240,7 +237,7 @@ bool MidiParser_XMIDI::loadMusic(byte *data, uint32 size) {
pos += 4; pos += 4;
_num_tracks = 1; _num_tracks = 1;
} else if (memcmp(pos, "XDIR", 4)) { } else if (memcmp(pos, "XDIR", 4)) {
// Not an XMIDI that we recognise // Not an XMIDI that we recognize
warning("Expected 'XDIR' but found '%c%c%c%c'", pos[0], pos[1], pos[2], pos[3]); warning("Expected 'XDIR' but found '%c%c%c%c'", pos[0], pos[1], pos[2], pos[3]);
return false; return false;
} else { } else {

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/midiplayer.h" #include "audio/midiplayer.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_MIDIPLAYER_H #ifndef SOUND_MIDIPLAYER_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/util.h" #include "common/util.h"
@ -260,6 +257,8 @@ int MixerImpl::mixCallback(byte *samples, uint len) {
Common::StackLock lock(_mutex); Common::StackLock lock(_mutex);
int16 *buf = (int16 *)samples; int16 *buf = (int16 *)samples;
// we store stereo, 16-bit samples
assert(len % 4 == 0);
len >>= 2; len >>= 2;
// Since the mixer callback has been called, the mixer must be ready... // Since the mixer callback has been called, the mixer must be ready...

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_MIXER_H #ifndef SOUND_MIXER_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_MIXER_INTERN_H #ifndef SOUND_MIXER_INTERN_H
@ -129,6 +126,8 @@ public:
* the backend (e.g. from an audio mixing thread). All the actual mixing * the backend (e.g. from an audio mixing thread). All the actual mixing
* work is done from here. * work is done from here.
* *
* @param samples Sample buffer, in which stereo 16-bit samples will be stored.
* @param len Length of the provided buffer to fill (in bytes, should be divisible by 4).
* @return number of sample pairs processed (which can still be silence!) * @return number of sample pairs processed (which can still be silence!)
*/ */
int mixCallback(byte *samples, uint len); int mixCallback(byte *samples, uint len);

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/mods/infogrames.h" #include "audio/mods/infogrames.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/scummsys.h" #include "common/scummsys.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// see if all engines using this class are DISABLED // see if all engines using this class are DISABLED

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/mods/module.h" #include "audio/mods/module.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_MODS_MODULE_H #ifndef SOUND_MODS_MODULE_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/mods/paula.h" #include "audio/mods/paula.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_MODS_PAULA_H #ifndef SOUND_MODS_PAULA_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/mods/protracker.h" #include "audio/mods/protracker.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/debug.h" #include "common/debug.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/endian.h" #include "common/endian.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/** /**

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "common/scummsys.h" #include "common/scummsys.h"
@ -335,7 +332,7 @@ void Tfmx::macroRun(ChannelContext &channel) {
channel.vibLength = macroPtr[1]; channel.vibLength = macroPtr[1];
channel.vibCount = macroPtr[1] / 2; channel.vibCount = macroPtr[1] / 2;
channel.vibDelta = macroPtr[3]; channel.vibDelta = macroPtr[3];
// TODO: Perhaps a bug, vibValue could be left uninitialised // TODO: Perhaps a bug, vibValue could be left uninitialized
if (!channel.portaDelta) { if (!channel.portaDelta) {
channel.period = channel.refPeriod; channel.period = channel.refPeriod;
channel.vibValue = 0; channel.vibValue = 0;
@ -703,7 +700,7 @@ void Tfmx::noteCommand(const uint8 note, const uint8 param1, const uint8 param2,
channel.relVol = param2 >> 4; channel.relVol = param2 >> 4;
channel.fineTune = (int8)param3; channel.fineTune = (int8)param3;
// TODO: the point where the channel gets initialised varies with the games, needs more research. // TODO: the point where the channel gets initialized varies with the games, needs more research.
initMacroProgramm(channel); initMacroProgramm(channel);
channel.keyUp = false; // key down = playing a Note channel.keyUp = false; // key down = playing a Note

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// see if all engines using this class are DISABLED // see if all engines using this class are DISABLED

View file

@ -42,10 +42,11 @@ MODULE_OBJS := \
softsynth/opl/mame.o \ softsynth/opl/mame.o \
softsynth/fmtowns_pc98/towns_audio.o \ softsynth/fmtowns_pc98/towns_audio.o \
softsynth/fmtowns_pc98/towns_euphony.o \ softsynth/fmtowns_pc98/towns_euphony.o \
softsynth/fmtowns_pc98/towns_midi.o \
softsynth/fmtowns_pc98/towns_pc98_driver.o \ softsynth/fmtowns_pc98/towns_pc98_driver.o \
softsynth/fmtowns_pc98/towns_pc98_fmsynth.o \ softsynth/fmtowns_pc98/towns_pc98_fmsynth.o \
softsynth/fmtowns_pc98/towns_pc98_plugins.o \
softsynth/appleiigs.o \ softsynth/appleiigs.o \
softsynth/ym2612.o \
softsynth/fluidsynth.o \ softsynth/fluidsynth.o \
softsynth/mt32.o \ softsynth/mt32.o \
softsynth/eas.o \ softsynth/eas.o \

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "audio/mpu401.h" #include "audio/mpu401.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_MPU401_H #ifndef SOUND_MPU401_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/musicplugin.h" #include "audio/musicplugin.h"

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#ifndef SOUND_MUSICPLUGIN_H #ifndef SOUND_MUSICPLUGIN_H

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "common/error.h" #include "common/error.h"

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#ifndef SOUND_NULL_H #ifndef SOUND_NULL_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/* /*

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef SOUND_RATE_H #ifndef SOUND_RATE_H

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
/* /*

View file

@ -18,9 +18,6 @@
@ along with this program@ if not, write to the Free Software @ along with this program@ if not, write to the Free Software
@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@ @
@ $URL$
@ $Id$
@
@ @author Robin Watts (robin@wss.co.uk) @ @author Robin Watts (robin@wss.co.uk)
@ @
@ This file, together with rate_arm.cpp, provides an ARM optimised version @ This file, together with rate_arm.cpp, provides an ARM optimised version

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "audio/softsynth/emumidi.h" #include "audio/softsynth/emumidi.h"

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/null.h" #include "audio/null.h"

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "audio/softsynth/cms.h" #include "audio/softsynth/cms.h"

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#ifndef SOUND_SOFTSYNTH_CMS_H #ifndef SOUND_SOFTSYNTH_CMS_H

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "common/scummsys.h" #include "common/scummsys.h"

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#ifndef SOUND_SOFTSYNTH_EMUMIDI_H #ifndef SOUND_SOFTSYNTH_EMUMIDI_H

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "common/scummsys.h" #include "common/scummsys.h"

File diff suppressed because it is too large Load diff

View file

@ -18,15 +18,14 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef TOWNS_AUDIO_H #ifndef TOWNS_AUDIO_H
#define TOWNS_AUDIO_H #define TOWNS_AUDIO_H
#include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h" #include "audio/mixer.h"
class TownsAudioInterfaceInternal;
class TownsAudioInterfacePluginDriver { class TownsAudioInterfacePluginDriver {
public: public:
@ -34,12 +33,9 @@ public:
virtual void timerCallback(int timerId) = 0; virtual void timerCallback(int timerId) = 0;
}; };
class TownsAudio_PcmChannel; class TownsAudioInterface {
class TownsAudio_WaveTable;
class TownsAudioInterface : public TownsPC98_FmSynth {
public: public:
TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver); TownsAudioInterface(Audio::Mixer *mixer, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling = false);
~TownsAudioInterface(); ~TownsAudioInterface();
bool init(); bool init();
@ -53,126 +49,7 @@ public:
void setSoundEffectChanMask(int mask); void setSoundEffectChanMask(int mask);
private: private:
void nextTickEx(int32 *buffer, uint32 bufferSize); TownsAudioInterfaceInternal *_intf;
void timerCallbackA();
void timerCallbackB();
typedef int (TownsAudioInterface::*TownsAudioIntfCallback)(va_list &);
const TownsAudioIntfCallback *_intfOpcodes;
int intf_reset(va_list &args);
int intf_keyOn(va_list &args);
int intf_keyOff(va_list &args);
int intf_setPanPos(va_list &args);
int intf_setInstrument(va_list &args);
int intf_loadInstrument(va_list &args);
int intf_setPitch(va_list &args);
int intf_setLevel(va_list &args);
int intf_chanOff(va_list &args);
int intf_writeReg(va_list &args);
int intf_writeRegBuffer(va_list &args);
int intf_readRegBuffer(va_list &args);
int intf_setTimerA(va_list &args);
int intf_setTimerB(va_list &args);
int intf_enableTimerA(va_list &args);
int intf_enableTimerB(va_list &args);
int intf_loadSamples(va_list &args);
int intf_reserveEffectChannels(va_list &args);
int intf_loadWaveTable(va_list &args);
int intf_unloadWaveTable(va_list &args);
int intf_pcmPlayEffect(va_list &args);
int intf_pcmChanOff(va_list &args);
int intf_pcmEffectPlaying(va_list &args);
int intf_fmKeyOn(va_list &args);
int intf_fmKeyOff(va_list &args);
int intf_fmSetPanPos(va_list &args);
int intf_fmSetInstrument(va_list &args);
int intf_fmLoadInstrument(va_list &args);
int intf_fmSetPitch(va_list &args);
int intf_fmSetLevel(va_list &args);
int intf_fmReset(va_list &args);
int intf_setOutputVolume(va_list &args);
int intf_resetOutputVolume(va_list &args);
int intf_updateOutputVolume(va_list &args);
int intf_cdaToggle(va_list &args);
int intf_pcmUpdateEnvelopeGenerator(va_list &args);
int intf_notImpl(va_list &args);
void fmReset();
int fmKeyOn(int chan, int note, int velo);
int fmKeyOff(int chan);
int fmChanOff(int chan);
int fmSetPanPos(int chan, int mode);
int fmSetInstrument(int chan, int instrId);
int fmLoadInstrument(int instrId, const uint8 *data);
int fmSetPitch(int chan, int pitch);
int fmSetLevel(int chan, int lvl);
void bufferedWriteReg(uint8 part, uint8 regAddress, uint8 value);
uint8 _fmChanPlaying;
uint8 _fmChanNote[6];
int16 _fmChanPitch[6];
uint8 *_fmSaveReg[2];
uint8 *_fmInstruments;
void pcmReset();
int pcmKeyOn(int chan, int note, int velo);
int pcmKeyOff(int chan);
int pcmChanOff(int chan);
int pcmSetPanPos(int chan, int mode);
int pcmSetInstrument(int chan, int instrId);
int pcmLoadInstrument(int instrId, const uint8 *data);
int pcmSetPitch(int chan, int pitch);
int pcmSetLevel(int chan, int lvl);
void pcmUpdateEnvelopeGenerator(int chan);
TownsAudio_PcmChannel *_pcmChan;
uint8 _pcmChanOut;
uint8 _pcmChanReserved;
uint8 _pcmChanKeyPressed;
uint8 _pcmChanEffectPlaying;
uint8 _pcmChanKeyPlaying;
uint8 _pcmChanNote[8];
uint8 _pcmChanVelo[8];
uint8 _pcmChanLevel[8];
uint8 _numReservedChannels;
uint8 *_pcmInstruments;
TownsAudio_WaveTable *_waveTables;
uint8 _numWaveTables;
uint32 _waveTablesTotalDataSize;
void pcmCalcPhaseStep(TownsAudio_PcmChannel *p, TownsAudio_WaveTable *w);
void updateOutputVolume();
uint8 _outputVolumeFlags;
uint8 _outputLevel[16];
uint8 _outputMuteFlags;
const float _baserate;
uint32 _timerBase;
uint32 _tickLength;
uint32 _timer;
uint16 _musicVolume;
uint16 _sfxVolume;
int _pcmSfxChanMask;
TownsAudioInterfacePluginDriver *_drv;
bool _ready;
static const uint8 _chanFlags[];
static const uint16 _frequency[];
static const uint8 _carrier[];
static const uint8 _fmDefaultInstrument[];
static const uint16 _pcmPhase1[];
static const uint16 _pcmPhase2[];
}; };
#endif #endif

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/softsynth/fmtowns_pc98/towns_euphony.h" #include "audio/softsynth/fmtowns_pc98/towns_euphony.h"
@ -31,7 +28,8 @@
TownsEuphonyDriver::TownsEuphonyDriver(Audio::Mixer *mixer) : _activeChannels(0), _sustainChannels(0), TownsEuphonyDriver::TownsEuphonyDriver(Audio::Mixer *mixer) : _activeChannels(0), _sustainChannels(0),
_assignedChannels(0), _paraCount(0), _command(0), _tEnable(0), _tMode(0), _tOrdr(0), _tLevel(0), _assignedChannels(0), _paraCount(0), _command(0), _tEnable(0), _tMode(0), _tOrdr(0), _tLevel(0),
_tTranspose(0), _musicPos(0), _musicStart(0), _playing(false), _eventBuffer(0), _bufferedEventsCount(0), _tTranspose(0), _musicPos(0), _musicStart(0), _playing(false), _eventBuffer(0), _bufferedEventsCount(0),
_tempoControlMode(0) { _tempoControlMode(0), _timerSetting(0), _tempoDiff(0), _timeStampBase(0), _elapsedEvents(0), _loop(false),
_endOfTrack(false), _suspendParsing(false), _musicTrackSize(0) {
_para[0] = _para[1] = 0; _para[0] = _para[1] = 0;
_intf = new TownsAudioInterface(mixer, this); _intf = new TownsAudioInterface(mixer, this);
resetTempo(); resetTempo();
@ -84,7 +82,7 @@ void TownsEuphonyDriver::reset() {
_intf->callback(0); _intf->callback(0);
_intf->callback(74); _intf->callback(74);
_intf->callback(70); _intf->callback(70, 0);
_intf->callback(75, 3); _intf->callback(75, 3);
setTimerA(true, 1); setTimerA(true, 1);
@ -223,21 +221,21 @@ void TownsEuphonyDriver::setOutputVolume(int mode, int volLeft, int volRight) {
_intf->callback(67, mode, volLeft, volRight); _intf->callback(67, mode, volLeft, volRight);
} }
int TownsEuphonyDriver::chanEnable(int tableEntry, int val) { int TownsEuphonyDriver::configChan_enable(int tableEntry, int val) {
if (tableEntry > 31) if (tableEntry > 31)
return 3; return 3;
_tEnable[tableEntry] = val; _tEnable[tableEntry] = val;
return 0; return 0;
} }
int TownsEuphonyDriver::chanMode(int tableEntry, int val) { int TownsEuphonyDriver::configChan_setMode(int tableEntry, int val) {
if (tableEntry > 31) if (tableEntry > 31)
return 3; return 3;
_tMode[tableEntry] = val; _tMode[tableEntry] = val;
return 0; return 0;
} }
int TownsEuphonyDriver::chanOrdr(int tableEntry, int val) { int TownsEuphonyDriver::configChan_remap(int tableEntry, int val) {
if (tableEntry > 31) if (tableEntry > 31)
return 3; return 3;
if (val < 16) if (val < 16)
@ -245,7 +243,7 @@ int TownsEuphonyDriver::chanOrdr(int tableEntry, int val) {
return 0; return 0;
} }
int TownsEuphonyDriver::chanVolumeShift(int tableEntry, int val) { int TownsEuphonyDriver::configChan_adjustVolume(int tableEntry, int val) {
if (tableEntry > 31) if (tableEntry > 31)
return 3; return 3;
if (val <= 40) if (val <= 40)
@ -253,7 +251,7 @@ int TownsEuphonyDriver::chanVolumeShift(int tableEntry, int val) {
return 0; return 0;
} }
int TownsEuphonyDriver::chanNoteShift(int tableEntry, int val) { int TownsEuphonyDriver::configChan_setTranspose(int tableEntry, int val) {
if (tableEntry > 31) if (tableEntry > 31)
return 3; return 3;
if (val <= 40) if (val <= 40)
@ -675,8 +673,8 @@ bool TownsEuphonyDriver::evtSetupNote() {
uint8 velo = _musicPos[5]; uint8 velo = _musicPos[5];
sendEvent(mode, evt); sendEvent(mode, evt);
sendEvent(mode, applyNoteShift(note)); sendEvent(mode, applyTranspose(note));
sendEvent(mode, applyVolumeShift(velo)); sendEvent(mode, applyVolumeAdjust(velo));
jumpNextLoop(); jumpNextLoop();
if (_musicPos[0] == 0xfe || _musicPos[0] == 0xfd) if (_musicPos[0] == 0xfe || _musicPos[0] == 0xfd)
@ -715,7 +713,7 @@ bool TownsEuphonyDriver::evtPolyphonicAftertouch() {
uint8 mode = _tMode[_musicPos[1]]; uint8 mode = _tMode[_musicPos[1]];
sendEvent(mode, evt); sendEvent(mode, evt);
sendEvent(mode, applyNoteShift(_musicPos[4])); sendEvent(mode, applyTranspose(_musicPos[4]));
sendEvent(mode, _musicPos[5]); sendEvent(mode, _musicPos[5]);
return false; return false;
@ -783,7 +781,7 @@ bool TownsEuphonyDriver::evtModeOrdrChange() {
return false; return false;
} }
uint8 TownsEuphonyDriver::applyNoteShift(uint8 in) { uint8 TownsEuphonyDriver::applyTranspose(uint8 in) {
int out = _tTranspose[_musicPos[1]]; int out = _tTranspose[_musicPos[1]];
if (!out) if (!out)
return in; return in;
@ -798,7 +796,7 @@ uint8 TownsEuphonyDriver::applyNoteShift(uint8 in) {
return out & 0xff; return out & 0xff;
} }
uint8 TownsEuphonyDriver::applyVolumeShift(uint8 in) { uint8 TownsEuphonyDriver::applyVolumeAdjust(uint8 in) {
int out = _tLevel[_musicPos[1]]; int out = _tLevel[_musicPos[1]];
out += (in & 0x7f); out += (in & 0x7f);
out = CLIP(out, 1, 127); out = CLIP(out, 1, 127);

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef TOWNS_EUP_H #ifndef TOWNS_EUP_H
@ -58,11 +55,11 @@ public:
void setOutputVolume(int chanType, int volLeft, int volRight); void setOutputVolume(int chanType, int volLeft, int volRight);
int chanEnable(int tableEntry, int val); int configChan_enable(int tableEntry, int val);
int chanMode(int tableEntry, int val); int configChan_setMode(int tableEntry, int val);
int chanOrdr(int tableEntry, int val); int configChan_remap(int tableEntry, int val);
int chanVolumeShift(int tableEntry, int val); int configChan_adjustVolume(int tableEntry, int val);
int chanNoteShift(int tableEntry, int val); int configChan_setTranspose(int tableEntry, int val);
int assignChannel(int chan, int tableEntry); int assignChannel(int chan, int tableEntry);
@ -114,8 +111,8 @@ private:
return false; return false;
} }
uint8 applyNoteShift(uint8 in); uint8 applyTranspose(uint8 in);
uint8 applyVolumeShift(uint8 in); uint8 applyVolumeAdjust(uint8 in);
void sendNoteOff(); void sendNoteOff();
void sendNoteOn(); void sendNoteOn();

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,83 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TOWNS_MIDI_H
#define TOWNS_MIDI_H
#include "audio/softsynth/fmtowns_pc98/towns_audio.h"
#include "audio/mididrv.h"
class TownsMidiOutputChannel;
class TownsMidiInputChannel;
class TownsMidiChanState;
class MidiDriver_TOWNS : public MidiDriver, public TownsAudioInterfacePluginDriver {
friend class TownsMidiInputChannel;
friend class TownsMidiOutputChannel;
public:
MidiDriver_TOWNS(Audio::Mixer *mixer);
~MidiDriver_TOWNS();
int open();
bool isOpen() const { return _isOpen; }
void close();
void send(uint32 b);
void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc);
uint32 getBaseTempo();
MidiChannel *allocateChannel();
MidiChannel *getPercussionChannel();
void timerCallback(int timerId);
private:
void updateParser();
void updateOutputChannels();
TownsMidiOutputChannel *allocateOutputChannel(uint8 pri);
int randomValue(int para);
TownsMidiInputChannel **_channels;
TownsMidiOutputChannel **_out;
TownsMidiChanState *_chanState;
Common::TimerManager::TimerProc _timerProc;
void *_timerProcPara;
TownsAudioInterface *_intf;
uint32 _tickCounter1;
uint32 _tickCounter2;
uint8 _allocCurPos;
uint8 _rand;
bool _isOpen;
uint8 *_operatorLevelTable;
};
#endif

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/softsynth/fmtowns_pc98/towns_pc98_driver.h" #include "audio/softsynth/fmtowns_pc98/towns_pc98_driver.h"
@ -1057,6 +1054,8 @@ TownsPC98_AudioDriver::~TownsPC98_AudioDriver() {
_ready = false; _ready = false;
deinit(); deinit();
Common::StackLock lock(_mutex);
if (_channels) { if (_channels) {
for (int i = 0; i < _numChan; i++) for (int i = 0; i < _numChan; i++)
delete _channels[i]; delete _channels[i];
@ -1239,7 +1238,6 @@ void TownsPC98_AudioDriver::fadeStep() {
if (!_musicPlaying) if (!_musicPlaying)
return; return;
Common::StackLock lock(_mutex);
for (int j = 0; j < _numChan; j++) { for (int j = 0; j < _numChan; j++) {
if (_updateChannelsFlag & _channels[j]->_idFlag) if (_updateChannelsFlag & _channels[j]->_idFlag)
_channels[j]->fadeStep(); _channels[j]->fadeStep();
@ -1264,6 +1262,57 @@ void TownsPC98_AudioDriver::fadeStep() {
} }
} }
void TownsPC98_AudioDriver::pause() {
_musicPlaying = false;
}
void TownsPC98_AudioDriver::cont() {
_musicPlaying = true;
}
bool TownsPC98_AudioDriver::looping() {
return _looping == _updateChannelsFlag ? true : false;
}
bool TownsPC98_AudioDriver::musicPlaying() {
return _musicPlaying;
}
void TownsPC98_AudioDriver::setMusicVolume(int volume) {
_musicVolume = volume;
setVolumeIntern(_musicVolume, _sfxVolume);
}
void TownsPC98_AudioDriver::setSoundEffectVolume(int volume) {
_sfxVolume = volume;
setVolumeIntern(_musicVolume, _sfxVolume);
}
void TownsPC98_AudioDriver::timerCallbackA() {
if (_sfxChannels && _sfxPlaying) {
if (_sfxData)
startSoundEffect();
_sfxOffs = 3;
_trackPtr = _sfxBuffer;
for (int i = 0; i < 2; i++) {
if (_updateSfxFlag & _sfxChannels[i]->_idFlag) {
_sfxChannels[i]->processEvents();
_sfxChannels[i]->processFrequency();
}
}
_trackPtr = _musicBuffer;
}
if (_updateSfxFlag && _finishedSfxFlag == _updateSfxFlag) {
_sfxPlaying = false;
_updateSfxFlag = 0;
setVolumeChannelMasks(-1, 0);
}
}
void TownsPC98_AudioDriver::timerCallbackB() { void TownsPC98_AudioDriver::timerCallbackB() {
_sfxOffs = 0; _sfxOffs = 0;
@ -1297,42 +1346,6 @@ void TownsPC98_AudioDriver::timerCallbackB() {
_musicPlaying = false; _musicPlaying = false;
} }
void TownsPC98_AudioDriver::timerCallbackA() {
if (_sfxChannels && _sfxPlaying) {
if (_sfxData)
startSoundEffect();
_sfxOffs = 3;
_trackPtr = _sfxBuffer;
for (int i = 0; i < 2; i++) {
if (_updateSfxFlag & _sfxChannels[i]->_idFlag) {
_sfxChannels[i]->processEvents();
_sfxChannels[i]->processFrequency();
}
}
_trackPtr = _musicBuffer;
}
if (_updateSfxFlag && _finishedSfxFlag == _updateSfxFlag) {
_sfxPlaying = false;
_updateSfxFlag = 0;
setVolumeChannelMasks(-1, 0);
}
}
void TownsPC98_AudioDriver::setMusicTempo(uint8 tempo) {
writeReg(0, 0x26, tempo);
writeReg(0, 0x27, 0x33);
}
void TownsPC98_AudioDriver::setSfxTempo(uint16 tempo) {
writeReg(0, 0x24, tempo & 0xff);
writeReg(0, 0x25, tempo >> 8);
writeReg(0, 0x27, 0x33);
}
void TownsPC98_AudioDriver::startSoundEffect() { void TownsPC98_AudioDriver::startSoundEffect() {
int volFlags = 0; int volFlags = 0;
@ -1353,6 +1366,16 @@ void TownsPC98_AudioDriver::startSoundEffect() {
_sfxData = 0; _sfxData = 0;
} }
void TownsPC98_AudioDriver::setMusicTempo(uint8 tempo) {
writeReg(0, 0x26, tempo);
writeReg(0, 0x27, 0x33);
}
void TownsPC98_AudioDriver::setSfxTempo(uint16 tempo) {
writeReg(0, 0x24, tempo & 0xff);
writeReg(0, 0x25, tempo >> 8);
writeReg(0, 0x27, 0x33);
}
const uint8 TownsPC98_AudioDriver::_drvTables[] = { const uint8 TownsPC98_AudioDriver::_drvTables[] = {
// channel presets // channel presets
0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01,

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef TOWNS_PC98_AUDIODRIVER_H #ifndef TOWNS_PC98_AUDIODRIVER_H
@ -53,33 +50,19 @@ public:
void fadeStep(); void fadeStep();
void pause() { void pause();
_musicPlaying = false; void cont();
}
void cont() {
_musicPlaying = true;
}
void timerCallbackB(); bool looping();
bool musicPlaying();
void setMusicVolume(int volume);
void setSoundEffectVolume(int volume);
private:
void timerCallbackA(); void timerCallbackA();
void timerCallbackB();
bool looping() {
return _looping == _updateChannelsFlag ? true : false;
}
bool musicPlaying() {
return _musicPlaying;
}
void setMusicVolume(int volume) {
_musicVolume = volume;
setVolumeIntern(_musicVolume, _sfxVolume);
}
void setSoundEffectVolume(int volume) {
_sfxVolume = volume;
setVolumeIntern(_musicVolume, _sfxVolume);
}
protected:
void startSoundEffect(); void startSoundEffect();
void setMusicTempo(uint8 tempo); void setMusicTempo(uint8 tempo);

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h" #include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h"
@ -42,45 +39,22 @@ public:
void recalculateRates(); void recalculateRates();
void generateOutput(int32 phasebuf, int32 *feedbuf, int32 &out); void generateOutput(int32 phasebuf, int32 *feedbuf, int32 &out);
void feedbackLevel(int32 level) { void feedbackLevel(int32 level);
_feedbackLevel = level ? level + 6 : 0; void detune(int value);
} void multiple(uint32 value);
void detune(int value) { void attackRate(uint32 value);
_detn = &_detnTbl[value << 5];
}
void multiple(uint32 value) {
_multiple = value ? (value << 1) : 1;
}
void attackRate(uint32 value) {
_specifiedAttackRate = value;
}
bool scaleRate(uint8 value); bool scaleRate(uint8 value);
void decayRate(uint32 value) { void decayRate(uint32 value);
_specifiedDecayRate = value; void sustainRate(uint32 value);
recalculateRates(); void sustainLevel(uint32 value);
} void releaseRate(uint32 value);
void sustainRate(uint32 value) { void totalLevel(uint32 value);
_specifiedSustainRate = value; void ampModulation(bool enable);
recalculateRates();
}
void sustainLevel(uint32 value) {
_sustainLevel = (value == 0x0f) ? 0x3e0 : value << 5;
}
void releaseRate(uint32 value) {
_specifiedReleaseRate = value;
recalculateRates();
}
void totalLevel(uint32 value) {
_totalLevel = value << 3;
}
void ampModulation(bool enable) {
_ampMod = enable;
}
void reset(); void reset();
protected: protected:
EnvelopeState _state; EnvelopeState _state;
bool _playing; bool _holdKey;
uint32 _feedbackLevel; uint32 _feedbackLevel;
uint32 _multiple; uint32 _multiple;
uint32 _totalLevel; uint32 _totalLevel;
@ -125,7 +99,7 @@ TownsPC98_FmSynthOperator::TownsPC98_FmSynthOperator(const uint32 timerbase, con
_rtt(rtt), _rateTbl(rateTable), _rshiftTbl(shiftTable), _adTbl(attackDecayTable), _fTbl(frqTable), _rtt(rtt), _rateTbl(rateTable), _rshiftTbl(shiftTable), _adTbl(attackDecayTable), _fTbl(frqTable),
_sinTbl(sineTable), _tLvlTbl(tlevelOut), _detnTbl(detuneTable), _tickLength(timerbase * 2), _sinTbl(sineTable), _tLvlTbl(tlevelOut), _detnTbl(detuneTable), _tickLength(timerbase * 2),
_specifiedAttackRate(0), _specifiedDecayRate(0), _specifiedReleaseRate(0), _specifiedSustainRate(0), _specifiedAttackRate(0), _specifiedDecayRate(0), _specifiedReleaseRate(0), _specifiedSustainRate(0),
_phase(0), _state(kEnvReady), _playing(false), _timer(0), _keyScale1(0), _sustainLevel(0), _phase(0), _state(kEnvReady), _holdKey(false), _timer(0), _keyScale1(0),
_keyScale2(0), _currentLevel(1023), _ampMod(false), _tickCount(0) { _keyScale2(0), _currentLevel(1023), _ampMod(false), _tickCount(0) {
fs_a.rate = fs_a.shift = fs_d.rate = fs_d.shift = fs_s.rate = fs_s.shift = fs_r.rate = fs_r.shift = 0; fs_a.rate = fs_a.shift = fs_d.rate = fs_d.shift = fs_s.rate = fs_s.shift = fs_r.rate = fs_r.shift = 0;
@ -134,19 +108,19 @@ TownsPC98_FmSynthOperator::TownsPC98_FmSynthOperator(const uint32 timerbase, con
} }
void TownsPC98_FmSynthOperator::keyOn() { void TownsPC98_FmSynthOperator::keyOn() {
if (_playing) if (_holdKey)
return; return;
_playing = true; _holdKey = true;
_state = kEnvAttacking; _state = kEnvAttacking;
_phase = 0; _phase = 0;
} }
void TownsPC98_FmSynthOperator::keyOff() { void TownsPC98_FmSynthOperator::keyOff() {
if (!_playing) if (!_holdKey)
return; return;
_playing = false; _holdKey = false;
if (_state != kEnvReady) if (_state != kEnvReady)
_state = kEnvReleasing; _state = kEnvReleasing;
} }
@ -202,39 +176,42 @@ void TownsPC98_FmSynthOperator::generateOutput(int32 phasebuf, int32 *feed, int3
int32 targetLevel = 0; int32 targetLevel = 0;
EnvelopeState nextState = kEnvReady; EnvelopeState nextState = kEnvReady;
switch (_state) { for (bool loop = true; loop;) {
case kEnvReady: switch (_state) {
return; case kEnvReady:
case kEnvAttacking: return;
targetLevel = 0; case kEnvAttacking:
nextState = kEnvDecaying; targetLevel = 0;
if ((_specifiedAttackRate << 1) + _keyScale2 < 64) { nextState = _sustainLevel ? kEnvDecaying : kEnvSustaining;
targetTime = (1 << fs_a.shift) - 1; if ((_specifiedAttackRate << 1) + _keyScale2 < 62) {
levelIncrement = (~_currentLevel * _adTbl[fs_a.rate + ((_tickCount >> fs_a.shift) & 7)]) >> 4; targetTime = (1 << fs_a.shift) - 1;
levelIncrement = (~_currentLevel * _adTbl[fs_a.rate + ((_tickCount >> fs_a.shift) & 7)]) >> 4;
} else {
_currentLevel = targetLevel;
_state = nextState;
continue;
}
break;
case kEnvDecaying:
targetTime = (1 << fs_d.shift) - 1;
nextState = kEnvSustaining;
targetLevel = _sustainLevel;
levelIncrement = _adTbl[fs_d.rate + ((_tickCount >> fs_d.shift) & 7)];
break;
case kEnvSustaining:
targetTime = (1 << fs_s.shift) - 1;
nextState = kEnvSustaining;
targetLevel = 1023;
levelIncrement = _adTbl[fs_s.rate + ((_tickCount >> fs_s.shift) & 7)];
break;
case kEnvReleasing:
targetTime = (1 << fs_r.shift) - 1;
nextState = kEnvReady;
targetLevel = 1023;
levelIncrement = _adTbl[fs_r.rate + ((_tickCount >> fs_r.shift) & 7)];
break; break;
} else {
_currentLevel = targetLevel;
_state = nextState;
} }
// Fall through loop = false;
case kEnvDecaying:
targetTime = (1 << fs_d.shift) - 1;
nextState = kEnvSustaining;
targetLevel = _sustainLevel;
levelIncrement = _adTbl[fs_d.rate + ((_tickCount >> fs_d.shift) & 7)];
break;
case kEnvSustaining:
targetTime = (1 << fs_s.shift) - 1;
nextState = kEnvSustaining;
targetLevel = 1023;
levelIncrement = _adTbl[fs_s.rate + ((_tickCount >> fs_s.shift) & 7)];
break;
case kEnvReleasing:
targetTime = (1 << fs_r.shift) - 1;
nextState = kEnvReady;
targetLevel = 1023;
levelIncrement = _adTbl[fs_r.rate + ((_tickCount >> fs_r.shift) & 7)];
break;
} }
if (!(_tickCount & targetTime)) { if (!(_tickCount & targetTime)) {
@ -275,6 +252,63 @@ void TownsPC98_FmSynthOperator::generateOutput(int32 phasebuf, int32 *feed, int3
out += *o; out += *o;
} }
void TownsPC98_FmSynthOperator::feedbackLevel(int32 level) {
_feedbackLevel = level ? level + 6 : 0;
}
void TownsPC98_FmSynthOperator::detune(int value) {
_detn = &_detnTbl[value << 5];
}
void TownsPC98_FmSynthOperator::multiple(uint32 value) {
_multiple = value ? (value << 1) : 1;
}
void TownsPC98_FmSynthOperator::attackRate(uint32 value) {
_specifiedAttackRate = value;
}
bool TownsPC98_FmSynthOperator::scaleRate(uint8 value) {
value = 3 - value;
if (_keyScale1 != value) {
_keyScale1 = value;
return true;
}
int k = _keyScale2;
int r = _specifiedAttackRate ? (_specifiedAttackRate << 1) + 0x20 : 0;
fs_a.rate = ((r + k) < 94) ? _rateTbl[r + k] : 136;
fs_a.shift = ((r + k) < 94) ? _rshiftTbl[r + k] : 0;
return false;
}
void TownsPC98_FmSynthOperator::decayRate(uint32 value) {
_specifiedDecayRate = value;
recalculateRates();
}
void TownsPC98_FmSynthOperator::sustainRate(uint32 value) {
_specifiedSustainRate = value;
recalculateRates();
}
void TownsPC98_FmSynthOperator::sustainLevel(uint32 value) {
_sustainLevel = (value == 0x0f) ? 0x3e0 : value << 5;
}
void TownsPC98_FmSynthOperator::releaseRate(uint32 value) {
_specifiedReleaseRate = value;
recalculateRates();
}
void TownsPC98_FmSynthOperator::totalLevel(uint32 value) {
_totalLevel = value << 3;
}
void TownsPC98_FmSynthOperator::ampModulation(bool enable) {
_ampMod = enable;
}
void TownsPC98_FmSynthOperator::reset() { void TownsPC98_FmSynthOperator::reset() {
keyOff(); keyOff();
_timer = 0; _timer = 0;
@ -295,20 +329,6 @@ void TownsPC98_FmSynthOperator::reset() {
ampModulation(false); ampModulation(false);
} }
bool TownsPC98_FmSynthOperator::scaleRate(uint8 value) {
value = 3 - value;
if (_keyScale1 != value) {
_keyScale1 = value;
return true;
}
int k = _keyScale2;
int r = _specifiedAttackRate ? (_specifiedAttackRate << 1) + 0x20 : 0;
fs_a.rate = ((r + k) < 94) ? _rateTbl[r + k] : 136;
fs_a.shift = ((r + k) < 94) ? _rshiftTbl[r + k] : 0;
return false;
}
class TownsPC98_FmSynthSquareSineSource { class TownsPC98_FmSynthSquareSineSource {
public: public:
TownsPC98_FmSynthSquareSineSource(const uint32 timerbase, const uint32 rtt); TownsPC98_FmSynthSquareSineSource(const uint32 timerbase, const uint32 rtt);
@ -633,7 +653,8 @@ void TownsPC98_FmSynthSquareSineSource::updateRegs() {
#ifndef DISABLE_PC98_RHYTHM_CHANNEL #ifndef DISABLE_PC98_RHYTHM_CHANNEL
TownsPC98_FmSynthPercussionSource::TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt) : TownsPC98_FmSynthPercussionSource::TownsPC98_FmSynthPercussionSource(const uint32 timerbase, const uint32 rtt) :
_rtt(rtt), _tickLength(timerbase * 2), _timer(0), _ready(false), _volMaskA(0), _volMaskB(0), _volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume) { _rtt(rtt), _tickLength(timerbase * 2), _timer(0), _totalLevel(0), _volMaskA(0), _volMaskB(0),
_volumeA(Audio::Mixer::kMaxMixerVolume), _volumeB(Audio::Mixer::kMaxMixerVolume), _ready(false) {
memset(_rhChan, 0, sizeof(RhtChannel) * 6); memset(_rhChan, 0, sizeof(RhtChannel) * 6);
_reg = new uint8 *[40]; _reg = new uint8 *[40];
@ -830,7 +851,7 @@ void TownsPC98_FmSynthPercussionSource::advanceInput(RhtChannel *ins) {
} }
#endif // DISABLE_PC98_RHYTHM_CHANNEL #endif // DISABLE_PC98_RHYTHM_CHANNEL
TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) : TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type, bool externalMutexHandling) :
_mixer(mixer), _mixer(mixer),
_chanInternal(0), _ssg(0), _chanInternal(0), _ssg(0),
#ifndef DISABLE_PC98_RHYTHM_CHANNEL #ifndef DISABLE_PC98_RHYTHM_CHANNEL
@ -841,7 +862,7 @@ TownsPC98_FmSynth::TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type) :
_oprRates(0), _oprRateshift(0), _oprAttackDecay(0), _oprFrq(0), _oprSinTbl(0), _oprLevelOut(0), _oprDetune(0), _oprRates(0), _oprRateshift(0), _oprAttackDecay(0), _oprFrq(0), _oprSinTbl(0), _oprLevelOut(0), _oprDetune(0),
_rtt(type == kTypeTowns ? 0x514767 : 0x5B8D80), _baserate(55125.0f / (float)mixer->getOutputRate()), _rtt(type == kTypeTowns ? 0x514767 : 0x5B8D80), _baserate(55125.0f / (float)mixer->getOutputRate()),
_volMaskA(0), _volMaskB(0), _volumeA(255), _volumeB(255), _volMaskA(0), _volMaskB(0), _volumeA(255), _volumeB(255),
_regProtectionFlag(false), _ready(false) { _regProtectionFlag(false), _externalMutex(externalMutexHandling), _ready(false) {
memset(&_timers[0], 0, sizeof(ChipTimer)); memset(&_timers[0], 0, sizeof(ChipTimer));
memset(&_timers[1], 0, sizeof(ChipTimer)); memset(&_timers[1], 0, sizeof(ChipTimer));
@ -854,6 +875,8 @@ TownsPC98_FmSynth::~TownsPC98_FmSynth() {
if (_ready) if (_ready)
deinit(); deinit();
Common::StackLock lock(_mutex);
delete _ssg; delete _ssg;
#ifndef DISABLE_PC98_RHYTHM_CHANNEL #ifndef DISABLE_PC98_RHYTHM_CHANNEL
delete _prc; delete _prc;
@ -934,10 +957,10 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) {
if (_regProtectionFlag || !_ready) if (_regProtectionFlag || !_ready)
return; return;
static const uint8 oprOrdr[] = { 0, 2, 1, 3 };
Common::StackLock lock(_mutex); Common::StackLock lock(_mutex);
static const uint8 oprOrdr[] = { 0, 2, 1, 3 };
uint8 h = regAddress & 0xf0; uint8 h = regAddress & 0xf0;
uint8 l = (regAddress & 0x0f); uint8 l = (regAddress & 0x0f);
@ -1084,6 +1107,7 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) {
if (l == 0) { if (l == 0) {
c->frqTemp = (c->frqTemp & 0xff00) | value; c->frqTemp = (c->frqTemp & 0xff00) | value;
c->updateEnvelopeParameters = true; c->updateEnvelopeParameters = true;
c->fmIndex = (c->frqTemp >> 4 & 0x7f);
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
co[i]->frequency(c->frqTemp); co[i]->frequency(c->frqTemp);
} else if (l == 4) { } else if (l == 4) {
@ -1118,21 +1142,37 @@ void TownsPC98_FmSynth::writeReg(uint8 part, uint8 regAddress, uint8 value) {
} }
int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) { int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) {
Common::StackLock lock(_mutex);
memset(buffer, 0, sizeof(int16) * numSamples); memset(buffer, 0, sizeof(int16) * numSamples);
int32 *tmp = new int32[numSamples]; int32 *tmp = new int32[numSamples];
int32 *tmpStart = tmp; int32 *tmpStart = tmp;
memset(tmp, 0, sizeof(int32) * numSamples); memset(tmp, 0, sizeof(int32) * numSamples);
int32 samplesLeft = numSamples >> 1; int32 samplesLeft = numSamples >> 1;
bool locked = false;
if (_ready) {
_mutex.lock();
locked = true;
}
while (_ready && samplesLeft) { while (_ready && samplesLeft) {
int32 render = samplesLeft; int32 render = samplesLeft;
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
if (_timers[i].enabled && _timers[i].cb) { if (_timers[i].enabled && _timers[i].cb) {
if (!_timers[i].smpTillCb) { if (!_timers[i].smpTillCb) {
if (locked && _externalMutex) {
_mutex.unlock();
locked = false;
}
(this->*_timers[i].cb)(); (this->*_timers[i].cb)();
if (!locked && _externalMutex) {
_mutex.lock();
locked = true;
}
_timers[i].smpTillCb = _timers[i].smpPerCb; _timers[i].smpTillCb = _timers[i].smpPerCb;
_timers[i].smpTillCbRem += _timers[i].smpPerCbRem; _timers[i].smpTillCbRem += _timers[i].smpPerCbRem;
@ -1175,16 +1215,37 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) {
tmp += (render << 1); tmp += (render << 1);
} }
if (locked)
_mutex.unlock();
delete[] tmpStart; delete[] tmpStart;
return numSamples; return numSamples;
} }
bool TownsPC98_FmSynth::isStereo() const {
return true;
}
bool TownsPC98_FmSynth::endOfData() const {
return false;
}
int TownsPC98_FmSynth::getRate() const {
return _mixer->getOutputRate();
}
void TownsPC98_FmSynth::deinit() { void TownsPC98_FmSynth::deinit() {
_ready = false; _ready = false;
_mixer->stopHandle(_soundHandle); _mixer->stopHandle(_soundHandle);
Common::StackLock lock(_mutex);
_timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback; _timers[0].cb = _timers[1].cb = &TownsPC98_FmSynth::idleTimerCallback;
} }
void TownsPC98_FmSynth::toggleRegProtection(bool prot) {
_regProtectionFlag = prot;
}
uint8 TownsPC98_FmSynth::readSSGStatus() { uint8 TownsPC98_FmSynth::readSSGStatus() {
return _ssg->chanEnable(); return _ssg->chanEnable();
} }
@ -1220,7 +1281,7 @@ void TownsPC98_FmSynth::generateTables() {
WRITE_BE_UINT32(_oprRates + 32, _numChan == 6 ? 0x90900000 : 0x00081018); WRITE_BE_UINT32(_oprRates + 32, _numChan == 6 ? 0x90900000 : 0x00081018);
WRITE_BE_UINT32(_oprRates + 36, _numChan == 6 ? 0x00001010 : 0x00081018); WRITE_BE_UINT32(_oprRates + 36, _numChan == 6 ? 0x00001010 : 0x00081018);
memset(_oprRates, 0x90, 32); memset(_oprRates, 0x90, 32);
memset(_oprRates + 96, 0x80, 32); memset(&_oprRates[96], 0x80, 32);
uint8 *dst = (uint8 *)_oprRates + 40; uint8 *dst = (uint8 *)_oprRates + 40;
for (int i = 0; i < 40; i += 4) for (int i = 0; i < 40; i += 4)
WRITE_BE_UINT32(dst + i, 0x00081018); WRITE_BE_UINT32(dst + i, 0x00081018);
@ -1277,8 +1338,8 @@ void TownsPC98_FmSynth::generateTables() {
uint8 *dtt = new uint8[128]; uint8 *dtt = new uint8[128];
memset(dtt, 0, 36); memset(dtt, 0, 36);
memset(dtt + 36, 1, 8); memset(&dtt[36], 1, 8);
memcpy(dtt + 44, _detSrc, 84); memcpy(&dtt[44], _detSrc, 84);
delete[] _oprDetune; delete[] _oprDetune;
_oprDetune = new int32[256]; _oprDetune = new int32[256];

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
#ifndef TOWNS_PC98_FMSYNTH_H #ifndef TOWNS_PC98_FMSYNTH_H
@ -47,7 +44,7 @@ class TownsPC98_FmSynthPercussionSource;
#endif #endif
enum EnvelopeState { enum EnvelopeState {
kEnvReady, kEnvReady = 0,
kEnvAttacking, kEnvAttacking,
kEnvDecaying, kEnvDecaying,
kEnvSustaining, kEnvSustaining,
@ -62,7 +59,7 @@ public:
kType86 kType86
}; };
TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type); TownsPC98_FmSynth(Audio::Mixer *mixer, EmuType type, bool externalMutexHandling = false);
virtual ~TownsPC98_FmSynth(); virtual ~TownsPC98_FmSynth();
virtual bool init(); virtual bool init();
@ -72,15 +69,9 @@ public:
// AudioStream interface // AudioStream interface
int readBuffer(int16 *buffer, const int numSamples); int readBuffer(int16 *buffer, const int numSamples);
bool isStereo() const { bool isStereo() const;
return true; bool endOfData() const;
} int getRate() const;
bool endOfData() const {
return false;
}
int getRate() const {
return _mixer->getOutputRate();
}
protected: protected:
void deinit(); void deinit();
@ -89,17 +80,15 @@ protected:
// additional output that has to be inserted into the buffer. // additional output that has to be inserted into the buffer.
virtual void nextTickEx(int32 *buffer, uint32 bufferSize) {} virtual void nextTickEx(int32 *buffer, uint32 bufferSize) {}
void toggleRegProtection(bool prot) { void toggleRegProtection(bool prot);
_regProtectionFlag = prot;
}
uint8 readSSGStatus(); uint8 readSSGStatus();
virtual void timerCallbackA() = 0; virtual void timerCallbackA() = 0;
virtual void timerCallbackB() = 0; virtual void timerCallbackB() = 0;
// The audio driver can store and apply two different audio settings // The audio driver can store and apply two different volume settings
// (usually for music and sound effects). The channel mask will determine // (usually for music and sound effects). The channel mask will determine
// which channels get effected by the setting. The first bits will be // which channels get effected by which setting. The first bits will be
// the normal fm channels, the next bits the ssg channels and the final // the normal fm channels, the next bits the ssg channels and the final
// bit the rhythm channel. // bit the rhythm channel.
void setVolumeIntern(int volA, int volB); void setVolumeIntern(int volA, int volB);
@ -110,6 +99,8 @@ protected:
const bool _hasPercussion; const bool _hasPercussion;
Common::Mutex _mutex; Common::Mutex _mutex;
bool _externalMutex;
private: private:
void generateTables(); void generateTables();
void nextTick(int32 *buffer, uint32 bufferSize); void nextTick(int32 *buffer, uint32 bufferSize);
@ -127,6 +118,7 @@ private:
} }
uint16 frqTemp; uint16 frqTemp;
uint8 fmIndex;
bool enableLeft; bool enableLeft;
bool enableRight; bool enableRight;
bool updateEnvelopeParameters; bool updateEnvelopeParameters;

View file

@ -0,0 +1,86 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "audio/softsynth/fmtowns_pc98/towns_midi.h"
#include "audio/musicplugin.h"
#include "common/translation.h"
#include "common/error.h"
#include "common/system.h"
class TownsEmuMusicPlugin : public MusicPluginObject {
public:
const char *getName() const {
return _s("FM-Towns Audio");
}
const char *getId() const {
return "towns";
}
MusicDevices getDevices() const;
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
};
MusicDevices TownsEmuMusicPlugin::getDevices() const {
MusicDevices devices;
devices.push_back(MusicDevice(this, "", MT_TOWNS));
return devices;
}
Common::Error TownsEmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
*mididriver = new MidiDriver_TOWNS(g_system->getMixer());
return Common::kNoError;
}
class PC98EmuMusicPlugin : public MusicPluginObject {
public:
const char *getName() const {
return _s("PC-98 Audio");
}
const char *getId() const {
return "pc98";
}
MusicDevices getDevices() const;
Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
};
MusicDevices PC98EmuMusicPlugin::getDevices() const {
MusicDevices devices;
devices.push_back(MusicDevice(this, "", MT_PC98));
return devices;
}
Common::Error PC98EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
//*mididriver = /**/
return Common::kNoError;
}
//#if PLUGIN_ENABLED_DYNAMIC(TOWNS)
//REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
//REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
//#else
REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
REGISTER_PLUGIN_STATIC(PC98, PLUGIN_TYPE_MUSIC, PC98EmuMusicPlugin);
//#endif

View file

@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
*/ */
#include "common/scummsys.h" #include "common/scummsys.h"
@ -66,7 +63,7 @@ protected:
void generateSamples(int16 *buf, int len); void generateSamples(int16 *buf, int len);
public: public:
bool _initialising; bool _initializing;
MidiDriver_MT32(Audio::Mixer *mixer); MidiDriver_MT32(Audio::Mixer *mixer);
virtual ~MidiDriver_MT32(); virtual ~MidiDriver_MT32();
@ -218,7 +215,7 @@ static MT32Emu::File *MT32_OpenFile(void *userData, const char *filename, MT32Em
} }
static void MT32_PrintDebug(void *userData, const char *fmt, va_list list) { static void MT32_PrintDebug(void *userData, const char *fmt, va_list list) {
if (((MidiDriver_MT32 *)userData)->_initialising) { if (((MidiDriver_MT32 *)userData)->_initializing) {
char buf[512]; char buf[512];
vsnprintf(buf, 512, fmt, list); vsnprintf(buf, 512, fmt, list);
@ -242,7 +239,7 @@ static int MT32_Report(void *userData, MT32Emu::ReportType type, const void *rep
error("Failed to load MT32_PCM.ROM"); error("Failed to load MT32_PCM.ROM");
break; break;
case MT32Emu::ReportType_progressInit: case MT32Emu::ReportType_progressInit:
if (((MidiDriver_MT32 *)userData)->_initialising) { if (((MidiDriver_MT32 *)userData)->_initializing) {
drawProgress(*((const float *)reportData)); drawProgress(*((const float *)reportData));
return eatSystemEvents(); return eatSystemEvents();
} }
@ -286,7 +283,7 @@ MidiDriver_MT32::MidiDriver_MT32(Audio::Mixer *mixer) : MidiDriver_Emulated(mixe
// at rates other than 32KHz, thus we produce data at 32KHz and // at rates other than 32KHz, thus we produce data at 32KHz and
// rely on Mixer to convert. // rely on Mixer to convert.
_outputRate = 32000; //_mixer->getOutputRate(); _outputRate = 32000; //_mixer->getOutputRate();
_initialising = false; _initializing = false;
} }
MidiDriver_MT32::~MidiDriver_MT32() { MidiDriver_MT32::~MidiDriver_MT32() {
@ -327,11 +324,11 @@ int MidiDriver_MT32::open() {
g_system->getPaletteManager()->setPalette(dummy_palette, 0, 3); g_system->getPaletteManager()->setPalette(dummy_palette, 0, 3);
} }
_initialising = true; _initializing = true;
drawMessage(-1, _s("Initialising MT-32 Emulator")); drawMessage(-1, _s("Initializing MT-32 Emulator"));
if (!_synth->open(prop)) if (!_synth->open(prop))
return MERR_DEVICE_NOT_AVAILABLE; return MERR_DEVICE_NOT_AVAILABLE;
_initialising = false; _initializing = false;
if (screenFormat.bytesPerPixel > 1) if (screenFormat.bytesPerPixel > 1)
g_system->fillScreen(screenFormat.RGBToColor(0, 0, 0)); g_system->fillScreen(screenFormat.RGBToColor(0, 0, 0));

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// Comb filter implementation // Comb filter implementation

View file

@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* $URL$
* $Id$
*
*/ */
// Macro for killing denormalled numbers // Macro for killing denormalled numbers

View file

@ -28,7 +28,7 @@
#if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__) #if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__)
// Older versions of Mac OS X didn't supply a powf function, so using it // Older versions of Mac OS X didn't supply a powf function, so using it
// will cause a binary incompatibility when trying to run a binary built // will cause a binary incompatibility when trying to run a binary built
// on a newer OS X release on an olderr one. And Solaris 8 doesn't provide // on a newer OS X release on an older one. And Solaris 8 doesn't provide
// powf, floorf, fabsf etc. at all. // powf, floorf, fabsf etc. at all.
// Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in // Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in
// libstdc++. math/stubs.o should be empty, but it comes with a symbol for // libstdc++. math/stubs.o should be empty, but it comes with a symbol for
@ -164,7 +164,7 @@ void Partial::startPartial(dpoly *usePoly, const PatchCache *useCache, Partial *
structurePosition = patchCache->structurePosition; structurePosition = patchCache->structurePosition;
play = true; play = true;
initKeyFollow(poly->freqnum); // Initialises noteVal, filtVal and realVal initKeyFollow(poly->freqnum); // Initializes noteVal, filtVal and realVal
#if MT32EMU_ACCURATENOTES == 0 #if MT32EMU_ACCURATENOTES == 0
noteLookup = &synth->tables.noteLookups[noteVal - LOWEST_NOTE]; noteLookup = &synth->tables.noteLookups[noteVal - LOWEST_NOTE];
#else #else

View file

@ -34,7 +34,7 @@
#if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__) #if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__)
// Older versions of Mac OS X didn't supply a powf function, so using it // Older versions of Mac OS X didn't supply a powf function, so using it
// will cause a binary incompatibility when trying to run a binary built // will cause a binary incompatibility when trying to run a binary built
// on a newer OS X release on an olderr one. And Solaris 8 doesn't provide // on a newer OS X release on an older one. And Solaris 8 doesn't provide
// powf, floorf, fabsf etc. at all. // powf, floorf, fabsf etc. at all.
// Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in // Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in
// libstdc++. math/stubs.o should be empty, but it comes with a symbol for // libstdc++. math/stubs.o should be empty, but it comes with a symbol for
@ -426,36 +426,36 @@ bool Synth::open(SynthProperties &useProp) {
} }
} }
printDebug("Initialising Timbre Bank A"); printDebug("Initializing Timbre Bank A");
if (!initTimbres(controlROMMap->timbreAMap, controlROMMap->timbreAOffset, 0)) { if (!initTimbres(controlROMMap->timbreAMap, controlROMMap->timbreAOffset, 0)) {
return false; return false;
} }
printDebug("Initialising Timbre Bank B"); printDebug("Initializing Timbre Bank B");
if (!initTimbres(controlROMMap->timbreBMap, controlROMMap->timbreBOffset, 64)) { if (!initTimbres(controlROMMap->timbreBMap, controlROMMap->timbreBOffset, 64)) {
return false; return false;
} }
printDebug("Initialising Timbre Bank R"); printDebug("Initializing Timbre Bank R");
if (!initRhythmTimbres(controlROMMap->timbreRMap, controlROMMap->timbreRCount)) { if (!initRhythmTimbres(controlROMMap->timbreRMap, controlROMMap->timbreRCount)) {
return false; return false;
} }
printDebug("Initialising Timbre Bank M"); printDebug("Initializing Timbre Bank M");
// CM-64 seems to initialise all bytes in this bank to 0. // CM-64 seems to initialize all bytes in this bank to 0.
memset(&mt32ram.timbres[128], 0, sizeof (mt32ram.timbres[128]) * 64); memset(&mt32ram.timbres[128], 0, sizeof (mt32ram.timbres[128]) * 64);
partialManager = new PartialManager(this); partialManager = new PartialManager(this);
pcmWaves = new PCMWaveEntry[controlROMMap->pcmCount]; pcmWaves = new PCMWaveEntry[controlROMMap->pcmCount];
printDebug("Initialising PCM List"); printDebug("Initializing PCM List");
initPCMList(controlROMMap->pcmTable, controlROMMap->pcmCount); initPCMList(controlROMMap->pcmTable, controlROMMap->pcmCount);
printDebug("Initialising Rhythm Temp"); printDebug("Initializing Rhythm Temp");
memcpy(mt32ram.rhythmSettings, &controlROMData[controlROMMap->rhythmSettings], controlROMMap->rhythmSettingsCount * 4); memcpy(mt32ram.rhythmSettings, &controlROMData[controlROMMap->rhythmSettings], controlROMMap->rhythmSettingsCount * 4);
printDebug("Initialising Patches"); printDebug("Initializing Patches");
for (Bit8u i = 0; i < 128; i++) { for (Bit8u i = 0; i < 128; i++) {
PatchParam *patch = &mt32ram.patches[i]; PatchParam *patch = &mt32ram.patches[i];
patch->timbreGroup = i / 64; patch->timbreGroup = i / 64;
@ -468,9 +468,9 @@ bool Synth::open(SynthProperties &useProp) {
patch->dummy = 0; patch->dummy = 0;
} }
printDebug("Initialising System"); printDebug("Initializing System");
// The MT-32 manual claims that "Standard pitch" is 442Hz. // The MT-32 manual claims that "Standard pitch" is 442Hz.
mt32ram.system.masterTune = 0x40; // Confirmed on CM-64 as 0x4A, but SCUMM games use 0x40 and we don't want to initialise twice mt32ram.system.masterTune = 0x40; // Confirmed on CM-64 as 0x4A, but SCUMM games use 0x40 and we don't want to initialize twice
mt32ram.system.reverbMode = 0; // Confirmed mt32ram.system.reverbMode = 0; // Confirmed
mt32ram.system.reverbTime = 5; // Confirmed mt32ram.system.reverbTime = 5; // Confirmed
mt32ram.system.reverbLevel = 3; // Confirmed mt32ram.system.reverbLevel = 3; // Confirmed
@ -792,7 +792,7 @@ void Synth::writeSysex(unsigned char device, const Bit8u *sysex, Bit32u len) {
for (;;) { for (;;) {
// Find the appropriate memory region // Find the appropriate memory region
int regionNum; int regionNum;
const MemoryRegion *region = NULL; // Initialised to please compiler const MemoryRegion *region = NULL; // Initialized to please compiler
for (regionNum = 0; regionNum < NUM_REGIONS; regionNum++) { for (regionNum = 0; regionNum < NUM_REGIONS; regionNum++) {
region = &memoryRegions[regionNum]; region = &memoryRegions[regionNum];
if (region->contains(addr)) { if (region->contains(addr)) {

View file

@ -263,7 +263,7 @@ public:
Synth(); Synth();
~Synth(); ~Synth();
// Used to initialise the MT-32. Must be called before any other function. // Used to initialize the MT-32. Must be called before any other function.
// Returns true if initialization was sucessful, otherwise returns false. // Returns true if initialization was sucessful, otherwise returns false.
bool open(SynthProperties &useProp); bool open(SynthProperties &useProp);

View file

@ -19,6 +19,10 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
// FIXME: Avoid using rand
#define FORBIDDEN_SYMBOL_EXCEPTION_rand
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
@ -28,7 +32,7 @@
#if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__) #if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__)
// Older versions of Mac OS X didn't supply a powf function, so using it // Older versions of Mac OS X didn't supply a powf function, so using it
// will cause a binary incompatibility when trying to run a binary built // will cause a binary incompatibility when trying to run a binary built
// on a newer OS X release on an olderr one. And Solaris 8 doesn't provide // on a newer OS X release on an older one. And Solaris 8 doesn't provide
// powf, floorf, fabsf etc. at all. // powf, floorf, fabsf etc. at all.
// Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in // Cross-compiled MinGW32 toolchains suffer from a cross-compile bug in
// libstdc++. math/stubs.o should be empty, but it comes with a symbol for // libstdc++. math/stubs.o should be empty, but it comes with a symbol for
@ -199,7 +203,7 @@ void Tables::initEnvelopes(float samplerate) {
void Tables::initMT32ConstantTables(Synth *synth) { void Tables::initMT32ConstantTables(Synth *synth) {
int lf; int lf;
synth->printDebug("Initialising Pitch Tables"); synth->printDebug("Initializing Pitch Tables");
for (lf = -108; lf <= 108; lf++) { for (lf = -108; lf <= 108; lf++) {
tvfKeyfollowMult[lf + 108] = (int)(256 * powf(2.0f, (float)(lf / 24.0f))); tvfKeyfollowMult[lf + 108] = (int)(256 * powf(2.0f, (float)(lf / 24.0f)));
//synth->printDebug("KT %d = %d", f, keytable[f+108]); //synth->printDebug("KT %d = %d", f, keytable[f+108]);
@ -664,7 +668,7 @@ bool Tables::initNotes(Synth *synth, PCMWaveEntry *pcmWaves, float rate, float m
bool abort = false; bool abort = false;
synth->report(ReportType_progressInit, &progress); synth->report(ReportType_progressInit, &progress);
for (int f = LOWEST_NOTE; f <= HIGHEST_NOTE; f++) { for (int f = LOWEST_NOTE; f <= HIGHEST_NOTE; f++) {
synth->printDebug("Initialising note %s%d", NoteNames[f % 12], (f / 12) - 2); synth->printDebug("Initializing note %s%d", NoteNames[f % 12], (f / 12) - 2);
NoteLookup *noteLookup = &noteLookups[f - LOWEST_NOTE]; NoteLookup *noteLookup = &noteLookups[f - LOWEST_NOTE];
file = initNote(synth, noteLookup, (float)f, rate, masterTune, pcmWaves, file); file = initNote(synth, noteLookup, (float)f, rate, masterTune, pcmWaves, file);
progress = (f - LOWEST_NOTE + 1) / (float)NUM_NOTES; progress = (f - LOWEST_NOTE + 1) / (float)NUM_NOTES;
@ -719,12 +723,12 @@ void Tables::freeNotes() {
} }
} }
} }
initialisedMasterTune = 0.0f; initializedMasterTune = 0.0f;
} }
Tables::Tables() { Tables::Tables() {
initialisedSampleRate = 0.0f; initializedSampleRate = 0.0f;
initialisedMasterTune = 0.0f; initializedMasterTune = 0.0f;
memset(&noteLookups, 0, sizeof(noteLookups)); memset(&noteLookups, 0, sizeof(noteLookups));
} }
@ -733,23 +737,23 @@ bool Tables::init(Synth *synth, PCMWaveEntry *pcmWaves, float sampleRate, float
synth->printDebug("Bad sampleRate (%f <= 0.0f)", (double)sampleRate); synth->printDebug("Bad sampleRate (%f <= 0.0f)", (double)sampleRate);
return false; return false;
} }
if (initialisedSampleRate == 0.0f) { if (initializedSampleRate == 0.0f) {
initMT32ConstantTables(synth); initMT32ConstantTables(synth);
} }
if (initialisedSampleRate != sampleRate) { if (initializedSampleRate != sampleRate) {
initFiltCoeff(sampleRate); initFiltCoeff(sampleRate);
initEnvelopes(sampleRate); initEnvelopes(sampleRate);
for (int key = 12; key <= 108; key++) { for (int key = 12; key <= 108; key++) {
initDep(&keyLookups[key - 12], (float)key); initDep(&keyLookups[key - 12], (float)key);
} }
} }
if (initialisedSampleRate != sampleRate || initialisedMasterTune != masterTune) { if (initializedSampleRate != sampleRate || initializedMasterTune != masterTune) {
freeNotes(); freeNotes();
if (!initNotes(synth, pcmWaves, sampleRate, masterTune)) { if (!initNotes(synth, pcmWaves, sampleRate, masterTune)) {
return false; return false;
} }
initialisedSampleRate = sampleRate; initializedSampleRate = sampleRate;
initialisedMasterTune = masterTune; initializedMasterTune = masterTune;
} }
return true; return true;
} }

View file

@ -69,8 +69,8 @@ struct KeyLookup {
}; };
class Tables { class Tables {
float initialisedSampleRate; float initializedSampleRate;
float initialisedMasterTune; float initializedMasterTune;
void initMT32ConstantTables(Synth *synth); void initMT32ConstantTables(Synth *synth);
static Bit16s clampWF(Synth *synth, const char *n, float ampVal, double input); static Bit16s clampWF(Synth *synth, const char *n, float ampVal, double input);
static File *initWave(Synth *synth, NoteLookup *noteLookup, float ampsize, float div2, File *file); static File *initWave(Synth *synth, NoteLookup *noteLookup, float ampsize, float div2, File *file);

Some files were not shown because too many files have changed in this diff Show more