More precision in frequency emulation, small changes in AY-3-8912 emulation and in gui

This commit is contained in:
fabio.olimpieri 2012-08-19 15:40:24 +00:00
parent c993740080
commit 0c7d82f0b2
5 changed files with 17 additions and 6 deletions

View File

@ -1554,7 +1554,7 @@ void ResetComputer () {
ordenador.last_selected_poke_file[0]='\0'; ordenador.last_selected_poke_file[0]='\0';
ordenador.tst_sample=ordenador.cpufreq/ordenador.freq; ordenador.tst_sample=(ordenador.cpufreq + ordenador.freq/2)/ordenador.freq;
microdrive_reset(); microdrive_reset();
} }

View File

@ -493,7 +493,7 @@ int bucle, bucle2,ret2;
} }
printf("Init sound 2\n"); printf("Init sound 2\n");
ordenador.tst_sample=ordenador.cpufreq/ordenador.freq; ordenador.tst_sample=(ordenador.cpufreq + ordenador.freq/2)/ordenador.freq;
} }
void end_system() { void end_system() {

View File

@ -544,7 +544,16 @@ static void emulation_settings(void)
} }
} }
if (ordenador.turbo==0) ordenador.precision = !submenus[4]; if (submenus[4] != submenus_old[4])
{
ordenador.precision = !submenus[4];
if (ordenador.precision)
{
update_frequency(0);
jump_frames=0;
ordenador.turbo =0;
}
}
} }
static void audio_settings(void) static void audio_settings(void)

View File

@ -2014,6 +2014,6 @@ if (freq == 0)
} }
else ordenador.cpufreq = freq; else ordenador.cpufreq = freq;
ordenador.tst_sample=ordenador.cpufreq/ordenador.freq; ordenador.tst_sample=(ordenador.cpufreq + ordenador.freq/2)/ordenador.freq;
} }

View File

@ -183,9 +183,7 @@ inline void play_ay (unsigned int tstados) {
tone_period_a= ((unsigned int) ordenador.ay_registers[0]) + 256 * ((unsigned int) ((ordenador.ay_registers[1]) & 0x0F)); tone_period_a= ((unsigned int) ordenador.ay_registers[0]) + 256 * ((unsigned int) ((ordenador.ay_registers[1]) & 0x0F));
tone_period_b= ((unsigned int) ordenador.ay_registers[2]) + 256 * ((unsigned int) ((ordenador.ay_registers[3]) & 0x0F)); tone_period_b= ((unsigned int) ordenador.ay_registers[2]) + 256 * ((unsigned int) ((ordenador.ay_registers[3]) & 0x0F));
tone_period_c= ((unsigned int) ordenador.ay_registers[4]) + 256 * ((unsigned int) ((ordenador.ay_registers[5]) & 0x0F)); tone_period_c= ((unsigned int) ordenador.ay_registers[4]) + 256 * ((unsigned int) ((ordenador.ay_registers[5]) & 0x0F));
noise_period= ((unsigned int) ordenador.ay_registers[6]) & 0x1F;
if (!noise_period) noise_period = 1;
if (tone_period_a<6) //max 20KHz if (tone_period_a<6) //max 20KHz
ordenador.ayval_a =1; ordenador.ayval_a =1;
@ -263,6 +261,10 @@ inline void play_ay (unsigned int tstados) {
ordenador.aych_n =0; ordenador.aych_n =0;
// Changes to R6 take effect only when internal counter reaches 0
noise_period= ((unsigned int) ordenador.ay_registers[6]) & 0x1F;
if (!noise_period) noise_period = 1;
} }