i386: Trap flag support [Carl]

This commit is contained in:
mahlemiut 2012-02-08 21:26:25 +00:00
parent 345d5bc6a1
commit ff2e20a96b
2 changed files with 9 additions and 0 deletions

View File

@ -3099,6 +3099,7 @@ static CPU_EXECUTE( i386 )
cpustate->address_prefix = 0;
cpustate->ext = 1;
cpustate->old_tf = cpustate->TF;
cpustate->segment_prefix = 0;
cpustate->prev_eip = cpustate->eip;
@ -3113,6 +3114,13 @@ static CPU_EXECUTE( i386 )
try
{
I386OP(decode_opcode)(cpustate);
if(cpustate->TF && cpustate->old_tf)
{
cpustate->prev_eip = cpustate->eip;
cpustate->ext = 0;
i386_trap(cpustate,1,0,0);
}
}
catch(UINT64 e)
{

View File

@ -240,6 +240,7 @@ struct _i386_state
UINT8 performed_intersegment_jump;
UINT8 delayed_interrupt_enable;
UINT8 old_tf;
UINT32 cr[5]; // Control registers
UINT32 dr[8]; // Debug registers