[Scummvm-cvs-logs] CVS: scummvm/sound fmopl.cpp,1.2,1.3
Travis Howell
kirben at users.sourceforge.net
Wed Mar 6 02:36:02 CET 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.30,1.31 script_v2.cpp,1.28,1.29
- Next message: [Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.31,1.32 akos.cpp,1.7,1.8 debug.cpp,1.16,1.17 gfx.cpp,1.39,1.40 object.cpp,1.34,1.35 script.cpp,1.27,1.28 script_v2.cpp,1.29,1.30 scumm.h,1.64,1.65 scummvm.cpp,1.61,1.62 scummvm.dsp,1.19,1.20 sdl.cpp,1.35,1.36 stdafx.h,1.8,1.9 string.cpp,1.26,1.27 windows.cpp,1.27,1.28 x11.cpp,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sound
In directory usw-pr-cvs1:/tmp/cvs-serv12021/sound
Modified Files:
fmopl.cpp
Log Message:
Add Matti Hmlinen's patch to suppress warnings
Index: fmopl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** fmopl.cpp 24 Feb 2002 17:25:02 -0000 1.2
--- fmopl.cpp 6 Mar 2002 10:35:39 -0000 1.3
***************
*** 98,150 ****
/* key scale level */
/* table is 3dB/OCT , DV converts this in TL step at 6dB/OCT */
! #define DV (EG_STEP/2)
static const UINT32 KSL_TABLE[8*16]=
{
/* OCT 0 */
! 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
! 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
! 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
! 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
/* OCT 1 */
! 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
! 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
! 0.000/DV, 0.750/DV, 1.125/DV, 1.500/DV,
! 1.875/DV, 2.250/DV, 2.625/DV, 3.000/DV,
/* OCT 2 */
! 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
! 0.000/DV, 1.125/DV, 1.875/DV, 2.625/DV,
! 3.000/DV, 3.750/DV, 4.125/DV, 4.500/DV,
! 4.875/DV, 5.250/DV, 5.625/DV, 6.000/DV,
/* OCT 3 */
! 0.000/DV, 0.000/DV, 0.000/DV, 1.875/DV,
! 3.000/DV, 4.125/DV, 4.875/DV, 5.625/DV,
! 6.000/DV, 6.750/DV, 7.125/DV, 7.500/DV,
! 7.875/DV, 8.250/DV, 8.625/DV, 9.000/DV,
/* OCT 4 */
! 0.000/DV, 0.000/DV, 3.000/DV, 4.875/DV,
! 6.000/DV, 7.125/DV, 7.875/DV, 8.625/DV,
! 9.000/DV, 9.750/DV,10.125/DV,10.500/DV,
! 10.875/DV,11.250/DV,11.625/DV,12.000/DV,
/* OCT 5 */
! 0.000/DV, 3.000/DV, 6.000/DV, 7.875/DV,
! 9.000/DV,10.125/DV,10.875/DV,11.625/DV,
! 12.000/DV,12.750/DV,13.125/DV,13.500/DV,
! 13.875/DV,14.250/DV,14.625/DV,15.000/DV,
/* OCT 6 */
! 0.000/DV, 6.000/DV, 9.000/DV,10.875/DV,
! 12.000/DV,13.125/DV,13.875/DV,14.625/DV,
! 15.000/DV,15.750/DV,16.125/DV,16.500/DV,
! 16.875/DV,17.250/DV,17.625/DV,18.000/DV,
/* OCT 7 */
! 0.000/DV, 9.000/DV,12.000/DV,13.875/DV,
! 15.000/DV,16.125/DV,16.875/DV,17.625/DV,
! 18.000/DV,18.750/DV,19.125/DV,19.500/DV,
! 19.875/DV,20.250/DV,20.625/DV,21.000/DV
};
! #undef DV
/* sustain lebel table (3db per step) */
/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/
! #define SC(db) (db*((3/EG_STEP)*(1<<ENV_BITS)))+EG_DST
static const INT32 SL_TABLE[16]={
SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7),
--- 98,152 ----
/* key scale level */
/* table is 3dB/OCT , DV converts this in TL step at 6dB/OCT */
!
! #define SC(mydb) ((UINT32) (mydb / (EG_STEP/2)))
!
static const UINT32 KSL_TABLE[8*16]=
{
/* OCT 0 */
! SC(0.000), SC(0.000), SC(0.000), SC(0.000),
! SC(0.000), SC(0.000), SC(0.000), SC(0.000),
! SC(0.000), SC(0.000), SC(0.000), SC(0.000),
! SC(0.000), SC(0.000), SC(0.000), SC(0.000),
/* OCT 1 */
! SC(0.000), SC(0.000), SC(0.000), SC(0.000),
! SC(0.000), SC(0.000), SC(0.000), SC(0.000),
! SC(0.000), SC(0.750), SC(1.125), SC(1.500),
! SC(1.875), SC(2.250), SC(2.625), SC(3.000),
/* OCT 2 */
! SC(0.000), SC(0.000), SC(0.000), SC(0.000),
! SC(0.000), SC(1.125), SC(1.875), SC(2.625),
! SC(3.000), SC(3.750), SC(4.125), SC(4.500),
! SC(4.875), SC(5.250), SC(5.625), SC(6.000),
/* OCT 3 */
! SC(0.000), SC(0.000), SC(0.000), SC(1.875),
! SC(3.000), SC(4.125), SC(4.875), SC(5.625),
! SC(6.000), SC(6.750), SC(7.125), SC(7.500),
! SC(7.875), SC(8.250), SC(8.625), SC(9.000),
/* OCT 4 */
! SC(0.000), SC(0.000), SC(3.000), SC(4.875),
! SC(6.000), SC(7.125), SC(7.875), SC(8.625),
! SC(9.000), SC(9.750), SC(10.125),SC(10.500),
! SC(10.875),SC(11.250),SC(11.625),SC(12.000),
/* OCT 5 */
! SC(0.000), SC(3.000), SC(6.000), SC(7.875),
! SC(9.000), SC(10.125),SC(10.875),SC(11.625),
! SC(12.000),SC(12.750),SC(13.125),SC(13.500),
! SC(13.875),SC(14.250),SC(14.625),SC(15.000),
/* OCT 6 */
! SC(0.000), SC(6.000), SC(9.000), SC(10.875),
! SC(12.000),SC(13.125),SC(13.875),SC(14.625),
! SC(15.000),SC(15.750),SC(16.125),SC(16.500),
! SC(16.875),SC(17.250),SC(17.625),SC(18.000),
/* OCT 7 */
! SC(0.000), SC(9.000), SC(12.000),SC(13.875),
! SC(15.000),SC(16.125),SC(16.875),SC(17.625),
! SC(18.000),SC(18.750),SC(19.125),SC(19.500),
! SC(19.875),SC(20.250),SC(20.625),SC(21.000)
};
! #undef SC
/* sustain lebel table (3db per step) */
/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/
! #define SC(db) ((int) (db*((3/EG_STEP)*(1<<ENV_BITS)))+EG_DST)
static const INT32 SL_TABLE[16]={
SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7),
***************
*** 372,376 ****
SLOT->ksl = ksl ? 3-ksl : 31;
! SLOT->TL = (v&0x3f)*(0.75/EG_STEP); /* 0.75db step */
if( !(OPL->mode&0x80) )
--- 374,378 ----
SLOT->ksl = ksl ? 3-ksl : 31;
! SLOT->TL = (INT32) ((v&0x3f)*(0.75/EG_STEP)); /* 0.75db step */
if( !(OPL->mode&0x80) )
***************
*** 463,467 ****
{
UINT32 env_tam,env_sd,env_top,env_hh;
! int whitenoise = (rand()&1)*(WHITE_NOISE_db/EG_STEP);
INT32 tone8;
--- 465,469 ----
{
UINT32 env_tam,env_sd,env_top,env_hh;
! int whitenoise = (int) ((rand()&1)*(WHITE_NOISE_db/EG_STEP));
INT32 tone8;
***************
*** 556,561 ****
rate *= 1<<((i>>2)-1); /* b2-5 : shift bit */
rate *= (double)(EG_ENT<<ENV_BITS);
! OPL->AR_TABLE[i] = rate / ARRATE;
! OPL->DR_TABLE[i] = rate / DRRATE;
}
for (i = 60;i < 76;i++)
--- 558,563 ----
rate *= 1<<((i>>2)-1); /* b2-5 : shift bit */
rate *= (double)(EG_ENT<<ENV_BITS);
! OPL->AR_TABLE[i] = (int) (rate / ARRATE);
! OPL->DR_TABLE[i] = (int) (rate / DRRATE);
}
for (i = 60;i < 76;i++)
***************
*** 613,617 ****
pom = sin(2*PI*s/SIN_ENT); /* sin */
pom = 20*log10(1/pom); /* decibel */
! j = pom / EG_STEP; /* TL_TABLE steps */
/* degree 0 - 90 , degree 180 - 90 : plus section */
--- 615,619 ----
pom = sin(2*PI*s/SIN_ENT); /* sin */
pom = 20*log10(1/pom); /* decibel */
! j = (int) (pom / EG_STEP); /* TL_TABLE steps */
/* degree 0 - 90 , degree 180 - 90 : plus section */
***************
*** 644,649 ****
{
pom = (1.0+sin(2*PI*i/AMS_ENT))/2; /* sin */
! AMS_TABLE[i] = (1.0/EG_STEP)*pom; /* 1dB */
! AMS_TABLE[AMS_ENT+i] = (4.8/EG_STEP)*pom; /* 4.8dB */
}
/* make LFO vibrate table */
--- 646,651 ----
{
pom = (1.0+sin(2*PI*i/AMS_ENT))/2; /* sin */
! AMS_TABLE[i] = (int) ((1.0/EG_STEP)*pom); /* 1dB */
! AMS_TABLE[AMS_ENT+i] = (int) ((4.8/EG_STEP)*pom); /* 4.8dB */
}
/* make LFO vibrate table */
***************
*** 652,657 ****
/* 100cent = 1seminote = 6% ?? */
pom = (double)VIB_RATE*0.06*sin(2*PI*i/VIB_ENT); /* +-100sect step */
! VIB_TABLE[i] = VIB_RATE + (pom*0.07); /* +- 7cent */
! VIB_TABLE[VIB_ENT+i] = VIB_RATE + (pom*0.14); /* +-14cent */
/* LOG(LOG_INF,("vib %d=%d\n",i,VIB_TABLE[VIB_ENT+i])); */
}
--- 654,659 ----
/* 100cent = 1seminote = 6% ?? */
pom = (double)VIB_RATE*0.06*sin(2*PI*i/VIB_ENT); /* +-100sect step */
! VIB_TABLE[i] = (int) (VIB_RATE + (pom*0.07)); /* +- 7cent */
! VIB_TABLE[VIB_ENT+i] = (int) (VIB_RATE + (pom*0.14)); /* +-14cent */
/* LOG(LOG_INF,("vib %d=%d\n",i,VIB_TABLE[VIB_ENT+i])); */
}
***************
*** 699,707 ****
for( fn=0 ; fn < 1024 ; fn++ )
{
! OPL->FN_TABLE[fn] = OPL->freqbase * fn * FREQ_RATE * (1<<7) / 2;
}
/* LFO freq.table */
! OPL->amsIncr = OPL->rate ? (double)AMS_ENT*(1<<AMS_SHIFT) / OPL->rate * 3.7 * ((double)OPL->clock/3600000) : 0;
! OPL->vibIncr = OPL->rate ? (double)VIB_ENT*(1<<VIB_SHIFT) / OPL->rate * 6.4 * ((double)OPL->clock/3600000) : 0;
}
--- 701,709 ----
for( fn=0 ; fn < 1024 ; fn++ )
{
! OPL->FN_TABLE[fn] = (int) (OPL->freqbase * fn * FREQ_RATE * (1<<7) / 2);
}
/* LFO freq.table */
! OPL->amsIncr = (INT32) (OPL->rate ? (double)AMS_ENT*(1<<AMS_SHIFT) / OPL->rate * 3.7 * ((double)OPL->clock/3600000) : 0);
! OPL->vibIncr = (INT32) (OPL->rate ? (double)VIB_ENT*(1<<VIB_SHIFT) / OPL->rate * 6.4 * ((double)OPL->clock/3600000) : 0);
}
- Previous message: [Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.30,1.31 script_v2.cpp,1.28,1.29
- Next message: [Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.31,1.32 akos.cpp,1.7,1.8 debug.cpp,1.16,1.17 gfx.cpp,1.39,1.40 object.cpp,1.34,1.35 script.cpp,1.27,1.28 script_v2.cpp,1.29,1.30 scumm.h,1.64,1.65 scummvm.cpp,1.61,1.62 scummvm.dsp,1.19,1.20 sdl.cpp,1.35,1.36 stdafx.h,1.8,1.9 string.cpp,1.26,1.27 windows.cpp,1.27,1.28 x11.cpp,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list