INLINE int noise(pleiads_sound_state *state, int samplerate) { int c_pa6_level = update_c_pa6(state, samplerate); int sum = 0; /* * bit 4 of latch A: noise counter rate modulation? * CV2 input of lower 556 is connected via 2k resistor */ if ( state->m_sound_latch_a & 0x10 ) state->m_noise.counter -= state->m_noise.freq * 2 / 3; /* ????? */ else state->m_noise.counter -= state->m_noise.freq * 1 / 3; /* ????? */ if( state->m_noise.counter <= 0 ) { int n = (-state->m_noise.counter / samplerate) + 1; state->m_noise.counter += n * samplerate; state->m_noise.polyoffs = (state->m_noise.polyoffs + n) & 0x3ffff; state->m_polybit = (state->m_poly18[state->m_noise.polyoffs>>5] >> (state->m_noise.polyoffs & 31)) & 1; }
inline int pleiads_sound_device::noise(int samplerate) { int c_pa6_level = update_c_pa6(samplerate); int sum = 0; /* * bit 4 of latch A: noise counter rate modulation? * CV2 input of lower 556 is connected via 2k resistor */ if ( m_sound_latch_a & 0x10 ) m_noise.counter -= m_noise.freq * 2 / 3; /* ????? */ else m_noise.counter -= m_noise.freq * 1 / 3; /* ????? */ if( m_noise.counter <= 0 ) { int n = (-m_noise.counter / samplerate) + 1; m_noise.counter += n * samplerate; m_noise.polyoffs = (m_noise.polyoffs + n) & 0x3ffff; m_polybit = (m_poly18[m_noise.polyoffs>>5] >> (m_noise.polyoffs & 31)) & 1; }
INLINE int noise(int samplerate) { static int counter, polyoffs; int c_pa6_level = update_c_pa6(samplerate); int sum = 0; /* * bit 4 of latch A: noise counter rate modulation? * CV2 input of lower 556 is connected via 2k resistor */ if ( sound_latch_a & 0x10 ) counter -= noise_freq * 2 / 3; /* ????? */ else counter -= noise_freq * 1 / 3; /* ????? */ if( counter <= 0 ) { int n = (-counter / samplerate) + 1; counter += n * samplerate; polyoffs = (polyoffs + n) & 0x3ffff; polybit = (poly18[polyoffs>>5] >> (polyoffs & 31)) & 1; }