[Scummvm-cvs-logs] CVS: scummvm/sound fmopl.cpp,1.20,1.21 fmopl.h,1.11,1.12 mixer.cpp,1.158,1.159
Max Horn
fingolfin at users.sourceforge.net
Tue Feb 24 14:55:02 CET 2004
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12241/sound
Modified Files:
fmopl.cpp fmopl.h mixer.cpp
Log Message:
the OSystem changes we discussed on the ML (note: renaming of the existing OSystem API is not yet finished); porters will have to fix their ports to get them to compile again
Index: fmopl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- fmopl.cpp 6 Jan 2004 12:45:33 -0000 1.20
+++ fmopl.cpp 24 Feb 2004 22:39:41 -0000 1.21
@@ -1117,3 +1117,27 @@
(OPL->TimerHandler)(OPL->TimerParam + c, (double)OPL->T[c] * OPL->TimerBase);
return OPL->status >> 7;
}
+
+FM_OPL *makeAdlibOPL(int rate) {
+ // We need to emulate one YM3812 chip
+ int env_bits = FMOPL_ENV_BITS_HQ;
+ int eg_ent = FMOPL_EG_ENT_HQ;
+#ifdef _WIN32_WCE
+ // TODO: On WinCE, use low quality FMOPL by default.
+ // FIXME: Don't use 'CE_' or similar prefixes if you need platform specific
+ // config keys. Rather use a seperate config domain - e.g. for WinCE we have
+ // two such domains already, "wince" and "smartfon-keys" (although I wonder
+ // a bit about the latter one).
+ if (ConfMan.getBool("CE_FM_high_quality"))
+ env_bits = FMOPL_ENV_BITS_HQ;
+ else
+ env_bits = FMOPL_ENV_BITS_LQ;
+
+ if (ConfMan.getBool("CE_FM_high_quality"))
+ eg_ent = FMOPL_EG_ENT_HQ;
+ else
+ eg_ent = FMOPL_EG_ENT_LQ;
+#endif
+ OPLBuildTables(env_bits, eg_ent);
+ return OPLCreate(OPL_TYPE_YM3812, 3579545, rate);
+}
Index: fmopl.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- fmopl.h 6 Jan 2004 12:45:33 -0000 1.11
+++ fmopl.h 24 Feb 2004 22:39:41 -0000 1.12
@@ -159,3 +159,6 @@
void OPLWriteReg(FM_OPL *OPL, int r, int v);
void YM3812UpdateOne(FM_OPL *OPL, int16 *buffer, int length);
#endif
+
+// Factory method
+FM_OPL *makeAdlibOPL(int rate);
Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- mixer.cpp 22 Feb 2004 14:11:10 -0000 1.158
+++ mixer.cpp 24 Feb 2004 22:39:41 -0000 1.159
@@ -111,7 +111,7 @@
_premixProc = 0;
int i = 0;
- _outputRate = (uint) _syst->property(OSystem::PROP_GET_SAMPLE_RATE, 0);
+ _outputRate = (uint) _syst->getOutputSampleRate();
if (_outputRate == 0)
error("OSystem returned invalid sample rate");
@@ -124,11 +124,11 @@
for (i = 0; i != NUM_CHANNELS; i++)
_channels[i] = 0;
- _mixerReady = _syst->set_sound_proc(mixCallback, this, OSystem::SOUND_16BIT);
+ _mixerReady = _syst->setSoundCallback(mixCallback, this);
}
SoundMixer::~SoundMixer() {
- _syst->clear_sound_proc();
+ _syst->clearSoundCallback();
stopAll();
_syst->delete_mutex(_mutex);
}
More information about the Scummvm-git-logs
mailing list