Previous 15994 Revisions Next

r15234 Saturday 19th May, 2012 at 23:24:17 UTC by Barry Rodewald
Another small vm86 fix [Carl]
[src/emu/cpu/i386]i386.c i386op16.c i386op32.c i386priv.h

src/emu/cpu/i386/i386op16.c
r15233r15234
35073507            SetZF(0);
35083508            return;
35093509         }
3510         if(((seg.flags >> 5) & 3) < cpustate->CPL)
3510         if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c))
35113511         {
35123512            SetZF(0);
35133513            return;
r15233r15234
35713571            SetZF(0);
35723572            return;
35733573         }
3574         if(((seg.flags >> 5) & 3) < cpustate->CPL)
3574         if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c))
35753575         {
35763576            SetZF(0);
35773577            return;
src/emu/cpu/i386/i386priv.h
r15233r15234
496496   if(!ret)
497497   {
498498      if(rwn != -1)
499         *error |= ((rwn & 1)<<1) | (user<<2);
499         *error |= ((rwn & 1)<<1) | ((cpustate->CPL == 3)<<2);
500500      return 0;
501501   }
502502   return 1;
src/emu/cpu/i386/i386.c
r15233r15234
105105   // assume the selector is valid, we don't need to check it again
106106   UINT32 base, addr, error;
107107   UINT8 rights;
108   if(!(selector & ~3))
109      return;
110   
108111   if ( selector & 0x4 )
109112      base = cpustate->ldtr.base;
110113   else
r15233r15234
717720         DPL = (desc.flags >> 5) & 0x03;  // descriptor privilege level
718721//          RPL = segment & 0x03;  // requested privilege level
719722
720         if((segment & ~0x07) == 0)
723         if((segment & ~0x03) == 0)
721724         {
722725            logerror("IRQ: Gate segment is null.\n");
723726            FAULT_EXP(FAULT_GP,cpustate->ext)
r15233r15234
22962299         // 16-bit iret can't reach here
22972300         newESP = READ32(cpustate, ea+12);
22982301         newSS = READ32(cpustate, ea+16) & 0xffff;
2299         memset(&desc, 0, sizeof(desc));
2300         desc.selector = newCS;
2301         i386_load_protected_mode_segment(cpustate,&desc,NULL);
2302         DPL = (desc.flags >> 5) & 0x03;  // descriptor privilege level
2303         RPL = newCS & 0x03;
2304         memset(&stack, 0, sizeof(stack));
2305         stack.selector = newSS;
2306         i386_load_protected_mode_segment(cpustate,&stack,NULL);
2307
23082302         /* Return to v86 mode */
23092303         logerror("IRET (%08x): Returning to Virtual 8086 mode.\n",cpustate->pc);
23102304         if(CPL != 0)
src/emu/cpu/i386/i386op32.c
r15233r15234
33053305            SetZF(0);
33063306            return;
33073307         }
3308         if(((seg.flags >> 5) & 3) < cpustate->CPL)
3308         if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c))
33093309         {
33103310            SetZF(0);
33113311            return;
r15233r15234
33693369            SetZF(0);
33703370            return;
33713371         }
3372         if(((seg.flags >> 5) & 3) < cpustate->CPL)
3372         if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c))
33733373         {
33743374            SetZF(0);
33753375            return;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team