mirror of
https://github.com/reactos/reactos.git
synced 2024-08-01 09:01:13 +00:00
[SOFT386]
Implement an API for external segment modification. [NTVDM] Implement EmulatorSetRegister for NEW_EMULATOR. svn path=/branches/ntvdm/; revision=60591
This commit is contained in:
parent
e9829f1830
commit
aef0bf1635
|
@ -369,6 +369,15 @@ VOID
|
|||
NTAPI
|
||||
Soft386SetStack(PSOFT386_STATE State, USHORT Segment, ULONG Offset);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
Soft386SetSegment
|
||||
(
|
||||
PSOFT386_STATE State,
|
||||
SOFT386_SEG_REGS Segment,
|
||||
USHORT Selector
|
||||
);
|
||||
|
||||
#endif // _SOFT386_H_
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -306,5 +306,14 @@ Soft386SetStack(PSOFT386_STATE State, USHORT Segment, ULONG Offset)
|
|||
State->GeneralRegs[SOFT386_REG_ESP].Long = Offset;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
Soft386SetSegment(PSOFT386_STATE State,
|
||||
SOFT386_SEG_REGS Segment,
|
||||
USHORT Selector)
|
||||
{
|
||||
/* Call the internal function */
|
||||
Soft386LoadSegment(State, Segment, Selector);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -521,16 +521,23 @@ ULONG EmulatorGetProgramCounter(VOID)
|
|||
VOID EmulatorSetRegister(ULONG Register, ULONG Value)
|
||||
{
|
||||
#ifndef NEW_EMULATOR
|
||||
if (Register < EMULATOR_REG_CS)
|
||||
if (Register < EMULATOR_REG_ES)
|
||||
{
|
||||
EmulatorContext.state->general_reg[Register].val = Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
EmulatorContext.state->segment_reg[Register - EMULATOR_REG_ES].val = (WORD)Value;
|
||||
EmulatorContext.state->segment_reg[Register - EMULATOR_REG_ES].val = (USHORT)Value;
|
||||
}
|
||||
#else
|
||||
// TODO: NOT IMPLEMENTED
|
||||
if (Register < EMULATOR_REG_ES)
|
||||
{
|
||||
EmulatorContext.GeneralRegs[Register].Long = Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
Soft386SetSegment(&EmulatorContext, Register - EMULATOR_REG_ES, (USHORT)Value);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -596,7 +603,7 @@ VOID EmulatorStep(VOID)
|
|||
}
|
||||
#else
|
||||
/* Dump the state for debugging purposes */
|
||||
Soft386DumpState(&EmulatorContext);
|
||||
// Soft386DumpState(&EmulatorContext);
|
||||
|
||||
/* Execute the next instruction */
|
||||
Soft386StepInto(&EmulatorContext);
|
||||
|
|
Loading…
Reference in a new issue