From 50b74dcb2aa50e9d6aab83db02396ba98346b738 Mon Sep 17 00:00:00 2001 From: TomW Date: Tue, 21 Apr 2015 17:39:04 +0100 Subject: [PATCH] Illegal instruction interrupt caused by disabled FPU has correct return address - Turok works again. --- src/codegen_ops_x86.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/codegen_ops_x86.h b/src/codegen_ops_x86.h index 1f02cdf..cf7605f 100644 --- a/src/codegen_ops_x86.h +++ b/src/codegen_ops_x86.h @@ -1226,7 +1226,11 @@ static void FP_ENTER() addlong((uintptr_t)&cr0); addbyte(0xc); addbyte(0x74); /*JZ +*/ - addbyte(7+5+5); + addbyte(10+7+5+5); + addbyte(0xC7); /*MOVL [oldpc],op_old_pc*/ + addbyte(0x05); + addlong((uintptr_t)&oldpc); + addlong(op_old_pc); addbyte(0xc7); /*MOV [ESP], 7*/ addbyte(0x04); addbyte(0x24);