From 7a9bfa6a7726ef97b0811cec033fa739cefe3458 Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sun, 6 Jan 2013 14:53:38 +0000 Subject: [PATCH] stop tape play after machine select, fixed crackling in auto mode, fixed bug in file list creation, fixed menu precision setting --- src/computer.c | 12 +++++++----- src/gui_sdl.c | 20 +++++++++----------- src/menu_sdl.c | 1 + src/tape.c | 8 ++++---- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/computer.c b/src/computer.c index 8e5139c..c50919d 100644 --- a/src/computer.c +++ b/src/computer.c @@ -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 diff --git a/src/gui_sdl.c b/src/gui_sdl.c index 3bc0b80..65bf6e7 100644 --- a/src/gui_sdl.c +++ b/src/gui_sdl.c @@ -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(); diff --git a/src/menu_sdl.c b/src/menu_sdl.c index befb594..9250b05 100644 --- a/src/menu_sdl.c +++ b/src/menu_sdl.c @@ -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; } } diff --git a/src/tape.c b/src/tape.c index ccdd41e..040f8e4 100644 --- a/src/tape.c +++ b/src/tape.c @@ -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)