OSDN Git Service

[VM][I386] Call PSEUDO-BIOS even VM86 mode, EMM386.EXE for FreeDOS(98) and VEM486...
authorK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 9 Apr 2019 16:26:13 +0000 (01:26 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 9 Apr 2019 16:26:13 +0000 (01:26 +0900)
Some games, i.e. Touhou-KaikiDan work now.

source/src/vm/mame/emu/cpu/i386/i386.c
source/src/vm/mame/emu/cpu/i386/i386ops.c

index b7a3c51..79ed493 100644 (file)
@@ -969,7 +969,7 @@ static void i386_trap(i386_state *cpustate,int irq, int irq_gate, int trap_level
                                }
                                /* change CPL before accessing the stack */
                                UINT32 _oldCPL = cpustate->CPL;
-                               if(_oldCPL != DPL) logerror("TRAP/INT GATE: Privilege changed from %d to %d at %08X, INT# %d, GATE %d TYPE %d\n", _oldCPL, DPL, cpustate->prev_pc, irq, irq_gate, type);
+                               //if(_oldCPL != DPL) logerror("TRAP/INT GATE: Privilege changed from %d to %d at %08X, INT# %d, GATE %d TYPE %d\n", _oldCPL, DPL, cpustate->prev_pc, irq, irq_gate, type);
                                cpustate->CPL = DPL;
                                /* check for page fault at new stack TODO: check if stack frame crosses page boundary */
                                WRITE_TEST(cpustate, stack.base+newESP-1);
@@ -1272,7 +1272,7 @@ static void i286_task_switch(i386_state *cpustate, UINT16 selector, UINT8 nested
        CHANGE_PC(cpustate,cpustate->eip);
        cpustate->CPL = (cpustate->sreg[SS].flags >> 5) & 3;
        UINT32 _newCPL = cpustate->CPL;
-       if(_oldCPL != _newCPL) logerror("I286 TASK SWITCH: Privilege changed from %d to %d at ADDR %08X to %08X\n", _oldCPL, _newCPL, _oldPC, cpustate->pc);
+       //if(_oldCPL != _newCPL) logerror("I286 TASK SWITCH: Privilege changed from %d to %d at ADDR %08X to %08X\n", _oldCPL, _newCPL, _oldPC, cpustate->pc);
        
        logerror("80286 Task Switch from selector %04x to %04x\n",old_task,selector);
 }
@@ -1397,7 +1397,7 @@ static void i386_task_switch(i386_state *cpustate, UINT16 selector, UINT8 nested
        cpustate->CPL = (cpustate->sreg[SS].flags >> 5) & 3;
        UINT32 _newCPL = cpustate->CPL;
        if(_oldCPL != _newCPL) logerror("I80386 TASK SWITCH: Privilege changed from %d to %d at ADDR %08X to %08X\n", _oldCPL, _newCPL, _oldPC, cpustate->pc);
-   printf("i386 Task Switch from selector %04x to %04x\n",old_task,selector);
+       logerrpr("i386 Task Switch from selector %04x to %04x\n",old_task,selector);
 }
 
 static void i386_check_irq_line(i386_state *cpustate)
index 2fbe98c..b6e08e1 100644 (file)
@@ -669,7 +669,7 @@ static void I386OP(mov_r32_cr)(i386_state *cpustate)        // Opcode 0x0f 20
                return;
        }
        UINT8 cr = (modrm >> 3) & 0x7;
-       logdebug("MOV r32 CR%d VAL=(%08X)\n", cr, cpustate->cr[cr], oldpc);
+       //logdebug("MOV r32 CR%d VAL=(%08X)\n", cr, cpustate->cr[cr], oldpc);
        if(cr < 5) {
                if(cr == 1) {
                        FAULT(FAULT_UD, 0);
@@ -776,7 +776,7 @@ static void I386OP(mov_cr_r32)(i386_state *cpustate)        // Opcode 0x0f 22
        UINT8 cr = (modrm >> 3) & 0x7;
        UINT32 data = LOAD_RM32(modrm);
        UINT32 data_bak;
-       logdebug("MOV CR%d r32 VAL=(%08X) at %08X\n", cr, data, oldpc);
+       //logdebug("MOV CR%d r32 VAL=(%08X) at %08X\n", cr, data, oldpc);
        switch(cr)
        {
                case 0:
@@ -892,7 +892,7 @@ static void I386OP(mov_dr_r32)(i386_state *cpustate)        // Opcode 0x0f 23
        }
        UINT8 dr = (modrm >> 3) & 0x7;
        UINT32 data =  LOAD_RM32(modrm);
-       logdebug("MOV DR%d r32 (VAL=%08X)\n", dr, data);
+       //logdebug("MOV DR%d r32 (VAL=%08X)\n", dr, data);
 
        switch(dr)
        {
@@ -914,7 +914,7 @@ static void I386OP(mov_dr_r32)(i386_state *cpustate)        // Opcode 0x0f 23
                        break;
                default:
                        cpustate->dr[dr] = data;
-                       logerror("i386: mov_dr_r32 DR%d!\n", dr);
+                       //logerror("i386: mov_dr_r32 DR%d!\n", dr);
                        return;
        }
 }
@@ -2528,7 +2528,7 @@ static void I386OP(int_16)(i386_state *cpustate)               // Opcode 0xcd
                        logerror("IRQ (%08x): Is in Virtual 8086 mode and IOPL != 3.\n",cpustate->pc);
                        FAULT(FAULT_GP,0);
                } else {
-                       //BIOS_INT(interrupt);
+                       BIOS_INT(interrupt);
                }
        } else {
                //logerror("INT %02xh @16bit mode PC=%08X\n", interrupt, cpustate->pc - 1);
@@ -2554,7 +2554,7 @@ static void I386OP(int_32)(i386_state *cpustate)               // Opcode 0xcd
                        logerror("IRQ (%08x): Is in Virtual 8086 mode and IOPL != 3.\n",cpustate->pc);
                        FAULT(FAULT_GP,0);
                } else {
-                       //BIOS_INT(interrupt);
+                       BIOS_INT(interrupt);
                }
        } else {
                //logerror("INT %02xh @32bit mode PC=%08X\n", interrupt, cpustate->pc - 1);