1
0
Fork 0

Remove the FILLFLAGS define and use a function call for it.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1180
This commit is contained in:
Sjoerd van der Berg 2003-08-11 08:42:58 +00:00
parent e5137b4d74
commit 6fed40f0a8
5 changed files with 28 additions and 29 deletions

View file

@ -66,7 +66,7 @@ static INLINE void DecodeModRM(void) {
#define LEAVECORE \
SaveIP(); \
FILLFLAGS;
FillFlags();
#define EXCEPTION(blah) \
{ \

View file

@ -216,7 +216,7 @@ l_M_Ed:
inst.op1.d=reg_32(inst.code.extra);
break;
case L_FLG:
FILLFLAGS;
FillFlags();
inst.op1.d = flags.word;
break;
case L_SEG:

View file

@ -396,11 +396,11 @@ switch (inst.code.op) {
CPU_LTR(inst.op1.d);
goto nextopcode; /* Else value will saved */
case 0x04: /* VERR */
FILLFLAGS;
FillFlags();
CPU_VERR(inst.op1.d);
goto nextopcode; /* Else value will saved */
case 0x05: /* VERW */
FILLFLAGS;
FillFlags();
CPU_VERW(inst.op1.d);
goto nextopcode; /* Else value will saved */
@ -441,7 +441,7 @@ switch (inst.code.op) {
break;
}
case 6: /* LMSW */
FILLFLAGS;
FillFlags();
CPU_LMSW(inst.op1.w);
goto nextopcode;
default:
@ -456,21 +456,21 @@ switch (inst.code.op) {
break;
case O_LAR:
{
FILLFLAGS;
FillFlags();
Bitu ar;CPU_LAR(inst.op1.d,ar);
inst.op1.d=ar;
}
break;
case O_LSL:
{
FILLFLAGS;
FillFlags();
Bitu limit;CPU_LSL(inst.op1.d,limit);
inst.op1.d=limit;
}
break;
case O_ARPL:
{
FILLFLAGS;
FillFlags();
Bitu new_sel=inst.op1.d;
CPU_ARPL(new_sel,inst.op2.d);
inst.op1.d=new_sel;
@ -478,7 +478,7 @@ switch (inst.code.op) {
break;
case O_BSFw:
{
FILLFLAGS;
FillFlags();
if (!inst.op1.w) {
SETFLAGBIT(ZF,true);
} else {
@ -494,7 +494,7 @@ switch (inst.code.op) {
break;
case O_BSFd:
{
FILLFLAGS;
FillFlags();
if (!inst.op1.d) {
SETFLAGBIT(ZF,true);
} else {
@ -510,7 +510,7 @@ switch (inst.code.op) {
break;
case O_BSRw:
{
FILLFLAGS;
FillFlags();
if (!inst.op1.w) {
SETFLAGBIT(ZF,true);
} else {
@ -526,7 +526,7 @@ switch (inst.code.op) {
break;
case O_BSRd:
{
FILLFLAGS;
FillFlags();
if (!inst.op1.d) {
SETFLAGBIT(ZF,true);
} else {
@ -547,7 +547,7 @@ switch (inst.code.op) {
{
Bitu val;PhysPt read;
Bitu mask=1 << (inst.op1.d & 15);
FILLFLAGS;
FillFlags();
if (inst.rm<0xc0) {
read=inst.rm_eaa+2*(inst.op1.d / 16);
val=mem_readw(read);
@ -573,7 +573,7 @@ switch (inst.code.op) {
{
Bitu val;PhysPt read;
Bitu mask=1 << (inst.op1.d & 31);
FILLFLAGS;
FillFlags();
if (inst.rm<0xc0) {
read=inst.rm_eaa+4*(inst.op1.d / 32);
val=mem_readd(read);

View file

@ -575,9 +575,18 @@ Bitu get_PF(void) {
}
#define SET_FLAG(TYPE,TEST) if ( TEST ) new_flags|=TYPE
void FillFlags(void) {
flags.word=(flags.word & ~FLAG_MASK);
if (get_CF()) flags.word|=FLAG_CF;
if (get_PF()) flags.word|=FLAG_PF;
if (get_AF()) flags.word|=FLAG_AF;
if (get_ZF()) flags.word|=FLAG_ZF;
if (get_SF()) flags.word|=FLAG_SF;
if (get_OF()) flags.word|=FLAG_OF;
flags.type=t_UNKNOWN;
}
#if 0
#endif
Bitu get_Flags(void) {
Bitu new_flags=0;
@ -808,4 +817,4 @@ Bitu get_Flags(void) {
return 0;
}
Bit8u * blah=(Bit8u *)&get_Flags;
#endif

View file

@ -24,6 +24,8 @@ Bitu get_SF(void);
Bitu get_OF(void);
Bitu get_PF(void);
void FillFlags(void);
#define SETFLAGSb(FLAGB) \
{ \
SETFLAGBIT(OF,get_OF()); \
@ -43,18 +45,6 @@ Bitu get_PF(void);
CPU_SetFlags(FLAGD); \
}
#define FILLFLAGS \
{ \
flags.word=(flags.word & ~FLAG_MASK) | \
(get_CF() ? FLAG_CF : 0 ) | \
(get_PF() ? FLAG_PF : 0 ) | \
(get_AF() ? FLAG_AF : 0 ) | \
(get_ZF() ? FLAG_ZF : 0 ) | \
(get_SF() ? FLAG_SF : 0 ) | \
(get_OF() ? FLAG_OF : 0 ); \
flags.type=t_UNKNOWN; \
}
#define LoadCF SETFLAGBIT(CF,get_CF());
#define LoadZF SETFLAGBIT(ZF,get_ZF());
#define LoadSF SETFLAGBIT(SF,get_SF());