add dbopl to vs project file;
fix internal opl rate of dbopl; change opl provider selection and default Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3358
This commit is contained in:
parent
423fe84280
commit
4ebdd5114a
4 changed files with 21 additions and 15 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dosbox.cpp,v 1.147 2009-04-17 17:24:47 c2woody Exp $ */
|
||||
/* $Id: dosbox.cpp,v 1.148 2009-04-26 15:37:04 c2woody Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -312,7 +312,8 @@ void DOSBOX_Init(void) {
|
|||
SDLNetInited = false;
|
||||
|
||||
// Some frequently used option sets
|
||||
const char *rates[] = { "22050", "44100", "48000", "32000", "16000", "11025", "8000", 0 };
|
||||
const char *rates[] = { "22050", "44100", "48000", "32000", "16000", "11025", "8000", "49716", 0 };
|
||||
const char *oplrates[] = { "22050", "49716", "44100", "48000", "32000", "16000", "11025", "8000", 0 };
|
||||
const char *ios[] = { "220", "240", "260", "280", "2a0", "2c0", "2e0", "300", 0 };
|
||||
const char *irqssb[] = { "7", "5", "3", "9", "10", "11", "12", 0 };
|
||||
const char *dmassb[] = { "1", "5", "0", "3", "6", "7", 0 };
|
||||
|
@ -439,7 +440,7 @@ void DOSBOX_Init(void) {
|
|||
|
||||
Pint = secprop->Add_int("rate",Property::Changeable::OnlyAtStart,22050);
|
||||
Pint->Set_values(rates);
|
||||
Pint->Set_help("Mixer sample rate, setting any devices higher than this will probably lower their sound quality.");
|
||||
Pint->Set_help("Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality.");
|
||||
|
||||
const char *blocksizes[] = {
|
||||
"2048", "4096", "8192", "1024", "512", "256", 0};
|
||||
|
@ -503,14 +504,14 @@ void DOSBOX_Init(void) {
|
|||
Pstring->Set_values(oplmodes);
|
||||
Pstring->Set_help("Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.");
|
||||
|
||||
const char* oplemus[]={ "default", "old", 0};
|
||||
Pstring = secprop->Add_string("oplemu",Property::Changeable::WhenIdle,"auto");
|
||||
const char* oplemus[]={ "default", "compat", "fast", "old", 0};
|
||||
Pstring = secprop->Add_string("oplemu",Property::Changeable::WhenIdle,"default");
|
||||
Pstring->Set_values(oplemus);
|
||||
Pstring->Set_help("Provider for the OPL emulation.");
|
||||
Pstring->Set_help("Provider for the OPL emulation. compat or old might provide better quality (see oplrate as well).");
|
||||
|
||||
Pint = secprop->Add_int("oplrate",Property::Changeable::WhenIdle,22050);
|
||||
Pint->Set_values(rates);
|
||||
Pint->Set_help("Sample rate of OPL music emulation.");
|
||||
Pint->Set_values(oplrates);
|
||||
Pint->Set_help("Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).");
|
||||
|
||||
|
||||
secprop=control->AddSection_prop("gus",&GUS_Init,true); //done
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2008 The DOSBox Team
|
||||
* Copyright (C) 2002-2009 The DOSBox Team
|
||||
*
|
||||
* 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
|
||||
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: adlib.cpp,v 1.35 2009-04-25 09:55:50 harekiet Exp $ */
|
||||
/* $Id: adlib.cpp,v 1.36 2009-04-26 15:37:04 c2woody Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -742,12 +742,14 @@ Module::Module( Section* configuration ) : Module_base(configuration) {
|
|||
}
|
||||
} else if (oplemu == "fast") {
|
||||
handler = new DBOPL::Handler();
|
||||
} else {
|
||||
} else if (oplemu == "compat") {
|
||||
if ( oplmode == OPL_opl2 ) {
|
||||
handler = new OPL2::Handler();
|
||||
} else {
|
||||
handler = new OPL3::Handler();
|
||||
}
|
||||
} else {
|
||||
handler = new DBOPL::Handler();
|
||||
}
|
||||
handler->Init( rate );
|
||||
Bit8u portRange = 4; //opl2 will set this to 2
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
namespace DBOPL {
|
||||
|
||||
#define MAX_SAMPLES 256
|
||||
#define OPLRATE 50000
|
||||
#define OPLRATE ((double)(14318180.0 / 288.0))
|
||||
|
||||
//Only need 4 valid bits at the top for vibrato
|
||||
#define VIBRATO_SH ( 32 - 4 )
|
||||
|
@ -1183,13 +1183,13 @@ void Chip::Setup( Bit32u rate ) {
|
|||
//10 bits of frequency counter
|
||||
//With higher octave this gets shifted up
|
||||
//-1 since the freqCreateTable = *2
|
||||
double scale = ((double)OPLRATE * (double)( 1 << ( WAVE_SH - 10 - 1))) / rate;
|
||||
double scale = (OPLRATE * (double)( 1 << ( WAVE_SH - 10 - 1))) / rate;
|
||||
for ( int i = 0; i < 16; i++ ) {
|
||||
//Use rounding with 0.5
|
||||
freqMul[i] = (Bit32u)( 0.5 + scale * FreqCreateTable[ i ] );
|
||||
}
|
||||
|
||||
scale = (double)OPLRATE / rate;
|
||||
scale = OPLRATE / rate;
|
||||
//-3 since the real envelope takes 8 steps to reach the single value we supply
|
||||
for ( Bit8u i = 0; i < 76; i++ ) {
|
||||
Bit8u index, shift;
|
||||
|
@ -1464,4 +1464,4 @@ void Handler::Init( Bitu rate ) {
|
|||
}
|
||||
|
||||
|
||||
}; //Namespace Kiet
|
||||
}; //Namespace DBOPL
|
||||
|
|
|
@ -538,6 +538,9 @@
|
|||
<File
|
||||
RelativePath="..\src\hardware\adlib.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\hardware\dbopl.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\hardware\disney.cpp">
|
||||
</File>
|
||||
|
|
Loading…
Add table
Reference in a new issue