diff --git a/src/386_dynarec.c b/src/386_dynarec.c index 08febf8..8a6e7fb 100644 --- a/src/386_dynarec.c +++ b/src/386_dynarec.c @@ -1319,6 +1319,7 @@ inrecomp=0; // pclog("Hash %08x %i\n", codeblock_hash_pc[HASH(cs + pc)], codeblock_page_dirty[(cs + pc) >> 12]); cpu_block_end = 0; + x86_was_reset = 0; cpu_new_blocks++; @@ -1356,6 +1357,13 @@ inrecomp=0; x86_opcodes[(opcode | op32) & 0x3ff](fetchdat); } + + if (x86_was_reset) + { + x86_was_reset = 0; + /*Codeblock structure will have been cleared so no need for CODE_BLOCK_END()*/ + goto recomp_end; + } if (!use32) pc &= 0xffff; @@ -1387,7 +1395,8 @@ inrecomp=0; // if (output && (SP & 1)) // fatal("odd SP\n"); } - cycdiff=oldcyc-cycles; +recomp_end: + cycdiff=oldcyc-cycles; tsc += cycdiff; // timer_end_period(cycles); diff --git a/src/808x.c b/src/808x.c index 85cd450..d276a4b 100644 --- a/src/808x.c +++ b/src/808x.c @@ -619,6 +619,7 @@ chdir(pcempath); } int resets = 0; +int x86_was_reset = 0; void resetx86() { pclog("x86 reset\n"); @@ -655,6 +656,7 @@ void resetx86() #ifdef DYNAREC codegen_reset(); #endif + x86_was_reset = 1; } void softresetx86() diff --git a/src/x86.h b/src/x86.h index b013076..c5cf782 100644 --- a/src/x86.h +++ b/src/x86.h @@ -104,3 +104,5 @@ void x86seg_reset(); void x86gpf(char *s, uint16_t error); extern uint16_t zero; + +extern int x86_was_reset;