From e3a2c394ee63b01c5a74f9a5f86820e63c3b827a Mon Sep 17 00:00:00 2001 From: "fabio.olimpieri" Date: Sat, 25 May 2013 09:51:40 +0000 Subject: [PATCH] Fixed 2 bugs on returnig from turbo state --- src/computer.c | 2 +- src/emulator.c | 10 +++++++++- src/tape.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/computer.c b/src/computer.c index 0d1f836..1a882b0 100644 --- a/src/computer.c +++ b/src/computer.c @@ -554,7 +554,7 @@ inline void show_screen (int tstados) { if (ordenador.tstados_counter>=ordenador.tstatodos_frame) { ordenador.tstados_counter-=ordenador.tstatodos_frame; ordenador.interr = 1; - if ((ordenador.turbo_state == 0) || ((curr_frames%7 == 0)&&(curr_frames))) ordenador.readkeyboard = 1; + if ((ordenador.turbo_state == 0) || ((curr_frames%5 == 0)&&(curr_frames))) ordenador.readkeyboard = 1; curr_frames++; if (ordenador.tape_start_countdwn==1) ordenador.tape_stop=0; //Autoplay if ((ordenador.tape_start_countdwn>0)&&(ordenador.stop_tape_start_countdown ==0)) ordenador.tape_start_countdwn--; diff --git a/src/emulator.c b/src/emulator.c index b8893db..01851e0 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -1596,7 +1596,10 @@ int main(int argc,char *argv[]) ordenador.contention=0; } else - if (tstados>0) { + { + ordenador.wr=0; + ordenador.r_fetch=0; + ordenador.io=0; show_screen(tstados); emulate(tstados+ordenador.contention); ordenador.contention=0; @@ -1618,6 +1621,11 @@ int main(int argc,char *argv[]) else { ordenador.tape_start_countdwn=0; //Stop tape play countdown + if ((ordenador.turbo_state != 1)&&(ordenador.turbo==1)) + { + update_frequency(0); //set machine frequency + jump_frames=0; + } if (ordenador.tape_stop ==1) fastload_block_tzx(ordenador.tap_file); } } diff --git a/src/tape.c b/src/tape.c index a6f7c08..5f7dfd8 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1269,7 +1269,7 @@ void fastload_block_tzx (FILE * fichero) { if ((ordenador.turbo_state!= 1)&&(ordenador.turbo==1)) { update_frequency(10000000); //precision could be on - jump_frames=7; + jump_frames=3; //ordenador.turbo_state=4; } ordenador.tape_start_countdwn=((unsigned int)pause[0]+256*(unsigned int)pause[1])/20+1; //autoplay countdown