From eeaf3db38f36f3f48841c46cc9303778e5309216 Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Thu, 3 Jan 2013 10:00:10 +0000 Subject: [PATCH] Turbo mode and precision emulation on at the same time --- src/computer.c | 1 + src/computer.h | 1 + src/gui_sdl.c | 17 ++++++++++++----- src/tape.c | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/computer.c b/src/computer.c index 74bc7a3..c8b1595 100644 --- a/src/computer.c +++ b/src/computer.c @@ -111,6 +111,7 @@ void computer_init () { //Called only on start-up ordenador.turbo = 0; ordenador.turbo_state = 0; ordenador.precision = 0; + ordenador.precision_old = 0; ordenador.tape_readed = 0; ordenador.pause = 1; // tape stop diff --git a/src/computer.h b/src/computer.h index 62f01e3..6129404 100644 --- a/src/computer.h +++ b/src/computer.h @@ -37,6 +37,7 @@ int countdown; struct computer { unsigned char precision; //If set 1 emulate with more precision + unsigned char precision_old; unsigned char npixels; //1, 2 or 4 depending on dblscan and zaurus_mini unsigned char progressive; //interlace or progressive 576 unsigned int temporal_io; diff --git a/src/gui_sdl.c b/src/gui_sdl.c index cc7a8fd..ac5712f 100644 --- a/src/gui_sdl.c +++ b/src/gui_sdl.c @@ -531,7 +531,7 @@ static void emulation_settings(void) switch(ordenador.turbo) { case 1: //auto - ordenador.precision =0; + //ordenador.precision =0; case 0: //off update_frequency(0); //set machine frequency jump_frames=0; @@ -541,12 +541,14 @@ static void emulation_settings(void) update_frequency(10000000); jump_frames=4; ordenador.precision =0; + ordenador.precision_old =0; ordenador.turbo_state=2; break; case 3: //ultra fast update_frequency(15000000); jump_frames=24; ordenador.precision =0; + ordenador.precision_old =0; ordenador.turbo_state=3; break; default: @@ -557,12 +559,17 @@ static void emulation_settings(void) if (submenus[4] != submenus_old[4]) { ordenador.precision = !submenus[4]; - if (ordenador.precision) - { + if ((ordenador.turbo==1)&&(ordenador.turbo_state==3)) ordenador.precision_old=ordenador.precision; //Tape is loading + else if (ordenador.precision) + { update_frequency(0); jump_frames=0; - ordenador.turbo =0; - ordenador.turbo_state=0; + if (ordenador.turbo!=1) + { + ordenador.turbo =0; + ordenador.turbo_state=0; + } + } } } diff --git a/src/tape.c b/src/tape.c index 36dc118..ccdd41e 100644 --- a/src/tape.c +++ b/src/tape.c @@ -39,6 +39,7 @@ inline void tape_read(FILE *fichero, int tstados) { update_frequency(0); //set machine frequency jump_frames=0; ordenador.turbo_state = 0; + ordenador.precision=ordenador.precision_old; } return; } @@ -48,6 +49,7 @@ inline void tape_read(FILE *fichero, int tstados) { { update_frequency(15000000); jump_frames=24; + ordenador.precision_old=ordenador.precision; ordenador.precision =0; ordenador.turbo_state = 3; }