Browse Source

More temporary 64 bit fixes; we can walk in town

pull/25/head
Xadhoom 7 years ago
parent
commit
15341fdae3
  1. 2
      Source/codec.cpp
  2. 14
      Source/control.cpp
  3. 4
      Source/drlg_l1.cpp
  4. 26
      Source/drlg_l2.cpp
  5. 2
      Source/effects.cpp
  6. 20
      Source/engine.cpp
  7. 2
      Source/engine.h
  8. 2
      Source/multi.cpp
  9. 2
      Source/town.cpp
  10. 2
      Source/town.h

2
Source/codec.cpp

@ -6,7 +6,7 @@ int __fastcall codec_decode(void *pbSrcDst, int size, char *pszPassword)
{
unsigned int v3; // ebx
char *v4; // esi
int v5; // ebx
INT_PTR v5; // ebx
signed int v7; // ecx
int v8; // esi
char v9[128]; // [esp+8h] [ebp-98h]

14
Source/control.cpp

@ -193,14 +193,14 @@ void __fastcall DrawSpellCel(int xp, int yp, char *Trans, int nCel, int w)
unsigned int v11; // ecx
char v14; // cf
unsigned int v15; // ecx
int v18; // [esp+Ch] [ebp-Ch]
INT_PTR v18; // [esp+Ch] [ebp-Ch]
int _EAX;
unsigned char *_EBX;
v5 = &Trans[4 * nCel];
v6 = &Trans[*(_DWORD *)v5];
v7 = (char *)gpBuffer + screen_y_times_768[yp] + xp;
v18 = (int)&v6[*((_DWORD *)v5 + 1) - *(_DWORD *)v5];
v18 = (INT_PTR)&v6[*((_DWORD *)v5 + 1) - *(_DWORD *)v5];
_EBX = splTrans;
do {
v9 = w;
@ -523,7 +523,7 @@ void __cdecl DrawSpellList()
++v4;
v26 *= (__int64)2;
v23 = v4;
} while ((signed int)v20 < (signed int)&spelldata[MAX_SPELLS].sTownSpell);
} while ((INT_PTR)v20 < (INT_PTR)&spelldata[MAX_SPELLS].sTownSpell);
if (v25 && v17 != 636)
v17 -= 56;
if (v17 == 20) {
@ -615,7 +615,7 @@ void __fastcall CPrintString(int No, unsigned int glyph, unsigned char col)
int *v3; // ebx
char *v4; // esi
char *v5; // edi
int v6; // ebx
INT_PTR v6; // ebx
signed int v7; // edx
unsigned int v8; // eax
unsigned int v9; // ecx
@ -637,7 +637,7 @@ void __fastcall CPrintString(int No, unsigned int glyph, unsigned char col)
v3 = (int *)((char *)pPanelText + 4 * glyph);
v4 = (char *)pPanelText + *v3;
v5 = (char *)gpBuffer + No;
v6 = (int)&v4[v3[1] - *v3];
v6 = (INT_PTR)&v4[v3[1] - *v3];
if ((_BYTE)col) {
if ((unsigned char)col == 1) {
do {
@ -2607,7 +2607,7 @@ void __cdecl DrawTalkPan()
LABEL_21:
a1 += 21720;
++v10;
if ((signed int)a1 >= (signed int)&plr[4]._pName)
if ((INT_PTR)a1 >= (INT_PTR)&plr[4]._pName)
return;
}
if (byte_4B894C[v10]) {
@ -2836,7 +2836,7 @@ void __cdecl control_press_enter()
break;
++v1;
++v0;
} while ((signed int)v1 < (signed int)&sgszTalkSave[8]);
} while ((INT_PTR)v1 < (INT_PTR)&sgszTalkSave[8]);
if (v0 < 8) {
v2 = sgbNextTalkSave;
v3 = (sgbNextTalkSave - 1) & 7;

4
Source/drlg_l1.cpp

@ -269,7 +269,7 @@ void __cdecl DRLG_L1Pass3()
--v3;
} while (v3);
v1 += 2;
} while ((signed int)v1 < (signed int)dPiece[2]);
} while ((INT_PTR)v1 < (INT_PTR)dPiece[2]);
v4 = 0;
v14 = &dPiece[17][16]; /* check */
do {
@ -365,7 +365,7 @@ void __cdecl DRLG_InitL1Vals()
} while (v6);
v7 = (int(*)[112])((char *)v7 + 4);
++v0;
} while ((signed int)v7 < (signed int)dPiece[1]);
} while ((INT_PTR)v7 < (INT_PTR)dPiece[1]);
}
void __fastcall LoadPreL1Dungeon(char *sFileName, int vx, int vy)

26
Source/drlg_l2.cpp

@ -375,7 +375,7 @@ void __fastcall LoadL2Dungeon(char *sFileName, int vx, int vy)
signed int v6; // eax
signed int v7; // ecx
int v8; // esi
int v9; // eax
INT_PTR v9; // eax
int v10; // ebx
int v11; // edi
char *v12; // eax
@ -420,7 +420,7 @@ void __fastcall LoadL2Dungeon(char *sFileName, int vx, int vy)
++v5;
} while (v5 < 40);
v8 = *v4;
v9 = (int)(v4 + 2);
v9 = (INT_PTR)(v4 + 2);
v10 = 0;
v11 = v4[2];
v12 = (char *)(v9 + 2);
@ -489,7 +489,7 @@ void __fastcall LoadL2Dungeon(char *sFileName, int vx, int vy)
} while (v21);
v33 = (int(*)[112])((char *)v33 + 4);
++v18;
} while ((signed int)v33 < (signed int)dPiece[1]);
} while ((INT_PTR)v33 < (INT_PTR)dPiece[1]);
v24 = 0;
v25 = dPiece;
do {
@ -511,7 +511,7 @@ void __fastcall LoadL2Dungeon(char *sFileName, int vx, int vy)
} while (v28);
v25 = (int(*)[112])((char *)v25 + 4);
++v24;
} while ((signed int)v25 < (signed int)dPiece[1]);
} while ((INT_PTR)v25 < (INT_PTR)dPiece[1]);
ViewX = v30;
ViewY = vy;
SetMapMonsters((unsigned char *)ptr, 0, 0);
@ -562,7 +562,7 @@ void __cdecl DRLG_L2Pass3()
--v3;
} while (v3);
v1 += 2;
} while ((signed int)v1 < (signed int)dPiece[2]);
} while ((INT_PTR)v1 < (INT_PTR)dPiece[2]);
v4 = 0;
v14 = &dPiece[17][16];
do {
@ -989,8 +989,8 @@ BOOLEAN __fastcall DRLG_L2PlaceMiniSet(unsigned char *miniset, int tmin, int tma
int v31; // [esp+14h] [ebp-20h]
int v32; // [esp+18h] [ebp-1Ch]
signed int v33; // [esp+1Ch] [ebp-18h]
int v34; // [esp+20h] [ebp-14h]
int v35; // [esp+24h] [ebp-10h]
INT_PTR v34; // [esp+20h] [ebp-14h]
INT_PTR v35; // [esp+24h] [ebp-10h]
int v36; // [esp+28h] [ebp-Ch]
int max; // [esp+2Ch] [ebp-8h]
//int v38; // [esp+30h] [ebp-4h]
@ -1084,7 +1084,7 @@ BOOLEAN __fastcall DRLG_L2PlaceMiniSet(unsigned char *miniset, int tmin, int tma
if (v34 > 0) {
v26 = &dungeon[v13][v24 + v14];
do {
v27 = v29[(_DWORD)miniset];
v27 = v29[(UINT_PTR)miniset];
if (v27)
*v26 = v27;
++miniset;
@ -1147,8 +1147,8 @@ void __fastcall DRLG_L2PlaceRndSet(unsigned char *miniset, int rndper)
int v27; // [esp+28h] [ebp-1Ch]
int v28; // [esp+2Ch] [ebp-18h]
int v29; // [esp+30h] [ebp-14h]
signed int v30; // [esp+34h] [ebp-10h]
signed int v31; // [esp+38h] [ebp-Ch]
INT_PTR v30; // [esp+34h] [ebp-10h]
INT_PTR v31; // [esp+38h] [ebp-Ch]
int v32; // [esp+3Ch] [ebp-8h]
signed int v33; // [esp+40h] [ebp-4h]
@ -1368,7 +1368,7 @@ void __cdecl DRLG_L2Shadows()
}
}
v1 += 7;
} while ((signed int)v1 < (signed int)&SPATSL2[2].s1);
} while ((INT_PTR)v1 < (INT_PTR)&SPATSL2[2].s1);
v0 += 40;
--v9;
} while (v9);
@ -2971,7 +2971,7 @@ void __cdecl DRLG_InitL2Vals()
} while (v4);
v1 = (int(*)[112])((char *)v1 + 4);
++v0;
} while ((signed int)v1 < (signed int)dPiece[1]);
} while ((INT_PTR)v1 < (INT_PTR)dPiece[1]);
v6 = 0;
v7 = dPiece;
do {
@ -2993,5 +2993,5 @@ void __cdecl DRLG_InitL2Vals()
} while (v10);
v7 = (int(*)[112])((char *)v7 + 4);
++v6;
} while ((signed int)v7 < (signed int)dPiece[1]);
} while ((INT_PTR)v7 < (INT_PTR)dPiece[1]);
}

2
Source/effects.cpp

@ -1159,7 +1159,7 @@ void __cdecl sound_update()
//v3 = v1;
if (sfx_stream) {
//_LOBYTE(v2) = SFileDdaGetPos(sfx_stream, (int)&v4, (int)&v3);
if (SFileDdaGetPos(sfx_stream, (int)&v4, (int)&v3)) {
if (SFileDdaGetPos(sfx_stream, (INT_PTR)&v4, (INT_PTR)&v3)) {
if (v4 >= v3)
sfx_stop();
}

20
Source/engine.cpp

@ -201,7 +201,7 @@ void __fastcall CelDecDatLightEntry(unsigned char n, char *LightIndex, char **pD
void __fastcall CelDecDatLightTrans(char *pDecodeTo, char *pRLEBytes, int frame_content_size, int frame_width)
{
char *v4; // esi
int v5; // edi
INT_PTR v5; // edi
char *v6; // ebx
int v7; // edx
unsigned int v8; // eax
@ -222,7 +222,7 @@ void __fastcall CelDecDatLightTrans(char *pDecodeTo, char *pRLEBytes, int frame_
if (pDecodeTo && pRLEBytes) {
v27 = &pLightTbl[256 * light_table_index];
v4 = pRLEBytes;
v5 = (int)pDecodeTo;
v5 = (INT_PTR)pDecodeTo;
v6 = &pRLEBytes[frame_content_size];
v28 = (unsigned char)pDecodeTo & 1;
do {
@ -987,7 +987,7 @@ void __fastcall CelDecodeRect(char *pBuff, int always_0, int dst_height, int dst
char *v7; // ebx
char *v8; // esi
char *v9; // edi
int v10; // ebx
UINT_PTR v10; // ebx
int v11; // edx
unsigned int v12; // eax
unsigned int v13; // ecx
@ -1000,7 +1000,7 @@ void __fastcall CelDecodeRect(char *pBuff, int always_0, int dst_height, int dst
v8 = &pCelBuff[*(_DWORD *)v7];
v9 = &pBuff[dst_width * dst_height + always_0];
dst_widtha = frame_width + dst_width;
v10 = (int)&v8[*((_DWORD *)v7 + 1) - *(_DWORD *)v7];
v10 = (UINT_PTR)&v8[*((_DWORD *)v7 + 1) - *(_DWORD *)v7];
do {
v11 = frame_width;
do {
@ -1670,11 +1670,11 @@ void __fastcall Cl2ApplyTrans(unsigned char *p, unsigned char *ttbl, int last_fr
}
}
void __fastcall Cl2DecodeFrm1(int x, int y, char *pCelBuff, int nCel, int width, int dir1, int dir2)
void __fastcall Cl2DecodeFrm1(int x, int y, char *pCelBuff, int nCel, int width, INT_PTR dir1, INT_PTR dir2)
{
char *v8; // edx
char *v9; // ecx
int v10; // ecx
LONG v9; // ecx
INT_PTR v10; // ecx
int v11; // eax
char *pCelBuffa; // [esp+18h] [ebp+8h]
@ -1682,12 +1682,12 @@ void __fastcall Cl2DecodeFrm1(int x, int y, char *pCelBuff, int nCel, int width,
v8 = pCelBuff;
if (pCelBuff) {
if (nCel > 0) {
v9 = *(char **)&pCelBuff[4 * nCel];
v9 = *(LONG*)&pCelBuff[4 * nCel];
pCelBuffa = v9;
v10 = (int)&v9[(_DWORD)v8];
v10 = (INT_PTR)&v8[v9];
if (*(_WORD *)(v10 + dir1)) {
if (dir2 == 8 || (v11 = *(unsigned short *)(v10 + dir2), !*(_WORD *)(v10 + dir2)))
v11 = *((_DWORD *)v8 + nCel + 1) - (_DWORD)pCelBuffa;
v11 = *((_DWORD *)v8 + nCel + 1) - (UINT_PTR)pCelBuffa;
Cl2DecDatFrm1(
(char *)gpBuffer + screen_y_times_768[y - 16 * dir1] + x,
(char *)(*(unsigned short *)(v10 + dir1) + v10),

2
Source/engine.h

@ -50,7 +50,7 @@ void __fastcall mem_free_dbg(void *p);
BYTE *__fastcall LoadFileInMem(char *pszName, int *pdwFileLen);
void __fastcall LoadFileWithMem(char *pszName, void *buf);
void __fastcall Cl2ApplyTrans(unsigned char *p, unsigned char *ttbl, int last_frame);
void __fastcall Cl2DecodeFrm1(int x, int y, char *pCelBuff, int nCel, int width, int dir1, int dir2);
void __fastcall Cl2DecodeFrm1(int x, int y, char *pCelBuff, int nCel, int width, INT_PTR dir1, INT_PTR dir2);
void __fastcall Cl2DecDatFrm1(char *buffer, char *frame_content, int a3, int width);
void __fastcall Cl2DecodeFrm2(char colour, int screen_x, int screen_y, char *pCelBuff, int nCel, int frame_width, int a7, int a8);
void __fastcall Cl2DecDatFrm2(char *buffer, char *a2, int a3, int a4, char a5);

2
Source/multi.cpp

@ -146,7 +146,7 @@ unsigned char *__fastcall multi_recv_packet(TBuffer *packet, unsigned char *a2,
v5 = (BYTE *)&v7[v6];
*a3 -= v6;
}
memcpy(v3->bData, v5, (size_t)&v3->bData[v3->dwNextWriteOffset - (_DWORD)v5 + 1]); /* memcpy_0 */
memcpy(v3->bData, v5, (size_t)&v3->bData[v3->dwNextWriteOffset - (UINT_PTR)v5 + 1]); /* memcpy_0 */
v3->dwNextWriteOffset += (char *)v3 - (char *)v5 + 4;
result = v8;
}

2
Source/town.cpp

@ -698,7 +698,7 @@ void __fastcall town_draw_town_all(BYTE *buffer, int x, int y, int a4, int dir,
// 4B8CC0: using guessed type char pcursitem;
// 4B8CC2: using guessed type char pcursplr;
void __fastcall town_draw_upper(int x, int y, int sx, int sy, int a5, int a6, int some_flag)
void __fastcall town_draw_upper(int x, int y, int sx, int sy, INT_PTR a5, int a6, int some_flag)
{
signed int v7; // ebx
int v8; // esi

2
Source/town.h

@ -12,7 +12,7 @@ void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, i
void __fastcall town_draw_lower_2(int x, int y, int sx, int sy, int a5, int a6, int some_flag);
void __fastcall town_draw_e_flag(BYTE *buffer, int x, int y, int a4, int dir, int sx, int sy);
void __fastcall town_draw_town_all(BYTE *buffer, int x, int y, int a4, int dir, int sx, int sy, int some_flag);
void __fastcall town_draw_upper(int x, int y, int sx, int sy, int a5, int a6, int some_flag);
void __fastcall town_draw_upper(int x, int y, int sx, int sy, INT_PTR a5, int a6, int some_flag);
void __fastcall T_DrawGame(int x, int y);
void __fastcall T_DrawZoom(int x, int y);
void __fastcall T_DrawView(int StartX, int StartY);

Loading…
Cancel
Save