Browse Source

OFSUB fix

pull/25/head
Anders Jenbo 7 years ago
parent
commit
ee014547b9
  1. 6
      Source/drlg_l3.cpp
  2. 18
      Source/lighting.cpp
  3. 16
      Source/monster.cpp
  4. 48
      Source/stores.cpp

6
Source/drlg_l3.cpp

@ -1140,7 +1140,7 @@ void __cdecl DRLG_L3River()
int v31; // ecx
int v32; // edx
BOOLEAN v33; // sf
unsigned char v34; // of
//unsigned char v34; // of
int river[3][100]; // [esp+Ch] [ebp-4E8h]
int v36; // [esp+4BCh] [ebp-38h]
int v37; // [esp+4C0h] [ebp-34h]
@ -1476,11 +1476,11 @@ void __cdecl DRLG_L3River()
if (max >= 0) {
do {
v32 = v44++;
v34 = __OFSUB__(v44, v31);
//v34 = __OFSUB__(v44, v31);
v14 = v44 == v31;
v33 = v44 - v31 < 0;
dungeon[river[0][v32]][river[1][v32]] = river[2][v32];
} while ((unsigned char)(v33 ^ v34) | v14);
} while (v33 | v14); //} while ((unsigned char)(v33 ^ v34) | v14);
}
}
}

18
Source/lighting.cpp

@ -495,7 +495,7 @@ void __fastcall DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
_BYTE *v14; // ecx
int v15; // ebx
BOOLEAN v16; // sf
unsigned char v17; // of
//unsigned char v17; // of
int v18; // esi
int v19; // ecx
char *v20; // edi
@ -606,10 +606,10 @@ void __fastcall DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
if (v9 >= 0 && v9 < 112 && v47 >= 0 && v47 < 112) {
v14 = (unsigned char *)dTransVal + v47 + v10;
v15 = (char)*v14;
v17 = __OFSUB__(v13, v15);
//v17 = __OFSUB__(v13, v15);
v16 = v13 - v15 < 0;
v5 = v52;
if (v16 ^ v17)
if (v16) // if (v16 ^ v17)
*v14 = v13;
}
}
@ -640,10 +640,10 @@ void __fastcall DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
if (v18 + v5 >= 0 && v18 + v5 < 112 && v19 >= 0 && v19 < 112) {
v23 = (unsigned char *)dTransVal + v47 + v19;
v24 = (char)*v23;
v17 = __OFSUB__(v22, v24);
//v17 = __OFSUB__(v22, v24);
v16 = v22 - v24 < 0;
v5 = v52;
if (v16 ^ v17)
if (v16) //if (v16 ^ v17)
*v23 = v22;
}
}
@ -674,10 +674,10 @@ void __fastcall DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
if (v26 >= 0 && v26 < 112 && v46 >= 0 && v46 < 112) {
v30 = (unsigned char *)dTransVal + v46 + v25;
v31 = (char)*v30;
v17 = __OFSUB__(v29, v31);
//v17 = __OFSUB__(v29, v31);
v16 = v29 - v31 < 0;
v5 = v52;
if (v16 ^ v17)
if (v16) //if (v16 ^ v17)
*v30 = v29;
}
}
@ -709,10 +709,10 @@ void __fastcall DoLighting(int nXPos, int nYPos, int nRadius, int Lnum)
if (Lnumd >= 0 && Lnumd < 112 && v33 >= 0 && v33 < 112) {
v37 = (unsigned char *)dTransVal + v33 + *(_DWORD *)s_r;
v38 = (char)*v37;
v17 = __OFSUB__(v36, v38);
//v17 = __OFSUB__(v36, v38);
v16 = v36 - v38 < 0;
v4 = v48;
if (v16 ^ v17)
if (v16) //if (v16 ^ v17)
*v37 = v36;
}
}

16
Source/monster.cpp

@ -2486,7 +2486,7 @@ void __fastcall M_TryH2HHit(int i, int pnum, int Hit, int MinDam, int MaxDam)
int v23; // eax
BOOLEAN v24; // zf
BOOLEAN v25; // sf
unsigned char v26; // of
//unsigned char v26; // of
int v27; // eax
int v29; // edi
int v30; // eax
@ -2584,11 +2584,11 @@ void __fastcall M_TryH2HHit(int i, int pnum, int Hit, int MinDam, int MaxDam)
v22 = plr[v7]._pMaxHPBase;
if (v22 > 64) {
v23 = v21 - 64;
v26 = __OFSUB__(plr[v7]._pHitPoints, v23);
//v26 = __OFSUB__(plr[v7]._pHitPoints, v23);
v24 = plr[v7]._pHitPoints == v23;
v25 = plr[v7]._pHitPoints - v23 < 0;
*v16 = v23;
if (!((unsigned char)(v25 ^ v26) | v24)) {
if (!(v25 | v24)) {//if (!((unsigned char)(v25 ^ v26) | v24)) {
plr[v7]._pHitPoints = v23;
if (v18 >= 0)
missile[v18]._miVar1 = v23;
@ -5221,7 +5221,7 @@ void __fastcall MAI_Counselor(int i)
int v10; // ecx
BOOLEAN v11; // zf
BOOLEAN v12; // sf
unsigned char v13; // of
//unsigned char v13; // of
int v14; // edx
int v15; // ecx
int v16; // ebx
@ -5267,13 +5267,13 @@ void __fastcall MAI_Counselor(int i)
v9 = monster[v2]._mgoal;
if (v9 == MGOAL_RETREAT) {
v10 = monster[v2]._mgoalvar1;
v13 = __OFSUB__(v10, 3);
//v13 = __OFSUB__(v10, 3);
v11 = v10 == 3;
v12 = v10 - 3 < 0;
v14 = v10 + 1;
v15 = v1;
monster[v2]._mgoalvar1 = v14;
if ((unsigned char)(v12 ^ v13) | v11) {
if (v12 | v11) {//if ((unsigned char)(v12 ^ v13) | v11) {
M_CallWalk(v1, opposite[md]);
goto LABEL_39;
}
@ -5341,10 +5341,10 @@ void __fastcall MAI_Counselor(int i)
} else {
v27 = md;
v28 = monster[v2]._mmaxhp >> 1;
v13 = __OFSUB__(monster[v2]._mhitpoints, v28);
//v13 = __OFSUB__(monster[v2]._mhitpoints, v28);
v12 = monster[v2]._mhitpoints - v28 < 0;
monster[v2]._mdir = md;
if (v12 ^ v13) {
if (v12) {//if (v12 ^ v13) {
_LOBYTE(monster[v2]._mgoal) = MGOAL_RETREAT;
LABEL_29:
monster[v2]._mgoalvar1 = 0;

48
Source/stores.cpp

@ -2681,7 +2681,7 @@ void __cdecl StoreSellItem()
int v2; // eax
int cost; // ebp
BOOLEAN v4; // sf
unsigned char v5; // of
//unsigned char v5; // of
unsigned int v6; // eax
int v8; // edx
int *v10; // edi
@ -2697,9 +2697,9 @@ void __cdecl StoreSellItem()
RemoveInvItem(myplr, v1);
v2 = storenumh - 1;
cost = storehold[idx]._iIvalue;
v5 = __OFSUB__(idx, storenumh - 1);
//v5 = __OFSUB__(idx, storenumh - 1);
v4 = idx - (storenumh-- - 1) < 0;
if (v4 ^ v5) {
if (v4) {//if (v4 ^ v5) {
v6 = v2 - idx;
qmemcpy(&storehidx[idx], &storehidx[idx + 1], v6);
qmemcpy(&storehold[idx], &storehold[idx + 1], 4 * (368 * v6 >> 2));
@ -2807,7 +2807,7 @@ void __cdecl S_SRepairEnter()
int v1; // edx
int v2; // ecx
BOOLEAN v3; // sf
unsigned char v4; // of
//unsigned char v4; // of
char v5; // cl
if (stextsel == 22) {
@ -2821,10 +2821,10 @@ void __cdecl S_SRepairEnter()
stextvhold = stextsval;
qmemcpy(&plr[myplr].HoldItem, &storehold[idx], sizeof(plr[myplr].HoldItem));
v2 = plr[v1]._pGold;
v4 = __OFSUB__(v2, storehold[idx]._iIvalue);
//v4 = __OFSUB__(v2, storehold[idx]._iIvalue);
v3 = v2 - storehold[idx]._iIvalue < 0;
v5 = STORE_NOMONEY;
if (!(v3 ^ v4))
if (!v3)//if (!(v3 ^ v4))
v5 = STORE_CONFIRM;
StartStore(v5);
}
@ -3005,7 +3005,7 @@ void __cdecl S_WRechargeEnter()
int v1; // edx
int v2; // ecx
BOOLEAN v3; // sf
unsigned char v4; // of
//unsigned char v4; // of
char v5; // cl
if (stextsel == 22) {
@ -3019,10 +3019,10 @@ void __cdecl S_WRechargeEnter()
stextvhold = stextsval;
qmemcpy(&plr[myplr].HoldItem, &storehold[idx], sizeof(plr[myplr].HoldItem));
v2 = plr[v1]._pGold;
v4 = __OFSUB__(v2, storehold[idx]._iIvalue);
//v4 = __OFSUB__(v2, storehold[idx]._iIvalue);
v3 = v2 - storehold[idx]._iIvalue < 0;
v5 = STORE_NOMONEY;
if (!(v3 ^ v4))
if (!v3)//if (!(v3 ^ v4))
v5 = STORE_CONFIRM;
StartStore(v5);
}
@ -3084,11 +3084,11 @@ void __cdecl HealerBuyItem()
{
int idx; // esi
BOOLEAN v1; // sf
unsigned char v2; // of
//unsigned char v2; // of
int v3; // eax
int v4; // ecx
BOOLEAN v5; // sf
unsigned char v6; // of
//unsigned char v6; // of
int v7; // eax
ItemStruct *v8; // edx
ItemStruct *v9; // edi
@ -3096,13 +3096,13 @@ void __cdecl HealerBuyItem()
idx = stextvhold + ((stextlhold - stextup) >> 2);
if (gbMaxPlayers == 1) {
v2 = __OFSUB__(idx, 2);
//v2 = __OFSUB__(idx, 2);
v1 = idx - 2 < 0;
} else {
v2 = __OFSUB__(idx, 3);
//v2 = __OFSUB__(idx, 3);
v1 = idx - 3 < 0;
}
if (v1 ^ v2) {
if (v1) {//if (v1 ^ v2) {
v3 = GetRndSeed();
v4 = myplr;
plr[myplr].HoldItem._iSeed = v3;
@ -3114,13 +3114,13 @@ void __cdecl HealerBuyItem()
plr[myplr].HoldItem._iIdentified = FALSE;
StoreAutoPlace();
if (gbMaxPlayers == 1) {
v6 = __OFSUB__(idx, 2);
//v6 = __OFSUB__(idx, 2);
v5 = idx - 2 < 0;
} else {
v6 = __OFSUB__(idx, 3);
//v6 = __OFSUB__(idx, 3);
v5 = idx - 3 < 0;
}
if (!(v5 ^ v6)) {
if (!v5) {//if (!(v5 ^ v6)) {
v7 = stextvhold + ((stextlhold - stextup) >> 2);
if (v7 == 19) {
healitem[19]._itype = -1;
@ -3408,7 +3408,7 @@ void __cdecl S_SIDEnter()
int v1; // edx
int v2; // ecx
BOOLEAN v3; // sf
unsigned char v4; // of
//unsigned char v4; // of
char v5; // cl
if (stextsel == 22) {
@ -3422,10 +3422,10 @@ void __cdecl S_SIDEnter()
stextvhold = stextsval;
qmemcpy(&plr[myplr].HoldItem, &storehold[idx], sizeof(plr[myplr].HoldItem));
v2 = plr[v1]._pGold;
v4 = __OFSUB__(v2, storehold[idx]._iIvalue);
//v4 = __OFSUB__(v2, storehold[idx]._iIvalue);
v3 = v2 - storehold[idx]._iIvalue < 0;
v5 = STORE_NOMONEY;
if (!(v3 ^ v4))
if (!v3)//if (!(v3 ^ v4))
v5 = STORE_CONFIRM;
StartStore(v5);
}
@ -3665,7 +3665,7 @@ void __cdecl STextEnter()
void __cdecl CheckStoreBtn()
{
BOOLEAN v0; // sf
unsigned char v1; // of
//unsigned char v1; // of
int v2; // eax
int *v3; // ecx
@ -3675,13 +3675,13 @@ void __cdecl CheckStoreBtn()
sfx_stop();
} else if (stextsel != -1 && MouseY >= 32 && MouseY <= 320) {
if (stextsize) {
v1 = __OFSUB__(MouseX, 24);
//v1 = __OFSUB__(MouseX, 24);
v0 = MouseX - 24 < 0;
} else {
v1 = __OFSUB__(MouseX, 344);
//v1 = __OFSUB__(MouseX, 344);
v0 = MouseX - 344 < 0;
}
if (!(v0 ^ v1) && MouseX <= 616) {
if (!v0 && MouseX <= 616) {//if (!(v0 ^ v1) && MouseX <= 616) {
v2 = (MouseY - 32) / 12;
if (stextscrl && MouseX > 600) {
if (v2 == 4) {

Loading…
Cancel
Save