Recompiler now handles reset caused by a newly generated codeblock.
This commit is contained in:
parent
d79814692f
commit
6bc394b4c6
3 changed files with 14 additions and 1 deletions
|
|
@ -1319,6 +1319,7 @@ inrecomp=0;
|
||||||
|
|
||||||
// pclog("Hash %08x %i\n", codeblock_hash_pc[HASH(cs + pc)], codeblock_page_dirty[(cs + pc) >> 12]);
|
// pclog("Hash %08x %i\n", codeblock_hash_pc[HASH(cs + pc)], codeblock_page_dirty[(cs + pc) >> 12]);
|
||||||
cpu_block_end = 0;
|
cpu_block_end = 0;
|
||||||
|
x86_was_reset = 0;
|
||||||
|
|
||||||
cpu_new_blocks++;
|
cpu_new_blocks++;
|
||||||
|
|
||||||
|
|
@ -1357,6 +1358,13 @@ inrecomp=0;
|
||||||
x86_opcodes[(opcode | op32) & 0x3ff](fetchdat);
|
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;
|
if (!use32) pc &= 0xffff;
|
||||||
|
|
||||||
/*Cap source code at 4000 bytes per block; this
|
/*Cap source code at 4000 bytes per block; this
|
||||||
|
|
@ -1387,6 +1395,7 @@ inrecomp=0;
|
||||||
// if (output && (SP & 1))
|
// if (output && (SP & 1))
|
||||||
// fatal("odd SP\n");
|
// fatal("odd SP\n");
|
||||||
}
|
}
|
||||||
|
recomp_end:
|
||||||
cycdiff=oldcyc-cycles;
|
cycdiff=oldcyc-cycles;
|
||||||
tsc += cycdiff;
|
tsc += cycdiff;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -619,6 +619,7 @@ chdir(pcempath);
|
||||||
}
|
}
|
||||||
|
|
||||||
int resets = 0;
|
int resets = 0;
|
||||||
|
int x86_was_reset = 0;
|
||||||
void resetx86()
|
void resetx86()
|
||||||
{
|
{
|
||||||
pclog("x86 reset\n");
|
pclog("x86 reset\n");
|
||||||
|
|
@ -655,6 +656,7 @@ void resetx86()
|
||||||
#ifdef DYNAREC
|
#ifdef DYNAREC
|
||||||
codegen_reset();
|
codegen_reset();
|
||||||
#endif
|
#endif
|
||||||
|
x86_was_reset = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void softresetx86()
|
void softresetx86()
|
||||||
|
|
|
||||||
|
|
@ -104,3 +104,5 @@ void x86seg_reset();
|
||||||
void x86gpf(char *s, uint16_t error);
|
void x86gpf(char *s, uint16_t error);
|
||||||
|
|
||||||
extern uint16_t zero;
|
extern uint16_t zero;
|
||||||
|
|
||||||
|
extern int x86_was_reset;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue