Far jmps/calls interrupts restart the core
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1402
This commit is contained in:
parent
43f7ba3ed9
commit
f28bdda7b1
3 changed files with 45 additions and 70 deletions
|
@ -63,13 +63,14 @@ typedef PhysPt EAPoint;
|
|||
Bit8u new_num=blah; \
|
||||
IPPoint=inst.start_entry; \
|
||||
LEAVECORE; \
|
||||
Interrupt(new_num); \
|
||||
CPU_Exception(new_num,0); \
|
||||
LoadIP(); \
|
||||
goto nextopcode; \
|
||||
}
|
||||
|
||||
Bits Full_DeCode(void) {
|
||||
FullData inst;
|
||||
restart_core:
|
||||
if (!cpu.code.big) {
|
||||
inst.start_prefix=0x0;;
|
||||
inst.start_entry=0x0;
|
||||
|
@ -83,6 +84,7 @@ Bits Full_DeCode(void) {
|
|||
while (CPU_Cycles>0) {
|
||||
#if C_DEBUG
|
||||
cycle_count++;
|
||||
CPU_Cycles--;
|
||||
#if C_HEAVY_DEBUG
|
||||
SaveIP();
|
||||
if (DEBUG_HeavyIsBreakpoint()) {
|
||||
|
@ -101,7 +103,6 @@ restartopcode:
|
|||
#include "core_full/op.h"
|
||||
#include "core_full/save.h"
|
||||
nextopcode:;
|
||||
CPU_Cycles--;
|
||||
}
|
||||
LEAVECORE;
|
||||
return CBRET_NONE;
|
||||
|
|
|
@ -273,49 +273,41 @@ l_M_Ed:
|
|||
inst.op1.d=4;
|
||||
break;
|
||||
case D_IRETw:
|
||||
lflags.type=t_UNKNOWN;
|
||||
if (!CPU_IRET(false)) return CBRET_NONE;
|
||||
LEAVECORE;
|
||||
CPU_IRET(false);
|
||||
if (GETFLAG(IF) && PIC_IRQCheck) {
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
goto restart_core;
|
||||
case D_IRETd:
|
||||
lflags.type=t_UNKNOWN;
|
||||
if (!CPU_IRET(true)) return CBRET_NONE;
|
||||
LEAVECORE;
|
||||
CPU_IRET(true);
|
||||
if (GETFLAG(IF) && PIC_IRQCheck) {
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
goto restart_core;
|
||||
case D_RETFwIw:
|
||||
if (!CPU_RET(false,Fetchw())) {
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
{
|
||||
Bitu words=Fetchw();
|
||||
LEAVECORE;
|
||||
CPU_RET(false,words);
|
||||
goto restart_core;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
case D_RETFw:
|
||||
if (!CPU_RET(false,0)) {
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
LEAVECORE;
|
||||
CPU_RET(false,0);
|
||||
goto restart_core;
|
||||
case D_RETFdIw:
|
||||
if (!CPU_RET(true,Fetchw())) {
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
{
|
||||
Bitu words=Fetchw();
|
||||
LEAVECORE;
|
||||
CPU_RET(true,words);
|
||||
goto restart_core;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
case D_RETFd:
|
||||
if (!CPU_RET(true,0)) {
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
LEAVECORE;
|
||||
CPU_RET(true,0);
|
||||
goto restart_core;
|
||||
/* Direct operations */
|
||||
case L_STRING:
|
||||
#include "string.h"
|
||||
|
@ -378,16 +370,14 @@ l_M_Ed:
|
|||
}
|
||||
goto nextopcode;
|
||||
case D_STC:
|
||||
SETFLAGBIT(CF,true);
|
||||
SetTypeCF();
|
||||
FillFlags();SETFLAGBIT(CF,true);
|
||||
goto nextopcode;
|
||||
case D_CLC:
|
||||
SETFLAGBIT(CF,false);
|
||||
SetTypeCF();
|
||||
FillFlags();SETFLAGBIT(CF,false);
|
||||
goto nextopcode;
|
||||
case D_CMC:
|
||||
SETFLAGBIT(CF,!get_CF());
|
||||
SetTypeCF();
|
||||
FillFlags();
|
||||
SETFLAGBIT(CF,!(reg_flags & FLAG_CF));
|
||||
goto nextopcode;
|
||||
case D_CLD:
|
||||
SETFLAGBIT(DF,false);
|
||||
|
|
|
@ -33,14 +33,14 @@ switch (inst.code.op) {
|
|||
lflags.type=inst.code.op;
|
||||
break;
|
||||
case t_ADCb: case t_ADCw: case t_ADCd:
|
||||
lflags.oldcf=get_CF();
|
||||
lflags.oldcf=get_CF()!=0;
|
||||
lf_var1d=inst.op1.d;
|
||||
lf_var2d=inst.op2.d;
|
||||
inst.op1.d=lf_resd=lf_var1d + lf_var2d + lflags.oldcf;
|
||||
lflags.type=inst.code.op;
|
||||
break;
|
||||
case t_SBBb: case t_SBBw: case t_SBBd:
|
||||
lflags.oldcf=get_CF();
|
||||
lflags.oldcf=get_CF()!=0;
|
||||
lf_var1d=inst.op1.d;
|
||||
lf_var2d=inst.op2.d;
|
||||
inst.op1.d=lf_resd=lf_var1d - lf_var2d - lflags.oldcf;
|
||||
|
@ -320,45 +320,29 @@ switch (inst.code.op) {
|
|||
Push_32(reg_eip);
|
||||
break;
|
||||
case O_CALLFw:
|
||||
SaveIP();
|
||||
if (!CPU_CALL(false,inst.op2.d,inst.op1.d)) {
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
LEAVECORE;
|
||||
CPU_CALL(false,inst.op2.d,inst.op1.d);
|
||||
goto restart_core;
|
||||
case O_CALLFd:
|
||||
SaveIP();
|
||||
if (!CPU_CALL(true,inst.op2.d,inst.op1.d)) {
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
LEAVECORE;
|
||||
CPU_CALL(true,inst.op2.d,inst.op1.d);
|
||||
goto restart_core;
|
||||
case O_JMPFw:
|
||||
if (!CPU_JMP(false,inst.op2.d,inst.op1.d)){
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
LEAVECORE;
|
||||
CPU_JMP(false,inst.op2.d,inst.op1.d);
|
||||
goto restart_core;
|
||||
case O_JMPFd:
|
||||
if (!CPU_JMP(true,inst.op2.d,inst.op1.d)) {
|
||||
FillFlags();
|
||||
return CBRET_NONE;
|
||||
}
|
||||
LoadIP();
|
||||
goto nextopcode;
|
||||
|
||||
LEAVECORE;
|
||||
CPU_JMP(true,inst.op2.d,inst.op1.d);
|
||||
goto restart_core;
|
||||
case O_INT:
|
||||
LEAVECORE;
|
||||
#if C_DEBUG
|
||||
if (((inst.entry & 0xFF)==0xcc) && DEBUG_Breakpoint()) return debugCallback;
|
||||
else if (DEBUG_IntBreakpoint(inst.op1.b)) return debugCallback;
|
||||
#endif
|
||||
if (!Interrupt(inst.op1.b)) return CBRET_NONE;
|
||||
LoadIP();
|
||||
break;
|
||||
Interrupt(inst.op1.b);
|
||||
goto restart_core;
|
||||
case O_INb:
|
||||
reg_al=IO_Read(inst.op1.d);
|
||||
goto nextopcode;
|
||||
|
|
Loading…
Add table
Reference in a new issue