Dynarec now jumps straight to GPF handler if it hits a NULL selector instead of relying on interpreter code to detect the GPF. Fixes hang in Windows 98 SE upgrade setup.

This commit is contained in:
SarahW 2017-11-27 21:09:42 +00:00
commit 2f1514d3b2
2 changed files with 8 additions and 8 deletions

View file

@ -889,9 +889,9 @@ static inline void CHECK_SEG_READ(x86seg *seg)
addbyte(0xe8 | REG_ESI); addbyte(0xe8 | REG_ESI);
addbyte(0xff); addbyte(0xff);
} }
addbyte(0x0f); /*JE end*/ addbyte(0x0f); /*JE BLOCK_GPF_OFFSET*/
addbyte(0x84); addbyte(0x84);
addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); addlong(BLOCK_GPF_OFFSET - (block_pos + 4));
seg->checked = 1; seg->checked = 1;
} }
@ -925,9 +925,9 @@ static inline void CHECK_SEG_WRITE(x86seg *seg)
addbyte(0xe8 | REG_ESI); addbyte(0xe8 | REG_ESI);
addbyte(0xff); addbyte(0xff);
} }
addbyte(0x0f); /*JE end*/ addbyte(0x0f); /*JE BLOCK_GPF_OFFSET*/
addbyte(0x84); addbyte(0x84);
addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); addlong(BLOCK_GPF_OFFSET - (block_pos + 4));
seg->checked = 1; seg->checked = 1;
} }

View file

@ -626,8 +626,8 @@ static inline void CHECK_SEG_READ(x86seg *seg)
addlong((uint32_t)&seg->base); addlong((uint32_t)&seg->base);
addbyte(-1); addbyte(-1);
addbyte(0x0f); addbyte(0x0f);
addbyte(0x84); /*JE end*/ addbyte(0x84); /*JE BLOCK_GPF_OFFSET*/
addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); addlong(BLOCK_GPF_OFFSET - (block_pos + 4));
seg->checked = 1; seg->checked = 1;
} }
@ -649,8 +649,8 @@ static inline void CHECK_SEG_WRITE(x86seg *seg)
addlong((uint32_t)&seg->base); addlong((uint32_t)&seg->base);
addbyte(-1); addbyte(-1);
addbyte(0x0f); addbyte(0x0f);
addbyte(0x84); /*JE end*/ addbyte(0x84); /*JE BLOCK_GPF_OFFSET*/
addlong(BLOCK_EXIT_OFFSET - (block_pos + 4)); addlong(BLOCK_GPF_OFFSET - (block_pos + 4));
seg->checked = 1; seg->checked = 1;
} }