Browse Source

Remove delta to devilution

pull/25/head
Anders Jenbo 7 years ago
parent
commit
1e4e826a36
  1. 826
      Source/appfat.cpp
  2. 12
      Source/codec.cpp
  3. 2
      Source/debug.cpp
  4. 2
      Source/diablo.cpp
  5. 2
      Source/drlg_l1.cpp
  6. 2
      Source/drlg_l2.cpp
  7. 2
      Source/drlg_l4.cpp
  8. 4
      Source/effects.cpp
  9. 12
      Source/engine.cpp
  10. 2
      Source/gendung.cpp
  11. 1
      Source/init.h
  12. 2
      Source/interfac.cpp
  13. 2
      Source/lighting.cpp
  14. 2
      Source/mainmenu.cpp
  15. 12
      Source/nthread.cpp
  16. 2
      Source/path.cpp
  17. 15
      Source/pfile.cpp
  18. 6
      Source/pfile.h
  19. 2
      Source/portal.cpp
  20. 2
      Source/render.cpp
  21. 2
      Source/sha.cpp
  22. 2
      Source/sync.cpp
  23. 2
      Source/towners.cpp
  24. 2
      Source/trigs.cpp
  25. 3
      Stub/diablo.cpp
  26. 2
      Stub/diabloui.cpp
  27. 5
      Stub/miniwin_msg_sdl.cpp
  28. 1
      Stub/sdlrender.cpp
  29. 1
      Stub/sdlrender.h

826
Source/appfat.cpp

@ -1,413 +1,413 @@
//HEADER_GOES_HERE //HEADER_GOES_HERE
#include "../types.h" #include "../types.h"
char sz_error_buf[256]; char sz_error_buf[256];
int terminating; // weak int terminating; // weak
int cleanup_thread_id; // weak int cleanup_thread_id; // weak
// delete overloads the delete operator. // delete overloads the delete operator.
//void operator delete(void *ptr) //void operator delete(void *ptr)
//{ //{
// if (ptr != NULL) { // if (ptr != NULL) {
// SMemFree(ptr, "delete", -1, 0); // SMemFree(ptr, "delete", -1, 0);
// } // }
//} //}
char *__fastcall GetErrorStr(int error_code) char *__fastcall GetErrorStr(int error_code)
{ {
int v1; // edi int v1; // edi
unsigned int v2; // eax unsigned int v2; // eax
signed int v4; // eax signed int v4; // eax
char *i; // ecx char *i; // ecx
v1 = error_code; v1 = error_code;
v2 = ((unsigned int)error_code >> 16) & 0x1FFF; v2 = ((unsigned int)error_code >> 16) & 0x1FFF;
if (v2 == 0x0878) { if (v2 == 0x0878) {
TraceErrorDS(error_code, sz_error_buf, 256); TraceErrorDS(error_code, sz_error_buf, 256);
} else if (v2 == 0x0876) { } else if (v2 == 0x0876) {
TraceErrorDD(error_code, sz_error_buf, 256); TraceErrorDD(error_code, sz_error_buf, 256);
} else { } else {
if (!SErrGetErrorStr(error_code, sz_error_buf, 256) && !FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, v1, 0x400u, sz_error_buf, 0x100u, NULL)) if (!SErrGetErrorStr(error_code, sz_error_buf, 256) && !FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, v1, 0x400u, sz_error_buf, 0x100u, NULL))
wsprintf(sz_error_buf, "unknown error 0x%08x", v1); wsprintf(sz_error_buf, "unknown error 0x%08x", v1);
} }
v4 = strlen(sz_error_buf); v4 = strlen(sz_error_buf);
for (i = &sz_error_buf[v4 - 1]; v4 > 0; *i = 0) { for (i = &sz_error_buf[v4 - 1]; v4 > 0; *i = 0) {
--v4; --v4;
--i; --i;
if (*i != '\r' && *i != '\n') if (*i != '\r' && *i != '\n')
break; break;
} }
return sz_error_buf; return sz_error_buf;
} }
#define CASE_ERROR(v, errName) \ #define CASE_ERROR(v, errName) \
case errName: \ case errName: \
v = #errName; \ v = #errName; \
break; break;
void __fastcall TraceErrorDD(int error_code, char *error_buf, int error_buf_len) void __fastcall TraceErrorDD(int error_code, char *error_buf, int error_buf_len)
{ {
const char *v3; // eax const char *v3; // eax
char v4[20]; // [esp+0h] [ebp-14h] char v4[20]; // [esp+0h] [ebp-14h]
switch (error_code) { switch (error_code) {
CASE_ERROR(v3, DDERR_CANTPAGEUNLOCK); CASE_ERROR(v3, DDERR_CANTPAGEUNLOCK);
CASE_ERROR(v3, DDERR_NOTPAGELOCKED); CASE_ERROR(v3, DDERR_NOTPAGELOCKED);
CASE_ERROR(v3, DD_OK); CASE_ERROR(v3, DD_OK);
CASE_ERROR(v3, DDERR_CANTPAGELOCK); CASE_ERROR(v3, DDERR_CANTPAGELOCK);
CASE_ERROR(v3, DDERR_BLTFASTCANTCLIP); CASE_ERROR(v3, DDERR_BLTFASTCANTCLIP);
CASE_ERROR(v3, DDERR_NOBLTHW); CASE_ERROR(v3, DDERR_NOBLTHW);
CASE_ERROR(v3, DDERR_NODDROPSHW); CASE_ERROR(v3, DDERR_NODDROPSHW);
CASE_ERROR(v3, DDERR_OVERLAYNOTVISIBLE); CASE_ERROR(v3, DDERR_OVERLAYNOTVISIBLE);
CASE_ERROR(v3, DDERR_NOOVERLAYDEST); CASE_ERROR(v3, DDERR_NOOVERLAYDEST);
CASE_ERROR(v3, DDERR_INVALIDPOSITION); CASE_ERROR(v3, DDERR_INVALIDPOSITION);
CASE_ERROR(v3, DDERR_NOTAOVERLAYSURFACE); CASE_ERROR(v3, DDERR_NOTAOVERLAYSURFACE);
CASE_ERROR(v3, DDERR_EXCLUSIVEMODEALREADYSET); CASE_ERROR(v3, DDERR_EXCLUSIVEMODEALREADYSET);
CASE_ERROR(v3, DDERR_NOTFLIPPABLE); CASE_ERROR(v3, DDERR_NOTFLIPPABLE);
CASE_ERROR(v3, DDERR_CANTDUPLICATE); CASE_ERROR(v3, DDERR_CANTDUPLICATE);
CASE_ERROR(v3, DDERR_NOTLOCKED); CASE_ERROR(v3, DDERR_NOTLOCKED);
CASE_ERROR(v3, DDERR_CANTCREATEDC); CASE_ERROR(v3, DDERR_CANTCREATEDC);
CASE_ERROR(v3, DDERR_NODC); CASE_ERROR(v3, DDERR_NODC);
CASE_ERROR(v3, DDERR_WRONGMODE); CASE_ERROR(v3, DDERR_WRONGMODE);
CASE_ERROR(v3, DDERR_IMPLICITLYCREATED); CASE_ERROR(v3, DDERR_IMPLICITLYCREATED);
CASE_ERROR(v3, DDERR_NOTPALETTIZED); CASE_ERROR(v3, DDERR_NOTPALETTIZED);
CASE_ERROR(v3, DDERR_NOMIPMAPHW); CASE_ERROR(v3, DDERR_NOMIPMAPHW);
CASE_ERROR(v3, DDERR_INVALIDSURFACETYPE); CASE_ERROR(v3, DDERR_INVALIDSURFACETYPE);
CASE_ERROR(v3, DDERR_DCALREADYCREATED); CASE_ERROR(v3, DDERR_DCALREADYCREATED);
CASE_ERROR(v3, DDERR_NOPALETTEHW); CASE_ERROR(v3, DDERR_NOPALETTEHW);
CASE_ERROR(v3, DDERR_DIRECTDRAWALREADYCREATED); CASE_ERROR(v3, DDERR_DIRECTDRAWALREADYCREATED);
CASE_ERROR(v3, DDERR_NODIRECTDRAWHW); CASE_ERROR(v3, DDERR_NODIRECTDRAWHW);
CASE_ERROR(v3, DDERR_PRIMARYSURFACEALREADYEXISTS); CASE_ERROR(v3, DDERR_PRIMARYSURFACEALREADYEXISTS);
CASE_ERROR(v3, DDERR_NOEMULATION); CASE_ERROR(v3, DDERR_NOEMULATION);
CASE_ERROR(v3, DDERR_REGIONTOOSMALL); CASE_ERROR(v3, DDERR_REGIONTOOSMALL);
CASE_ERROR(v3, DDERR_CLIPPERISUSINGHWND); CASE_ERROR(v3, DDERR_CLIPPERISUSINGHWND);
CASE_ERROR(v3, DDERR_NOCLIPPERATTACHED); CASE_ERROR(v3, DDERR_NOCLIPPERATTACHED);
CASE_ERROR(v3, DDERR_NOHWND); CASE_ERROR(v3, DDERR_NOHWND);
CASE_ERROR(v3, DDERR_HWNDSUBCLASSED); CASE_ERROR(v3, DDERR_HWNDSUBCLASSED);
CASE_ERROR(v3, DDERR_HWNDALREADYSET); CASE_ERROR(v3, DDERR_HWNDALREADYSET);
CASE_ERROR(v3, DDERR_NOPALETTEATTACHED); CASE_ERROR(v3, DDERR_NOPALETTEATTACHED);
CASE_ERROR(v3, DDERR_INVALIDDIRECTDRAWGUID); CASE_ERROR(v3, DDERR_INVALIDDIRECTDRAWGUID);
CASE_ERROR(v3, DDERR_UNSUPPORTEDFORMAT); CASE_ERROR(v3, DDERR_UNSUPPORTEDFORMAT);
CASE_ERROR(v3, DDERR_UNSUPPORTEDMASK); CASE_ERROR(v3, DDERR_UNSUPPORTEDMASK);
CASE_ERROR(v3, DDERR_VERTICALBLANKINPROGRESS); CASE_ERROR(v3, DDERR_VERTICALBLANKINPROGRESS);
CASE_ERROR(v3, DDERR_WASSTILLDRAWING); CASE_ERROR(v3, DDERR_WASSTILLDRAWING);
CASE_ERROR(v3, DDERR_XALIGN); CASE_ERROR(v3, DDERR_XALIGN);
CASE_ERROR(v3, DDERR_TOOBIGWIDTH); CASE_ERROR(v3, DDERR_TOOBIGWIDTH);
CASE_ERROR(v3, DDERR_CANTLOCKSURFACE); CASE_ERROR(v3, DDERR_CANTLOCKSURFACE);
CASE_ERROR(v3, DDERR_SURFACEISOBSCURED); CASE_ERROR(v3, DDERR_SURFACEISOBSCURED);
CASE_ERROR(v3, DDERR_SURFACELOST); CASE_ERROR(v3, DDERR_SURFACELOST);
CASE_ERROR(v3, DDERR_SURFACENOTATTACHED); CASE_ERROR(v3, DDERR_SURFACENOTATTACHED);
CASE_ERROR(v3, DDERR_TOOBIGHEIGHT); CASE_ERROR(v3, DDERR_TOOBIGHEIGHT);
CASE_ERROR(v3, DDERR_TOOBIGSIZE); CASE_ERROR(v3, DDERR_TOOBIGSIZE);
CASE_ERROR(v3, DDERR_SURFACEBUSY); CASE_ERROR(v3, DDERR_SURFACEBUSY);
CASE_ERROR(v3, DDERR_OVERLAYCOLORKEYONLYONEACTIVE); CASE_ERROR(v3, DDERR_OVERLAYCOLORKEYONLYONEACTIVE);
CASE_ERROR(v3, DDERR_PALETTEBUSY); CASE_ERROR(v3, DDERR_PALETTEBUSY);
CASE_ERROR(v3, DDERR_COLORKEYNOTSET); CASE_ERROR(v3, DDERR_COLORKEYNOTSET);
CASE_ERROR(v3, DDERR_SURFACEALREADYATTACHED); CASE_ERROR(v3, DDERR_SURFACEALREADYATTACHED);
CASE_ERROR(v3, DDERR_SURFACEALREADYDEPENDENT); CASE_ERROR(v3, DDERR_SURFACEALREADYDEPENDENT);
CASE_ERROR(v3, DDERR_OVERLAYCANTCLIP); CASE_ERROR(v3, DDERR_OVERLAYCANTCLIP);
CASE_ERROR(v3, DDERR_NOVSYNCHW); CASE_ERROR(v3, DDERR_NOVSYNCHW);
CASE_ERROR(v3, DDERR_NOZBUFFERHW); CASE_ERROR(v3, DDERR_NOZBUFFERHW);
CASE_ERROR(v3, DDERR_NOZOVERLAYHW); CASE_ERROR(v3, DDERR_NOZOVERLAYHW);
CASE_ERROR(v3, DDERR_OUTOFCAPS); CASE_ERROR(v3, DDERR_OUTOFCAPS);
CASE_ERROR(v3, DDERR_OUTOFVIDEOMEMORY); CASE_ERROR(v3, DDERR_OUTOFVIDEOMEMORY);
CASE_ERROR(v3, DDERR_NOTEXTUREHW); CASE_ERROR(v3, DDERR_NOTEXTUREHW);
CASE_ERROR(v3, DDERR_NOROTATIONHW); CASE_ERROR(v3, DDERR_NOROTATIONHW);
CASE_ERROR(v3, DDERR_NOSTRETCHHW); CASE_ERROR(v3, DDERR_NOSTRETCHHW);
CASE_ERROR(v3, DDERR_NOT4BITCOLOR); CASE_ERROR(v3, DDERR_NOT4BITCOLOR);
CASE_ERROR(v3, DDERR_NOT4BITCOLORINDEX); CASE_ERROR(v3, DDERR_NOT4BITCOLORINDEX);
CASE_ERROR(v3, DDERR_NOT8BITCOLOR); CASE_ERROR(v3, DDERR_NOT8BITCOLOR);
CASE_ERROR(v3, DDERR_NORASTEROPHW); CASE_ERROR(v3, DDERR_NORASTEROPHW);
CASE_ERROR(v3, DDERR_NOEXCLUSIVEMODE); CASE_ERROR(v3, DDERR_NOEXCLUSIVEMODE);
CASE_ERROR(v3, DDERR_NOFLIPHW); CASE_ERROR(v3, DDERR_NOFLIPHW);
CASE_ERROR(v3, DDERR_NOGDI); CASE_ERROR(v3, DDERR_NOGDI);
CASE_ERROR(v3, DDERR_NOMIRRORHW); CASE_ERROR(v3, DDERR_NOMIRRORHW);
CASE_ERROR(v3, DDERR_NOTFOUND); CASE_ERROR(v3, DDERR_NOTFOUND);
CASE_ERROR(v3, DDERR_NOOVERLAYHW); CASE_ERROR(v3, DDERR_NOOVERLAYHW);
CASE_ERROR(v3, DDERR_NOCOLORKEYHW); CASE_ERROR(v3, DDERR_NOCOLORKEYHW);
CASE_ERROR(v3, DDERR_NOALPHAHW); CASE_ERROR(v3, DDERR_NOALPHAHW);
CASE_ERROR(v3, DDERR_NOCLIPLIST); CASE_ERROR(v3, DDERR_NOCLIPLIST);
CASE_ERROR(v3, DDERR_NOCOLORCONVHW); CASE_ERROR(v3, DDERR_NOCOLORCONVHW);
CASE_ERROR(v3, DDERR_NOCOOPERATIVELEVELSET); CASE_ERROR(v3, DDERR_NOCOOPERATIVELEVELSET);
CASE_ERROR(v3, DDERR_NOCOLORKEY); CASE_ERROR(v3, DDERR_NOCOLORKEY);
CASE_ERROR(v3, DDERR_NO3D); CASE_ERROR(v3, DDERR_NO3D);
CASE_ERROR(v3, DDERR_INVALIDMODE); CASE_ERROR(v3, DDERR_INVALIDMODE);
CASE_ERROR(v3, DDERR_INVALIDOBJECT); CASE_ERROR(v3, DDERR_INVALIDOBJECT);
CASE_ERROR(v3, DDERR_INVALIDPIXELFORMAT); CASE_ERROR(v3, DDERR_INVALIDPIXELFORMAT);
CASE_ERROR(v3, DDERR_INVALIDRECT); CASE_ERROR(v3, DDERR_INVALIDRECT);
CASE_ERROR(v3, DDERR_LOCKEDSURFACES); CASE_ERROR(v3, DDERR_LOCKEDSURFACES);
CASE_ERROR(v3, DDERR_INVALIDCLIPLIST); CASE_ERROR(v3, DDERR_INVALIDCLIPLIST);
CASE_ERROR(v3, DDERR_CURRENTLYNOTAVAIL); CASE_ERROR(v3, DDERR_CURRENTLYNOTAVAIL);
CASE_ERROR(v3, DDERR_EXCEPTION); CASE_ERROR(v3, DDERR_EXCEPTION);
CASE_ERROR(v3, DDERR_HEIGHTALIGN); CASE_ERROR(v3, DDERR_HEIGHTALIGN);
CASE_ERROR(v3, DDERR_INCOMPATIBLEPRIMARY); CASE_ERROR(v3, DDERR_INCOMPATIBLEPRIMARY);
CASE_ERROR(v3, DDERR_INVALIDCAPS); CASE_ERROR(v3, DDERR_INVALIDCAPS);
CASE_ERROR(v3, DDERR_CANNOTDETACHSURFACE); CASE_ERROR(v3, DDERR_CANNOTDETACHSURFACE);
CASE_ERROR(v3, DDERR_UNSUPPORTED); CASE_ERROR(v3, DDERR_UNSUPPORTED);
CASE_ERROR(v3, DDERR_GENERIC); CASE_ERROR(v3, DDERR_GENERIC);
CASE_ERROR(v3, DDERR_OUTOFMEMORY); CASE_ERROR(v3, DDERR_OUTOFMEMORY);
CASE_ERROR(v3, DDERR_INVALIDPARAMS); CASE_ERROR(v3, DDERR_INVALIDPARAMS);
CASE_ERROR(v3, DDERR_ALREADYINITIALIZED); CASE_ERROR(v3, DDERR_ALREADYINITIALIZED);
CASE_ERROR(v3, DDERR_CANNOTATTACHSURFACE); CASE_ERROR(v3, DDERR_CANNOTATTACHSURFACE);
default: default:
strcpy(v4, "DDERR unknown 0x%x"); strcpy(v4, "DDERR unknown 0x%x");
sprintf(error_buf, v4, error_code); sprintf(error_buf, v4, error_code);
return; return;
} }
strncpy(error_buf, v3, error_buf_len); strncpy(error_buf, v3, error_buf_len);
} }
void __fastcall TraceErrorDS(int error_code, char *error_buf, int error_buf_len) void __fastcall TraceErrorDS(int error_code, char *error_buf, int error_buf_len)
{ {
const char *v3; // eax const char *v3; // eax
char v4[20]; // [esp+0h] [ebp-14h] char v4[20]; // [esp+0h] [ebp-14h]
switch (error_code) { switch (error_code) {
CASE_ERROR(v3, DSERR_PRIOLEVELNEEDED); CASE_ERROR(v3, DSERR_PRIOLEVELNEEDED);
CASE_ERROR(v3, DSERR_BADFORMAT); CASE_ERROR(v3, DSERR_BADFORMAT);
CASE_ERROR(v3, DSERR_NODRIVER); CASE_ERROR(v3, DSERR_NODRIVER);
CASE_ERROR(v3, DSERR_ALREADYINITIALIZED); CASE_ERROR(v3, DSERR_ALREADYINITIALIZED);
CASE_ERROR(v3, DSERR_BUFFERLOST); CASE_ERROR(v3, DSERR_BUFFERLOST);
CASE_ERROR(v3, DS_OK); CASE_ERROR(v3, DS_OK);
CASE_ERROR(v3, DSERR_INVALIDCALL); CASE_ERROR(v3, DSERR_INVALIDCALL);
CASE_ERROR(v3, E_NOINTERFACE); CASE_ERROR(v3, E_NOINTERFACE);
CASE_ERROR(v3, DSERR_NOAGGREGATION); CASE_ERROR(v3, DSERR_NOAGGREGATION);
CASE_ERROR(v3, DSERR_OUTOFMEMORY); CASE_ERROR(v3, DSERR_OUTOFMEMORY);
CASE_ERROR(v3, DSERR_INVALIDPARAM); CASE_ERROR(v3, DSERR_INVALIDPARAM);
CASE_ERROR(v3, DSERR_ALLOCATED); CASE_ERROR(v3, DSERR_ALLOCATED);
CASE_ERROR(v3, DSERR_CONTROLUNAVAIL); CASE_ERROR(v3, DSERR_CONTROLUNAVAIL);
default: default:
strcpy(v4, "DSERR unknown 0x%x"); strcpy(v4, "DSERR unknown 0x%x");
sprintf(error_buf, v4, error_code); sprintf(error_buf, v4, error_code);
return; return;
} }
strncpy(error_buf, v3, error_buf_len); strncpy(error_buf, v3, error_buf_len);
} }
char *__cdecl TraceLastError() char *__cdecl TraceLastError()
{ {
int v0; // eax int v0; // eax
v0 = GetLastError(); v0 = GetLastError();
return GetErrorStr(v0); return GetErrorStr(v0);
} }
void TermMsg(char *pszFmt, ...) void TermMsg(char *pszFmt, ...)
{ {
va_list arglist; // [esp+8h] [ebp+8h] va_list arglist; // [esp+8h] [ebp+8h]
va_start(arglist, pszFmt); va_start(arglist, pszFmt);
FreeDlg(); FreeDlg();
if (pszFmt) if (pszFmt)
MsgBox(pszFmt, arglist); MsgBox(pszFmt, arglist);
va_end(arglist); va_end(arglist);
init_cleanup(0); init_cleanup(0);
exit(1); exit(1);
} }
void __fastcall MsgBox(char *pszFmt, va_list va) void __fastcall MsgBox(char *pszFmt, va_list va)
{ {
char Text[256]; // [esp+0h] [ebp-100h] char Text[256]; // [esp+0h] [ebp-100h]
wvsprintf(Text, pszFmt, va); wvsprintf(Text, pszFmt, va);
if (ghMainWnd) if (ghMainWnd)
SetWindowPos(ghMainWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); SetWindowPos(ghMainWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
MessageBox(ghMainWnd, Text, "ERROR", MB_TASKMODAL | MB_ICONHAND); MessageBox(ghMainWnd, Text, "ERROR", MB_TASKMODAL | MB_ICONHAND);
} }
void __cdecl FreeDlg() void __cdecl FreeDlg()
{ {
if (terminating && cleanup_thread_id != GetCurrentThreadId()) if (terminating && cleanup_thread_id != GetCurrentThreadId())
Sleep(20000u); Sleep(20000u);
terminating = 1; terminating = 1;
cleanup_thread_id = GetCurrentThreadId(); cleanup_thread_id = GetCurrentThreadId();
dx_cleanup(); dx_cleanup();
if ((unsigned char)gbMaxPlayers > 1u) { if ((unsigned char)gbMaxPlayers > 1u) {
if (SNetLeaveGame(3)) if (SNetLeaveGame(3))
Sleep(2000u); Sleep(2000u);
} }
SNetDestroy(); SNetDestroy();
ShowCursor(1); ShowCursor(1);
} }
// 4B7A34: using guessed type int terminating; // 4B7A34: using guessed type int terminating;
// 4B7A38: using guessed type int cleanup_thread_id; // 4B7A38: using guessed type int cleanup_thread_id;
// 679660: using guessed type char gbMaxPlayers; // 679660: using guessed type char gbMaxPlayers;
void DrawDlg(char *pszFmt, ...) void DrawDlg(char *pszFmt, ...)
{ {
char text[256]; // [esp+0h] [ebp-100h] char text[256]; // [esp+0h] [ebp-100h]
va_list arglist; // [esp+10Ch] [ebp+Ch] va_list arglist; // [esp+10Ch] [ebp+Ch]
va_start(arglist, pszFmt); va_start(arglist, pszFmt);
wvsprintf(text, pszFmt, arglist); wvsprintf(text, pszFmt, arglist);
va_end(arglist); va_end(arglist);
SDrawMessageBox(text, "Diablo", MB_TASKMODAL | MB_ICONEXCLAMATION); SDrawMessageBox(text, "Diablo", MB_TASKMODAL | MB_ICONEXCLAMATION);
} }
void __fastcall DDErrMsg(int error_code, int log_line_nr, char *log_file_path) void __fastcall DDErrMsg(int error_code, int log_line_nr, char *log_file_path)
{ {
int v3; // esi int v3; // esi
char *v4; // eax char *v4; // eax
v3 = log_line_nr; v3 = log_line_nr;
if (error_code) { if (error_code) {
v4 = GetErrorStr(error_code); v4 = GetErrorStr(error_code);
TermMsg("Direct draw error (%s:%d)\n%s", log_file_path, v3, v4); TermMsg("Direct draw error (%s:%d)\n%s", log_file_path, v3, v4);
} }
} }
void __fastcall DSErrMsg(int error_code, int log_line_nr, char *log_file_path) void __fastcall DSErrMsg(int error_code, int log_line_nr, char *log_file_path)
{ {
int v3; // esi int v3; // esi
char *v4; // eax char *v4; // eax
v3 = log_line_nr; v3 = log_line_nr;
if (error_code) { if (error_code) {
v4 = GetErrorStr(error_code); v4 = GetErrorStr(error_code);
TermMsg("Direct sound error (%s:%d)\n%s", log_file_path, v3, v4); TermMsg("Direct sound error (%s:%d)\n%s", log_file_path, v3, v4);
} }
} }
void __fastcall center_window(HWND hDlg) void __fastcall center_window(HWND hDlg)
{ {
LONG v1; // esi LONG v1; // esi
LONG v2; // edi LONG v2; // edi
int v3; // ebx int v3; // ebx
char *v4; // eax char *v4; // eax
struct tagRECT Rect; // [esp+Ch] [ebp-1Ch] struct tagRECT Rect; // [esp+Ch] [ebp-1Ch]
int v6; // [esp+1Ch] [ebp-Ch] int v6; // [esp+1Ch] [ebp-Ch]
HDC hdc; // [esp+20h] [ebp-8h] HDC hdc; // [esp+20h] [ebp-8h]
HWND hWnd; // [esp+24h] [ebp-4h] HWND hWnd; // [esp+24h] [ebp-4h]
hWnd = hDlg; hWnd = hDlg;
GetWindowRect(hDlg, &Rect); GetWindowRect(hDlg, &Rect);
v1 = Rect.right - Rect.left; v1 = Rect.right - Rect.left;
v2 = Rect.bottom - Rect.top; v2 = Rect.bottom - Rect.top;
hdc = GetDC(hWnd); hdc = GetDC(hWnd);
v6 = GetDeviceCaps(hdc, HORZRES); v6 = GetDeviceCaps(hdc, HORZRES);
v3 = GetDeviceCaps(hdc, VERTRES); v3 = GetDeviceCaps(hdc, VERTRES);
ReleaseDC(hWnd, hdc); ReleaseDC(hWnd, hdc);
if (!SetWindowPos(hWnd, HWND_TOP, (v6 - v1) / 2, (v3 - v2) / 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE)) { if (!SetWindowPos(hWnd, HWND_TOP, (v6 - v1) / 2, (v3 - v2) / 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE)) {
v4 = TraceLastError(); v4 = TraceLastError();
TermMsg("center_window: %s", v4); TermMsg("center_window: %s", v4);
} }
} }
void __fastcall ErrDlg(int template_id, int error_code, char *log_file_path, int log_line_nr) void __fastcall ErrDlg(int template_id, int error_code, char *log_file_path, int log_line_nr)
{ {
int v4; // ebx int v4; // ebx
int v5; // edi int v5; // edi
char *v6; // esi char *v6; // esi
char *v7; // eax char *v7; // eax
char *v8; // eax char *v8; // eax
LPARAM dwInitParam[128]; // [esp+Ch] [ebp-200h] LPARAM dwInitParam[128]; // [esp+Ch] [ebp-200h]
v4 = error_code; v4 = error_code;
v5 = template_id; v5 = template_id;
FreeDlg(); FreeDlg();
v6 = log_file_path; v6 = log_file_path;
v7 = strrchr(log_file_path, '\\'); v7 = strrchr(log_file_path, '\\');
if (v7) if (v7)
v6 = v7 + 1; v6 = v7 + 1;
v8 = GetErrorStr(v4); v8 = GetErrorStr(v4);
wsprintf((LPSTR)dwInitParam, "%s\nat: %s line %d", v8, v6, log_line_nr); wsprintf((LPSTR)dwInitParam, "%s\nat: %s line %d", v8, v6, log_line_nr);
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(v5), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)dwInitParam) == -1) if (DialogBoxParam(ghInst, MAKEINTRESOURCE(v5), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)dwInitParam) == -1)
TermMsg("ErrDlg: %d", v5); TermMsg("ErrDlg: %d", v5);
TermMsg(0); TermMsg(0);
} }
BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, char *text) BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, char *text)
{ {
if (uMsg == WM_INITDIALOG) { if (uMsg == WM_INITDIALOG) {
TextDlg(hDlg, text); TextDlg(hDlg, text);
} else { } else {
if (uMsg != WM_COMMAND) if (uMsg != WM_COMMAND)
return 0; return 0;
if ((_WORD)wParam == 1) { if ((_WORD)wParam == 1) {
EndDialog(hDlg, 1); EndDialog(hDlg, 1);
} else if ((_WORD)wParam == 2) { } else if ((_WORD)wParam == 2) {
EndDialog(hDlg, 0); EndDialog(hDlg, 0);
} }
} }
return 1; return 1;
} }
void __fastcall TextDlg(HWND hDlg, char *text) void __fastcall TextDlg(HWND hDlg, char *text)
{ {
char *v2; // esi char *v2; // esi
HWND v3; // edi HWND v3; // edi
v2 = text; v2 = text;
v3 = hDlg; v3 = hDlg;
center_window(hDlg); center_window(hDlg);
if (v2) if (v2)
SetDlgItemText(v3, 1000, v2); SetDlgItemText(v3, 1000, v2);
} }
void __fastcall ErrOkDlg(int template_id, int error_code, char *log_file_path, int log_line_nr) void __fastcall ErrOkDlg(int template_id, int error_code, char *log_file_path, int log_line_nr)
{ {
char *v4; // esi char *v4; // esi
int v5; // edi int v5; // edi
unsigned short v6; // bx unsigned short v6; // bx
char *v7; // eax char *v7; // eax
char *v8; // eax char *v8; // eax
LPARAM dwInitParam[128]; // [esp+Ch] [ebp-200h] LPARAM dwInitParam[128]; // [esp+Ch] [ebp-200h]
v4 = log_file_path; v4 = log_file_path;
v5 = error_code; v5 = error_code;
v6 = template_id; v6 = template_id;
v7 = strrchr(log_file_path, '\\'); v7 = strrchr(log_file_path, '\\');
if (v7) if (v7)
v4 = v7 + 1; v4 = v7 + 1;
v8 = GetErrorStr(v5); v8 = GetErrorStr(v5);
wsprintf((LPSTR)dwInitParam, "%s\nat: %s line %d", v8, v4, log_line_nr); wsprintf((LPSTR)dwInitParam, "%s\nat: %s line %d", v8, v4, log_line_nr);
DialogBoxParam(ghInst, MAKEINTRESOURCE(v6), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)dwInitParam); DialogBoxParam(ghInst, MAKEINTRESOURCE(v6), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)dwInitParam);
} }
void __fastcall FileErrDlg(const char *error) void __fastcall FileErrDlg(const char *error)
{ {
const char *v1; // esi const char *v1; // esi
v1 = error; v1 = error;
FreeDlg(); FreeDlg();
if (!v1) if (!v1)
v1 = ""; v1 = "";
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG3), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)v1) == -1) if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG3), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)v1) == -1)
TermMsg("FileErrDlg"); TermMsg("FileErrDlg");
TermMsg(0); TermMsg(0);
} }
void __fastcall DiskFreeDlg(char *error) void __fastcall DiskFreeDlg(char *error)
{ {
char *v1; // esi char *v1; // esi
v1 = error; v1 = error;
FreeDlg(); FreeDlg();
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG7), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)v1) == -1) if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG7), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)v1) == -1)
TermMsg("DiskFreeDlg"); TermMsg("DiskFreeDlg");
TermMsg(0); TermMsg(0);
} }
BOOL __cdecl InsertCDDlg() BOOL __cdecl InsertCDDlg()
{ {
int v0; // edi int v0; // edi
ShowCursor(1); ShowCursor(1);
v0 = DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG9), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM) ""); v0 = DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG9), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM) "");
if (v0 == -1) if (v0 == -1)
TermMsg("InsertCDDlg"); TermMsg("InsertCDDlg");
ShowCursor(0); ShowCursor(0);
return v0 == 1; return v0 == 1;
} }
void __fastcall DirErrorDlg(char *error) void __fastcall DirErrorDlg(char *error)
{ {
char *v1; // esi char *v1; // esi
v1 = error; v1 = error;
FreeDlg(); FreeDlg();
if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG11), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)v1) == -1) if (DialogBoxParam(ghInst, MAKEINTRESOURCE(IDD_DIALOG11), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)v1) == -1)
TermMsg("DirErrorDlg"); TermMsg("DirErrorDlg");
TermMsg(0); TermMsg(0);
} }

12
Source/codec.cpp

@ -2,18 +2,6 @@
#include "../types.h" #include "../types.h"
#ifdef MINIWIN
#define srand srand_miniwin
#define rand rand_miniwin
#endif
#ifdef ANDROID
#define srand srand_miniwin
#define rand rand_miniwin
#endif
int __fastcall codec_decode(void *pbSrcDst, int size, char *pszPassword) int __fastcall codec_decode(void *pbSrcDst, int size, char *pszPassword)
{ {
unsigned int v3; // ebx unsigned int v3; // ebx

2
Source/debug.cpp

@ -2,11 +2,9 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
void *pSquareCel; void *pSquareCel;
char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY];
char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY];
#endif
void __cdecl LoadDebugGFX() void __cdecl LoadDebugGFX()
{ {

2
Source/diablo.cpp

@ -64,8 +64,6 @@ char *spszMsgTbl[4] = {
}; // weak }; // weak
char *spszMsgKeyTbl[4] = { "F9", "F10", "F11", "F12" }; // weak char *spszMsgKeyTbl[4] = { "F9", "F10", "F11", "F12" }; // weak
bool CUSTOM_SDL_KEY_LSHIFT;
void __cdecl FreeGameMem() void __cdecl FreeGameMem()
{ {
void *p; void *p;

2
Source/drlg_l1.cpp

@ -2,7 +2,6 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
char L5dungeon[80][80]; char L5dungeon[80][80];
char mydflags[40][40]; char mydflags[40][40];
int setloadflag; // weak int setloadflag; // weak
@ -13,7 +12,6 @@ int VR1;
int VR2; int VR2;
int VR3; int VR3;
void *pSetPiece; // idb void *pSetPiece; // idb
#endif
const ShadowStruct SPATS[37] = { const ShadowStruct SPATS[37] = {
// clang-format off // clang-format off

2
Source/drlg_l2.cpp

@ -2,7 +2,6 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
int nSx1; int nSx1;
int nSx2; // weak int nSx2; // weak
int nSy1; int nSy1;
@ -11,7 +10,6 @@ int nRoomCnt;
char predungeon[40][40]; char predungeon[40][40];
ROOMNODE RoomList[81]; ROOMNODE RoomList[81];
HALLNODE *pHallList; HALLNODE *pHallList;
#endif
int Area_Min = 2; // weak int Area_Min = 2; // weak
int Room_Max = 10; // weak int Room_Max = 10; // weak

2
Source/drlg_l4.cpp

@ -2,7 +2,6 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
int diabquad1x; // weak int diabquad1x; // weak
int diabquad1y; // weak int diabquad1y; // weak
int diabquad3x; // idb int diabquad3x; // idb
@ -21,7 +20,6 @@ int SP4y2; // weak
char L4dungeon[80][80]; char L4dungeon[80][80];
char dung[20][20]; char dung[20][20];
//int dword_52A4DC; // weak //int dword_52A4DC; // weak
#endif
const unsigned char L4ConvTbl[16] = { 30u, 6u, 1u, 6u, 2u, 6u, 6u, 6u, 9u, 6u, 1u, 6u, 2u, 6u, 3u, 6u }; const unsigned char L4ConvTbl[16] = { 30u, 6u, 1u, 6u, 2u, 6u, 6u, 6u, 9u, 6u, 1u, 6u, 2u, 6u, 3u, 6u };
const unsigned char L4USTAIRS[42] = { const unsigned char L4USTAIRS[42] = {

4
Source/effects.cpp

@ -1052,11 +1052,11 @@ void __fastcall stream_play(TSFX *pSFX, int lVolume, int lPan)
if (lVolume > VOLUME_MAX) if (lVolume > VOLUME_MAX)
lVolume = VOLUME_MAX; lVolume = VOLUME_MAX;
#ifdef _DEBUG #ifdef _DEBUG
//SFileEnableDirectAccess(FALSE); SFileEnableDirectAccess(FALSE);
#endif #endif
success = SFileOpenFile(pSFX->pszName, &sfx_stream); success = SFileOpenFile(pSFX->pszName, &sfx_stream);
#ifdef _DEBUG #ifdef _DEBUG
//SFileEnableDirectAccess(TRUE); SFileEnableDirectAccess(TRUE);
#endif #endif
if (!success) { if (!success) {
sfx_stream = 0; sfx_stream = 0;

12
Source/engine.cpp

@ -1,7 +1,6 @@
//HEADER_GOES_HERE //HEADER_GOES_HERE
#include "../types.h" #include "../types.h"
#include "miniwin_sdl.h"
char gbPixelCol; // automap pixel color 8-bit (palette entry) char gbPixelCol; // automap pixel color 8-bit (palette entry)
int dword_52B970; // BOOLEAN flip - if y < x int dword_52B970; // BOOLEAN flip - if y < x
@ -1535,17 +1534,6 @@ int __fastcall random(BYTE idx, int v)
return (GetRndSeed() >> 16) % v; return (GetRndSeed() >> 16) % v;
} }
#ifndef MINIWIN
struct engine_cpp_init_2
{
engine_cpp_init_2()
{
mem_init_mutex();
mem_atexit_mutex();
}
} _engine_cpp_init_2;
#endif
#ifndef _MSC_VER #ifndef _MSC_VER
__attribute__((constructor)) __attribute__((constructor))
#endif #endif

2
Source/gendung.cpp

@ -2,7 +2,6 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
short level_frame_types[2048]; short level_frame_types[2048];
int themeCount; int themeCount;
char nTransTable[2049]; char nTransTable[2049];
@ -69,7 +68,6 @@ char dMissile[MAXDUNX][MAXDUNY];
int dminx; // weak int dminx; // weak
int dminy; // weak int dminy; // weak
short dpiece_defs_map_2[16][MAXDUNX][MAXDUNY]; short dpiece_defs_map_2[16][MAXDUNX][MAXDUNY];
#endif
void __cdecl FillSolidBlockTbls() void __cdecl FillSolidBlockTbls()
{ {

1
Source/init.h

@ -39,6 +39,5 @@ extern const int init_inf; // weak
extern char gszVersionNumber[260]; extern char gszVersionNumber[260];
extern char gszProductName[260]; extern char gszProductName[260];
extern int SelectedItem;
#endif /* __INIT_H__ */ #endif /* __INIT_H__ */

2
Source/interfac.cpp

@ -86,7 +86,7 @@ void __fastcall ShowProgress(unsigned int uMsg)
DrawCutscene(); DrawCutscene();
PaletteFadeIn(8); PaletteFadeIn(8);
IncProgress(); IncProgress();
stream_update(); // What is this? stream_update();
IncProgress(); IncProgress();
switch (uMsg) { switch (uMsg) {
case WM_DIABNEXTLVL: case WM_DIABNEXTLVL:

2
Source/lighting.cpp

@ -2,7 +2,6 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
LightListStruct VisionList[32]; LightListStruct VisionList[32];
char lightactive[32]; char lightactive[32];
LightListStruct LightList[32]; LightListStruct LightList[32];
@ -16,7 +15,6 @@ char dung_map_rgba[16384]; /* int [64][64] short [64][128] char [64][256] */
int visionid; int visionid;
char *pLightTbl; /* todo: struct? */ char *pLightTbl; /* todo: struct? */
BOOL lightflag; BOOL lightflag;
#endif
char CrawlTable[2749] = { char CrawlTable[2749] = {
1, 1,

2
Source/mainmenu.cpp

@ -2,8 +2,6 @@
#include "../types.h" #include "../types.h"
#include "diablo.h"
char gszHero[16]; char gszHero[16];
/* data */ /* data */

12
Source/nthread.cpp

@ -32,16 +32,8 @@ nthread_c_init(void)
nthread_cleanup_mutex_atexit(); nthread_cleanup_mutex_atexit();
} }
#ifndef MINIWIN SEG_ALLOCATE(SEGMENT_C_INIT)
struct nthread_cpp_init_2 _PVFV nthread_c_init_funcs[] = { &nthread_c_init };
{
nthread_cpp_init_2()
{
nthread_init_mutex();
nthread_cleanup_mutex_atexit();
}
} _nthread_cpp_init_2;
#endif
void __cdecl nthread_init_mutex() void __cdecl nthread_init_mutex()
{ {

2
Source/path.cpp

@ -2,7 +2,6 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
// preallocated nodes, search is terminated after 300 nodes are visited // preallocated nodes, search is terminated after 300 nodes are visited
PATHNODE path_nodes[MAXPATHNODES]; PATHNODE path_nodes[MAXPATHNODES];
// size of the pnode_tblptr stack // size of the pnode_tblptr stack
@ -19,7 +18,6 @@ PATHNODE *pnode_ptr;
PATHNODE *pnode_tblptr[MAXPATHNODES]; PATHNODE *pnode_tblptr[MAXPATHNODES];
// a linked list of the A* frontier, sorted by distance // a linked list of the A* frontier, sorted by distance
PATHNODE *path_2_nodes; PATHNODE *path_2_nodes;
#endif
// for iterating over the 8 possible movement directions // for iterating over the 8 possible movement directions
const char pathxdir[8] = { -1, -1, 1, 1, -1, 0, 1, 0 }; const char pathxdir[8] = { -1, -1, 1, 1, -1, 0, 1, 0 };

15
Source/pfile.cpp

@ -113,16 +113,7 @@ BOOL __fastcall pfile_open_archive(BOOL a1, unsigned int save_num)
if ( a1 && gbMaxPlayers > 1 ) if ( a1 && gbMaxPlayers > 1 )
mpqapi_update_multi_creation_time(save_num); mpqapi_update_multi_creation_time(save_num);
return FALSE; return FALSE;
#else #else
char FileName[MAX_PATH]; char FileName[MAX_PATH];
pfile_get_save_path(FileName, sizeof(FileName), save_num); pfile_get_save_path(FileName, sizeof(FileName), save_num);
@ -132,9 +123,7 @@ BOOL __fastcall pfile_open_archive(BOOL a1, unsigned int save_num)
if (a1 && gbMaxPlayers > 1) if (a1 && gbMaxPlayers > 1)
mpqapi_update_multi_creation_time(save_num); mpqapi_update_multi_creation_time(save_num);
return FALSE; return FALSE;
#endif #endif
} }
void __fastcall pfile_get_save_path(char *pszBuf, DWORD dwBufSize, unsigned int save_num) void __fastcall pfile_get_save_path(char *pszBuf, DWORD dwBufSize, unsigned int save_num)
@ -399,8 +388,8 @@ HANDLE __fastcall pfile_open_save_archive(int *unused, unsigned int save_num)
return archive; return archive;
return NULL; return NULL;
#else // IF NOT ANDROID #else // IF NOT ANDROID
char SrcStr[MAX_PATH]; char SrcStr[MAX_PATH];
HANDLE archive; HANDLE archive;
pfile_get_save_path(SrcStr, sizeof(SrcStr), save_num); pfile_get_save_path(SrcStr, sizeof(SrcStr), save_num);
if (SFileOpenArchive(SrcStr, 0x7000, 0, &archive)) if (SFileOpenArchive(SrcStr, 0x7000, 0, &archive))

6
Source/pfile.h

@ -3,12 +3,6 @@
#define __PFILE_H__ #define __PFILE_H__
extern BOOL gbValidSaveFile; // idb extern BOOL gbValidSaveFile; // idb
extern char hero_names[MAX_CHARACTERS][PLR_NAME_LEN];
void __cdecl pfile_init_save_directory(); void __cdecl pfile_init_save_directory();
void __fastcall pfile_check_available_space(char *pszDir); void __fastcall pfile_check_available_space(char *pszDir);

2
Source/portal.cpp

@ -2,10 +2,8 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
PortalStruct portal[MAXPORTAL]; PortalStruct portal[MAXPORTAL];
int portalindex; int portalindex;
#endif
int WarpDropX[MAXPORTAL] = { 57, 59, 61, 63 }; int WarpDropX[MAXPORTAL] = { 57, 59, 61, 63 };
int WarpDropY[MAXPORTAL] = { 40, 40, 40, 40 }; int WarpDropY[MAXPORTAL] = { 40, 40, 40, 40 };

2
Source/render.cpp

@ -3,14 +3,12 @@
#include "../types.h" #include "../types.h"
#include "_asm.cpp" #include "_asm.cpp"
#ifndef NO_GLOBALS
int WorldBoolFlag = 0; int WorldBoolFlag = 0;
unsigned int gdwCurrentMask = 0; unsigned int gdwCurrentMask = 0;
// char world_4B3264 = 0; // char world_4B3264 = 0;
unsigned char *gpCelFrame = NULL; unsigned char *gpCelFrame = NULL;
unsigned int *gpDrawMask = NULL; unsigned int *gpDrawMask = NULL;
// char world_4B326D[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // char world_4B326D[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
#endif
unsigned int RightMask[32] = { unsigned int RightMask[32] = {
0xEAAAAAAA, 0xF5555555, 0xFEAAAAAA, 0xFF555555, 0xFFEAAAAA, 0xFFF55555, 0xFFFEAAAA, 0xFFFF5555, 0xEAAAAAAA, 0xF5555555, 0xFEAAAAAA, 0xFF555555, 0xFFEAAAAA, 0xFFF55555, 0xFFFEAAAA, 0xFFFF5555,

2
Source/sha.cpp

@ -2,9 +2,7 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
SHA1Context sgSHA1[3]; SHA1Context sgSHA1[3];
#endif
void __cdecl SHA1Clear() void __cdecl SHA1Clear()
{ {

2
Source/sync.cpp

@ -2,13 +2,11 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
short sync_word_6AA708[MAXMONSTERS]; short sync_word_6AA708[MAXMONSTERS];
int syncmonsters; // weak int syncmonsters; // weak
short sync_word_6AA89C[MAXMONSTERS]; short sync_word_6AA89C[MAXMONSTERS];
int syncitems; int syncitems;
int sgnSyncPInv; // weak int sgnSyncPInv; // weak
#endif
int __fastcall sync_all_monsters(TSyncHeader *packet, int size) int __fastcall sync_all_monsters(TSyncHeader *packet, int size)
{ {

2
Source/towners.cpp

@ -2,7 +2,6 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
int storeflag; // weak int storeflag; // weak
int sgnCowMsg; int sgnCowMsg;
int numtowners; // idb int numtowners; // idb
@ -11,7 +10,6 @@ int bannerflag; // weak // unused 0x6AAC28
int boyloadflag; // weak int boyloadflag; // weak
BYTE *pCowCels; BYTE *pCowCels;
TownerStruct towner[16]; TownerStruct towner[16];
#endif
const int snSFX[3][3] = { const int snSFX[3][3] = {
{ PS_WARR52, PS_ROGUE52, PS_MAGE52 }, { PS_WARR52, PS_ROGUE52, PS_MAGE52 },

2
Source/trigs.cpp

@ -2,11 +2,9 @@
#include "../types.h" #include "../types.h"
#ifndef NO_GLOBALS
int trigflag[MAXTRIGGERS]; int trigflag[MAXTRIGGERS];
TriggerStruct trigs[MAXTRIGGERS]; TriggerStruct trigs[MAXTRIGGERS];
int TWarpFrom; // weak int TWarpFrom; // weak
#endif
int TownDownList[11] = { 716, 715, 719, 720, 721, 723, 724, 725, 726, 727, -1 }; int TownDownList[11] = { 716, 715, 719, 720, 721, 723, 724, 725, 726, 727, -1 };
int TownWarp1List[13] = { int TownWarp1List[13] = {

3
Stub/diablo.cpp

@ -2221,9 +2221,6 @@ void __fastcall game_loop(BOOL bStartup)
// 525650: using guessed type int gbRunGame; // 525650: using guessed type int gbRunGame;
// 679660: using guessed type char gbMaxPlayers; // 679660: using guessed type char gbMaxPlayers;
bool CUSTOM_SDL_KEY_LSHIFT;
void __cdecl game_logic() void __cdecl game_logic()
{ {
if ( PauseMode != 2 ) if ( PauseMode != 2 )

2
Stub/diabloui.cpp

@ -5,8 +5,8 @@
#include "stubs.h" #include "stubs.h"
char chr_name_str[16]; char chr_name_str[16];
char hero_names[MAX_CHARACTERS][PLR_NAME_LEN];
int SelectedItem = 1;
int SelectedItemMax = 0; int SelectedItemMax = 0;
int MenuItem[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int MenuItem[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int PreviousItem[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int PreviousItem[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

5
Stub/miniwin_msg_sdl.cpp

@ -75,7 +75,7 @@ static int translate_sdl_key(SDL_Keysym key)
return VK_OEM_PERIOD; return VK_OEM_PERIOD;
case SDLK_COMMA: case SDLK_COMMA:
return VK_OEM_COMMA; return VK_OEM_COMMA;
// case SDLK_LSHIFT: // case SDLK_LSHIFT:
// printf("Fooooooo\n"); // printf("Fooooooo\n");
//PlayerS._pmode = 5; //PlayerS._pmode = 5;
@ -94,8 +94,7 @@ static int translate_sdl_key(SDL_Keysym key)
} else if (sym >= SDLK_F1 && sym <= SDLK_F12) { } else if (sym >= SDLK_F1 && sym <= SDLK_F12) {
return VK_F1 + (sym - SDLK_F1); return VK_F1 + (sym - SDLK_F1);
} }
CUSTOM_SDL_KEY_LSHIFT = 0;
DUMMY_PRINT("unknown key: name=%s sym=0x%X scan=%d mod=0x%X", SDL_GetKeyName(sym), sym, key.scancode, key.mod); DUMMY_PRINT("unknown key: name=%s sym=0x%X scan=%d mod=0x%X", SDL_GetKeyName(sym), sym, key.scancode, key.mod);
return -1; return -1;

1
Stub/sdlrender.cpp

@ -31,6 +31,7 @@ bool SinglePlayerMenuItemsLoaded = 0;
bool DiabloImageLoaded = 0; bool DiabloImageLoaded = 0;
bool DiabloMainMenuListLoaded = 0; bool DiabloMainMenuListLoaded = 0;
bool TitleImageLoaded = false; bool TitleImageLoaded = false;
int SelectedItem = 1;
void *pPcxLogoImage; void *pPcxLogoImage;
int gdwLogoWidth; int gdwLogoWidth;

1
Stub/sdlrender.h

@ -55,6 +55,7 @@ extern int gdwCreditsWidth;
extern int gdwCreditsHeight; extern int gdwCreditsHeight;
extern bool TitleImageLoaded; extern bool TitleImageLoaded;
extern int SelectedItem;
extern int totalFrames; extern int totalFrames;
//extern SDL_Texture* spriteSheet; //extern SDL_Texture* spriteSheet;

Loading…
Cancel
Save