OSDN Git Service

[VM][DEVICE][I386] Add bios_call_far_ia32() and bios_int_ia32() because BIOS calling...
[csp-qt/common_source_project-fm7.git] / source / src / vm / mame / emu / cpu / i386 / i386ops.c
index 681437a..fa09574 100644 (file)
@@ -664,6 +664,7 @@ static void I386OP(mov_r32_cr)(i386_state *cpustate)        // Opcode 0x0f 20
        //      FAULT(FAULT_UD, 0);
        //      return;
        //}
+       UINT8 IOPL = cpustate->IOP1 | (cpustate->IOP2 << 1);
        if((PROTECTED_MODE && ((V8086_MODE) || (cpustate->CPL != 0)))) {
                logerror("Call from non-supervisor privilege: I386OP(mov_r32_cr) at %08X", oldpc); 
                FAULT(FAULT_GP, 0);
@@ -778,6 +779,7 @@ static void I386OP(mov_cr_r32)(i386_state *cpustate)        // Opcode 0x0f 22
                FAULT(FAULT_UD, 0);
                return;
        }
+       UINT8 IOPL = cpustate->IOP1 | (cpustate->IOP2 << 1);
        if(PROTECTED_MODE && ((V8086_MODE) || (cpustate->CPL != 0))) {
                logerror("Call from non-supervisor privilege: I386OP(mov_cr_r32) at %08X", oldpc); 
                FAULT(FAULT_GP, 0);
@@ -2558,22 +2560,9 @@ static void I386OP(int_16)(i386_state *cpustate)               // Opcode 0xcd
 {
        int interrupt = FETCH(cpustate);
        CYCLES(cpustate,CYCLES_INT);
-       if(V8086_MODE) {
-               //logerror("INT %02xh @V8086(16bit) mode PC=%08X\n", interrupt, cpustate->pc - 1);
-//             if((!cpustate->IOP1 || !cpustate->IOP2))
-//             {
-//                     logerror("IRQ (%08x): Is in Virtual 8086 mode and IOPL != 3.\n",cpustate->pc);
-//                     FAULT(FAULT_GP,0);
-//             } else {
-                       BIOS_INT(interrupt);
-//             }
-       } else {
-               //logerror("INT %02xh @16bit mode PC=%08X\n", interrupt, cpustate->pc - 1);
-//             UINT8 IOPL = cpustate->IOP1 | (cpustate->IOP2 << 1);
-//             if(!(PROTECTED_MODE && (cpustate->CPL > IOPL))) {
-                       BIOS_INT(interrupt);
-//             }
-       }               
+       //BIOS_INT(interrupt);
+       BIOS_INT32(interrupt);
+       
        cpustate->ext = 0; // not an external interrupt
        i386_trap(cpustate,interrupt, 1, 0);
        cpustate->ext = 1;
@@ -2584,22 +2573,7 @@ static void I386OP(int_32)(i386_state *cpustate)               // Opcode 0xcd
        int interrupt = FETCH(cpustate);
        CYCLES(cpustate,CYCLES_INT);
 #if 1
-       if(V8086_MODE) {
-               //logerror("INT %02xh @V8086(32bit) mode PC=%08X\n", interrupt, cpustate->pc - 1);
-//             if((!cpustate->IOP1 || !cpustate->IOP2))
-//             {
-//                     logerror("IRQ (%08x): Is in Virtual 8086 mode and IOPL != 3.\n",cpustate->pc);
-//                     FAULT(FAULT_GP,0);
-//             } else {
-                       BIOS_INT(interrupt);
-//             }
-       } else {
-               //logerror("INT %02xh @32bit mode PC=%08X\n", interrupt, cpustate->pc - 1);
-//             UINT8 IOPL = cpustate->IOP1 | (cpustate->IOP2 << 1);
-//             if(!(PROTECTED_MODE && (cpustate->CPL > IOPL))) {
-                       BIOS_INT(interrupt);
-//             }
-       }
+       BIOS_INT32(interrupt);
 #endif
        cpustate->ext = 0; // not an external interrupt
        i386_trap(cpustate,interrupt, 1, 0);