Skip to content

Commit

Permalink
Merge branch 'upstream' into vt
Browse files Browse the repository at this point in the history
  • Loading branch information
cracyc committed Jan 21, 2025
2 parents a2588f2 + 9e61eb4 commit 68b2cb4
Show file tree
Hide file tree
Showing 16 changed files with 1,553 additions and 236 deletions.
15 changes: 1 addition & 14 deletions mame/emu/cpu/i386/i386op16.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,21 +805,8 @@ static void I386OP(iret16)() // Opcode 0xcf

// Emulate system call on MS-DOS Player
if(IRET_TOP <= old && old < (IRET_TOP + IRET_SIZE)) {
#ifdef USE_DEBUGGER
// Disallow reentering CPU_EXECUTE() in msdos_syscall()
msdos_int_num = (old - IRET_TOP);
#else
// Call msdos_syscall() here for better processing speed
if(m_lock)
m_lock = false;
#ifdef SUPPORT_RDTSC
m_tsc += (m_base_cycles - m_cycles);
#endif
msdos_syscall(old - IRET_TOP);
#ifdef SUPPORT_RDTSC
m_cycles = m_base_cycles = 1;
#endif
#endif
msdos_stat |= REQ_SYSCALL;
}
}

Expand Down
15 changes: 1 addition & 14 deletions mame/emu/cpu/i386/i386op32.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,21 +773,8 @@ static void I386OP(iret32)() // Opcode 0xcf

// Emulate system call on MS-DOS Player
if(IRET_TOP <= old && old < (IRET_TOP + IRET_SIZE)) {
#ifdef USE_DEBUGGER
// Disallow reentering CPU_EXECUTE() in msdos_syscall()
msdos_int_num = (old - IRET_TOP);
#else
// Call msdos_syscall() here for better processing speed
if(m_lock)
m_lock = false;
#ifdef SUPPORT_RDTSC
m_tsc += (m_base_cycles - m_cycles);
#endif
msdos_syscall(old - IRET_TOP);
#ifdef SUPPORT_RDTSC
m_cycles = m_base_cycles = 1;
#endif
#endif
msdos_stat |= REQ_SYSCALL;
}
}

Expand Down
2 changes: 1 addition & 1 deletion mame/emu/cpu/i386/i386ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2374,7 +2374,7 @@ static void I386OP(hlt)() // Opcode 0xf4
// Exit MS-DOS Player
if(m_pc == 0xffff1) {
// The first process is terminated and jump to FFFF:0000 HALT
msdos_exit = 1;
msdos_stat |= REQ_EXIT;
}
}

Expand Down
7 changes: 1 addition & 6 deletions mame/emu/cpu/i86/instr286.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,13 +853,8 @@ static void PREFIX286(_iret)()

// Emulate system call on MS-DOS Player
if(IRET_TOP <= old && old < (IRET_TOP + IRET_SIZE)) {
#ifdef USE_DEBUGGER
// Disallow reentering CPU_EXECUTE() in msdos_syscall()
msdos_int_num = (old - IRET_TOP);
#else
// Call msdos_syscall() here for better processing speed
msdos_syscall(old - IRET_TOP);
#endif
msdos_stat |= REQ_SYSCALL;
}
}

Expand Down
9 changes: 2 additions & 7 deletions mame/emu/cpu/i86/instr86.c
Original file line number Diff line number Diff line change
Expand Up @@ -2175,13 +2175,8 @@ static void PREFIX86(_iret)() /* Opcode 0xcf */

// Emulate system call on MS-DOS Player
if(IRET_TOP <= old && old < (IRET_TOP + IRET_SIZE)) {
#ifdef USE_DEBUGGER
// Disallow reentering CPU_EXECUTE() in msdos_syscall()
msdos_int_num = (old - IRET_TOP);
#else
// Call msdos_syscall() here for better processing speed
msdos_syscall(old - IRET_TOP);
#endif
msdos_stat |= REQ_SYSCALL;
}
}
#endif
Expand Down Expand Up @@ -2590,7 +2585,7 @@ static void PREFIX86(_hlt)() /* Opcode 0xf4 */
// Exit MS-DOS Player
if(m_pc == 0xffff1) {
// The first process is terminated and jump to FFFF:0000 HALT
msdos_exit = 1;
msdos_stat |= REQ_EXIT;
}
}

Expand Down
27 changes: 27 additions & 0 deletions mame_i386.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,33 @@ inline void CPU_SET_EIP(UINT32 value)
#define CPU_D_FLAG (m_DF != 0)
#define CPU_O_FLAG (m_OF != 0)

#if defined(SUPPORT_FPU)
#define FPU_CTRLWORD m_x87_cw
#define FPU_STATUSWORD m_x87_sw
#define FPU_TAGWORD m_x87_tw
#define FPU_INSTPTR_OFFSET m_x87_inst_ptr
#define FPU_INSTPTR_SEG m_x87_cs
#define FPU_DATAPTR_OFFSET m_x87_data_ptr
#define FPU_DATAPTR_SEG m_x87_ds

UINT8 FPU_REG(int n, int i)
{
switch(i) {
case 0: return (m_x87_reg[n].low >> 0) & 0xff;
case 1: return (m_x87_reg[n].low >> 8) & 0xff;
case 2: return (m_x87_reg[n].low >> 16) & 0xff;
case 3: return (m_x87_reg[n].low >> 24) & 0xff;
case 4: return (m_x87_reg[n].low >> 32) & 0xff;
case 5: return (m_x87_reg[n].low >> 40) & 0xff;
case 6: return (m_x87_reg[n].low >> 48) & 0xff;
case 7: return (m_x87_reg[n].low >> 56) & 0xff;
case 8: return (m_x87_reg[n].high >> 0) & 0xff;
case 9: return (m_x87_reg[n].high >> 8) & 0xff;
}
return 0;
}
#endif

inline void CPU_SET_C_FLAG(UINT8 value)
{
m_CF = value;
Expand Down
Loading

0 comments on commit 68b2cb4

Please sign in to comment.