--- src/base/async/int.c Sun Jun 15 03:01:24 2003 +++ src/base/async/int.c Mon Jul 14 21:14:22 2003 @@ -1941,6 +1941,13 @@ LWORD(esp) -= 4; } +void fake_call_to(int cs, int ip) +{ + fake_call(REG(cs), LWORD(eip)); + REG(cs) = cs; + REG(eip) = ip; +} + void fake_pusha(void) { #ifdef X86_EMULATOR --- src/dosext/dpmi/dpmi.c Sun Jun 15 19:43:23 2003 +++ src/dosext/dpmi/dpmi.c Mon Jul 14 21:15:13 2003 @@ -1581,15 +1581,6 @@ REG(ds) = rmreg->ds; REG(fs) = rmreg->fs; REG(gs) = rmreg->gs; - if (_LWORD(eax)==0x0300) { - if (_LO(bx)==0x21) - D_printf("DPMI: int 0x21 fn %04x\n",LWORD(eax)); - REG(cs) = ((us *) 0)[(_LO(bx) << 1) + 1]; - REG(eip) = ((us *) 0)[_LO(bx) << 1]; - } else { - REG(cs) = rmreg->cs; - REG(eip) = (long) rmreg->ip; - } if (!(rmreg->sp==0)) { REG(ss) = rmreg->ss; REG(esp) = (long) rmreg->sp; @@ -1606,36 +1597,29 @@ if (tmp) E_MPROT_STACK(tmp_ssp); #endif LWORD(esp) -= 2 * (_LWORD(ecx)); - if (_LWORD(eax)==0x0301) - LWORD(esp) -= 4; - else { - LWORD(esp) -= 6; -#ifdef X86_EMULATOR - tmp_ssp = rm_ssp+rm_sp; - tmp = E_MUNPROT_STACK(tmp_ssp); -#endif - pushw(rm_ssp, rm_sp, LWORD(eflags)); -#ifdef X86_EMULATOR - if (tmp) E_MPROT_STACK(tmp_ssp); -#endif - REG(eflags) &= ~(IF|TF); + in_dpmi_dos_int=1; + REG(cs) = DPMI_SEG; + LWORD(eip) = DPMI_OFF + HLT_OFF(DPMI_return_from_realmode); + switch (_LWORD(eax)) { + case 0x0300: + if (_LO(bx)==0x21) + D_printf("DPMI: int 0x21 fn %04x\n",LWORD(eax)); + do_int(_LO(bx)); + break; + case 0x0301: + fake_call_to(rmreg->cs, rmreg->ip); + break; + case 0x0302: + fake_int_to(rmreg->cs, rmreg->ip); + break; } + /* --------------------------------------------------- 0x300: RM | FC90C | | dpmi_seg | | flags | | cx words | --------------------------------------------------- */ -#ifdef X86_EMULATOR - tmp_ssp = rm_ssp+rm_sp; - tmp = E_MUNPROT_STACK(tmp_ssp); -#endif - pushw(rm_ssp, rm_sp, DPMI_SEG); - pushw(rm_ssp, rm_sp, DPMI_OFF + HLT_OFF(DPMI_return_from_realmode)); -#ifdef X86_EMULATOR - if (tmp) E_MPROT_STACK(tmp_ssp); -#endif - in_dpmi_dos_int=1; } #ifdef SHOWREGS if (debug_level('e')==0) { --- src/include/int.h Mon Jul 14 21:15:01 2003 +++ src/include/int.h Mon Jul 14 21:15:09 2003 @@ -20,6 +20,7 @@ void fake_int(int, int); void fake_int_to(int cs, int ip); void fake_call(int, int); +void fake_call_to(int cs, int ip); void fake_pusha(void); void setup_interrupts(void); void version_init(void);