CMS/SAA: Fix warnings.

This commit is contained in:
OBattler
2025-04-02 08:58:16 +02:00
parent 2a8e4d5a68
commit de04870db2
6 changed files with 27 additions and 20 deletions

View File

@@ -107,7 +107,7 @@ void CSAADevice::_SetSampleRate(unsigned int nSampleRate)
void CSAADevice::_SetOversample(unsigned int nOversample)
{
if (nOversample != m_nOversample)
if (((int) nOversample) != m_nOversample)
{
m_nOversample = nOversample;
m_Osc0._SetOversample(nOversample);

View File

@@ -40,12 +40,12 @@ const ENVDATA CSAAEnv::cs_EnvData[8] =
CSAAEnv::CSAAEnv()
:
m_bEnabled(false),
m_bNewData(false),
m_nNextData(0),
m_bEnvelopeEnded(true),
m_nPhase(0),
m_nPhasePosition(0),
m_nResolution(1)
m_bEnvelopeEnded(true),
m_nResolution(1),
m_bNewData(false),
m_nNextData(0)
{
// initialise itself with the value 'zero'
SetEnvControl(0);

View File

@@ -32,11 +32,18 @@ const int INITIAL_LEVEL = 1;
CSAAFreq::CSAAFreq(CSAANoise * const NoiseGenerator, CSAAEnv * const EnvGenerator)
:
m_nCounter(0), m_nCounter_low(0), m_nAdd(0),
m_nCounter(0),
m_nAdd(0),
m_nCounter_low(0),
m_nOversample(0),
m_nCounterLimit_low(1),
m_nLevel(INITIAL_LEVEL),
m_nOversample(0), m_nCounterLimit_low(1),
m_nCurrentOffset(0), m_nCurrentOctave(0), m_nNextOffset(0), m_nNextOctave(0),
m_bIgnoreOffsetData(false), m_bNewData(false),
m_nCurrentOffset(0),
m_nCurrentOctave(0),
m_nNextOffset(0),
m_nNextOctave(0),
m_bIgnoreOffsetData(false),
m_bNewData(false),
m_bSync(false),
m_nSampleRate(SAMPLE_RATE_HZ),
m_pcConnectedNoiseGenerator(NoiseGenerator),
@@ -194,7 +201,7 @@ void CSAAFreq::_SetClockRate(int nClockRate)
// Finally, note that the standard formula corresponds to a 8MHz base clock
// so we rescale the final result by the ratio nClockRate/8000000
if (nClockRate != m_nClockRate)
if (((unsigned long) nClockRate) != m_nClockRate)
{
m_nClockRate = nClockRate;
int ix = 0;

View File

@@ -20,16 +20,18 @@
CSAASoundInternal::CSAASoundInternal()
:
m_nClockRate(EXTERNAL_CLK_HZ),
m_bHighpass(false),
m_nSampleRate(SAMPLE_RATE_HZ),
m_nOversample(DEFAULT_OVERSAMPLE),
m_chip(),
m_uParam(0),
m_uParamRate(0),
m_nClockRate(EXTERNAL_CLK_HZ),
m_nSampleRate(SAMPLE_RATE_HZ),
m_nOversample(DEFAULT_OVERSAMPLE),
#if defined(DEBUGSAA) || defined(USE_CONFIG_FILE)
m_nDebugSample(0),
m_bHighpass(false),
m_nDebugSample(0)
#else
m_bHighpass(false)
#endif
m_chip()
{
#ifdef USE_CONFIG_FILE
m_Config.ReadConfig();

View File

@@ -25,8 +25,8 @@ CSAANoise::CSAANoise()
:
m_nCounter(0),
m_nCounter_low(0),
m_nCounterLimit_low(1),
m_nOversample(0),
m_nCounterLimit_low(1),
m_bSync(false),
m_nSampleRate(SAMPLE_RATE_HZ),
m_nSourceMode(0),
@@ -40,8 +40,8 @@ CSAANoise::CSAANoise(unsigned long seed)
:
m_nCounter(0),
m_nCounter_low(0),
m_nCounterLimit_low(1),
m_nOversample(0),
m_nCounterLimit_low(1),
m_bSync(false),
m_nSampleRate(SAMPLE_RATE_HZ),
m_nSourceMode(0),

View File

@@ -56,8 +56,6 @@ void
cms_write(uint16_t addr, uint8_t val, void *priv)
{
cms_t *cms = (cms_t *) priv;
int voice;
int chip = (addr & 2) >> 1;
switch (addr & 0xf) {
case 0x1: /* SAA #1 Register Select Port */