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
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue