warning-free compilation

This commit is contained in:
tildearrow 2021-12-14 12:33:26 -05:00
parent 9da9ed3cd7
commit bde8a7f79d
16 changed files with 28 additions and 35 deletions

View File

@ -9,9 +9,6 @@ class TAAudioSDL: public TAAudio {
SDL_AudioSpec ac, ar;
SDL_AudioDeviceID ai;
float** iInBufs;
float** iOutBufs;
public:
void onProcess(unsigned char* buf, int nframes);

View File

@ -1021,7 +1021,7 @@ void DivEngine::renderSamples() {
memset(s->adpcmRendData,0,adpcmLen);
// step 1: render to PCM
int k=0;
unsigned int k=0;
float mult=(float)(s->vol+100)/150.0f;
for (double j=0; j<s->length; j+=samplePitches[s->pitch]) {
if (k>=s->rendLength) {
@ -1045,7 +1045,7 @@ void DivEngine::renderSamples() {
int index=0;
int prevsample=0;
int previndex=0;
for (int j=0; j<s->rendLength; j++) {
for (unsigned int j=0; j<s->rendLength; j++) {
unsigned char encoded=0;
int tempstep=0;
@ -1341,12 +1341,12 @@ bool DivEngine::init(String outName) {
nextBuf(NULL,NULL,0,2,got.bufsize);
if (dispatch->isStereo()) {
for (int i=0; i<got.bufsize; i++) {
for (size_t i=0; i<got.bufsize; i++) {
ilBuffer[i<<1]=bbOut[0][i];
ilBuffer[1+(i<<1)]=bbOut[1][i];
}
} else {
for (int i=0; i<got.bufsize; i++) {
for (size_t i=0; i<got.bufsize; i++) {
ilBuffer[i<<1]=bbOut[0][i];
ilBuffer[1+(i<<1)]=bbOut[0][i];
}
@ -1374,4 +1374,4 @@ bool DivEngine::quit() {
output->quit();
quitDispatch();
return true;
}
}

View File

@ -34,7 +34,8 @@ class DivPlatformArcade: public DivDispatch {
std::queue<QueuedWrite> writes;
opm_t fm;
int delay;
int pcmL, pcmR, pcmCycles, sampleBank;
int pcmL, pcmR, pcmCycles;
unsigned char sampleBank;
unsigned char lastBusy;
bool extMode;

View File

@ -67,7 +67,6 @@ void DivPlatformC64::tick() {
sid.write(i*7+4,(chan[i].wave<<4)|(chan[i].ring<<2)|(chan[i].sync<<1)|chan[i].active);
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
DivInstrument* ins=parent->getIns(chan[i].ins);
chan[i].freq=(chan[i].baseFreq*(ONE_SEMITONE+chan[i].pitch))/ONE_SEMITONE;
if (chan[i].freq>0xffff) chan[i].freq=0xffff;
if (chan[i].keyOn) {

View File

@ -8,7 +8,7 @@
#define FREQ_BASE 8015.85f
void DivPlatformGB::acquire(short* bufL, short* bufR, size_t start, size_t len) {
for (int i=start; i<start+len; i++) {
for (size_t i=start; i<start+len; i++) {
GB_advance_cycles(gb,16);
bufL[i]=gb->apu_output.final_sample.left<<2;
bufR[i]=gb->apu_output.final_sample.right<<2;

View File

@ -36,9 +36,9 @@ class DivPlatformGenesis: public DivDispatch {
bool dacMode;
int dacPeriod;
int dacRate;
int dacPos;
unsigned int dacPos;
int dacSample;
int sampleBank;
unsigned char sampleBank;
bool extMode;

View File

@ -104,7 +104,6 @@ void DivPlatformNES::tick() {
if (chan[i].std.hadDuty) {
chan[i].duty=chan[i].std.duty;
if (i==3 && chan[i].duty>1) chan[i].duty=1;
DivInstrument* ins=parent->getIns(chan[i].ins);
if (i!=2) {
apu_wr_reg(0x4000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
}
@ -119,7 +118,6 @@ void DivPlatformNES::tick() {
}
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
DivInstrument* ins=parent->getIns(chan[i].ins);
if (i==3) { // noise
chan[i].freq=noiseTable[chan[i].baseFreq];
} else {

View File

@ -32,7 +32,10 @@ class DivPlatformNES: public DivDispatch {
wave(-1) {}
};
Channel chan[5];
int dacPeriod, dacRate, dacPos, dacSample, sampleBank;
int dacPeriod, dacRate;
unsigned int dacPos;
int dacSample;
unsigned char sampleBank;
unsigned char lastPan;
float freqBase;

View File

@ -9,7 +9,9 @@
class DivPlatformPCE: public DivDispatch {
struct Channel {
int freq, baseFreq, pitch;
int dacPeriod, dacRate, dacPos, dacSample;
int dacPeriod, dacRate;
unsigned int dacPos;
int dacSample;
unsigned char ins, note, pan;
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise, pcm;
signed char vol, outVol, wave;
@ -47,7 +49,7 @@ class DivPlatformPCE: public DivDispatch {
unsigned char lastPan;
int tempL, tempR, cycles, curChan, delay;
int sampleBank;
unsigned char sampleBank;
PCE_PSG* pce;
void updateWave(int ch);
public:

View File

@ -220,13 +220,13 @@ void Filter::reset()
// ----------------------------------------------------------------------------
void Filter::writeFC_LO(reg8 fc_lo)
{
fc = fc & 0x7f8 | fc_lo & 0x007;
fc = (fc & 0x7f8) | (fc_lo & 0x007);
set_w0();
}
void Filter::writeFC_HI(reg8 fc_hi)
{
fc = (fc_hi << 3) & 0x7f8 | fc & 0x007;
fc = ((fc_hi << 3) & 0x7f8) | (fc & 0x007);
set_w0();
}

View File

@ -68,22 +68,22 @@ void WaveformGenerator::set_chip_model(chip_model model)
// ----------------------------------------------------------------------------
void WaveformGenerator::writeFREQ_LO(reg8 freq_lo)
{
freq = freq & 0xff00 | freq_lo & 0x00ff;
freq = (freq & 0xff00) | (freq_lo & 0x00ff);
}
void WaveformGenerator::writeFREQ_HI(reg8 freq_hi)
{
freq = (freq_hi << 8) & 0xff00 | freq & 0x00ff;
freq = ((freq_hi << 8) & 0xff00) | (freq & 0x00ff);
}
void WaveformGenerator::writePW_LO(reg8 pw_lo)
{
pw = pw & 0xf00 | pw_lo & 0x0ff;
pw = (pw & 0xf00) | (pw_lo & 0x0ff);
}
void WaveformGenerator::writePW_HI(reg8 pw_hi)
{
pw = (pw_hi << 8) & 0xf00 | pw & 0x0ff;
pw = ((pw_hi << 8) & 0xf00) | (pw & 0x0ff);
}
void WaveformGenerator::writeCONTROL_REG(reg8 control)

View File

@ -68,12 +68,6 @@ static const int scale_tab[] =
#define CLOCK_LFSR(lfsr) { unsigned int newbit = ((lfsr >> 0) ^ (lfsr >> 1) ^ (lfsr >> 11) ^ (lfsr >> 12) ^ (lfsr >> 17)) & 1; lfsr = (lfsr >> 1) | (newbit << 17); }
static const int16_t Phase_Filter[2][7] =
{
/* 0 */ { 35, 250, 579, 641, 425, 112, 6 }, // 2048
/* 1 */ { 6, 112, 425, 641, 579, 250, 35 }, // 2048
};
inline void PCE_PSG::UpdateOutputSub(const int32_t timestamp, psg_channel *ch, const int32_t samp0, const int32_t samp1)
{
HRBufs[0][0]+=samp0;
@ -825,4 +819,4 @@ void PCE_PSG::Power(const int32_t timestamp)
vol_pending = false;
vol_update_counter = 0;
vol_update_which = 0;
}
}

View File

@ -74,7 +74,6 @@ void DivPlatformYM2610::tick() {
chan[i].psgMode|=(chan[i].std.wave+1)&3;
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
DivInstrument* ins=parent->getIns(chan[i].ins);
chan[i].freq=(chan[i].baseFreq*(ONE_SEMITONE-chan[i].pitch))/ONE_SEMITONE;
if (chan[i].freq>4095) chan[i].freq=4095;
if (chan[i].keyOn) {

View File

@ -45,7 +45,7 @@ class DivPlatformYM2610: public DivDispatch {
int dacRate;
int dacPos;
int dacSample;
int sampleBank;
unsigned char sampleBank;
int delay;

View File

@ -799,7 +799,7 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
memset(bbIn[1]+runPos,0,runLeft*sizeof(short));
break;
} else {
if (runLeft>=cycles) {
if ((int)runLeft>=cycles) {
runLeft-=cycles;
dispatch->acquire(bbIn[0],bbIn[1],runPos,cycles);
runPos+=cycles;

View File

@ -4,7 +4,7 @@ struct DivSample {
signed char vol, pitch;
unsigned char depth;
short* data;
int rendLength, adpcmRendLength, rendOff;
unsigned int rendLength, adpcmRendLength, rendOff;
short* rendData;
unsigned char* adpcmRendData;