| 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 |
| r15233 | r15234 | |
|---|---|---|
| 3507 | 3507 | SetZF(0); |
| 3508 | 3508 | return; |
| 3509 | 3509 | } |
| 3510 | if(((seg.flags >> 5) & 3) < cpustate->CPL) | |
| 3510 | if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c)) | |
| 3511 | 3511 | { |
| 3512 | 3512 | SetZF(0); |
| 3513 | 3513 | return; |
| r15233 | r15234 | |
| 3571 | 3571 | SetZF(0); |
| 3572 | 3572 | return; |
| 3573 | 3573 | } |
| 3574 | if(((seg.flags >> 5) & 3) < cpustate->CPL) | |
| 3574 | if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c)) | |
| 3575 | 3575 | { |
| 3576 | 3576 | SetZF(0); |
| 3577 | 3577 | return; |
| r15233 | r15234 | |
|---|---|---|
| 496 | 496 | if(!ret) |
| 497 | 497 | { |
| 498 | 498 | if(rwn != -1) |
| 499 | *error |= ((rwn & 1)<<1) | (use | |
| 499 | *error |= ((rwn & 1)<<1) | ((cpustate->CPL == 3)<<2); | |
| 500 | 500 | return 0; |
| 501 | 501 | } |
| 502 | 502 | return 1; |
| r15233 | r15234 | |
|---|---|---|
| 105 | 105 | // assume the selector is valid, we don't need to check it again |
| 106 | 106 | UINT32 base, addr, error; |
| 107 | 107 | UINT8 rights; |
| 108 | if(!(selector & ~3)) | |
| 109 | return; | |
| 110 | ||
| 108 | 111 | if ( selector & 0x4 ) |
| 109 | 112 | base = cpustate->ldtr.base; |
| 110 | 113 | else |
| r15233 | r15234 | |
| 717 | 720 | DPL = (desc.flags >> 5) & 0x03; // descriptor privilege level |
| 718 | 721 | // RPL = segment & 0x03; // requested privilege level |
| 719 | 722 | |
| 720 | if((segment & ~0x0 | |
| 723 | if((segment & ~0x03) == 0) | |
| 721 | 724 | { |
| 722 | 725 | logerror("IRQ: Gate segment is null.\n"); |
| 723 | 726 | FAULT_EXP(FAULT_GP,cpustate->ext) |
| r15233 | r15234 | |
| 2296 | 2299 | // 16-bit iret can't reach here |
| 2297 | 2300 | newESP = READ32(cpustate, ea+12); |
| 2298 | 2301 | 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 | ||
| 2308 | 2302 | /* Return to v86 mode */ |
| 2309 | 2303 | logerror("IRET (%08x): Returning to Virtual 8086 mode.\n",cpustate->pc); |
| 2310 | 2304 | if(CPL != 0) |
| r15233 | r15234 | |
|---|---|---|
| 3305 | 3305 | SetZF(0); |
| 3306 | 3306 | return; |
| 3307 | 3307 | } |
| 3308 | if(((seg.flags >> 5) & 3) < cpustate->CPL) | |
| 3308 | if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c)) | |
| 3309 | 3309 | { |
| 3310 | 3310 | SetZF(0); |
| 3311 | 3311 | return; |
| r15233 | r15234 | |
| 3369 | 3369 | SetZF(0); |
| 3370 | 3370 | return; |
| 3371 | 3371 | } |
| 3372 | if(((seg.flags >> 5) & 3) < cpustate->CPL) | |
| 3372 | if((((seg.flags >> 5) & 3) < cpustate->CPL) && ((seg.flags && 0x1c) != 0x1c)) | |
| 3373 | 3373 | { |
| 3374 | 3374 | SetZF(0); |
| 3375 | 3375 | return; |
| Previous | 15994 Revisions | Next |