summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2013-02-28 03:53:37 +0000
committer cracyc <cracyc@users.noreply.github.com>2013-02-28 03:53:37 +0000
commit6f52503894027ea1c7d1a18bd8ca5a3419d22748 (patch)
tree6853b201d0d55a5ed6123aac28b4d5e816bdd088
parent5c52a65b0f79d14b6b69160686a936e28520d196 (diff)
(mess) i386: int 6 on invalid LxS insn. Makes NTVDM happier. (nw)
-rw-r--r--src/emu/cpu/i386/i386op16.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/emu/cpu/i386/i386op16.c b/src/emu/cpu/i386/i386op16.c
index d47bfee538d..edff2947465 100644
--- a/src/emu/cpu/i386/i386op16.c
+++ b/src/emu/cpu/i386/i386op16.c
@@ -3660,47 +3660,50 @@ static void I386OP(retf_i16)(i386_state *cpustate) // Opcode 0xca
CYCLES(cpustate,CYCLES_RET_IMM_INTERSEG);
}
-static void I386OP(load_far_pointer16)(i386_state *cpustate, int s)
+static bool I386OP(load_far_pointer16)(i386_state *cpustate, int s)
{
UINT8 modrm = FETCH(cpustate);
UINT16 selector;
if( modrm >= 0xc0 ) {
- fatalerror("i386: load_far_pointer16 NYI\n");
+ //logerror("i386: load_far_pointer16 NYI\n"); // don't log, NT will use this a lot
+ i386_trap(cpustate,6, 0, 0);
+ return false;
} else {
UINT32 ea = GetEA(cpustate,modrm,0);
STORE_REG16(modrm, READ16(cpustate,ea + 0));
selector = READ16(cpustate,ea + 2);
i386_sreg_load(cpustate,selector,s,NULL);
}
+ return true;
}
static void I386OP(lds16)(i386_state *cpustate) // Opcode 0xc5
{
- I386OP(load_far_pointer16)(cpustate, DS);
- CYCLES(cpustate,CYCLES_LDS);
+ if(I386OP(load_far_pointer16)(cpustate, DS))
+ CYCLES(cpustate,CYCLES_LDS);
}
static void I386OP(lss16)(i386_state *cpustate) // Opcode 0x0f 0xb2
{
- I386OP(load_far_pointer16)(cpustate, SS);
- CYCLES(cpustate,CYCLES_LSS);
+ if(I386OP(load_far_pointer16)(cpustate, SS))
+ CYCLES(cpustate,CYCLES_LSS);
}
static void I386OP(les16)(i386_state *cpustate) // Opcode 0xc4
{
- I386OP(load_far_pointer16)(cpustate, ES);
- CYCLES(cpustate,CYCLES_LES);
+ if(I386OP(load_far_pointer16)(cpustate, ES))
+ CYCLES(cpustate,CYCLES_LES);
}
static void I386OP(lfs16)(i386_state *cpustate) // Opcode 0x0f 0xb4
{
- I386OP(load_far_pointer16)(cpustate, FS);
- CYCLES(cpustate,CYCLES_LFS);
+ if(I386OP(load_far_pointer16)(cpustate, FS))
+ CYCLES(cpustate,CYCLES_LFS);
}
static void I386OP(lgs16)(i386_state *cpustate) // Opcode 0x0f 0xb5
{
- I386OP(load_far_pointer16)(cpustate, GS);
- CYCLES(cpustate,CYCLES_LGS);
+ if(I386OP(load_far_pointer16)(cpustate, GS))
+ CYCLES(cpustate,CYCLES_LGS);
}