mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:33:16 +00:00
[NTVDM]
- Code reorganization: Move CPU code to specific files for modularity (prepares ground for some future work). Part 2/2 (fixes build ;) ) - Improve a DPRINT. - Set reported DOS OEM number to 0xFF as NTDOS does. svn path=/trunk/; revision=64430
This commit is contained in:
parent
e9190ef591
commit
26fc5d3c9c
1 changed files with 14 additions and 11 deletions
|
@ -12,7 +12,8 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
#include "callback.h"
|
#include "cpu/cpu.h"
|
||||||
|
#include "int32.h"
|
||||||
|
|
||||||
#include "dos.h"
|
#include "dos.h"
|
||||||
#include "dos/dem.h"
|
#include "dos/dem.h"
|
||||||
|
@ -1062,8 +1063,8 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType,
|
||||||
/* Execute */
|
/* Execute */
|
||||||
CurrentPsp = Segment;
|
CurrentPsp = Segment;
|
||||||
DiskTransferArea = MAKELONG(0x80, Segment);
|
DiskTransferArea = MAKELONG(0x80, Segment);
|
||||||
EmulatorExecute(Segment + Header->e_cs + (sizeof(DOS_PSP) >> 4),
|
CpuExecute(Segment + Header->e_cs + (sizeof(DOS_PSP) >> 4),
|
||||||
Header->e_ip);
|
Header->e_ip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1121,7 +1122,7 @@ DWORD DosLoadExecutable(IN DOS_EXEC_TYPE LoadType,
|
||||||
/* Execute */
|
/* Execute */
|
||||||
CurrentPsp = Segment;
|
CurrentPsp = Segment;
|
||||||
DiskTransferArea = MAKELONG(0x80, Segment);
|
DiskTransferArea = MAKELONG(0x80, Segment);
|
||||||
EmulatorExecute(Segment, 0x100);
|
CpuExecute(Segment, 0x100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1165,7 +1166,7 @@ DWORD DosStartProcess(IN LPCSTR ExecutablePath,
|
||||||
|
|
||||||
/* Start simulation */
|
/* Start simulation */
|
||||||
SetEvent(VdmTaskEvent);
|
SetEvent(VdmTaskEvent);
|
||||||
EmulatorSimulate();
|
CpuSimulate();
|
||||||
|
|
||||||
/* Detach from the console */
|
/* Detach from the console */
|
||||||
VidBiosDetachFromConsole(); // FIXME: And in fact, detach the full NTVDM UI from the console
|
VidBiosDetachFromConsole(); // FIXME: And in fact, detach the full NTVDM UI from the console
|
||||||
|
@ -1344,7 +1345,7 @@ Done:
|
||||||
if (CurrentPsp == SYSTEM_PSP)
|
if (CurrentPsp == SYSTEM_PSP)
|
||||||
{
|
{
|
||||||
ResetEvent(VdmTaskEvent);
|
ResetEvent(VdmTaskEvent);
|
||||||
EmulatorUnsimulate();
|
CpuUnsimulate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1374,8 +1375,8 @@ Done:
|
||||||
DosErrorLevel = MAKEWORD(ReturnCode, 0x00);
|
DosErrorLevel = MAKEWORD(ReturnCode, 0x00);
|
||||||
|
|
||||||
/* Return control to the parent process */
|
/* Return control to the parent process */
|
||||||
EmulatorExecute(HIWORD(PspBlock->TerminateAddress),
|
CpuExecute(HIWORD(PspBlock->TerminateAddress),
|
||||||
LOWORD(PspBlock->TerminateAddress));
|
LOWORD(PspBlock->TerminateAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN DosHandleIoctl(BYTE ControlCode, WORD FileHandle)
|
BOOLEAN DosHandleIoctl(BYTE ControlCode, WORD FileHandle)
|
||||||
|
@ -1752,7 +1753,8 @@ VOID WINAPI DosInt21h(LPWORD Stack)
|
||||||
case 0x25:
|
case 0x25:
|
||||||
{
|
{
|
||||||
ULONG FarPointer = MAKELONG(getDX(), getDS());
|
ULONG FarPointer = MAKELONG(getDX(), getDS());
|
||||||
DPRINT1("Setting interrupt 0x%x ...\n", getAL());
|
DPRINT1("Setting interrupt 0x%02X to %04X:%04X ...\n",
|
||||||
|
getAL(), HIWORD(FarPointer), LOWORD(FarPointer));
|
||||||
|
|
||||||
/* Write the new far pointer to the IDT */
|
/* Write the new far pointer to the IDT */
|
||||||
((PULONG)BaseAddress)[getAL()] = FarPointer;
|
((PULONG)BaseAddress)[getAL()] = FarPointer;
|
||||||
|
@ -1837,8 +1839,9 @@ VOID WINAPI DosInt21h(LPWORD Stack)
|
||||||
* Return DOS OEM number:
|
* Return DOS OEM number:
|
||||||
* 0x00 for IBM PC-DOS
|
* 0x00 for IBM PC-DOS
|
||||||
* 0x02 for packaged MS-DOS
|
* 0x02 for packaged MS-DOS
|
||||||
|
* 0xFF for NT DOS
|
||||||
*/
|
*/
|
||||||
setBH(0x02);
|
setBH(0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOBYTE(PspBlock->DosVersion) >= 5 && getAL() == 0x01)
|
if (LOBYTE(PspBlock->DosVersion) >= 5 && getAL() == 0x01)
|
||||||
|
@ -2806,7 +2809,7 @@ VOID WINAPI DosBreakInterrupt(LPWORD Stack)
|
||||||
|
|
||||||
/* Stop the VDM task */
|
/* Stop the VDM task */
|
||||||
ResetEvent(VdmTaskEvent);
|
ResetEvent(VdmTaskEvent);
|
||||||
EmulatorUnsimulate();
|
CpuUnsimulate();
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WINAPI DosFastConOut(LPWORD Stack)
|
VOID WINAPI DosFastConOut(LPWORD Stack)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue