From d96852828bfe9368712de3cb6ac1d5bebae9e247 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 18 May 2011 16:24:02 +0000 Subject: i286 - More protected mode fixes by Carl (no whatsnew) --- src/emu/cpu/i86/i286.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/emu/cpu/i86/i286.c') diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c index 2765070e70c..085a1628470 100644 --- a/src/emu/cpu/i86/i286.c +++ b/src/emu/cpu/i86/i286.c @@ -170,6 +170,7 @@ static CPU_RESET( i80286 ) cpustate->ldtr.rights=cpustate->tr.rights=0; cpustate->ldtr.sel=cpustate->tr.sel=0; cpustate->rep_in_progress = FALSE; + cpustate->seg_prefix = FALSE; CHANGE_PC(cpustate->pc); @@ -239,10 +240,12 @@ static CPU_EXECUTE( i80286 ) debugger_instruction_hook(device, cpustate->pc); cpustate->seg_prefix=FALSE; - cpustate->prevpc = cpustate->pc; - try { + if (PM && ((cpustate->pc-cpustate->base[CS]) > cpustate->limit[CS])) + throw TRAP(GENERAL_PROTECTION_FAULT, cpustate->sregs[CS] & ~3); + cpustate->prevpc = cpustate->pc; + TABLE286 // call instruction } catch (UINT32 e) -- cgit v1.2.3-70-g09d2