1
0
Fork 0

silence some warnings, add most of sf patch #1185267 by Moe

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2883
This commit is contained in:
Sebastian Strohhäcker 2007-06-12 20:22:09 +00:00
parent 8c6d24bb61
commit 0c24e87fdc
49 changed files with 265 additions and 255 deletions

View file

@ -329,51 +329,51 @@ static const int slot_array[32]=
/* key scale level */
/* table is 3dB/octave , DV converts this into 6dB/octave */
/* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */
#define DV (0.1875/2.0)
#define SC(x) ((UINT32)((x)/(0.1875/2.0)))
static const UINT32 ksl_tab[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,
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 */
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,
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 */
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,
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 */
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,
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 */
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,
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 */
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,
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 */
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,
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 */
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
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 DV
#undef SC
/* sustain level table (3dB per step) */
/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/
@ -493,13 +493,13 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),
/* multiple table */
#define ML 2
#define SC(x) ((UINT32)((x)*2))
static const UINT8 mul_tab[16]= {
/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */
0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML,
8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML
SC(0.50), SC(1.00), SC(2.00), SC(3.00), SC(4.00), SC(5.00), SC(6.00), SC(7.00),
SC(8.00), SC(9.00),SC(10.00),SC(10.00),SC(12.00),SC(12.00),SC(15.00),SC(15.00)
};
#undef ML
#undef SC
/* TL_TAB_LEN is calculated as:
* 12 - sinus amplitude bits (Y axis)
@ -1301,17 +1301,17 @@ static void OPL_initalize(FM_OPL *OPL)
/* Amplitude modulation: 27 output levels (triangle waveform); 1 level takes one of: 192, 256 or 448 samples */
/* One entry from LFO_AM_TABLE lasts for 64 samples */
OPL->lfo_am_inc = (1.0 / 64.0 ) * (1<<LFO_SH) * OPL->freqbase;
OPL->lfo_am_inc = (UINT32)((1.0 / 64.0 ) * (1<<LFO_SH) * OPL->freqbase);
/* Vibrato: 8 output levels (triangle waveform); 1 level takes 1024 samples */
OPL->lfo_pm_inc = (1.0 / 1024.0) * (1<<LFO_SH) * OPL->freqbase;
OPL->lfo_pm_inc = (UINT32)((1.0 / 1024.0) * (1<<LFO_SH) * OPL->freqbase);
/*logerror ("OPL->lfo_am_inc = %8x ; OPL->lfo_pm_inc = %8x\n", OPL->lfo_am_inc, OPL->lfo_pm_inc);*/
/* Noise generator: a step takes 1 sample */
OPL->noise_f = (1.0 / 1.0) * (1<<FREQ_SH) * OPL->freqbase;
OPL->noise_f = (UINT32)((1.0 / 1.0) * (1<<FREQ_SH) * OPL->freqbase);
OPL->eg_timer_add = (1<<EG_SH) * OPL->freqbase;
OPL->eg_timer_add = (UINT32)((1<<EG_SH) * OPL->freqbase);
OPL->eg_timer_overflow = ( 1 ) * (1<<EG_SH);
/*logerror("OPLinit eg_timer_add=%8x eg_timer_overflow=%8x\n", OPL->eg_timer_add, OPL->eg_timer_overflow);*/

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: iohandler.cpp,v 1.27 2007-06-01 16:40:40 c2woody Exp $ */
/* $Id: iohandler.cpp,v 1.28 2007-06-12 20:22:08 c2woody Exp $ */
#include <string.h>
#include "dosbox.h"
@ -174,7 +174,7 @@ static Bits IOFaultCore(void) {
inline void IO_USEC_read_delay_old() {
if(CPU_CycleMax > static_cast<Bit32s>((IODELAY_READ_MICROS*1000.0))) {
// this could be calculated whenever CPU_CycleMax changes
Bitu delaycyc = static_cast<Bitu>((CPU_CycleMax/1000)*IODELAY_READ_MICROS);
Bits delaycyc = static_cast<Bits>((CPU_CycleMax/1000)*IODELAY_READ_MICROS);
if(CPU_Cycles > delaycyc) CPU_Cycles -= delaycyc;
else CPU_Cycles = 0;
}
@ -183,7 +183,7 @@ inline void IO_USEC_read_delay_old() {
inline void IO_USEC_write_delay_old() {
if(CPU_CycleMax > static_cast<Bit32s>((IODELAY_WRITE_MICROS*1000.0))) {
// this could be calculated whenever CPU_CycleMax changes
Bitu delaycyc = static_cast<Bitu>((CPU_CycleMax/1000)*IODELAY_WRITE_MICROS);
Bits delaycyc = static_cast<Bits>((CPU_CycleMax/1000)*IODELAY_WRITE_MICROS);
if(CPU_Cycles > delaycyc) CPU_Cycles -= delaycyc;
else CPU_Cycles = 0;
}
@ -194,14 +194,14 @@ inline void IO_USEC_write_delay_old() {
#define IODELAY_WRITE_MICROSk (Bit32u)(1024/0.75)
inline void IO_USEC_read_delay() {
Bitu delaycyc = CPU_CycleMax/IODELAY_READ_MICROSk;
Bits delaycyc = CPU_CycleMax/IODELAY_READ_MICROSk;
if(GCC_UNLIKELY(CPU_Cycles < 3*delaycyc)) delaycyc = 0; //Else port acces will set cycles to 0. which might trigger problem with games which read 16 bit values
CPU_Cycles -= delaycyc;
CPU_IODelayRemoved += delaycyc;
}
inline void IO_USEC_write_delay() {
Bitu delaycyc = CPU_CycleMax/IODELAY_WRITE_MICROSk;
Bits delaycyc = CPU_CycleMax/IODELAY_WRITE_MICROSk;
if(GCC_UNLIKELY(CPU_Cycles < 3*delaycyc)) delaycyc=0;
CPU_Cycles -= delaycyc;
CPU_IODelayRemoved += delaycyc;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: keyboard.cpp,v 1.38 2007-06-08 08:21:45 qbix79 Exp $ */
/* $Id: keyboard.cpp,v 1.39 2007-06-12 20:22:08 c2woody Exp $ */
#include "dosbox.h"
#include "keyboard.h"
@ -66,7 +66,6 @@ static void KEYBOARD_TransferBuffer(Bitu val) {
LOG(LOG_KEYBOARD,LOG_NORMAL)("Transfer started with empty buffer");
return;
}
Bit8u data=keyb.buffer[keyb.pos];
KEYBOARD_SetPort60(keyb.buffer[keyb.pos]);
if (++keyb.pos>=KEYBUFSIZE) keyb.pos-=KEYBUFSIZE;
keyb.used--;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: mixer.cpp,v 1.45 2007-05-01 18:57:19 c2woody Exp $ */
/* $Id: mixer.cpp,v 1.46 2007-06-12 20:22:08 c2woody Exp $ */
/*
Remove the sdl code from here and have it handeld in the sdlmain.
@ -595,7 +595,7 @@ void MIXER_Init(Section* sec) {
spec.channels=2;
spec.callback=MIXER_CallBack;
spec.userdata=NULL;
spec.samples=mixer.blocksize;
spec.samples=(Uint16)mixer.blocksize;
mixer.tick_remain=0;
if (mixer.nosound) {

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: pic.cpp,v 1.40 2007-04-16 13:25:06 c2woody Exp $ */
/* $Id: pic.cpp,v 1.41 2007-06-12 20:22:08 c2woody Exp $ */
#include <list>
@ -83,7 +83,7 @@ static void write_command(Bitu port,Bitu val,Bitu iolen) {
if (val&0x04) E_Exit("PIC: 4 byte interval not handled");
if (val&0x08) E_Exit("PIC: level triggered mode not handled");
if (val&0xe0) E_Exit("PIC: 8080/8085 mode not handled");
pic->single=val&0x02;
pic->single=(val&0x02)==0x02;
pic->icw_index=1; // next is ICW2
pic->icw_words=2 + (val&0x01); // =3 if ICW4 needed
} else if (GCC_UNLIKELY(val&0x08)) { // OCW3 issued
@ -118,7 +118,7 @@ static void write_command(Bitu port,Bitu val,Bitu iolen) {
}
}
}
if (val&0x80); // perform rotation
// if (val&0x80); // perform rotation
} else { // nonspecific EOI
if (PIC_IRQActive<(irq_base+8)) {
irqs[PIC_IRQActive].inservice=false;
@ -130,7 +130,7 @@ static void write_command(Bitu port,Bitu val,Bitu iolen) {
}
}
}
if (val&0x80); // perform rotation
// if (val&0x80); // perform rotation
}
} else {
if ((val&0x40)==0) { // rotate in auto EOI mode
@ -232,7 +232,6 @@ static Bitu read_command(Bitu port,Bitu iolen) {
}
static Bitu read_data(Bitu port,Bitu iolen) {
PIC_Controller * pic=&pics[port==0x21 ? 0 : 1];
Bitu irq_base=(port==0x21) ? 0 : 8;
Bitu i;Bit8u ret=0;Bit8u b=1;
for (i=irq_base;i<=irq_base+7;i++) {
@ -387,7 +386,7 @@ void PIC_AddEvent(PIC_EventHandler handler,float delay,Bitu val) {
return;
}
PICEntry * entry=pic.free_entry;
entry->index=delay+PIC_TickIndex();;
entry->index=delay+PIC_TickIndex();
entry->event=handler;
entry->value=val;
pic.free_entry=pic.free_entry->next;

View file

@ -233,7 +233,7 @@ bool TCPClientSocket::SendArrayBuffered(Bit8u* data, Bitu bufsize) {
while(
// first case, buffer already full
/*if(sendbufferindex==(sendbuffersize-1)) {
if(sendbufferindex==(sendbuffersize-1)) {
// buffer is full, get rid of it
sendbuffer[sendbufferindex]=data;
sendbufferindex=0;
@ -242,9 +242,9 @@ bool TCPClientSocket::SendArrayBuffered(Bit8u* data, Bitu bufsize) {
isopen=false;
return false;
}
}*/
//}
}
}
*/
void TCPClientSocket::FlushBuffer() {
if(sendbufferindex) {
if(SDLNet_TCP_Send(mysock, sendbuffer,

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: timer.cpp,v 1.43 2007-06-08 08:21:45 qbix79 Exp $ */
/* $Id: timer.cpp,v 1.44 2007-06-12 20:22:08 c2woody Exp $ */
#include <math.h>
#include "dosbox.h"
@ -69,7 +69,7 @@ static void PIT0_Event(Bitu /*val*/) {
if (pit[0].mode != 0) {
pit[0].start += pit[0].delay;
double error = pit[0].start - PIC_FullIndex();
PIC_AddEvent(PIT0_Event,pit[0].delay + error);
PIC_AddEvent(PIT0_Event,(float)(pit[0].delay + error));
}
}

View file

@ -84,7 +84,8 @@ void VGA_SetClock(Bitu which,Bitu target) {
Bits err;
} best;
best.err=target;
Bitu n,m,r;
Bitu n,r;
Bits m;
for (r = 0; r <= 3; r++) {
Bitu f_vco = target * (1 << r);

View file

@ -139,6 +139,7 @@ static void write_p3c9(Bitu port,Bitu val,Bitu iolen) {
break;
default:
LOG(LOG_VGAGFX,LOG_NORMAL)("VGA:DAC:Illegal Pel Index"); //If this can actually happen that will be the day
break;
};
}
@ -161,6 +162,8 @@ static Bitu read_p3c9(Bitu port,Bitu iolen) {
break;
default:
LOG(LOG_VGAMISC,LOG_NORMAL)("VGA:DAC:Illegal Pel Index"); //If this can actually happen that will be the day
ret=0;
break;
}
return ret;
}

View file

@ -380,7 +380,7 @@ static Bit8u * VGA_Draw_LIN32_Line_HWMouse(Bitu vidstart, Bitu line) {
static Bit32u FontMask[2]={0xffffffff,0x0};
static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart, Bitu line) {
Bitu font_addr;
Bits font_addr;
Bit32u * draw=(Bit32u *)TempLine;
const Bit8u *vidmem = &vga.tandy.draw_base[vidstart];
for (Bitu cx=0;cx<vga.draw.blocks;cx++) {
@ -396,7 +396,7 @@ static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart, Bitu line) {
}
if (!vga.draw.cursor.enabled || !(vga.draw.cursor.count&0x8)) goto skip_cursor;
font_addr = (vga.draw.cursor.address-vidstart) >> 1;
if (font_addr>=0 && font_addr<vga.draw.blocks) {
if (font_addr>=0 && font_addr<(Bits)vga.draw.blocks) {
if (line<vga.draw.cursor.sline) goto skip_cursor;
if (line>vga.draw.cursor.eline) goto skip_cursor;
draw=(Bit32u *)&TempLine[font_addr*8];
@ -579,8 +579,8 @@ static void VGA_VerticalTimer(Bitu val) {
break;
}
//VGA_DrawPart( vga.draw.parts_lines );
PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts,vga.draw.parts_lines);
// PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts/2,vga.draw.parts_lines); //Else tearline in Tyrian and second reality
PIC_AddEvent(VGA_DrawPart,(float)vga.draw.delay.parts,vga.draw.parts_lines);
// PIC_AddEvent(VGA_DrawPart,(float)(vga.draw.delay.parts/2),vga.draw.parts_lines); //Else tearline in Tyrian and second reality
}
void VGA_CheckScanLength(void) {
@ -983,7 +983,7 @@ void VGA_SetupDrawing(Bitu val) {
#endif
RENDER_SetSize(width,height,bpp,fps,aspect_ratio,doublewidth,doubleheight);
vga.draw.delay.framestart = PIC_FullIndex();
PIC_AddEvent( VGA_VerticalTimer , vga.draw.delay.vtotal );
PIC_AddEvent( VGA_VerticalTimer , (float)vga.draw.delay.vtotal );
}
};

View file

@ -96,6 +96,8 @@ INLINE static Bit32u ModeOperation(Bit8u val) {
break;
default:
LOG(LOG_VGAMISC,LOG_NORMAL)("VGA:Unsupported write mode %d",vga.config.write_mode);
full=0;
break;
}
return full;
}

View file

@ -22,7 +22,6 @@
#include "vga.h"
#include <math.h>
static Bit8u flip=0;
void vga_write_p3d4(Bitu port,Bitu val,Bitu iolen);
Bitu vga_read_p3d4(Bitu port,Bitu iolen);

View file

@ -280,51 +280,51 @@ static const int slot_array[32]=
/* key scale level */
/* table is 3dB/octave , DV converts this into 6dB/octave */
/* 0.1875 is bit 0 weight of the envelope counter (volume) expressed in the 'decibel' scale */
#define DV (0.1875/2.0)
#define SC(x) ((UINT32)((x)/(0.1875/2.0)))
static const UINT32 ksl_tab[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,
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 */
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,
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 */
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,
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 */
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,
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 */
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,
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 */
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,
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 */
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,
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 */
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
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 DV
#undef SC
/* sustain level table (3dB per step) */
/* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/
@ -444,13 +444,13 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),
/* multiple table */
#define ML 2
#define SC(x) ((UINT32)((x)*2))
static const UINT8 mul_tab[16]= {
/* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,12,12,15,15 */
0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML,
8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML
SC(0.50), SC(1.00), SC(2.00), SC(3.00), SC(4.00), SC(5.00), SC(6.00), SC(7.00),
SC(8.00), SC(9.00),SC(10.00),SC(10.00),SC(12.00),SC(12.00),SC(15.00),SC(15.00)
};
#undef ML
#undef SC
/* TL_TAB_LEN is calculated as:
@ -1344,17 +1344,17 @@ static void OPL3_initalize(OPL3 *chip)
/* Amplitude modulation: 27 output levels (triangle waveform); 1 level takes one of: 192, 256 or 448 samples */
/* One entry from LFO_AM_TABLE lasts for 64 samples */
chip->lfo_am_inc = (1.0 / 64.0 ) * (1<<LFO_SH) * chip->freqbase;
chip->lfo_am_inc = (UINT32)((1.0 / 64.0 ) * (1<<LFO_SH) * chip->freqbase);
/* Vibrato: 8 output levels (triangle waveform); 1 level takes 1024 samples */
chip->lfo_pm_inc = (1.0 / 1024.0) * (1<<LFO_SH) * chip->freqbase;
chip->lfo_pm_inc = (UINT32)((1.0 / 1024.0) * (1<<LFO_SH) * chip->freqbase);
/*logerror ("chip->lfo_am_inc = %8x ; chip->lfo_pm_inc = %8x\n", chip->lfo_am_inc, chip->lfo_pm_inc);*/
/* Noise generator: a step takes 1 sample */
chip->noise_f = (1.0 / 1.0) * (1<<FREQ_SH) * chip->freqbase;
chip->noise_f = (UINT32)((1.0 / 1.0) * (1<<FREQ_SH) * chip->freqbase);
chip->eg_timer_add = (1<<EG_SH) * chip->freqbase;
chip->eg_timer_add = (UINT32)((1<<EG_SH) * chip->freqbase);
chip->eg_timer_overflow = ( 1 ) * (1<<EG_SH);
/*logerror("YMF262init eg_timer_add=%8x eg_timer_overflow=%8x\n", chip->eg_timer_add, chip->eg_timer_overflow);*/