File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ void sgu1_reset(sgu1_t* sgu) {
4848static uint64_t _sgu1_tick (sgu1_t * sgu , uint64_t pins ) {
4949 /* next sample? */
5050 sgu -> tick_counter -= SGU1_FIXEDPOINT_SCALE ;
51- if (sgu -> tick_counter <= 0 ) {
51+ while (sgu -> tick_counter <= 0 ) {
5252 sgu -> tick_counter += sgu -> tick_period ;
5353 int32_t l , r ;
5454 SoundUnit_NextSample (& sgu -> su , & l , & r );
@@ -66,16 +66,14 @@ static uint64_t _sgu1_tick(sgu1_t* sgu, uint64_t pins) {
6666 }
6767
6868 /* new sample? */
69+ pins &= ~SGU1_SAMPLE ;
6970 sgu -> sample_counter -= SGU1_FIXEDPOINT_SCALE ;
70- if (sgu -> sample_counter <= 0 ) {
71+ while (sgu -> sample_counter <= 0 ) {
7172 sgu -> sample_counter += sgu -> sample_period ;
7273 sgu -> sample [0 ] = sgu -> sample_mag * sgu -> sample [0 ];
7374 sgu -> sample [1 ] = sgu -> sample_mag * sgu -> sample [1 ];
7475 pins |= SGU1_SAMPLE ;
7576 }
76- else {
77- pins &= ~SGU1_SAMPLE ;
78- }
7977 return pins ;
8078}
8179
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ static uint64_t _x65_tick(x65_t* sys, uint64_t pins) {
235235 }
236236 }
237237
238- // tick the SID
238+ // tick the SGU
239239 {
240240 sgu_pins = sgu1_tick (& sys -> sgu , sgu_pins );
241241 if (sgu_pins & SGU1_SAMPLE ) {
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ extern "C" {
4848#define X65_SNAPSHOT_VERSION (1)
4949
5050#define X65_FREQUENCY (3140000) // clock frequency in Hz
51- #define X65_MAX_AUDIO_SAMPLES (1024 ) // max number of audio samples in internal sample buffer
52- #define X65_DEFAULT_AUDIO_SAMPLES (128 ) // default number of samples in internal sample buffer
51+ #define X65_MAX_AUDIO_SAMPLES (2048 ) // max number of audio samples in internal sample buffer
52+ #define X65_DEFAULT_AUDIO_SAMPLES (512 ) // default number of samples in internal sample buffer
5353#define X65_AUDIO_CHANNELS (2) // stereo output
5454
5555// X65 joystick types
You can’t perform that action at this time.
0 commit comments