Browse Source

First "working" version of diabloui.dll ^_^ (#221)

pull/4/head
galaxyhaxz 8 years ago committed by Anders Jenbo
parent
commit
71c2149d46
  1. 4
      3rdParty/Storm/Source/storm.cpp
  2. 4
      3rdParty/Storm/Source/storm.def
  3. 4
      3rdParty/Storm/Source/storm.h
  4. 6
      3rdParty/Storm/Source/storm_gcc.def
  5. 4
      DiabloUI/DiabloUI.dsp
  6. 29
      DiabloUI/_temp_data.cpp
  7. 76
      DiabloUI/_temp_funcs.h
  8. 334
      DiabloUI/diabedit.cpp
  9. 108
      DiabloUI/diabloui.cpp
  10. 4
      DiabloUI/diabloui.h
  11. BIN
      DiabloUI/diabloui.res
  12. 10
      DiabloUI/doom.cpp
  13. 2
      DiabloUI/fade.cpp
  14. 2
      DiabloUI/focus.cpp
  15. 2
      DiabloUI/local.cpp
  16. 386
      DiabloUI/title.cpp
  17. 2
      MakefileVC

4
3rdParty/Storm/Source/storm.cpp vendored

@ -243,5 +243,7 @@ void __stdcall SDlgBeginPaint(HWND hWnd, char *a2) rVoid;
void __stdcall SDlgEndPaint(HWND hWnd, char *a2) rVoid; void __stdcall SDlgEndPaint(HWND hWnd, char *a2) rVoid;
void __stdcall SDlgSetSystemCursor(BYTE *a1, BYTE *a2, int *a3, int a4) rVoid; void __stdcall SDlgSetSystemCursor(BYTE *a1, BYTE *a2, int *a3, int a4) rVoid;
void __stdcall SDlgSetCursor(HWND hWnd, HCURSOR a2, int a3, int *a4) rVoid; void __stdcall SDlgSetCursor(HWND hWnd, HCURSOR a2, int a3, int *a4) rVoid;
BOOL __stdcall SDlgSetTimer(int a1, int a2, int a3, void (__stdcall *a4)(int)) rBool; BOOL __stdcall SDlgSetTimer(int a1, int a2, int a3, void (__stdcall *a4)(int, int, int, int)) rBool;
BOOL __stdcall SDlgKillTimer(int a1, int a2) rBool; BOOL __stdcall SDlgKillTimer(int a1, int a2) rBool;
BOOL __stdcall SDlgDrawBitmap(HWND hWnd, int a2, int a3, int a4, int a5, int a6, int a7) rBool;
BOOL __stdcall SDlgDialogBoxParam(HINSTANCE hInst, char *szDialog, int a3, WNDPROC func, int a5) rBool;

4
3rdParty/Storm/Source/storm.def vendored

@ -59,8 +59,8 @@ EXPORTS
SDlgDefDialogProc @206 NONAME SDlgDefDialogProc @206 NONAME
SDlgDialogBoxIndirectParam @208 NONAME SDlgDialogBoxIndirectParam @208 NONAME
;SDlgDialogBoxParam @209 NONAME SDlgDialogBoxParam @209 NONAME
;SDlgDrawBitmap @210 NONAME SDlgDrawBitmap @210 NONAME
SDlgEndDialog @211 NONAME SDlgEndDialog @211 NONAME
SDlgEndPaint @212 NONAME SDlgEndPaint @212 NONAME
SDlgKillTimer @213 NONAME SDlgKillTimer @213 NONAME

4
3rdParty/Storm/Source/storm.h vendored

@ -1306,8 +1306,10 @@ void __stdcall SDlgBeginPaint(HWND hWnd, char *a2);
void __stdcall SDlgEndPaint(HWND hWnd, char *a2); void __stdcall SDlgEndPaint(HWND hWnd, char *a2);
void __stdcall SDlgSetSystemCursor(BYTE *a1, BYTE *a2, int *a3, int a4); void __stdcall SDlgSetSystemCursor(BYTE *a1, BYTE *a2, int *a3, int a4);
void __stdcall SDlgSetCursor(HWND hWnd, HCURSOR a2, int a3, int *a4); void __stdcall SDlgSetCursor(HWND hWnd, HCURSOR a2, int a3, int *a4);
BOOL __stdcall SDlgSetTimer(int a1, int a2, int a3, void (__stdcall *a4)(int)); BOOL __stdcall SDlgSetTimer(int a1, int a2, int a3, void (__stdcall *a4)(int, int, int, int));
BOOL __stdcall SDlgKillTimer(int a1, int a2); BOOL __stdcall SDlgKillTimer(int a1, int a2);
BOOL __stdcall SDlgDrawBitmap(HWND hWnd, int a2, int a3, int a4, int a5, int a6, int a7);
BOOL __stdcall SDlgDialogBoxParam(HINSTANCE hInst, char *szDialog, int a3, WNDPROC func, int a5);
#ifdef __GNUC__ #ifdef __GNUC__
} }

6
3rdParty/Storm/Source/storm_gcc.def vendored

@ -78,8 +78,10 @@ EXPORTS
SDlgDefDialogProc @206 NONAME SDlgDefDialogProc @206 NONAME
SDlgDialogBoxIndirectParam @208 NONAME SDlgDialogBoxIndirectParam @208 NONAME
;SDlgDialogBoxParam @209 NONAME SDlgDialogBoxParam @209 NONAME
;SDlgDrawBitmap @210 NONAME SDlgDialogBoxParam@20 @209 NONAME
SDlgDrawBitmap @210 NONAME
SDlgDrawBitmap@28 @210 NONAME
SDlgEndDialog @211 NONAME SDlgEndDialog @211 NONAME
SDlgEndPaint @212 NONAME SDlgEndPaint @212 NONAME
SDlgEndPaint@8 @212 NONAME SDlgEndPaint@8 @212 NONAME

4
DiabloUI/DiabloUI.dsp

@ -89,5 +89,9 @@ LINK32=link.exe
SOURCE=.\diabloui.cpp SOURCE=.\diabloui.cpp
# End Source File # End Source File
# Begin Source File
SOURCE=.\diabloui.res
# End Source File
# End Target # End Target
# End Project # End Project

29
DiabloUI/_temp_data.cpp

@ -8,10 +8,13 @@ ProfileStruct bnprofiles[4] =
}; };
int profilemsg1[6] = { 1125, 1127, 1129, 1131, 1133, 0 }; int profilemsg1[6] = { 1125, 1127, 1129, 1131, 1133, 0 };
int profilemsg2[6] = { 1126, 1128, 1130, 1132, 1134, 0 }; int profilemsg2[6] = { 1126, 1128, 1130, 1132, 1134, 0 };
int DiabEdit_cpp_float_value = 2139095040; // weak
int DiabloUI_cpp_float_value = 2139095040; // weak
int doom_cpp_float_value = 2139095040; // weak int doom_cpp_float_value = 2139095040; // weak
int fade_cpp_float_value = 2139095040; // weak int fade_cpp_float_value = 2139095040; // weak
int focus_cpp_float_value = 2139095040; // weak int focus_cpp_float_value = 2139095040; // weak
int local_cpp_float_value = 2139095040; // weak int local_cpp_float_value = 2139095040; // weak
int Title_cpp_float_value = 2139095040; // weak
int titlesnd_cpp_float_value = 2139095040; // weak int titlesnd_cpp_float_value = 2139095040; // weak
int dword_10022258 = 4; // weak int dword_10022258 = 4; // weak
ProfFntStruct proffnts[4] = ProfFntStruct proffnts[4] =
@ -87,7 +90,7 @@ int dword_10023260[3] = { 1056, 1054, 0 };
int dword_1002326C[7] = { 1135, 1136, 1137, 1138, 1139, 1140, 0 }; int dword_1002326C[7] = { 1135, 1136, 1137, 1138, 1139, 1140, 0 };
int dword_100232D4[2] = { 1026, 0 }; int dword_100232D4[2] = { 1026, 0 };
int dword_100232DC[3] = { 1109, 2, 0 }; int dword_100232DC[3] = { 1109, 2, 0 };
int dword_10023340[2] = { 1067, 0 }; int titlemsgtbl[2] = { 1067, 0 };
//data+bss //data+bss
int artfont_cpp_float = 0; // weak int artfont_cpp_float = 0; // weak
@ -115,7 +118,7 @@ void *dword_1002942C; // idb
int (__stdcall *dword_10029430)(_DWORD, _DWORD, _DWORD, _DWORD); // weak int (__stdcall *dword_10029430)(_DWORD, _DWORD, _DWORD, _DWORD); // weak
void *dword_10029434; // idb void *dword_10029434; // idb
int dword_10029438[4]; // weak int dword_10029438[4]; // weak
char *wndtext_pointer; /* check */ char nullcharacter; /* check */
HGDIOBJ dword_10029450; // idb HGDIOBJ dword_10029450; // idb
int dword_10029454; // weak int dword_10029454; // weak
int dword_10029458; // weak int dword_10029458; // weak
@ -190,15 +193,15 @@ int dword_100296FC; // weak
int dword_10029700; // weak int dword_10029700; // weak
void *dword_10029704; // idb void *dword_10029704; // idb
int dword_10029708; // weak int dword_10029708; // weak
int dword_1002970C; // weak int DiabEdit_cpp_float; // weak
int dword_10029710; // weak int DiabloUI_cpp_float; // weak
int dword_10029714; // weak int dword_10029714; // weak
HINSTANCE hInstance; // idb HINSTANCE ghUiInst; // idb
int dword_1002971C; // weak int backbmp_flag1; // weak
int dword_10029720; // weak int backbmp_flag2; // weak
int dword_10029724; // weak int backbmp_flag3; // weak
int dword_10029728; // weak int app_is_active; // weak
int dword_1002972C; // weak int sgbIsSpawn; // weak
int dword_10029730; // weak int dword_10029730; // weak
int dword_10029738; // weak int dword_10029738; // weak
char byte_1002973C; // idb char byte_1002973C; // idb
@ -345,8 +348,8 @@ int dword_1002A500; // weak
int dword_1002A504; // weak int dword_1002A504; // weak
int (*dword_1002A508)(void); // weak int (*dword_1002A508)(void); // weak
int dword_1002A50C; // weak int dword_1002A50C; // weak
HANDLE dword_1002A510; // idb HANDLE titlePHTrans[30];
int dword_1002A588; // weak int Title_cpp_float; // weak
int dword_1002A58C; // weak int titleTransIdx; // weak
int titlesnd_cpp_float; // weak int titlesnd_cpp_float; // weak
void (__stdcall *gfnSoundFunction)(char *file); void (__stdcall *gfnSoundFunction)(char *file);

76
DiabloUI/_temp_funcs.h

@ -143,27 +143,30 @@ signed int __fastcall credits_10005736(_BYTE *a1);
int __fastcall credits_10005755(int a1, int a2); int __fastcall credits_10005755(int a1, int a2);
BOOL UNKCALL DiabEdit_10005765(HWND hWnd); void __fastcall DiabEdit_DoPaintBMP(HWND hWnd);
signed int DiabEdit_1000579B(); void __cdecl j_DiabEdit_cpp_init();
ATOM DiabEdit_100057A6(); void __cdecl DiabEdit_cpp_init();
HANDLE __fastcall DiabEdit_100057E8(int a1, int a2, HWND hWnd, UINT Msg, HANDLE hData, LPARAM lParam); void __cdecl DiabEdit_SetupWindow();
LRESULT __fastcall DiabEdit_1000591C(LPARAM lParam, unsigned short a2); LRESULT __stdcall DiabEdit_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
LRESULT UNKCALL DiabEdit_1000594E(LPARAM lParam); void __fastcall DiabEdit_SendWndCommand(HWND hWnd, WORD a2);
char *__fastcall DiabEdit_10005A0A(HWND a1, unsigned char a2, int a3); void __fastcall DiabEdit_GetCursorProp(HWND hWnd);
int __fastcall DiabEdit_10005AF4(LPARAM lParam, int a2, int a3); void __fastcall DiabEdit_RestrictAndLimit(HWND hWnd, WPARAM wParam, LPARAM lParam);
char *__fastcall DiabEdit_10005B70(HWND hWnd, char *a2); void __fastcall DiabEdit_SetTextAndProp(HWND hWnd, WPARAM wParam, LPARAM lParam);
BOOL __fastcall DiabEdit_10005B9F(HWND hWnd, int a2); void __fastcall DiabEdit_SetRestrictString(HWND hWnd, LPARAM lParam);
HANDLE UNKCALL DiabEdit_10005BE7(HWND hWnd); void __fastcall DiabEdit_SetRestrictTimer(HWND hWnd);
void __fastcall DiabEdit_RemoveAllProps(HWND hWnd);
int DiabloUI_10005C2A();
//int __stdcall UiSetBackgroundBitmap(int a1, int a2, int a3, int a4, int a5); int __cdecl DiabloUI_GetSpawned();
//int __stdcall UiSetSpawned(int a1); void __stdcall UiOnPaint(int a1);
//BOOL UiInitialize(); void __stdcall UiSetBackgroundBitmap(int a1, PALETTEENTRY *a2, int a3, int a4, int a5);
//void *UiDestroy(); void __stdcall UiSetSpawned(BOOL bSpawned);
//int __stdcall UiAppActivate(int a1); void __cdecl UiInitialize();
void __cdecl UiDestroy();
void __stdcall UiAppActivate(BOOL bActive);
BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
signed int DiabloUI_10005CEA(); void __cdecl j_DiabloUI_cpp_init();
void __cdecl DiabloUI_cpp_init();
signed int DirLink_10005CFA(); signed int DirLink_10005CFA();
@ -236,7 +239,7 @@ void __cdecl Fade_Range5SetZero();
void __fastcall Fade_NoInputAndArt(HWND hWnd, BOOL bShowCurs); void __fastcall Fade_NoInputAndArt(HWND hWnd, BOOL bShowCurs);
void __fastcall Fade_SetInputWindow(HWND hWnd); void __fastcall Fade_SetInputWindow(HWND hWnd);
void __fastcall Fade_SetFadeTimer(int nTime); void __fastcall Fade_SetFadeTimer(int nTime);
void __stdcall Fade_TimerFunctionDlg(int a1); void __stdcall Fade_TimerFunctionDlg(int a1, int a2, int a3, int a4);
void __cdecl j_Fade_cpp_init(); void __cdecl j_Fade_cpp_init();
void __cdecl Fade_cpp_init(); void __cdecl Fade_cpp_init();
@ -253,7 +256,7 @@ void __cdecl j_Focus_cpp_init();
void __cdecl Focus_cpp_init(); void __cdecl Focus_cpp_init();
void __fastcall Focus_LoadSpinner(const char *pszFileName); void __fastcall Focus_LoadSpinner(const char *pszFileName);
void __fastcall Focus_SetFocusTimer(HWND hWnd, const char *pszFileName); void __fastcall Focus_SetFocusTimer(HWND hWnd, const char *pszFileName);
void __stdcall Focus_SetFocusAndBlit(int hWnd); void __stdcall Focus_SetFocusAndBlit(int hWnd, int a2, int a3, int a4);
void __fastcall Focus_KillFocusTimer(HWND hWnd); void __fastcall Focus_KillFocusTimer(HWND hWnd);
@ -595,20 +598,21 @@ int __fastcall SelYesNo_1000FD77(int a1, UINT a2, int a3);
signed int SelYesNo_1000FDE3(); signed int SelYesNo_1000FDE3();
_DWORD *UNKCALL Title_1000FDEE(HWND hWnd); void __fastcall Title_BlitTitleBuffer(HWND hWnd);
int Title_1000FEED(); void __cdecl Title_DeletePhTrans();
void **UNKCALL Title_1000FF0F(HWND hWnd); void __fastcall Title_FreeTransMem(HWND hWnd);
HWND UNKCALL Title_1000FF51(HWND arg); void __fastcall Title_SetTitleBMP(HWND hWnd);
_DWORD *__fastcall Title_1000FFE8(HWND hWnd, const char *edx0); void __fastcall Title_LoadTitleImage(HWND hWnd, const char *pszFileName);
int __fastcall Title_1001009E(HWND hWnd, const char *a2, HWND hWnda); void __fastcall Title_LoadImgSetTimer(HWND hWnd, const char *pszFileName);
_DWORD *__stdcall Title_100100CB(HWND hWnd, int a2, int a3, int a4); void __stdcall Title_BlitTitleBufFnc(int hWnd, int a2, int a3, int a4);
signed int Title_100100DC(); void __cdecl j_Title_cpp_init();
void **UNKCALL Title_100100E7(HWND hWnd); void __cdecl Title_cpp_init();
//signed int __stdcall UiTitleDialog(int a1); void __fastcall Title_KillTitleTimer(HWND hWnd);
int __stdcall Title_10010126(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); // idb BOOL __stdcall UiTitleDialog(int a1);
void UNKCALL Title_10010235(HWND hDlg); LRESULT __stdcall Title_MainProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
int __fastcall Title_1001025A(HWND hWnd, int a2); void __fastcall Title_KillTimerAndFree(HWND hWnd);
int UNKCALL Title_100102D7(void *arg); void __fastcall Title_LoadAllTitleImgs(HWND hWnd, int time);
void __fastcall Title_KillAndFadeDlg(HWND hWnd);
void __fastcall TitleSnd_SetSoundFunction(void (__stdcall *func)(char *file)); void __fastcall TitleSnd_SetSoundFunction(void (__stdcall *func)(char *file));

334
DiabloUI/diabedit.cpp

@ -1,57 +1,51 @@
// ref: 0x10005765 // ref: 0x10005765
BOOL UNKCALL DiabEdit_10005765(HWND hWnd) { return 0; } void __fastcall DiabEdit_DoPaintBMP(HWND hWnd)
/* { {
HWND v1; // esi
struct tagPAINTSTRUCT Paint; // [esp+4h] [ebp-40h] struct tagPAINTSTRUCT Paint; // [esp+4h] [ebp-40h]
v1 = hWnd;
BeginPaint(hWnd, &Paint); BeginPaint(hWnd, &Paint);
SDlgDrawBitmap(v1, 1, 0, 0, 0, 0, 0); SDlgDrawBitmap(hWnd, 1, 0, 0, 0, 0, 0);
return EndPaint(v1, &Paint); EndPaint(hWnd, &Paint);
} */ }
// 1001042A: using guessed type int __stdcall SDlgDrawBitmap(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x1000579B // ref: 0x1000579B
signed int DiabEdit_1000579B() { return 0; } void __cdecl DiabEdit_cpp_init()
/* { {
signed int result; // eax DiabEdit_cpp_float = DiabEdit_cpp_float_value;
}
result = 2139095040; // 1001F40C: using guessed type int DiabEdit_cpp_float_value;
dword_1002970C = 2139095040; // 1002970C: using guessed type int DiabEdit_cpp_float;
return result;
} */
// 1002970C: using guessed type int dword_1002970C;
// ref: 0x100057A6 // ref: 0x100057A6
ATOM DiabEdit_100057A6() { return 0; } void __cdecl DiabEdit_SetupWindow()
/* { {
WNDCLASSA WndClass; // [esp+0h] [ebp-28h] WNDCLASSA WndClass; // [esp+0h] [ebp-28h]
memset(&WndClass, 0, 0x28u); memset(&WndClass, 0, 0x28u);
WndClass.style = 64; WndClass.style = 64;
WndClass.lpfnWndProc = (WNDPROC)DiabEdit_100057E8; WndClass.lpfnWndProc = DiabEdit_WndProc;
WndClass.hInstance = GetModuleHandleA(0); WndClass.hInstance = GetModuleHandleA(0);
WndClass.lpszClassName = "DIABLOEDIT"; WndClass.lpszClassName = "DIABLOEDIT";
return RegisterClassA(&WndClass); RegisterClassA(&WndClass);
} */ }
// ref: 0x100057E8 // ref: 0x100057E8
HANDLE __stdcall DiabEdit_100057E8(HWND hWnd, UINT Msg, HANDLE hData, LPARAM lParam) { return 0; } LRESULT __stdcall DiabEdit_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
if ( Msg <= 0x113 ) if ( Msg <= 0x113 )
{ {
if ( Msg == 275 ) if ( Msg == 275 )
{ {
DiabEdit_1000594E((LPARAM)hWnd); DiabEdit_GetCursorProp(hWnd);
return 0; return 0;
} }
if ( Msg == 1 ) if ( Msg == 1 )
{ {
DiabEdit_10005B9F(hWnd); DiabEdit_SetRestrictTimer(hWnd);
} }
else if ( Msg == 2 ) else if ( Msg == 2 )
{ {
DiabEdit_10005BE7(hWnd); DiabEdit_RemoveAllProps(hWnd);
} }
else else
{ {
@ -59,251 +53,215 @@ HANDLE __stdcall DiabEdit_100057E8(HWND hWnd, UINT Msg, HANDLE hData, LPARAM lPa
{ {
if ( Msg == 15 ) if ( Msg == 15 )
{ {
DiabEdit_10005765(hWnd); DiabEdit_DoPaintBMP(hWnd);
} }
else else
{ {
if ( Msg == 135 ) if ( Msg == 135 )
return (HANDLE)129; return 129;
if ( Msg != 256 ) if ( Msg != 256 )
{ {
if ( Msg == 258 ) if ( Msg == 258 )
DiabEdit_10005A0A(hWnd, (unsigned char)hData, lParam); DiabEdit_RestrictAndLimit(hWnd, wParam, lParam);
return (HANDLE)DefWindowProcA(hWnd, Msg, (WPARAM)hData, lParam); return DefWindowProcA(hWnd, Msg, wParam, lParam);
} }
DiabEdit_10005AF4((LPARAM)hWnd, (int)hData, lParam); DiabEdit_SetTextAndProp(hWnd, wParam, lParam);
} }
return 0; return 0;
} }
DiabEdit_1000591C((LPARAM)hWnd, 1u); DiabEdit_SendWndCommand(hWnd, 1u);
} }
return (HANDLE)DefWindowProcA(hWnd, Msg, (WPARAM)hData, lParam); return DefWindowProcA(hWnd, Msg, wParam, lParam);
} }
switch ( Msg ) switch ( Msg )
{ {
case 0x201u: case 0x201u:
SetFocus(hWnd); SetFocus(hWnd);
return (HANDLE)DefWindowProcA(hWnd, Msg, (WPARAM)hData, lParam); return DefWindowProcA(hWnd, Msg, wParam, lParam);
case 0x400u: case 0x400u:
SetWindowTextA(hWnd, &byte_10029448); SetWindowTextA(hWnd, &nullcharacter);
DiabEdit_1000591C((LPARAM)hWnd, 3u); DiabEdit_SendWndCommand(hWnd, 3u);
return 0; return 0;
case 0x401u: case 0x401u:
SetPropA(hWnd, "LIMIT", hData); SetPropA(hWnd, "LIMIT", (HANDLE)wParam);
return 0; return 0;
case 0x402u: case 0x402u:
return GetPropA(hWnd, "LIMIT"); return (LRESULT)GetPropA(hWnd, "LIMIT");
} }
if ( Msg != 1027 ) if ( Msg != 1027 )
{ {
if ( Msg == 1028 ) if ( Msg == 1028 )
{ {
DiabEdit_10005B70(hWnd, (char *)lParam); DiabEdit_SetRestrictString(hWnd, lParam);
return 0; return 0;
} }
return (HANDLE)DefWindowProcA(hWnd, Msg, (WPARAM)hData, lParam); return DefWindowProcA(hWnd, Msg, wParam, lParam);
} }
return GetPropA(hWnd, "CURSOR"); return (LRESULT)GetPropA(hWnd, "CURSOR");
} */ }
// ref: 0x1000591C // ref: 0x1000591C
LRESULT __fastcall DiabEdit_1000591C(LPARAM lParam, unsigned short a2) { return 0; } void __fastcall DiabEdit_SendWndCommand(HWND hWnd, WORD a2)
/* { {
HWND v2; // esi
LPARAM v3; // ST0C_4
int v4; // ST08_4 int v4; // ST08_4
HWND v5; // eax HWND v5; // eax
v2 = (HWND)lParam; v4 = (a2 << 16) | (unsigned short)GetWindowLongA(hWnd, -12);
v3 = lParam; v5 = GetParent(hWnd);
v4 = (a2 << 16) | (unsigned short)GetWindowLongA((HWND)lParam, -12); SendMessageA(v5, 0x111u, v4, (LPARAM)hWnd);
v5 = GetParent(v2); }
return SendMessageA(v5, 0x111u, v4, v3);
} */
// ref: 0x1000594E // ref: 0x1000594E
LRESULT UNKCALL DiabEdit_1000594E(LPARAM lParam) { return 0; } void __fastcall DiabEdit_GetCursorProp(HWND hWnd)
/* { {
HWND v1; // ebx size_t v2; // eax
LRESULT result; // eax char *v3; // esi
size_t v3; // eax char String[256]; // [esp+Ch] [ebp-100h]
CHAR *v4; // esi
CHAR String; // [esp+Ch] [ebp-100h]
char v6[252]; // [esp+Dh] [ebp-FFh]
short v7; // [esp+109h] [ebp-3h]
char v8; // [esp+10Bh] [ebp-1h]
v1 = (HWND)lParam; String[0] = nullcharacter;
String = byte_10029448; memset(&String[1], 0, 0xFCu);
memset(v6, 0, sizeof(v6)); *(_WORD *)&String[253] = 0;
v7 = 0; String[255] = 0;
v8 = 0; if ( GetPropA(hWnd, "CURSOR") )
if ( GetPropA((HWND)lParam, "CURSOR") )
{ {
SetPropA(v1, "CURSOR", 0); SetPropA(hWnd, "CURSOR", 0);
result = DiabEdit_1000591C((LPARAM)v1, 3u); DiabEdit_SendWndCommand(hWnd, 3u);
} }
else else
{ {
SetPropA(v1, "CURSOR", HANDLE_FLAG_INHERIT); SetPropA(hWnd, "CURSOR", (void *)HANDLE_FLAG_INHERIT);
GetWindowTextA(v1, &String, 255); GetWindowTextA(hWnd, String, 255);
HIBYTE(v7) = 0; String[254] = 0;
v3 = strlen(&String); v2 = strlen(String);
v6[v3] = 0; String[v2 + 1] = 0;
v4 = &String + v3; v3 = &String[v2];
*(&String + v3) = 124; String[v2] = 124;
SetWindowTextA(v1, &String); SetWindowTextA(hWnd, String);
DiabEdit_1000591C((LPARAM)v1, 3u); DiabEdit_SendWndCommand(hWnd, 3u);
*v4 = 0; *v3 = 0;
result = SetWindowTextA(v1, &String); SetWindowTextA(hWnd, String);
} }
return result; }
} */
// 1000594E: using guessed type char var_FF[252];
// ref: 0x10005A0A // ref: 0x10005A0A
char *__fastcall DiabEdit_10005A0A(HWND a1, unsigned char a2, int a3) { return 0; } void __fastcall DiabEdit_RestrictAndLimit(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* { {
char *result; // eax unsigned char v3; // bl
unsigned char v4; // bl char *v4; // eax
char v5; // cl char v5; // cl
signed int v6; // eax signed int v6; // eax
signed int v7; // esi signed int v7; // esi
char v8; // [esp+7h] [ebp-105h] //char v8; // [esp+7h] [ebp-105h]
CHAR String; // [esp+8h] [ebp-104h] char String[256]; // [esp+8h] [ebp-104h]
char v10[252]; // [esp+9h] [ebp-103h]
short v11; // [esp+105h] [ebp-7h]
char v12; // [esp+107h] [ebp-5h]
HWND hWnd; // [esp+108h] [ebp-4h]
hWnd = a1; String[0] = nullcharacter;
String = byte_10029448; v3 = wParam;
result = 0; memset(&String[1], 0, 0xFCu);
v4 = a2; *(_WORD *)&String[253] = 0;
memset(v10, 0, sizeof(v10)); String[255] = 0;
v11 = 0; if ( (_BYTE)wParam == 8 )
v12 = 0;
if ( a2 == 8 )
goto LABEL_9; goto LABEL_9;
if ( a2 < 0x20u || a2 > 0x7Eu && a2 < 0xC0u ) if ( (unsigned char)wParam < 0x20u || (unsigned char)wParam > 0x7Eu && (unsigned char)wParam < 0xC0u )
return result; return;
result = (char *)GetPropA(hWnd, "RESTRICTED"); v4 = (char *)GetPropA(hWnd, "RESTRICTED");
if ( !result || (v5 = *result) == 0 ) if ( !v4 || (v5 = *v4) == 0 )
{ {
LABEL_9: LABEL_9:
GetWindowTextA(hWnd, &String, 255); GetWindowTextA(hWnd, String, 255);
HIBYTE(v11) = 0; String[254] = 0;
v6 = strlen(&String); v6 = strlen(String);
v7 = v6; v7 = v6;
if ( v4 == 8 ) if ( v3 == 8 )
{ {
if ( v6 ) if ( v6 )
{ {
*(&v8 + v6) = 0; String[v6-1] = 0; // *(&v8 + v6) = 0;
goto LABEL_14; goto LABEL_14;
} }
} }
else if ( v6 < (signed int)GetPropA(hWnd, "LIMIT") ) else if ( v6 < (signed int)GetPropA(hWnd, "LIMIT") )
{ {
*(&String + v7) = v4; String[v7] = v3;
v10[v7] = 0; String[v7 + 1] = 0;
LABEL_14: LABEL_14:
SetWindowTextA(hWnd, &String); SetWindowTextA(hWnd, String);
return (char *)DiabEdit_1000594E((LPARAM)hWnd); goto LABEL_15;
} }
return (char *)DiabEdit_1000594E((LPARAM)hWnd); LABEL_15:
DiabEdit_GetCursorProp(hWnd);
return;
} }
while ( v4 != v5 ) while ( v3 != v5 )
{ {
v5 = *++result; v5 = *++v4;
if ( !*result ) if ( !*v4 )
goto LABEL_9; goto LABEL_9;
} }
return result; }
} */
// 10005A0A: using guessed type char var_103[252];
// ref: 0x10005AF4 // ref: 0x10005AF4
int __fastcall DiabEdit_10005AF4(LPARAM lParam, int a2, int a3) { return 0; } void __fastcall DiabEdit_SetTextAndProp(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* { {
HWND v3; // esi WPARAM v4; // ebx
int v4; // ebx size_t v5; // eax
int result; // eax //char v6; // [esp+Bh] [ebp-101h]
char v6; // [esp+Bh] [ebp-101h] char String[256]; // [esp+Ch] [ebp-100h]
CHAR String; // [esp+Ch] [ebp-100h]
char v8; // [esp+Dh] [ebp-FFh]
short v9; // [esp+109h] [ebp-3h]
char v10; // [esp+10Bh] [ebp-1h]
v3 = (HWND)lParam; String[0] = nullcharacter;
String = byte_10029448; memset(&String[1], 0, 0xFCu);
memset(&v8, 0, 0xFCu); *(_WORD *)&String[253] = 0;
v9 = 0; String[255] = 0;
v10 = 0; v4 = wParam;
v4 = a2; GetWindowTextA(hWnd, String, 255);
GetWindowTextA((HWND)lParam, &String, 255); String[254] = 0;
HIBYTE(v9) = 0; v5 = strlen(String);
result = strlen(&String);
if ( v4 == 37 ) if ( v4 == 37 )
{ {
if ( result ) if ( v5 )
{ {
*(&v6 + result) = 0; String[v5-1] = 0; // *(&v6 + v5) = 0;
SetWindowTextA(v3, &String); SetWindowTextA(hWnd, String);
} }
result = DiabEdit_1000594E((LPARAM)v3); DiabEdit_GetCursorProp(hWnd);
} }
return result; }
} */
// ref: 0x10005B70 // ref: 0x10005B70
char *__fastcall DiabEdit_10005B70(HWND hWnd, char *a2) { return 0; } void __fastcall DiabEdit_SetRestrictString(HWND hWnd, LPARAM lParam)
/* { {
char *v2; // edi const char *v2; // edi
char *result; // eax char *v3; // eax MAPDST
char *v4; // esi
v2 = a2; v2 = (const char *)lParam;
result = (char *)GetPropA(hWnd, "RESTRICTED"); v3 = (char *)GetPropA(hWnd, "RESTRICTED");
v4 = result; if ( v3 )
if ( result )
{ {
result = strncpy(result, v2, 0xFFu); strncpy(v3, v2, 0xFFu);
v4[255] = 0; v3[255] = 0;
} }
return result; }
} */
// ref: 0x10005B9F // ref: 0x10005B9F
BOOL UNKCALL DiabEdit_10005B9F(HWND hWnd) { return 0; } void __fastcall DiabEdit_SetRestrictTimer(HWND hWnd)
/* { {
HWND v1; // esi unsigned char *v2; // eax
_BYTE *v2; // eax
v1 = hWnd; SDlgSetTimer((int)hWnd, 1, 500, 0);
SDlgSetTimer(hWnd, 1, 500, 0); SetPropA(hWnd, "CURSOR", 0);
SetPropA(v1, "CURSOR", 0); v2 = (unsigned char *)SMemAlloc(0x100u, "C:\\Src\\Diablo\\DiabloUI\\DiabEdit.cpp", 185, 0);
v2 = (_BYTE *)SMemAlloc(256, "C:\\Src\\Diablo\\DiabloUI\\DiabEdit.cpp", 185, 0);
*v2 = 0; *v2 = 0;
return SetPropA(v1, "RESTRICTED", v2); SetPropA(hWnd, "RESTRICTED", v2);
} */ }
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x10005BE7 // ref: 0x10005BE7
HANDLE UNKCALL DiabEdit_10005BE7(HWND hWnd) { return 0; } void __fastcall DiabEdit_RemoveAllProps(HWND hWnd)
/* { {
HWND v1; // edi HANDLE v2; // eax
HANDLE result; // eax
v1 = hWnd; SDlgKillTimer((int)hWnd, 1);
SDlgKillTimer(hWnd, 1); RemovePropA(hWnd, "LIMIT");
RemovePropA(v1, "LIMIT"); RemovePropA(hWnd, "CURSOR");
RemovePropA(v1, "CURSOR"); v2 = RemovePropA(hWnd, "RESTRICTED");
result = RemovePropA(v1, "RESTRICTED"); if ( v2 )
if ( result ) SMemFree(v2, "C:\\Src\\Diablo\\DiabloUI\\DiabEdit.cpp", 200, 0);
result = (HANDLE)SMemFree(result, "C:\\Src\\Diablo\\DiabloUI\\DiabEdit.cpp", 200, 0); }
return result;
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);

108
DiabloUI/diabloui.cpp

@ -66,11 +66,11 @@
// ref: 0x10005C2A // ref: 0x10005C2A
int DiabloUI_10005C2A() { return 0; } int __cdecl DiabloUI_GetSpawned()
/* { {
return dword_1002972C; return sgbIsSpawn;
} */ }
// 1002972C: using guessed type int dword_1002972C; // 1002972C: using guessed type int sgbIsSpawn;
// ref: 0x10005C30 // ref: 0x10005C30
void __stdcall UiOnPaint(int a1) void __stdcall UiOnPaint(int a1)
@ -79,67 +79,52 @@ void __stdcall UiOnPaint(int a1)
} }
// ref: 0x10005C33 // ref: 0x10005C33
int __stdcall UiSetBackgroundBitmap(int a1, int a2, int a3, int a4, int a5) { return 0; } void __stdcall UiSetBackgroundBitmap(int a1, PALETTEENTRY *a2, int a3, int a4, int a5)
/* { {
dword_1002971C = a3; backbmp_flag1 = a3;
dword_10029720 = a4; backbmp_flag2 = a4;
dword_10029724 = a5; backbmp_flag3 = a5;
return SDrawUpdatePalette(10, 236, a2 + 40, 0); SDrawUpdatePalette(0xAu, 0xECu, a2 + 10, 0);
} */ }
// 100103FA: using guessed type int __stdcall SDrawUpdatePalette(_DWORD, _DWORD, _DWORD, _DWORD); // 1002971C: using guessed type int backbmp_flag1;
// 1002971C: using guessed type int dword_1002971C; // 10029720: using guessed type int backbmp_flag2;
// 10029720: using guessed type int dword_10029720; // 10029724: using guessed type int backbmp_flag3;
// 10029724: using guessed type int dword_10029724;
// ref: 0x10005C67 // ref: 0x10005C67
int __stdcall UiSetSpawned(int a1) { return 0; } void __stdcall UiSetSpawned(BOOL bSpawned)
/* { {
int result; // eax sgbIsSpawn = bSpawned;
}
result = a1; // 1002972C: using guessed type int sgbIsSpawn;
dword_1002972C = a1;
return result;
} */
// 1002972C: using guessed type int dword_1002972C;
// ref: 0x10005C73 // ref: 0x10005C73
void __cdecl UiInitialize() { return; } void __cdecl UiInitialize()
//int UiInitialize() { return 0; } {
/* {
dword_10029714 = 1; dword_10029714 = 1;
TitleSnd_1001030D(); TitleSnd_InitSoundFunc();
artfont_10001098(); artfont_InitAllFonts();
Connect_10002EC4(); Connect_10002EC4();
local_10007FD0(); local_LoadArtCursor();
return bn_prof_100021C4(); bn_prof_100021C4();
} */ }
// 10029714: using guessed type int dword_10029714; // 10029714: using guessed type int dword_10029714;
// ref: 0x10005C96 // ref: 0x10005C96
void __cdecl UiDestroy() { return; } void __cdecl UiDestroy()
//int UiDestroy() { return 0; } {
/* {
int result; // eax
bn_prof_10002247(); bn_prof_10002247();
local_100080AD(); local_FreeArtCursor();
result = Connect_10002E2B(); Connect_10002E2B();
dword_10029714 = 0; dword_10029714 = 0;
return result; }
} */
// 10029714: using guessed type int dword_10029714; // 10029714: using guessed type int dword_10029714;
// ref: 0x10005CAD // ref: 0x10005CAD
void __stdcall UiAppActivate(int a1) { return; } void __stdcall UiAppActivate(BOOL bActive)
//int __stdcall UiAppActivate(int a1) { return 0; } {
/* { app_is_active = bActive;
int result; // eax }
// 10029728: using guessed type int app_is_active;
result = a1;
dword_10029728 = a1;
return result;
} */
// 10029728: using guessed type int dword_10029728;
// ref: 0x10005CB9 // ref: 0x10005CB9
BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@ -148,8 +133,8 @@ BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ {
if ( fdwReason == 1 ) if ( fdwReason == 1 )
{ {
// hInstance = hinstDLL; ghUiInst = hinstDLL;
DiabEdit_100057A6(); DiabEdit_SetupWindow();
local_InitUiPalette(); local_InitUiPalette();
} }
} }
@ -161,12 +146,9 @@ BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
} }
// ref: 0x10005CEA // ref: 0x10005CEA
signed int DiabloUI_10005CEA() { return 0; } void __cdecl DiabloUI_cpp_init()
/* { {
signed int result; // eax DiabloUI_cpp_float = DiabloUI_cpp_float_value;
}
result = 2139095040; // 1001F410: using guessed type int DiabloUI_cpp_float_value;
dword_10029710 = 2139095040; // 10029710: using guessed type int DiabloUI_cpp_float;
return result;
} */
// 10029710: using guessed type int dword_10029710;

4
DiabloUI/diabloui.h

@ -29,10 +29,10 @@ struct ProfFntStruct
}; };
void __cdecl UiDestroy(); void __cdecl UiDestroy();
void __stdcall UiTitleDialog(int a1); BOOL __stdcall UiTitleDialog(int a1);
void __cdecl UiInitialize(); void __cdecl UiInitialize();
void __stdcall UiCopyProtError(int a1); void __stdcall UiCopyProtError(int a1);
void __stdcall UiAppActivate(int a1); void __stdcall UiAppActivate(BOOL bActive);
int __stdcall UiValidPlayerName(char *a1); int __stdcall UiValidPlayerName(char *a1);
int __stdcall UiSelHeroMultDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, int *a6, char *name); int __stdcall UiSelHeroMultDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, int *a6, char *name);
int __stdcall UiSelHeroSingDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, char *name, int *difficulty); int __stdcall UiSelHeroSingDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, char *name, int *difficulty);

BIN
DiabloUI/diabloui.res

Binary file not shown.

10
DiabloUI/doom.cpp

@ -40,7 +40,7 @@ void __fastcall Doom_GetSetWndText(HWND hWnd, int msg, int nFont, int a4)
{ {
v6 = GetWindowLongA(v4, -21); v6 = GetWindowLongA(v4, -21);
local_SetWndLongStr(v6, String); local_SetWndLongStr(v6, String);
SetWindowTextA(v4, (LPCSTR)&wndtext_pointer); SetWindowTextA(v4, &nullcharacter);
} }
} }
} }
@ -104,7 +104,7 @@ void __fastcall Doom_AllocAndSetBMP(HWND hWnd, int bmp_flags)
v3[2] = Rect.bottom; v3[2] = Rect.bottom;
*v3 = (DWORD)SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Doom.cpp", 139, 0); *v3 = (DWORD)SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Doom.cpp", 139, 0);
SetWindowLongA(hWnd, -21, (LONG)v3); SetWindowLongA(hWnd, -21, (LONG)v3);
SDlgSetBitmapI(hWnd, 0, (char *)&wndtext_pointer, -1, bmp_flags, (void *)*v3, 0, v3[1], v3[2], -1); SDlgSetBitmapI(hWnd, 0, &nullcharacter, -1, bmp_flags, (void *)*v3, 0, v3[1], v3[2], -1);
} }
// ref: 0x1000678A // ref: 0x1000678A
@ -167,7 +167,7 @@ void __fastcall Doom_GetSetWndTxt2(HWND hWnd, int msg, int nFont, int a4)
{ {
v5 = GetWindowLongA(v4, -21); v5 = GetWindowLongA(v4, -21);
local_SetWndLongStr(v5, String); local_SetWndLongStr(v5, String);
SetWindowTextA(v4, (LPCSTR)&wndtext_pointer); SetWindowTextA(v4, &nullcharacter);
} }
} }
} }
@ -208,7 +208,7 @@ void __fastcall Doom_GetSetWndTxt3(HWND hWnd, int msg, int nFont)
{ {
v6 = GetWindowLongA(v3, -21); v6 = GetWindowLongA(v3, -21);
local_SetWndLongStr(v6, String); local_SetWndLongStr(v6, String);
SetWindowTextA(v3, (LPCSTR)&wndtext_pointer); SetWindowTextA(v3, &nullcharacter);
} }
} }
} }
@ -280,7 +280,7 @@ void __fastcall Doom_GetSetWndTxt4(HWND hWnd, int msg, int nFont)
{ {
v5 = GetWindowLongA(v3, -21); v5 = GetWindowLongA(v3, -21);
local_SetWndLongStr(v5, String); local_SetWndLongStr(v5, String);
SetWindowTextA(v3, (LPCSTR)&wndtext_pointer); SetWindowTextA(v3, &nullcharacter);
} }
} }
} }

2
DiabloUI/fade.cpp

@ -135,7 +135,7 @@ void __fastcall Fade_SetFadeTimer(int nTime)
// 10029C70: using guessed type int sgbIsFading; // 10029C70: using guessed type int sgbIsFading;
// ref: 0x10007420 // ref: 0x10007420
void __stdcall Fade_TimerFunctionDlg(int a1) void __stdcall Fade_TimerFunctionDlg(int a1, int a2, int a3, int a4)
{ {
if ( sgbFadeRange > 5 ) if ( sgbFadeRange > 5 )
{ {

2
DiabloUI/focus.cpp

@ -230,7 +230,7 @@ void __fastcall Focus_SetFocusTimer(HWND hWnd, const char *pszFileName)
} }
// ref: 0x10007804 // ref: 0x10007804
void __stdcall Focus_SetFocusAndBlit(int hWnd) void __stdcall Focus_SetFocusAndBlit(int hWnd, int a2, int a3, int a4)
{ {
HWND v1; // eax HWND v1; // eax

2
DiabloUI/local.cpp

@ -570,7 +570,7 @@ void __fastcall local_SetDiabloCursor(HWND hWnd)
v3 = 0; v3 = 0;
local_SetCursorDefault(); local_SetCursorDefault();
v2 = LoadCursorA(hInstance, "DIABLOCURSOR"); v2 = LoadCursorA(ghUiInst, "DIABLOCURSOR");
SDlgSetCursor(hWnd, v2, 32512, &v3); SDlgSetCursor(hWnd, v2, 32512, &v3);
} }
// 10010454: using guessed type int __stdcall SDlgSetCursor(_DWORD, _DWORD, _DWORD, _DWORD); // 10010454: using guessed type int __stdcall SDlgSetCursor(_DWORD, _DWORD, _DWORD, _DWORD);

386
DiabloUI/title.cpp

@ -1,352 +1,296 @@
// ref: 0x1000FDEE // ref: 0x1000FDEE
_DWORD *UNKCALL Title_1000FDEE(HWND hWnd) { return 0; } void __fastcall Title_BlitTitleBuffer(HWND hWnd)
/* { {
HWND v1; // esi
_DWORD *v2; // edi _DWORD *v2; // edi
_DWORD *result; // eax int v3; // eax
int v4; // eax HANDLE v4; // esi
_DWORD *v5; // esi
struct tagRECT Rect; // [esp+Ch] [ebp-18h] struct tagRECT Rect; // [esp+Ch] [ebp-18h]
HWND v7; // [esp+1Ch] [ebp-8h]
HWND hWnda; // [esp+20h] [ebp-4h] HWND hWnda; // [esp+20h] [ebp-4h]
v1 = hWnd;
v7 = hWnd;
v2 = (_DWORD *)GetWindowLongA(hWnd, -21); v2 = (_DWORD *)GetWindowLongA(hWnd, -21);
hWnda = GetDlgItem(v1, 1043); hWnda = GetDlgItem(hWnd, 1043);
result = (_DWORD *)IsWindowVisible(v1); if ( IsWindowVisible(hWnd) && hWnda && v2 && *v2 && titlePHTrans[0] )
if ( result && hWnda && v2 && *v2 && dword_1002A510[0] )
{ {
v4 = dword_1002A58C + 1; v3 = titleTransIdx + 1;
dword_1002A58C = v4; titleTransIdx = v3;
if ( !dword_1002A510[v4] || v4 >= 30 ) if ( !titlePHTrans[v3] || v3 >= 30 )
dword_1002A58C = 0; titleTransIdx = 0;
GetWindowRect(hWnda, &Rect); GetWindowRect(hWnda, &Rect);
ScreenToClient(v1, (LPPOINT)&Rect); ScreenToClient(hWnd, (LPPOINT)&Rect);
ScreenToClient(v7, (LPPOINT)&Rect.right); ScreenToClient(hWnd, (LPPOINT)&Rect.right);
result = GetPropA(v7, "TITLE_BUFFER"); v4 = GetPropA(hWnd, "TITLE_BUFFER");
v5 = result; if ( v4 )
if ( result )
{ {
SBltROP3(*result, Rect.left + *v2 + Rect.top * v2[1], result[1], result[2], result[1], v2[1], 0, 13369376); SBltROP3(
STransBlt(*v5, 0, 0, v5[1], dword_1002A510[dword_1002A58C]); *(void **)v4,
result = (_DWORD *)InvalidateRect(hWnda, 0, 0); (void *)(Rect.left + *v2 + Rect.top * v2[1]),
*((_DWORD *)v4 + 1),
*((_DWORD *)v4 + 2),
*((_DWORD *)v4 + 1),
v2[1],
0,
0xCC0020u);
STransBlt(*(void **)v4, 0, 0, *((_DWORD *)v4 + 1), (HANDLE)titlePHTrans[titleTransIdx]);
InvalidateRect(hWnda, 0, 0);
} }
} }
return result; }
} */ // 1002A58C: using guessed type int titleTransIdx;
// 1001036A: using guessed type int __stdcall STransBlt(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 100103F4: using guessed type int __stdcall SBltROP3(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 1002A58C: using guessed type int dword_1002A58C;
// ref: 0x1000FEED // ref: 0x1000FEED
int Title_1000FEED() { return 0; } void __cdecl Title_DeletePhTrans()
/* { {
int *v0; // esi int *v0; // esi
int result; // eax
v0 = dword_1002A510; v0 = (int *)titlePHTrans;
do do
{ {
result = *v0;
if ( *v0 ) if ( *v0 )
{ {
result = STransDelete(*v0); STransDelete((HANDLE)*v0);
*v0 = 0; *v0 = 0;
} }
++v0; ++v0;
} }
while ( (signed int)v0 < (signed int)&dword_1002A588 ); while ( (signed int)v0 < (signed int)&titlePHTrans[30] );
return result; }
} */
// 1001033A: using guessed type int __stdcall STransDelete(_DWORD);
// 1002A588: using guessed type int dword_1002A588;
// ref: 0x1000FF0F // ref: 0x1000FF0F
void **UNKCALL Title_1000FF0F(HWND hWnd) { return 0; } void __fastcall Title_FreeTransMem(HWND hWnd)
/* { {
HWND v1; // esi void **v2; // eax MAPDST
_DWORD *result; // eax void *v4; // eax
_DWORD *v3; // esi
int v4; // eax
v1 = hWnd; Title_DeletePhTrans();
Title_1000FEED(); v2 = (void **)RemovePropA(hWnd, "TITLE_BUFFER");
result = RemovePropA(v1, "TITLE_BUFFER"); if ( v2 )
v3 = result;
if ( result )
{ {
v4 = *result; v4 = *v2;
if ( v4 ) if ( v4 )
{ {
SMemFree(v4, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 114, 0); SMemFree(v4, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 114, 0);
*v3 = 0; *v2 = 0;
} }
result = (_DWORD *)SMemFree(v3, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 117, 0); SMemFree(v2, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 117, 0);
} }
return result; }
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x1000FF51 // ref: 0x1000FF51
HWND UNKCALL Title_1000FF51(HWND arg) { return 0; } void __fastcall Title_SetTitleBMP(HWND hWnd)
/* { {
HWND result; // eax HWND v1; // eax MAPDST
int *v2; // esi _DWORD *v2; // esi
int v3; // eax void *v3; // eax
struct tagRECT Rect; // [esp+0h] [ebp-18h] struct tagRECT Rect; // [esp+0h] [ebp-18h]
HWND v5; // [esp+10h] [ebp-8h]
HWND hDlg; // [esp+14h] [ebp-4h]
hDlg = arg; Title_FreeTransMem(hWnd);
Title_1000FF0F(arg); v1 = GetDlgItem(hWnd, 1043);
result = GetDlgItem(hDlg, 1043); if ( v1 )
v5 = result;
if ( result )
{ {
GetClientRect(result, &Rect); GetClientRect(v1, &Rect);
v2 = (int *)SMemAlloc(12, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 134, 0); v2 = (unsigned int *)SMemAlloc(0xCu, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 134, 0);
v3 = SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 136, 8); v3 = SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 136, 8);
*v2 = v3; *v2 = (unsigned int)v3;
v2[1] = Rect.right; v2[1] = Rect.right;
v2[2] = Rect.bottom; v2[2] = Rect.bottom;
SDlgSetBitmapI(v5, 0, 0, -1, 1, v3, 0, Rect.right, Rect.bottom, -1); SDlgSetBitmapI(v1, 0, 0, -1, 1, v3, 0, Rect.right, Rect.bottom, -1);
result = (HWND)SetPropA(hDlg, "TITLE_BUFFER", v2); SetPropA(hWnd, "TITLE_BUFFER", v2);
} }
return result; }
} */
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010400: using guessed type int __stdcall SDlgSetBitmapI(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x1000FFE8 // ref: 0x1000FFE8
_DWORD *__fastcall Title_1000FFE8(HWND hWnd, int a2) { return 0; } void __fastcall Title_LoadTitleImage(HWND hWnd, const char *pszFileName)
/* { {
HWND v2; // esi
int v3; // edi int v3; // edi
_DWORD *result; // eax _DWORD *v4; // eax
int v5; // esi _DWORD *v5; // esi
int v6; // ebx int v6; // ebx
int v7; // [esp+8h] [ebp-20h] int a5[4]; // [esp+8h] [ebp-20h]
int v8; // [esp+Ch] [ebp-1Ch] int data[2]; // [esp+18h] [ebp-10h]
int v9; // [esp+10h] [ebp-18h] HANDLE *phTransOut; // [esp+20h] [ebp-8h]
int v10; // [esp+14h] [ebp-14h] BYTE *pBuffer; // [esp+24h] [ebp-4h]
char v11; // [esp+18h] [ebp-10h]
int v12; // [esp+1Ch] [ebp-Ch]
int *v13; // [esp+20h] [ebp-8h]
int v14; // [esp+24h] [ebp-4h]
v2 = hWnd;
v3 = 0; v3 = 0;
v14 = 0; pBuffer = 0;
local_100078BE(a2, &v14, &v11); local_LoadArtImage(pszFileName, &pBuffer, (DWORD *)data);
result = GetPropA(v2, "TITLE_BUFFER"); v4 = (unsigned int *)GetPropA(hWnd, "TITLE_BUFFER");
v5 = (int)result; v5 = v4;
if ( v14 ) if ( pBuffer )
{ {
if ( result ) if ( v4 )
{ {
v6 = v12 / result[2]; v6 = data[1] / v4[2];
if ( v6 > 30 ) if ( v6 > 30 )
v6 = 30; v6 = 30;
if ( v6 > 0 ) if ( v6 > 0 )
{ {
v13 = dword_1002A510; phTransOut = (HANDLE *)titlePHTrans;
do do
{ {
v7 = 0; a5[0] = 0;
v9 = *(_DWORD *)(v5 + 4) - 1; a5[2] = v5[1] - 1;
v8 = v3 * *(_DWORD *)(v5 + 8); a5[1] = v3 * v5[2];
v10 = *(_DWORD *)(v5 + 8) + v8 - 1; a5[3] = v5[2] + a5[1] - 1;
STransCreateI(v14, *(_DWORD *)(v5 + 4), *(_DWORD *)(v5 + 8), 8, &v7, 16777466, v13); STransCreateI(pBuffer, v5[1], v5[2], 8, (int)a5, 16777466, phTransOut);
++v13; ++phTransOut;
++v3; ++v3;
} }
while ( v3 < v6 ); while ( v3 < v6 );
} }
} }
result = (_DWORD *)SMemFree(v14, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 197, 0); SMemFree(pBuffer, "C:\\Src\\Diablo\\DiabloUI\\Title.cpp", 197, 0);
} }
dword_1002A58C = 0; titleTransIdx = 0;
return result; }
} */ // 1002A58C: using guessed type int titleTransIdx;
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010346: using guessed type int __stdcall STransCreateI(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 1002A58C: using guessed type int dword_1002A58C;
// ref: 0x1001009E // ref: 0x1001009E
int __fastcall Title_1001009E(HWND hWnd, int a2, HWND hWnda) { return 0; } void __fastcall Title_LoadImgSetTimer(HWND hWnd, const char *pszFileName)
/* { {
int v3; // edi Title_SetTitleBMP(hWnd);
HWND v4; // esi Title_LoadTitleImage(hWnd, pszFileName);
Title_BlitTitleBuffer(hWnd);
v3 = a2; SDlgSetTimer((int)hWnd, 2, 55, Title_BlitTitleBufFnc);
v4 = hWnd; }
Title_1000FF51(hWnd);
Title_1000FFE8(v4, v3);
Title_1000FDEE(v4);
return SDlgSetTimer(v4, 2, 55, Title_100100CB);
} */
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x100100CB // ref: 0x100100CB
_DWORD *__stdcall Title_100100CB(HWND hWnd, int a2, int a3, int a4) { return 0; } void __stdcall Title_BlitTitleBufFnc(int hWnd, int a2, int a3, int a4)
/* { {
return Title_1000FDEE(hWnd); Title_BlitTitleBuffer((HWND)hWnd);
} */ }
// ref: 0x100100DC // ref: 0x100100DC
signed int Title_100100DC() { return 0; } void __cdecl Title_cpp_init()
/* { {
signed int result; // eax Title_cpp_float = Title_cpp_float_value;
}
result = 2139095040; // 1001F47C: using guessed type int Title_cpp_float_value;
dword_1002A588 = 2139095040; // 1002A588: using guessed type int Title_cpp_float;
return result;
} */
// 1002A588: using guessed type int dword_1002A588;
// ref: 0x100100E7 // ref: 0x100100E7
void **UNKCALL Title_100100E7(HWND hWnd) { return 0; } void __fastcall Title_KillTitleTimer(HWND hWnd)
/* { {
HWND v1; // esi HWND v1; // esi
v1 = hWnd; v1 = hWnd;
SDlgKillTimer(hWnd, 2); SDlgKillTimer((int)hWnd, 2);
return Title_1000FF0F(v1); Title_FreeTransMem(v1);
} */ }
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);
// ref: 0x100100FA // ref: 0x100100FA
void __stdcall UiTitleDialog(int a1) { return; } BOOL __stdcall UiTitleDialog(int a1)
/* { {
int v1; // eax int v1; // eax
artfont_10001159(); artfont_LoadAllFonts();
v1 = SDrawGetFrameWindow(); v1 = (int)SDrawGetFrameWindow();
SDlgDialogBoxParam(hInstance, "TITLESCREEN_DIALOG", v1, Title_10010126, a1); SDlgDialogBoxParam(ghUiInst, "TITLESCREEN_DIALOG", v1, Title_MainProc, a1);
return 1; return 1;
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x10010126 // ref: 0x10010126
int __stdcall Title_10010126(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall Title_MainProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v5; // eax HWND v5; // eax
int v6; // [esp+0h] [ebp-8h]
if ( Msg <= 0x111 ) if ( uMsg <= 0x111 )
{ {
if ( Msg != 273 ) if ( uMsg != 273 )
{ {
if ( Msg != 2 ) if ( uMsg != 2 )
{ {
if ( Msg == 135 ) if ( uMsg == 135 )
return 4; return 4;
if ( Msg != 256 ) if ( uMsg != 256 )
{ {
if ( Msg > 0x103 ) if ( uMsg > 0x103 )
{ {
if ( Msg <= 0x105 ) if ( uMsg <= 0x105 )
{ {
v5 = (HWND)SDrawGetFrameWindow(); v5 = (HWND)SDrawGetFrameWindow();
SendMessageA(v5, Msg, wParam, lParam); SendMessageA(v5, uMsg, wParam, lParam);
} }
else if ( Msg == 272 ) else if ( uMsg == 272 )
{ {
Title_1001025A(hWnd, lParam); Title_LoadAllTitleImgs(hWnd, lParam);
PostMessageA(hWnd, 0x7E8u, 0, 0); PostMessageA(hWnd, 0x7E8u, 0, 0);
return 1; return 1;
} }
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, uMsg, (HDC)wParam, (HWND)lParam);
} }
goto LABEL_25; goto LABEL_25;
} }
Title_10010235(hWnd); Title_KillTimerAndFree(hWnd);
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, uMsg, (HDC)wParam, (HWND)lParam);
} }
goto LABEL_25; goto LABEL_25;
} }
if ( Msg != 275 ) if ( uMsg != 275 )
{ {
if ( Msg != 513 && Msg != 516 ) if ( uMsg != 513 && uMsg != 516 )
{ {
if ( Msg == 528 ) if ( uMsg == 528 )
{ {
if ( (_WORD)wParam == 513 || (_WORD)wParam == 516 ) if ( (_WORD)wParam == 513 || (_WORD)wParam == 516 )
Title_100102D7(hWnd); Title_KillAndFadeDlg(hWnd);
} }
else if ( Msg == 2024 ) else if ( uMsg == 2024 )
{ {
if ( !Fade_1000739F() ) if ( !Fade_CheckRange5() )
Fade_100073FD(hWnd, v6); Fade_SetFadeTimer((int)hWnd);
return 0; return 0;
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, uMsg, (HDC)wParam, (HWND)lParam);
} }
LABEL_25: LABEL_25:
Title_100102D7(hWnd); Title_KillAndFadeDlg(hWnd);
return 0; return 0;
} }
if ( wParam == 1 ) if ( wParam == 1 )
goto LABEL_25; goto LABEL_25;
return 0; return 0;
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD); // 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x10010235 // ref: 0x10010235
void UNKCALL Title_10010235(HWND hDlg) { return; } void __fastcall Title_KillTimerAndFree(HWND hWnd)
/* { {
HWND v1; // esi void **v2; // eax
_DWORD *v2; // eax
v1 = hDlg; Title_KillTitleTimer(hWnd);
Title_100100E7(hDlg); Doom_DeleteFreeProcs(hWnd, titlemsgtbl);
Doom_10006C53(v1, (int *)&unk_10023340); v2 = (void **)GetWindowLongA(hWnd, -21);
v2 = (_DWORD *)GetWindowLongA(v1, -21); local_FreeMemPtr(v2);
local_10007F72(v2); }
} */
// ref: 0x1001025A // ref: 0x1001025A
int __fastcall Title_1001025A(HWND hWnd, int a2) { return 0; } void __fastcall Title_LoadAllTitleImgs(HWND hWnd, int time)
/* { {
int v2; // ebx DWORD *v4; // edi
HWND v3; // esi
int *v4; // edi
int result; // eax
HWND v6; // [esp+0h] [ebp-Ch]
v2 = a2; v4 = local_AllocWndLongData();
v3 = hWnd; SetWindowLongA(hWnd, -21, (LONG)v4);
v4 = (int *)local_10007F46();
SetWindowLongA(v3, -21, (LONG)v4);
if ( v4 ) if ( v4 )
{ {
local_10007944((int)v3, 0, &byte_10029448, -1, 1, (int)"ui_art\\title.pcx", v4, v4 + 1, 0); local_LoadArtWithPal(hWnd, 0, &nullcharacter, -1, 1, "ui_art\\title.pcx", (BYTE **)v4, v4 + 1, 0);
Fade_100073C5(v3, 0); Fade_NoInputAndArt(hWnd, 0);
} }
Doom_100068AB(v3, (int *)&unk_10023340, 3); Doom_ParseWndProc3(hWnd, titlemsgtbl, 3);
Title_1001009E(v3, (int)"ui_art\\logo.pcx", v6); Title_LoadImgSetTimer(hWnd, "ui_art\\logo.pcx");
if ( v2 ) if ( time )
result = SDlgSetTimer(v3, 1, 1000 * v2, 0); SDlgSetTimer((int)hWnd, 1, 1000 * time, 0);
else else
result = SDlgSetTimer(v3, 1, 5000, 0); SDlgSetTimer((int)hWnd, 1, 5000, 0);
return result; }
} */
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x100102D7 // ref: 0x100102D7
int UNKCALL Title_100102D7(void *arg) { return 0; } void __fastcall Title_KillAndFadeDlg(HWND hWnd)
/* { {
void *v1; // esi Fade_Range5SetZero();
SDlgKillTimer((int)hWnd, 1);
v1 = arg; Fade_UpdatePaletteRange(10);
Fade_100073B4(); SDlgEndDialog(hWnd, (void *)HANDLE_FLAG_INHERIT);
SDlgKillTimer(v1, 1); }
Fade_100072BE(10);
return SDlgEndDialog(v1, 1);
} */
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);

2
MakefileVC

@ -67,7 +67,7 @@ Diablo.exe: main_files $(PKWARE_OBJS) diablo.res DiabloUI/diabloui.lib 3rdParty/
$(VC_LINK) /OUT:$@ $(LINKFLAGS) $(OBJS) $(PKWARE_OBJS) diablo.res advapi32.lib gdi32.lib shell32.lib user32.lib version.lib DiabloUI/diabloui.lib 3rdParty/Storm/Source/storm.lib $(VC_LINK) /OUT:$@ $(LINKFLAGS) $(OBJS) $(PKWARE_OBJS) diablo.res advapi32.lib gdi32.lib shell32.lib user32.lib version.lib DiabloUI/diabloui.lib 3rdParty/Storm/Source/storm.lib
DiabloUI/diabloui.lib: $(DIABLOUI_OBJS) 3rdParty/Storm/Source/storm.lib DiabloUI/diabloui.lib: $(DIABLOUI_OBJS) 3rdParty/Storm/Source/storm.lib
$(CL) $^ /link /LINK50COMPAT /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC6_LIB_DIR) advapi32.lib gdi32.lib shell32.lib user32.lib version.lib 3rdParty/Storm/Source/storm.lib /def:"DiabloUI/diabloui.def" /out:DiabloUI/diabloui.dll $(CL) $^ /link /LINK50COMPAT /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC6_LIB_DIR) DiabloUI/diabloui.res advapi32.lib gdi32.lib shell32.lib user32.lib version.lib 3rdParty/Storm/Source/storm.lib /def:"DiabloUI/diabloui.def" /out:DiabloUI/diabloui.dll
3rdParty/Storm/Source/storm.lib: $(STORM_OBJS) 3rdParty/Storm/Source/storm.lib: $(STORM_OBJS)
$(CL) $^ /link /LINK50COMPAT /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC6_LIB_DIR) /def:"3rdParty/Storm/Source/storm.def" /out:3rdParty/Storm/Source/storm.dll $(CL) $^ /link /LINK50COMPAT /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC6_LIB_DIR) /def:"3rdParty/Storm/Source/storm.def" /out:3rdParty/Storm/Source/storm.dll

Loading…
Cancel
Save