Revert changes to fmopl.c
fmopl.c was taken from MAME and doesn't include QEMU header files so we cannot use qemu_malloc in it. It happens to build because C is a silly language. Unfortunately, it doesn't play nicely with the QEMU headers so lets just revert the changes that were made to it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6541 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
f21c0ed97c
commit
809c130cef
27
hw/fmopl.c
27
hw/fmopl.c
|
@ -619,10 +619,26 @@ static int OPLOpenTable( void )
|
||||||
double pom;
|
double pom;
|
||||||
|
|
||||||
/* allocate dynamic tables */
|
/* allocate dynamic tables */
|
||||||
TL_TABLE = qemu_malloc(TL_MAX*2*sizeof(INT32));
|
if( (TL_TABLE = malloc(TL_MAX*2*sizeof(INT32))) == NULL)
|
||||||
SIN_TABLE = qemu_malloc(SIN_ENT*4 *sizeof(INT32 *));
|
return 0;
|
||||||
AMS_TABLE = qemu_malloc(AMS_ENT*2 *sizeof(INT32));
|
if( (SIN_TABLE = malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
|
||||||
VIB_TABLE = qemu_malloc(VIB_ENT*2 *sizeof(INT32));
|
{
|
||||||
|
free(TL_TABLE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if( (AMS_TABLE = malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
|
||||||
|
{
|
||||||
|
free(TL_TABLE);
|
||||||
|
free(SIN_TABLE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if( (VIB_TABLE = malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
|
||||||
|
{
|
||||||
|
free(TL_TABLE);
|
||||||
|
free(SIN_TABLE);
|
||||||
|
free(AMS_TABLE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
/* make total level table */
|
/* make total level table */
|
||||||
for (t = 0;t < EG_ENT-1 ;t++){
|
for (t = 0;t < EG_ENT-1 ;t++){
|
||||||
rate = ((1<<TL_BITS)-1)/pow(10,EG_STEP*t/20); /* dB -> voltage */
|
rate = ((1<<TL_BITS)-1)/pow(10,EG_STEP*t/20); /* dB -> voltage */
|
||||||
|
@ -1205,7 +1221,8 @@ FM_OPL *OPLCreate(int type, int clock, int rate)
|
||||||
if(type&OPL_TYPE_ADPCM) state_size+= sizeof(YM_DELTAT);
|
if(type&OPL_TYPE_ADPCM) state_size+= sizeof(YM_DELTAT);
|
||||||
#endif
|
#endif
|
||||||
/* allocate memory block */
|
/* allocate memory block */
|
||||||
ptr = qemu_malloc(state_size);
|
ptr = malloc(state_size);
|
||||||
|
if(ptr==NULL) return NULL;
|
||||||
/* clear */
|
/* clear */
|
||||||
memset(ptr,0,state_size);
|
memset(ptr,0,state_size);
|
||||||
OPL = (FM_OPL *)ptr; ptr+=sizeof(FM_OPL);
|
OPL = (FM_OPL *)ptr; ptr+=sizeof(FM_OPL);
|
||||||
|
|
Loading…
Reference in a new issue