mirror of
https://github.com/86Box/86Box.git
synced 2025-01-23 09:42:47 -05:00
One last attempt at a fix to my own GPF handler.
This commit is contained in:
parent
4dc74515e8
commit
bff5026b8b
4 changed files with 7 additions and 6 deletions
|
@ -281,7 +281,7 @@ void codegen_block_start_recompile(codeblock_t *block)
|
|||
block->status = cpu_cur_status;
|
||||
|
||||
block_pos = BLOCK_GPF_OFFSET;
|
||||
#ifndef NEW_GPF
|
||||
#ifdef OLD_GPF
|
||||
#if _WIN64
|
||||
addbyte(0x48); /*XOR RCX, RCX*/
|
||||
addbyte(0x31);
|
||||
|
@ -306,8 +306,8 @@ void codegen_block_start_recompile(codeblock_t *block)
|
|||
addbyte(0x31); /* xor eax,eax */
|
||||
addbyte(0xc0);
|
||||
addbyte(0x89); /*MOVB eax,(abrt_error)*/
|
||||
addbyte(0x05);
|
||||
rip_rel = (uintptr_t) &(codeblock[block_current].data[block_pos]);
|
||||
addbyte(0x85);
|
||||
rip_rel = ((uintptr_t)&cpu_state) + 128;
|
||||
rip_rel = ((uintptr_t) &(abrt_error)) - rip_rel;
|
||||
addlong((uint32_t) rip_rel);
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define HASH(l) ((l) & 0x1ffff)
|
||||
|
||||
#define BLOCK_EXIT_OFFSET 0x7e0
|
||||
#ifndef NEW_GPF
|
||||
#ifdef OLD_GPF
|
||||
#define BLOCK_GPF_OFFSET (BLOCK_EXIT_OFFSET - 20)
|
||||
#else
|
||||
#define BLOCK_GPF_OFFSET (BLOCK_EXIT_OFFSET - 12)
|
||||
|
|
|
@ -73,6 +73,9 @@ enum {
|
|||
/* Make sure this is as low as possible. */
|
||||
cpu_state_t cpu_state;
|
||||
|
||||
/* Place this immediately after. */
|
||||
uint32_t abrt_error;
|
||||
|
||||
#ifdef USE_DYNAREC
|
||||
const OpFn *x86_dynarec_opcodes, *x86_dynarec_opcodes_0f,
|
||||
*x86_dynarec_opcodes_d8_a16, *x86_dynarec_opcodes_d8_a32,
|
||||
|
|
|
@ -41,8 +41,6 @@ uint8_t opcode2;
|
|||
int cgate16, cgate32;
|
||||
int intgatesize;
|
||||
|
||||
uint32_t abrt_error;
|
||||
|
||||
void taskswitch286(uint16_t seg, uint16_t *segdat, int is32);
|
||||
|
||||
void pmodeint(int num, int soft);
|
||||
|
|
Loading…
Add table
Reference in a new issue