stop tape play after machine select, fixed crackling in auto mode, fixed bug in file list creation, fixed menu precision setting

This commit is contained in:
fabio.olimpieri 2013-01-06 14:53:38 +00:00
parent 44f0eecea5
commit 7a9bfa6a77
4 changed files with 21 additions and 20 deletions

View File

@ -1247,11 +1247,6 @@ inline void read_keyboard () {
case SDLK_F10: // Reset emulator
ResetComputer ();
ordenador.pause = 1;
if (ordenador.tap_file != NULL) {
ordenador.tape_current_mode = TAP_TRASH;
rewind_tape (ordenador.tap_file,1);
}
break;
case SDLK_F11: // lower volume
@ -1588,6 +1583,13 @@ void ResetComputer () {
ordenador.tst_sample=(ordenador.cpufreq + ordenador.freq/2)/ordenador.freq;
microdrive_reset();
ordenador.pause = 1;
if (ordenador.tap_file != NULL) {
ordenador.tape_current_mode = TAP_TRASH;
rewind_tape (ordenador.tap_file,1);
}
ordenador.precision=ordenador.precision_old;
}
// check if there's contention and waits the right number of tstates

View File

@ -527,7 +527,7 @@ static void emulation_settings(void)
if (opt < 0)
return;
set_machine_model(submenus[0]);
if (submenus[0]!=submenus_old[0]) set_machine_model(submenus[0]);
if ((old_mode!=ordenador.mode128k)||(old_videosystem!=ordenador.videosystem)) ResetComputer();
jump_frames = submenus[1];
@ -545,6 +545,7 @@ static void emulation_settings(void)
update_frequency(0); //set machine frequency
jump_frames=0;
ordenador.turbo_state=0;
ordenador.precision = ordenador.precision_old;
break;
case 2: //fast
update_frequency(10000000);
@ -554,7 +555,7 @@ static void emulation_settings(void)
ordenador.turbo_state=2;
break;
case 3: //ultra fast
update_frequency(15000000);
update_frequency(14000000);
jump_frames=24;
ordenador.precision =0;
ordenador.precision_old =0;
@ -568,8 +569,9 @@ static void emulation_settings(void)
if (submenus[4] != submenus_old[4])
{
ordenador.precision = !submenus[4];
if ((ordenador.turbo==1)&&(ordenador.turbo_state==3)) ordenador.precision_old=ordenador.precision; //Tape is loading
else if (ordenador.precision)
ordenador.precision_old=ordenador.precision;
if (ordenador.turbo_state!=4) //Tape is not loading with turbo mode
if (ordenador.precision)
{
update_frequency(0);
jump_frames=0;
@ -1817,20 +1819,16 @@ void main_menu()
break;
case 13:
ResetComputer ();
ordenador.pause = 1;
if (ordenador.tap_file != NULL) {
ordenador.tape_current_mode = TAP_TRASH;
rewind_tape (ordenador.tap_file,1);
}
retorno=-1;
break;
case 14:
if (msgYesNo("Are you sure to quit?", 0, FULL_DISPLAY_X /2-138/RATIO, FULL_DISPLAY_Y /2-48/RATIO))
{salir = 0;}
{salir = 0;retorno=-1;}
break;
default:
break;
}
} while (opt != 13 && opt != 14 && (!retorno));
} while (!retorno);
clean_screen();

View File

@ -393,6 +393,7 @@ static const char **get_file_list(const char *base_dir)
for ( i = 0; file_list[i]; i++ )
free((void*)file_list[i]);
free(file_list);
closedir(d);
return NULL;
}
}

View File

@ -45,13 +45,13 @@ inline void tape_read(FILE *fichero, int tstados) {
}
//Auto ultra fast mode
if ((ordenador.turbo_state != 3)&&(ordenador.turbo==1))
if ((ordenador.turbo_state != 4)&&(ordenador.turbo==1))
{
update_frequency(15000000);
jump_frames=24;
update_frequency(11000000);
jump_frames=7;
ordenador.precision_old=ordenador.precision;
ordenador.precision =0;
ordenador.turbo_state = 3;
ordenador.turbo_state = 4;
}
if(ordenador.tape_file_type == TAP_TAP)