static void audio_event_reset (void) { int i; last_cycles = get_cycles (); next_sample_evtime = scaled_sample_evtime; if (!isrestore ()) { for (i = 0; i < 4; i++) zerostate (audio_channel + i); } schedule_audio (); events_schedule (); }
void audio_reset (void) { memset (audio_channel, 0, 4 * sizeof *audio_channel); audio_channel[0].per = PERIOD_MAX; audio_channel[1].per = PERIOD_MAX; audio_channel[2].per = PERIOD_MAX; audio_channel[3].per = PERIOD_MAX; #ifndef NO_AHI_CHANNELS memset (audio_channel + 4, 0, 2 * sizeof *audio_channel); audio_channel[4].per = PERIOD_MAX; audio_channel[5].per = PERIOD_MAX; #endif last_cycles = 0; #ifdef ENABLE_AHI_SOUND sound_ahi_enabled = 0; ahi_interrupt_state = 0; #endif next_sample_evtime = scaled_sample_evtime; schedule_audio (); }
void sound_default_evtime(void) { int pal = beamcon0 & 0x20; switch(m68k_speed) { case 6: scaled_sample_evtime=(unsigned)(MAXHPOS_PAL*MAXVPOS_PAL*VBLANK_HZ_PAL*CYCLE_UNIT/1.86)/sound_rate; break; case 5: case 4: // ~4/3 234 if (pal) scaled_sample_evtime=(MAXHPOS_PAL*244*VBLANK_HZ_PAL*CYCLE_UNIT)/sound_rate; // ??? else scaled_sample_evtime=(MAXHPOS_NTSC*255*VBLANK_HZ_NTSC*CYCLE_UNIT)/sound_rate; break; case 3: case 2: // ~8/7 273 if (pal) scaled_sample_evtime=(MAXHPOS_PAL*270*VBLANK_HZ_PAL*CYCLE_UNIT)/sound_rate; else scaled_sample_evtime=(MAXHPOS_NTSC*255*VBLANK_HZ_NTSC*CYCLE_UNIT)/sound_rate; break; case 1: default: // MAXVPOS_PAL? if (pal) scaled_sample_evtime=(MAXHPOS_PAL*313*VBLANK_HZ_PAL*CYCLE_UNIT)/sound_rate; else scaled_sample_evtime=(MAXHPOS_NTSC*MAXVPOS_NTSC*VBLANK_HZ_NTSC*CYCLE_UNIT)/sound_rate + 1; break; } schedule_audio(); }