@@ -29,7 +29,7 @@ void sgu1_init(sgu1_t* sgu, const sgu1_desc_t* desc) {
2929 sgu -> sample_mag = desc -> magnitude ;
3030 sgu -> tick_period = (desc -> tick_hz * SGU1_FIXEDPOINT_SCALE ) / SGU1_CHIP_CLOCK ;
3131 sgu -> tick_counter = sgu -> tick_period ;
32- SoundUnit_Init (& sgu -> su , 65536 , false );
32+ SoundUnit_Init (& sgu -> su , 65536 );
3333 sgu -> resampler = speex_resampler_init (SGU1_AUDIO_CHANNELS , SGU1_CHIP_CLOCK , sgu -> sound_hz , 10 , nullptr );
3434}
3535
@@ -50,14 +50,14 @@ static uint64_t _sgu1_tick(sgu1_t* sgu, uint64_t pins) {
5050 sgu -> tick_counter -= SGU1_FIXEDPOINT_SCALE ;
5151 if (sgu -> tick_counter <= 0 ) {
5252 sgu -> tick_counter += sgu -> tick_period ;
53- short l , r ;
53+ int32_t l , r ;
5454 SoundUnit_NextSample (& sgu -> su , & l , & r );
5555 float in [2 ] = { ((float )l / 32767.0f ), ((float )r / 32767.0f ) };
5656 spx_uint32_t in_len = 1 ; // 1 stereo frame
5757 spx_uint32_t out_len = 1 ; // room for 1 stereo frame
5858 speex_resampler_process_interleaved_float (sgu -> resampler , in , & in_len , sgu -> sample , & out_len );
5959
60- for (int i = 0 ; i < SGU1_NUM_CHANNELS ; i ++ ) {
60+ for (uint8_t i = 0 ; i < SGU1_NUM_CHANNELS ; i ++ ) {
6161 sgu -> voice [i ].sample_buffer [sgu -> voice [i ].sample_pos ++ ] = (float )(SoundUnit_GetSample (& sgu -> su , i ));
6262 if (sgu -> voice [i ].sample_pos >= SGU1_AUDIO_SAMPLES ) {
6363 sgu -> voice [i ].sample_pos = 0 ;
0 commit comments