Porting d2multires to 1.13

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Sammy
Posts: 14
Joined: Fri Jun 22, 2012 4:47 am

Porting d2multires to 1.13

Post by Sammy » Fri Jun 22, 2012 4:57 am

Below is an attempt to port d2multires to 1.13 as the original author has vanished, it is mostly done but I don't have time to finish it any time soon. Perhaps someone else would be interested in finishing it

There are two things that need to be modified.
multiresgame.exe is just game.exe with two small hex changes, or you can put the following line in plugy so you can avoid using the .exe all together, "DllToLoad=D2MultiRes.dll"

After close inspection I think the following are the only changes which need to be made to D2MultiRes.dll to get it working are the following ones

The numbers at the end of the command are just hex addresses for code in other files which multires.dll depends on, such as commondll, so D2MultiRes.dll needs to be updated with the new hex locations the code has changed to.

Format:
Hex location of command in D2multires.dll, hex code of command, command with referenced hex location
"referenced hex location" and the dll it references
Change that needs to be made.

The following changes are all for the 1.13c version of diablo, it won't work until all the locations are updated. I have most of them but I am missing a few and I am unsure about a couple of them due to code changes between versions.

00005B50 8D88 B0750500 LEA ECX,DWORD PTR DS:[EAX+575B0]
"575B0" is a hex address in D2Common.dll
Change to: LEA ECX,DWORD PTR DS:[EAX+2FE10]

00005B56 8D90 20580500 LEA EDX,DWORD PTR DS:[EAX+55820]
"55820" is a hex address in D2Common.dll
LEA EDX,DWORD PTR DS:[EAX+3BA20] (not 100% sure this is the right address change, it is hard to tell, but it is probably it)

00005B62 8D88 60580500 LEA ECX,DWORD PTR DS:[EAX+55860]
"55860" is a hex address in D2Common.dll
change to: LEA ECX,DWORD PTR DS:[EAX+3BA60]

00005B6E 8D90 50590500 LEA EDX,DWORD PTR DS:[EAX+55950]
"55950" is a hex address in D2Common.dll
change to: LEA EDX,DWORD PTR DS:[EAX+3BB50] (not 100% sure this is the right address change, it is hard to tell, but it is probably is)

00005B74 05 50550500 ADD EAX,55550
"55550" is a hex address in D2Common.dll
change to: ADD EAX,3B7D0

00005B90 8D91 608E0000 LEA EDX,DWORD PTR DS:[ECX+8E60]
"8E60" is a hex address in D2gfx.dll
change to:LEA EDX,DWORD PTR DS:[ECX+B310] (probably the right address but not 100% sure)

00005BA2 8D82 70C10800 LEA EAX,DWORD PTR DS:[EDX+8C170]
"8C170" is a hex address in D2Client.dll
change to: LEA EAX,DWORD PTR DS:[EDX+BF6C0]

00005BB2 05 00960000 ADD EAX,9600
"9600" is a hex address in d2cmp
change to: ADD EAX,11520

00005BC1 05 104C0100 ADD EAX,14C10
"14C10" is a hex address in fog
change to: ADD EAX,1CCF0

00005BCB 8D81 C07E0000 LEA EAX,DWORD PTR DS:[ECX+7EC0]
"7EC0" is a hex address in D2gfx.dll
change to: LEA EAX,DWORD PTR DS:[ECX+B050]

00005BD1 8DB2 80890600 LEA ESI,DWORD PTR DS:[EDX+68980]
"68980" is a hex address in D2client.dll
change to: LEA ESI,DWORD PTR DS:[EDX+13CE0]

00005BE7 8DB0 D0080100 LEA ESI,DWORD PTR DS:[EAX+108D0]
"108D0" is a hex address in D2Win.dll
change to: LEA ESI,DWORD PTR DS:[EAX+12FE0]

00005BF3 8DB0 90080100 LEA ESI,DWORD PTR DS:[EAX+10890]
"10890" is a hex address in D2Win.dll
change to: LEA ESI,DWORD PTR DS:[EAX+12FA0]

00005BFF 8DB1 107D0000 LEA ESI,DWORD PTR DS:[ECX+7D10]
"7D10" is a hex address in D2gfx.dll
change to: LEA ESI,DWORD PTR DS:[EAX+B9F0]

00005C05 81C1 E08D0000 ADD ECX,8DE0
"8DE0" is a hex address in D2gfx
change to: ADD ECX,B280 (99% sure)

00005C17 05 407E0000 ADD EAX,7E40
"7E40" is a hex address in D2win.dll
change to: ADD EAX,07E60

00005C27 8D86 70B60100 LEA EAX,DWORD PTR DS:[ESI+1B670]
"1B670" is a hex address in Storm.dll
change to: LEA EAX,DWORD PTR DS:[ESI+3C1D0]

00005C32 8D9E 20B50100 LEA EBX,DWORD PTR DS:[ESI+1B520]
"1B520" is a hex address in Storm.dll
change to: LEA EBX,DWORD PTR DS:[ESI+3C080]

00005C40 81C2 30260100 ADD EDX,12630
"12630" is a hex address in D2Client.dll
change to: ADD EDX,10DF0 (not 100% sure this is the right address change)
Last edited by Sammy on Fri Jun 29, 2012 11:54 am, edited 1 time in total.

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Porting d2multires to 1.13

Post by kidpaddle94 » Fri Jun 22, 2012 12:41 pm

Yes, it's about time to update this mod. Also, that would be nice for my mod. So I will help.
Though, I'm in the obligation to tell you that the required amount of work is much more huge than what you thought! There are much more pointers that need to be updated, mostly due to the patching code which is huge.

We are going to have to split the work. At first, no edits in the dll itself will be done. We will write everything we need in Notepad++, then I will update the dll, once we have all the needed code. I should have all codes that need to be updated until tonight.

Let's start, here is what I have right now (Well, I have more, but on paper. I need to format it, will be posted soon. Check my post for regular edits)
Don't start to update pointers until I have them all in here. Then we can split the work.

D2Client

Code: Select all

D2MultiRes.dll Offset | 1.12a Pointer | 1.13c Pointer

3ACD		D2CLIENT.0x1263D		D2CLIENT.0x
3C38		D2CLIENT.0x56150		D2CLIENT.0x
3C76		D2CLIENT.0x6905A		D2CLIENT.0x
3CC3		D2CLIENT.0x6E265		D2CLIENT.0x
3CF7		D2CLIENT.0xCD760		D2CLIENT.0x
3D2A		D2CLIENT.0x55D08		D2CLIENT.0x
3D68		D2CLIENT.0x5613A		D2CLIENT.0x
3DA6		D2CLIENT.0x67ED2		D2CLIENT.0x
3DF4		D2CLIENT.0x7CC44		D2CLIENT.0x
3E22		D2CLIENT.0x82249		D2CLIENT.0x
3EE0		D2CLIENT.0x836C7		D2CLIENT.0x
3E90		D2CLIENT.0x90161		D2CLIENT.0x
3EC3		D2CLIENT.0x62F40		D2CLIENT.0x
3EF9		D2CLIENT.0xCD790		D2CLIENT.0x
3F4B		D2CLIENT.0x55347		D2CLIENT.0x
3F81		D2CLIENT.0xCD7B0		D2CLIENT.0x
3FB4		D2CLIENT.0x55298		D2CLIENT.0x
3FF2		D2CLIENT.0xCD7E0		D2CLIENT.0x
4025		D2CLIENT.0x90524		D2CLIENT.0x
405B		D2CLIENT.0xCD800		D2CLIENT.0x
4097		D2CLIENT.0x30381		D2CLIENT.0x
40DC		D2CLIENT.0xD5388		D2CLIENT.0x
4111		D2CLIENT.0xBA9DB		D2CLIENT.0x
414A		D2CLIENT.0xCD820		D2CLIENT.0x
41CB		D2CLIENT.0x6906C		D2CLIENT.0x
41F2		D2CLIENT.0xCD770		D2CLIENT.0x
4219		D2CLIENT.0x824B0		D2CLIENT.0x
4240		D2CLIENT.0x836D8		D2CLIENT.0x
4267		D2CLIENT.0x90174		D2CLIENT.0x
428E		D2CLIENT.0xCD7A4		D2CLIENT.0x
42B5		D2CLIENT.0x56158		D2CLIENT.0x
42DC		D2CLIENT.0xCD7CC		D2CLIENT.0x
4303		D2CLIENT.0xCD810		D2CLIENT.0x
432A		D2CLIENT.0x3038C		D2CLIENT.0x
D2Gfx

Code: Select all

D2MultiRes.dll Offset | 1.12a Pointer | 1.13c Pointer

472A		D2GFX.0x8590		D2GFX.0x
4840		D2GFX.0xA609		D2GFX.0x
487B		D2GFX.0xC9E0		D2GFX.0x
48B7		D2GFX.0xB477		D2GFX.0x
48F7		D2GFX.0xC9F0		D2GFX.0x
4933		D2GFX.0xA80A		D2GFX.0x
4973		D2GFX.0xCA00		D2GFX.0x
49AF		D2GFX.0xB8A0		D2GFX.0x
49EF		D2GFX.0xCA10		D2GFX.0x
4A2B		D2GFX.0xA2DC		D2GFX.0x
4A6B		D2GFX.0xCA20		D2GFX.0x
4AA7		D2GFX.0x8B7C		D2GFX.0x
4AE2		D2GFX.0xCA30		D2GFX.0x
4B34		D2GFX.0x85B0		D2GFX.0x
4B5B		D2GFX.0x85B4		D2GFX.0x
4B82		D2GFX.0xCA44		D2GFX.0x
D2Gdi

Code: Select all

D2MultiRes.dll Offset | 1.12a Pointer | 1.13c Pointer

4DF7		D2GDI.0x6284		D2GDI.0x
4F47		D2GDI.0x658C		D2GDI.0x
4F7A		D2GDI.0x6684		D2GDI.0x
4FAD		D2GDI.0x62A0		D2GDI.0x
4FD4		D2GDI.0x62A4		D2GDI.0x	
D2Common

Code: Select all

D2MultiRes.dll Offset | 1.12a Pointer | 1.13c Pointer

5292		D2COMMON.0x1AFF0		D2COMMON.0x
52A5		D2COMMON.0x1B080		D2COMMON.0x
52CC		D2COMMON.0x1B100		D2COMMON.0x
52F3		D2COMMON.0x1B0F0		D2COMMON.0x
5322		D2COMMON.0x886A0		D2COMMON.0x
535E		D2COMMON.0x1B072		D2COMMON.0x
538D		D2COMMON.0x886C0		D2COMMON.0x
53C9		D2COMMON.0x1B166		D2COMMON.0x
53F8		D2COMMON.0x886E0		D2COMMON.0x
5434		D2COMMON.0x4BA66		D2COMMON.0x
545B		D2COMMON.0x4BB10		D2COMMON.0x
5485		D2COMMON.0x4BA85		D2COMMON.0x
54B4		D2COMMON.0x88700		D2COMMON.0x
54F0		D2COMMON.0x4BB81		D2COMMON.0x
551F		D2COMMON.0x88720		D2COMMON.0x
555B		D2COMMON.0x886B0		D2COMMON.0x
5582		D2COMMON.0x886D0		D2COMMON.0x
55A9		D2COMMON.0x886F0		D2COMMON.0x
55D0		D2COMMON.0x88710		D2COMMON.0x
55F7		D2COMMON.0x88730		D2COMMON.0x		
D2Direct

Code: Select all

D2MultiRes.dll Offset | 1.12a Pointer | 1.13c Pointer

5624		D2DIRECT.0xFCCC		D2DIRECT.0x
5843		D2DIRECT.0xFCF0		D2DIRECT.0x
586A		D2DIRECT.0xFCF4		D2DIRECT.0x

Sammy
Posts: 14
Joined: Fri Jun 22, 2012 4:47 am

Re: Porting d2multires to 1.13

Post by Sammy » Fri Jun 29, 2012 12:14 pm

I believe I have found the rest of the unknowns in my original post, they were references to d2cmp.dll, fog.dll and gfx.dll

When we have a full list of pointers we can start on finding the new pointer locations.

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: Porting d2multires to 1.13

Post by Necrolis » Fri Jun 29, 2012 2:49 pm

something I was doing as a favour for someone on another board long ago, seeing as sluggy disappeared and didn't respond to emails (note: there are still 5 TODO's left, this is the code of 1.02, no changes, other than where noted, also, 100% credits to Sluggy):

Code: Select all

#pragma pack(1)
struct D2Rect
{
	int nWidth, nWidthEx;
	int nHeight, nHeightEx;
};

struct D2View
{
	unsigned long dwPad;
	int nWidth, nWidthEx;
	int nHeight, nHeightEx;
};

struct D2Bounds
{
	unsigned long dwPad;
	unsigned char nBounds;
	unsigned char nPad[3];
	D2Rect pRects[1]; //no clue how long this can get, so w/e
};
#pragma pack()

//1000692E                   |.  A1 C8BC0010        MOV EAX,DWORD PTR DS:[1000BCC8]
FILE* gpLogFile = NULL;

//10003932                   |> \8B14B5 10A00010    |MOV EDX,DWORD PTR DS:[ESI*4+1000A010]
const char*  gszDllFiles[] = 
{
	"D2Client.dll",
	"D2GFX.dll",
	"D2GDI.dll",
	"D2Common.dll",
	"D2CMP.dll",
	"Fog.dll",
	"D2Win.dll",
	"Storm.dll",
	"D2DDraw.dll",
	"D2Direct3D.dll",
};

//1000394F                   |.  8904B5 E8BB0010    |MOV DWORD PTR DS:[ESI*4+1000BBE8],EAX
HMODULE ghDllFiles[ARRAY(gszDllFiles)] = {NULL};

//1000395C                   |.  8B14B5 38A00010    |MOV EDX,DWORD PTR DS:[ESI*4+1000A038]
DWORD gdwModuleSizes[ARRAY(gszDllFiles)] =
{
	0x00134000,
	0x00020000,
	0x0000D000, 
	0x000A8000, 
	0x00107000, 
	0x0005B000, 
	0x000CD000, 
	0x0005F000, 
	0x00012000, 
	0x00035000
};

//1000113B                         |.  3B05 10BC0010      CMP EAX,DWORD PTR DS:[1000BC10]
DWORD gdwResolutions = 0;

//1000114B                         |> \8B0485 E8B30010    MOV EAX,DWORD PTR DS:[EAX*4+1000B3E8]
DWORD gdwResolutionHeights[255] = {0};

//1000118D                         |> \8B0485 E8B70010    MOV EAX,DWORD PTR DS:[EAX*4+1000B7E8]
DWORD gdwResolutionWidths[255] = {0};

//10001640                          .  A1 14BC0010        MOV EAX,DWORD PTR DS:[1000BC14]
DWORD gdwKeyDown = 0;

//1000169A                          .  A3 18BC0010        MOV DWORD PTR DS:[1000BC18],EAX                    ; |
HWND ghWnd = NULL;

//100016B4                          .  A3 1CBC0010        MOV DWORD PTR DS:[<gpWndProc>],EAX
WNDPROC gpWndProc = NULL;

//100016C0                          .  A3 7CBC0010        MOV DWORD PTR DS:[1000BC7C],EAX
HANDLE ghArchive = NULL;

//100016F4                          > /8B04B5 60A00010    MOV EAX,DWORD PTR DS:[ESI*4+1000A060]
const char* gszPanels[] =
{
	"D2MRStoneBack",
	"D2MRFancyBorderCorner",
	"D2MRFancyBorderTop",
	"D2MRFancyBorderBottom",
	"D2MRFancyBorderLeft",
	"D2MRFancyBorderRight",
	"D2MRFancyVerticalBar",
	"D2MRFancyHorizontalBar",
	"D2MRFancyBorderInterfaceLeft",
	"D2MRHorizontalBlackBar",
	"D2MRVerticalBlackBar",
	"D2MRHorizontalBorder",
	"D2MRVerticalBorder",
	"D2MRFancyBorderInterfaceRight",
	"D2MRFancyPanelLeft",
	"D2MRFancyPanelRight",
	"D2MRFancyPanelBar",
	"D2MRChooseResolutionBack",
};

//10001717                          .  8904B5 80BC0010    MOV DWORD PTR DS:[ESI*4+1000BC80],EAX
void* gpPanels[ARRAY(gszPanels)] = {NULL};

//100038C4                   |.  E8 57D7FFFF        CALL D2MultiR.10001020
void __stdcall Log(const char* szFormat)
{
	//this was really faggy, fixed it up a little...
	fprintf(gpLogFile,"%s\n",szFormat);		
	fflush(gpLogFile);
}

//this can only have been an inline
inline BOOL CheckModes(DEVMODE* pDevMode)
{
	if(gdwResolutions > 0)
	{
		for(int j = 0; j < gdwResolutions; j++)
		{
			if(gdwResolutionWidths[j] == pDevMode.dmPelsWidth && gdwResolutionHeights[j] == pDevMode.dmPelsHeight)
				return TRUE;
		}	
	}
	
	return FALSE;
}

//100038C9                   |.  E8 72FDFFFF        CALL D2MultiR.10003640
BOOL __stdcall EnumDisplayModes()
{
	Log("Enumerating Display Modes...");
	gdwResolutions = 0;
	int i = 0;
	while(gdwResolutions < ARRAY(gdwResolutionWidths))
	{
		DEVMODE pDevMode = {NULL};
		pDevMode.dmSize = sizeof(DEVMODE);
		if(!EnumDisplaySettings(NULL,i,&pDevMode))
			break;
			
		if(pDevMode.dmPelsWidth > 640 && pDevMode.dmPelsHeight > 480)
		{
			if(CheckModes(&pDevMode))
			{
				i++;
				continue;
			}
			
			gdwResolutionWidths[gdwResolutions] = pDevMode.dmPelsWidth;
			gdwResolutionHeights[gdwResolutions] = pDevMode.dmPelsHeight;
			gdwResolutions++;
			fprintf(gpLogFile,"Added Display Mode: %d x %d\n",pDevMode.dmPelsWidth,pDevMode.dmPelsHeight);
		}
		
		i++;
	}
	
	fprintf(gpLogFile,"Enumeration Complete: %d Display Mode(s) Found\n",gdwResolutions);
	return (gdwResolutions != 0);
}

//1000684B                                     |.  C705 20BC0010 A011>MOV DWORD PTR DS:[1000BC20],D2Mult_1.100011A0
void* __stdcall GetPlayer()
{
	return *reinterpret_cast<void**>(ghDllFiles[0] + 0x11C3D0);
}

//10006855                         |.  C705 24BC0010 B011>MOV DWORD PTR DS:[1000BC24],D2Mult_1.100011B0
void* __stdcall GetView()
{
	return *reinterpret_cast<void**>(ghDllFiles[0] + 0x11C028);
}

//1000685F                         |.  C705 28BC0010 C011>MOV DWORD PTR DS:[1000BC28],D2Mult_1.100011C0
int __stdcall GetViewWidth(void* pView)
{
	return reinterpret_cast<int*>(pView)[9];
}

//10006869                         |.  C705 2CBC0010 D011>MOV DWORD PTR DS:[1000BC2C],D2Mult_1.100011D0
int __stdcall GetViewHeight(void* pView)
{
	return reinterpret_cast<int*>(pView)[10];
}

//1000672B                         |> \C703 20110010      MOV DWORD PTR DS:[EBX],D2Mult_1.10001120             ;  Entry address
size_t __stdcall GetHeight(int nMode)
{	
	if(nMode < 10)
		return (nMode == 0) ? 480 : 600;
		
	if((nMode -= 10) < gdwResolutions)
		return gdwResolutionHeights[nMode];

	return 600;
}

//10006705                         |> \C703 60110010      MOV DWORD PTR DS:[EBX],D2Mult_1.10001160             ;  Entry address
size_t __stdcall GetWidth(int nMode)
{
	if(nMode < 10)
		return (nMode == 0) ? 640 : 800;
		
	if((nMode -= 10) < gdwResolutions)
		return gdwResolutionWidths[nMode];

	return 800;
}

//10004F3D                         |> \C745 00 D01E0010   MOV DWORD PTR SS:[EBP],D2Mult_1.10001ED0
void __stdcall DrawHelpScreen()
{
	int nResMode = D2GetResMode();
	int nXpos = (GetWidth(nResMode) - 560) / 2;						//these where inlined, i don't care :P
	int nYpos = (GetHeight(nResMode) - 400) / 2;
	int nOldFont = D2SetFont(5);
	D2DrawText(L"Dear Friend, ",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"It is our sincere hope that you are enjoying Diablo II in more",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"resolutions than originally provided.  However, it has come to",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"our attention that you are seeking access to the help screen.",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"We regret to inform you that the creator of D2MultiRes did not",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"take the time or trouble to create a help screen that could",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"span multiple resolutions.  We would assume, though, that anybody",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"using this does not truly require help.  And to be quite honest,",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"there's not much you need to know.  Take your mouse, click the",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"monster, watch it die.  We would apologize for any inconvenience",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"this has caused, but quite frankly we don't really care.  Thank",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"you and good day.",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"Sincerly, ",nXpos,nYpos,0,0);
	nYpos += 30;
	D2DrawText(L"-The Management",nXpos,nYpos,0,0);	
	D2SetFont(nOldFont);
}

//10004EEF                         |> \C745 00 40160010   MOV DWORD PTR SS:[EBP],D2Mult_1.10001640
DWORD __stdcall GetKeyDown()
{
	return gdwKeyDown;
}

//10004EC8                         |> \C745 00 30160010   MOV DWORD PTR SS:[EBP],D2Mult_1.10001630
void __stdcall SetKeyDown()
{
	gdwKeyDown = 1;
}

//10001710                          .  E8 3BFBFFFF                CALL D2Mult_1.10001250
void* __stdcall __declspec(naked) LoadImage(const char* szBuffer)
{
	__asm
	{
		push esi
		mov esi,[esp + 8]
		call [D2LoadUIImage]
		pop esi
		retn
	}
}

//100015E4                          .  E8 27FEFFFF                CALL D2Mult_1.10001410
HRESULT __stdcall ProcessClick(WPARAM wParam)
{
	//more..
}

//10001692                          > \68 30150010        PUSH D2Mult_1.10001530                             ; /NewValue = 10001530
HRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, LPARAM lParam, WPARAM wParam)
{
	if(!*reinterpret_cast<BOOL*>(ghDllFiles[0] + 0x11C3D0) || !gdwKeyDown)
		return CallWindowProc(gpWndProc,hWnd,uMsg,lParam,wParam);
		
	switch(uMsg)
	{
		case WM_KEYDOWN:
		{
			if(lParam == 0x1B)
				gdwKeyDown = 0;
				
			return FALSE;
		}
		
		case WM_MOUSEMOVE:
		{
			*reinterpret_cast<int*>(ghDllFiles[0] + 0x101638) = LOWORD(wParam);
			*reinterpret_cast<int*>(ghDllFiles[0] + 0x101634) = HIWORD(wParam);
			return FALSE;
		}
		
		case WM_LBUTTONDOWN: return ProcessClick(wParam);
		
		case WM_KEYUP:
		case WM_CHAR:
		case WM_SYSKEYDOWN:
		case WM_SYSKEYUP:
		case WM_LBUTTONUP:
		case WM_LBUTTONDBLCLK:
		case WM_RBUTTONDOWN:
		case WM_RBUTTONUP:
		case WM_RBUTTONDBLCLK:
		case WM_MBUTTONDOWN:
		case WM_MBUTTONUP:
		case WM_MBUTTONDBLCLK:
			return FALSE;
	}
	
	return CallWindowProc(gpWndProc,hWnd,uMsg,lParam,wParam);
}

//10005795                         |> \C745 00 50160010   MOV DWORD PTR SS:[EBP],D2Mult_1.10001650
HWND __stdcall InitWindow(HWND hWnd)
{
	if(hWnd == NULL)
	{
		LOG("ERROR: Null window handle provided to SetWindowHandle.");
		return NULL;
	}
	
	ghWnd = hWnd;
	gpWndProc = SetWindowLong(hWnd,GWL_WNDPROC,WndProc);
	if(!D2LoadArchive("D2MultiRes.mpq",3000,2,&ghArchive)) //{filtered} inline asm, storm ords ftw!
	{
		LOG("ERROR: Unable to load D2MultiRes.mpq.  Diablo II will now exit.");
		return NULL;	
	}

	char szBuffer[512] = {'\0'};
	for(int i = 0; i < ARRAY(gszPanels); i++)
	{
		sprintf(szBuffer,"Panel\\%s",gszPanels[i]);
		if((gpPanels[i] = LoadImage(szBuffer)) == NULL)
		{
			LOG("ERROR: Unable to load D2MultiRes.mpq.  Diablo II will now exit.");
			return NULL;
		}
	}
	
	return hWnd;
}

//100033A0                                                 .  FF15 40BC0010                                  CALL DWORD PTR DS:[<D2GetResMode>]
//SIGH, dunno how DCE and constant propagation didn't fix this up...
//so now I've fixed it
void __stdcall SetDisplayRect(D2Rect* pRect)
{
	int nWidth, nHeight;
	int nMode = D2GetResMode();
	if(nMode >= 10)
	{
		nMode -= 10;
		if(nMode >= gdwResolutions)
		{
			nWidth = 800;
			nHeight = 600;
		}
		else
		{
			nWidth = gdwResolutionWidths[nMode];
			nHeight = gdwResolutionHeights[nMode];	
		}		
	}
	else if(nMode != 0)
	{
		nWidth = 800;
		nHeight = 600;
	}
	else
	{
		nWidth = 640;
		nHeight = 480;
	}
	
	nWidth -= 640;
	nWidth /= 2;
	pRect->nWidth = nWidth;
	pRect->nWdithEx = nWidth;
	nHeight -= 480;
	nHeight /= 2;
	pRect->nHeight = nHeight;
	pRect->nHeightEx = nHeight;
}

//100034A0                                                 .  8B4C24 04                                      MOV ECX,DWORD PTR SS:[ESP+4]
//this never call SetDisplayRect(D2Rect* pRect), but its the EXACT same code -.-
void __stdcall FillDisplayBounds(D2Bounds* pBounds)
{
	int nBounds = pBounds->nBounds;
	for(int i = 0; i < nBounds; i++)
	{
		D2Rect* pRect = &pBounds->nRects[i];
		SetDisplayRect(pRect);
	}
}

//10003320                                                 .  FF15 40BC0010                                  CALL DWORD PTR DS:[<D2GetResMode>]
void __stdcall SetViewBounds(D2View* pView)
{
	int nWidth, nHeight;
	int nMode = D2GetResMode();
	if(nMode >= 10)
	{
		nMode -= 10;
		if(nMode >= gdwResolutions)
		{
			nWidth = 800;
			nHeight = 600;
		}
		else
		{
			nWidth = gdwResolutionWidths[nMode];
			nHeight = gdwResolutionHeights[nMode];	
		}		
	}
	else if(nMode != 0)
	{
		nWidth = 800;
		nHeight = 600;
	}
	else
	{
		nWidth = 640;
		nHeight = 480;
	}
	
	nWidth -= 640;
	nWidth /= 2;
	pView->nWidth = nWidth;
	pView->nWdithEx = nWidth;
	nHeight -= 480;
	nHeight /= 2;
	pView->nHeight = nHeight;
	pView->nHeightEx = nHeight;
}

//10003420                                                 .  FF15 40BC0010                                  CALL DWORD PTR DS:[<D2GetResMode>]
void __stdcall SetDisplayRectEx(D2Rect* pRect)
{
	int nWidth, nHeight;
	int nMode = D2GetResMode();
	if(nMode >= 10)
	{
		nMode -= 10;
		if(nMode >= gdwResolutions)
		{
			nWidth = 800;
			nHeight = 600;
		}
		else
		{
			nWidth = gdwResolutionWidths[nMode];
			nHeight = gdwResolutionHeights[nMode];	
		}		
	}
	else if(nMode != 0)
	{
		nWidth = 800;
		nHeight = 600;
	}
	else
	{
		nWidth = 640;
		nHeight = 480;
	}
	
	nWidth -= 640;
	nWidth /= 2;
	pRect->nWidth = nWidth;
	pRect->nWdithEx = nWidth;
	nHeight -= 480;
	pRect->nHeight = nHeight;
	pRect->nHeightEx = nHeight;
}

struct D2Dlg
{
	unsigned long dwPad[8]; //+00
	struct
	{
		int nXpos;//+00
		int nYpos;//+04
	}pPos[3]; //+20/+28/+30
};

struct D2DlgProxy
{
	D2Dlg* pDlg;
	D2DlgProxy* pNext;
};

struct D2DlgManager
{
	unsigned long dwPad[11]; //+00
	int nXpos; //+2C
	int nYpos; //+30
	unsigned long dwPad2[11]; //+34	
	void* pfDraw; //+60
	unsigned long dwPad3[681]; //+64	
	D2DlgProxy* pChain; //+0B08
};

//10003550                                                 .  56                                             PUSH ESI
void __stdcall AdjustDialogPositions(D2DlgManager* pDlgM)
{
	if(pDlgM == NULL || pDlgM->pfDraw == reinterpret_cast<void*>(D2ClientBase + 0x6F3E0 /* 0x6FB1F3E0 */))
		return;
		
	int nWidth, nHeight;
	int nMode = D2GetResMode();
	if(nMode >= 10)
	{
		nMode -= 10;
		if(nMode >= gdwResolutions)
		{
			nWidth = 800;
			nHeight = 600;
		}
		else
		{
			nWidth = gdwResolutionWidths[nMode];
			nHeight = gdwResolutionHeights[nMode];	
		}		
	}
	else if(nMode != 0)
	{
		nWidth = 800;
		nHeight = 600;
	}
	else
	{
		nWidth = 640;
		nHeight = 480;
	}

	nWidth -= 210;
	nWidth /= 2;
	nHeight -= 158;
	nHeight /= 2;	
	
	int nXpos = pDlgM->nXpos;
	int nYpos = pDlgM->nYpos;
	pDlgM->nXpos = nWdith;
	pDlgM->nYpos = nHeight;
	
	D2DlgProxy* pStart = pDlgM->pChain;
	int nAdjustX = nWidth - nXpos;
	int nAdjustY = nHeight - nYpos;
	while(pStart != NULL)
	{
		D2Dlg* pDlg = pStart->pDlg;
		pDlg->pPos[0].nXpos += nAdjustX;
		pDlg->pPos[0].nYpos += nAdjustY;
		pDlg->pPos[1].nXpos += nAdjustX;
		pDlg->pPos[1].nYpos += nAdjustY;
		pDlg->pPos[2].nXpos += nAdjustX;
		pDlg->pPos[2].nYpos += nAdjustY;		
		pStart = pStart->pNext;
	}
}

//100032A0                                                 .  FF15 40BC0010                                  CALL DWORD PTR DS:[<D2GetResMode>]
void __stdcall GetScreenSizeAdjustment(int* pX, int* pY)
{
	int nWidth, nHeight;
	int nMode = D2GetResMode();
	if(nMode >= 10)
	{
		nMode -= 10;
		if(nMode >= gdwResolutions)
		{
			nWidth = 800;
			nHeight = 600;
		}
		else
		{
			nWidth = gdwResolutionWidths[nMode];
			nHeight = gdwResolutionHeights[nMode];	
		}		
	}
	else if(nMode != 0)
	{
		nWidth = 800;
		nHeight = 600;
	}
	else
	{
		nWidth = 640;
		nHeight = 480;
	}
	
	nWidth -= 640;
	nWidth /= 2;
	nHeight -= 480;
	nHeight /= 2;
	*pX = nWidth;
	*pY = nHeight;
}

//10006923                   |.  E8 38CFFFFF        CALL D2MultiR.10003860
BOOL __stdcall MultiResLoad()
{
	if(gpLogFile == NULL)
	{
		gpLogFile = fopen("D2MultiResLog.txt","w+");
		//there was a {filtered} up error condition here, sigh
	}
	
	fprintf("Loading D2MultiRes v%s\n",);//I'm just merging this message {filtered}...
	if(!EnumDisplayModes())
	{
		Log("ERROR: Unable to enumerate any display modes.  DLL file not loading.");
		return;
	}
	
	HANDLE hProcess = GetCurrentProcess();
	for(int i = 0; i < ARRAY(gszDllFiles); i++)
	{
		fprintf(gpLogFile,"Loading Dll File: %s\n",gszDllFiles[i]);
		if((ghDllFiles[i] = LoadLibrary(gszDllFiles[i]) == NULL)
		{
			Log("ERROR: Unable to load DLL: %s\n",gszDllFiles[i]);
			return;
		}
		
		DWORD dwOldProtect;
		if(!VirtualProtectEx(hProcess,ghDllFiles[i],gdwDllSizes[i],0x40,&dwOldProtect))
		{
			Log("ERROR: Unable to change access to DLL %s\n",gszDllFiles[i]);
			return ;
		}
	}
	
	static BYTE pPatch1_D2Client[76] =
	{
		0x56, 0xFF, 0x15, 0x60, 0x26, 0xAC, 0x6F, 0xA3,
		0xE0, 0xC6, 0xB8, 0x6F, 0x56, 0xFF, 0x15, 0x64,
		0x26, 0xAC, 0x6F, 0xA3, 0xE4, 0xC6, 0xB8, 0x6F,
		0x89, 0x35, 0x80, 0xB9, 0xBC, 0x6F, 0xEB, 0x2C,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x1263D),pPatch1_D2Client,76);
	
	static BYTE pPatch2_D2Client[10] =
	{
		0xFF, 0x15, 0x58, 0x61, 0xB0, 0x6F, 0xC3, 0x90,
		0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x56150),pPatch2_D2Client,10);
	
	static BYTE pPatch3_D2Client[17] =
	{
		0x53, 0xFF, 0x15, 0x6C, 0x90, 0xB1, 0x6F, 0x5F,
		0x5E, 0x5D, 0x5B, 0x83, 0xC4, 0x30, 0xC2, 0x04,
		0x2E
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x6905A),pPatch3_D2Client,17);
		
	static BYTE pPatch4_D2Client[8] =
	{
		0xE9, 0xF6, 0xF4, 0x05, 0x00, 0x90, 0x90, 0x90
	};
		
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x6E265),pPatch4_D2Client,8);	
		
	static BYTE pPatch5_D2Client[39] =
	{
		0xFF, 0x15, 0x70, 0xD7, 0xB7, 0x6F, 0x5F, 0x5E,
		0x83, 0xC4, 0x24, 0xC2, 0x04, 0x00, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xCD760),pPatch5_D2Client,39);

	static BYTE pPatch6_D2Client[14] =
	{
		0x8B, 0x74, 0x24, 0x04, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x55D08),pPatch6_D2Client,14);
	
	static BYTE pPatch7_D2Client[12] =
	{
		0x8B, 0x37, 0xC7, 0x07, 0x00, 0x00, 0x00, 0x00,
		0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x5613A),pPatch7_D2Client,12);
	
	static BYTE pPatch8_D2Client[14] =
	{
		0x8B, 0x74, 0x24, 0x04, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x67ED2),pPatch8_D2Client,14);
	
	static BYTE pPatch9_D2Client[14] =
	{
		0x8B, 0x74, 0x24, 0x0C, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x7CC44),pPatch9_D2Client,14);
	
	static BYTE pPatch10_D2Client[9] =
	{
		0xFF, 0x15, 0xBC, 0x24, 0xB3, 0x6F, 0x90, 0x90,
		0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x82249),pPatch10_D2Client,9);
	
	static BYTE pPatch11_D2Client[45] =
	{
		0xA1, 0xD0, 0xC1, 0xBC, 0x6F, 0x50, 0xFF, 0x15,
		0xD8, 0x36, 0xB3, 0x6F, 0xEB, 0x1F, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90	
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x836C7),pPatch11_D2Client,45);
	
	static BYTE pPatch12_D2Client[44] =
	{
		0x68, 0x2C, 0xBD, 0xBC, 0x6F, 0x68, 0x28, 0xBD,
		0xBC, 0x6F, 0xFF, 0x15, 0x74, 0x01, 0xB4, 0x6F,
		0xEB, 0x1A, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x90161),pPatch12_D2Client,44);
	
	static BYTE pPatch13_D2Client[6] =
	{
		0xE9, 0x4B, 0xA8, 0x06, 0x00, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x62F40),pPatch13_D2Client,6);
	
	static BYTE pPatch14_D2Client[20] =
	{
		0x56, 0xFF, 0x15, 0xA4, 0xD7, 0xB7, 0x6F, 0x83,
		0xEC, 0x68, 0x55, 0x33, 0xED, 0xE9, 0xA4, 0x57,
		0xF9, 0xFF, 0x90, 0x90, 0xFF, 0x15, 0x70, 0xD7,
		0xB7, 0x6F, 0x5F, 0x5E, 0x83, 0xC4, 0x24, 0xC2
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xCD790),pPatch14_D2Client,20);
	
	static BYTE pPatch15_D2Client[6] =
	{
		0xE9, 0x64, 0x84, 0x07, 0x00, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x55347),pPatch15_D2Client,6);
	
	static BYTE pPatch16_D2Client[28] =
	{
		0xFF, 0x15, 0xCC, 0xD7, 0xB7, 0x6F, 0x85, 0xC0,
		0x0F, 0x85, 0x2B, 0x7C, 0xF8, 0xFF, 0x8B, 0x15,
		0x48, 0xBD, 0xBC, 0x6F, 0xE9, 0x84, 0x7B, 0xF8,
		0xFF, 0x90, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xCD7B0),pPatch16_D2Client,28);
	
	static BYTE pPatch17_D2Client[9] =
	{
		0xE9, 0x43, 0x85, 0x07, 0x00, 0x90, 0x90, 0x90,
		0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x55298),pPatch17_D2Client,9);
	
	static BYTE pPatch18_D2Client[32] =
	{
		0x81, 0xFF, 0x50, 0x05, 0x00, 0x00, 0x0F, 0x84,
		0xD6, 0x7A, 0xF8, 0xFF, 0x6A, 0xFF, 0x8B, 0xD0,
		0xA1, 0x04, 0xC2, 0xBC, 0x6F, 0xE9, 0xA7, 0x7A,
		0xF8, 0xFF, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90	
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xCD7E0),pPatch18_D2Client,32);
	
	static BYTE pPatch19_D2Client[6] =
	{
		0xE9, 0xD7, 0xD2, 0x03, 0x00, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x90524),pPatch19_D2Client,6);
	
	static BYTE pPatch20_D2Client[16] =
	{
		0xFF, 0x15, 0x10, 0xD8, 0xB7, 0x6F, 0x5E, 0x5B,
		0x59, 0xC2, 0x04, 0x00, 0x90, 0x90, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xCD800),pPatch20_D2Client,16);
	
	static BYTE pPatch21_D2Client[11] =
	{
		0xFF, 0x15, 0x8C, 0x03, 0xAE, 0x6F, 0xC3, 0x90,
		0x90, 0x90, 0x1C
	};		
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0x30381),pPatch21_D2Client,11);

	static BYTE pPatch22_D2Client[12] =
	{
		0x44, 0x32, 0x52, 0x4D, 0x52, 0x65, 0x73, 0x00,
		0x00, 0x00, 0x00, 0x00
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xD5388),pPatch22_D2Client,12);

	static BYTE pPatch23_D2Client[9] =
	{
		0xE9, 0x40, 0x2E, 0x01, 0x00, 0x90, 0x90, 0x90,
		0xAC
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xBA9DB),pPatch23_D2Client,9);
	
	static BYTE pPatch24_D2Client[32] =
	{
		0x53, 0x8B, 0x5E, 0x0C, 0xC1, 0xEB, 0x02, 0x2B,
		0xD3, 0x03, 0xC3, 0x8B, 0x5E, 0x10, 0xC1, 0xEB,
		0x02, 0x2B, 0xCB, 0x5B, 0xE9, 0xAB, 0xD1, 0xFE,
		0xFF, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[0] + 0xCD820),pPatch24_D2Client,32);

	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x12660) = GetWidth;
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x12664) = GetHeight;
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x6906C) = 10001A30; //TODO
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0xCD770) = 10001C40; //TODO
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x824BC) = 10001CF0; //TODO
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x836D8) = 10003240; //TODO
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x90174) = GetScreenSizeAdjustment;
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0xCD7A4) = AdjustDialogPositions;
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x56158) = SetKeyDown;
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0xCD7CC) = GetKeyDown;
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0xCD810) = 10002080; //TODO
	*reinterpret_cast<DWORD*>(ghDllFiles[0] + 0x3038C) = DrawHelpScreen;
	
	static BYTE pPatch1_D2GFX[51] =
	{
		0x57, 0x56, 0x53, 0x8B, 0xDA, 0x8B, 0xF1, 0x8B,
		0xF8, 0x53, 0xFF, 0x15, 0xB0, 0x85, 0xA8, 0x6F,
		0x89, 0x06, 0x53, 0xFF, 0x15, 0xB4, 0x85, 0xA8,
		0x6F, 0x89, 0x07, 0x5B, 0x5E, 0x5F, 0xC3, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0x8590),pPatch1_D2GFX,51);
	
	static BYTE pPatch2_D2GFX[7] =
	{
		0xE9, 0xD2, 0x23, 0x00, 0x00, 0x90, 0x90	
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xA609),pPatch2_D2GFX,7);
	
	static BYTE pPatch3_D2GFX[16] =
	{
		0x8B, 0x1D, 0xF4, 0x12, 0xA9, 0x6F, 0x0F, 0xAF,
		0xDE, 0xE9, 0x22, 0xDC, 0xFF, 0xFF, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xC9E0),pPatch3_D2GFX,16);
	
	static BYTE pPatch4_D2GFX[7] =
	{
		0xE9, 0x74, 0x15, 0x00, 0x00, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xB477),pPatch4_D2GFX,7);
	
	static BYTE pPatch5_D2GFX[16] = 
	{
		0x8B, 0x0D, 0xF4, 0x12, 0xA9, 0x6F, 0x0F, 0xAF,
		0xCF, 0xE9, 0x80, 0xEA, 0xFF, 0xFF, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xC9F0),pPatch5_D2GFX,16);
	
	static BYTE pPatch6_D2GFX[7] = 
	{
		0xE9, 0xF1, 0x21, 0x00, 0x00, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xA80A),pPatch6_D2GFX,7);
	
	static BYTE pPatch7_D2GFX[16] = 
	{
		0x8B, 0x0D, 0xF4, 0x12, 0xA9, 0x6F, 0x0F, 0xAF,
		0xC8, 0xE9, 0x03, 0xDE, 0xFF, 0xFF, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xCA00),pPatch7_D2GFX,16);
	
	static BYTE pPatch8_D2GFX[7] = 
	{
		0xE9, 0x6B, 0x11, 0x00, 0x00, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xB8A0),pPatch8_D2GFX,7);
	
	static BYTE pPatch9_D2GFX[16] = 
	{
		0x8B, 0x35, 0xF4, 0x12, 0xA9, 0x6F, 0x0F, 0xAF,
		0xF0, 0xE9, 0x89, 0xEE, 0xFF, 0xFF, 0x90, 0x90	
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xCA10),pPatch9_D2GFX,16);
	
	static BYTE pPatch10_D2GFX[7] = 
	{
		0xE9, 0x3F, 0x27, 0x00, 0x00, 0x90, 0x90	
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xA2DC),pPatch10_D2GFX,7);
	
	static BYTE pPatch11_D2GFX[16] = 
	{
		0x8B, 0x1D, 0xF4, 0x12, 0xA9, 0x6F, 0x0F, 0xAF,
		0xD8, 0xE9, 0xB5, 0xD8, 0xFF, 0xFF, 0x90, 0x90	
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xCA20),pPatch11_D2GFX,16);
	
	static BYTE pPatch12_D2GFX[7] = 
	{
		0xE9, 0xAF, 0x3E, 0x00, 0x00, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0x8B7C),pPatch12_D2GFX,7);
	
	static BYTE pPatch13_D2GFX[20] = 
	{
		0x50, 0xFF, 0x15, 0x44, 0xCA, 0xA8, 0x6F, 0x85,
		0xC0, 0xA3, 0x58, 0xD4, 0xA9, 0x6F, 0xE9, 0x40,
		0xC1, 0xFF, 0xFF, 0x90	
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[1] + 0xCA30),pPatch13_D2GFX,20);
	
	*reinterpret_cast<DWORD*>(ghDllFiles[1] + 0x85B0) = GetWidth;
	*reinterpret_cast<DWORD*>(ghDllFiles[1] + 0x85B4) = GetHeight;
	*reinterpret_cast<DWORD*>(ghDllFiles[1] + 0xCA44) = InitWindow;
	
	static BYTE pPatch1_D2GDI[43] =
	{
		0x50, 0x50, 0xFF, 0x15, 0xA0, 0x62, 0x87, 0x6F,
		0x8B, 0xF0, 0xFF, 0x15, 0xA4, 0x62, 0x87, 0x6F,
		0x8B, 0xD0, 0xEB, 0x17, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[2] + 0x6284),pPatch1_D2GDI,43);
	
	static BYTE pPatch2_D2GDI[31] =
	{	
		0x89, 0x3D, 0x40, 0xC0, 0x87, 0x6F, 0x56, 0xFF,
		0x15, 0xA0, 0x62, 0x87, 0x6F, 0xA3, 0x44, 0xC0,
		0x87, 0x6F, 0x5F, 0x5E, 0xB8, 0x01, 0x00, 0x00,
		0x00, 0xC3, 0x90, 0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[2] + 0x658C),pPatch2_D2GDI,31);
	
	static BYTE pPatch3_D2GDI[40] =
	{
		0xA3, 0x48, 0xC0, 0x87, 0x6F, 0x89, 0x3D, 0x40,
		0xC0, 0x87, 0x6F, 0x56, 0xFF, 0x15, 0xA0, 0x62,
		0x87, 0x6F, 0xA3, 0x44, 0xC0, 0x87, 0x6F, 0x5F,
		0x5E, 0x8B, 0xE5, 0x5D, 0xB8, 0x01, 0x00, 0x00,
		0x00, 0xC3, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[2] + 0x6684),pPatch3_D2GDI,40);
	
	*reinterpret_cast<DWORD*>(ghDllFiles[2] + 0x62A0) = GetWidth;
	*reinterpret_cast<DWORD*>(ghDllFiles[2] + 0x62A4) = GetHeight;
	
	static BYTE pPatch1_D2Common[4] =
	{
		0x33, 0xC0, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x1AFF0),pPatch1_D2Common,4);
	
	static BYTE pPatch2_D2Common[4] =
	{
		0x33, 0xC0, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x1B080),pPatch2_D2Common,4);
	
	static BYTE pPatch3_D2Common[4] =
	{
		0x33, 0xC0, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x1B100),pPatch3_D2Common,4);
	
	static BYTE pPatch4_D2Common[5] =
	{
		0xC2, 0x0C, 0x00, 0xCC, 0x00
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x1B0F6),pPatch4_D2Common,5);
	
	static BYTE pPatch5_D2Common[16] =
	{
		0xFF, 0x74, 0x24, 0x0C, 0xFF, 0x15, 0xB0, 0x86,
		0xDD, 0x6F, 0xC2, 0x0C, 0x00, 0x90, 0x90, 0x90
	};		
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x886A0),pPatch5_D2Common,16);
	
	static BYTE pPatch6_D2Common[5] =
	{
		0xE9, 0x49, 0xD6, 0x06, 0x00
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x1B072),pPatch6_D2Common,5);
	
	static BYTE pPatch7_D2Common[16] =
	{
		0xFF, 0x74, 0x24, 0x0C, 0xFF, 0x15, 0xD0, 0x86,
		0xDD, 0x6F, 0xC2, 0x10, 0x00, 0x90, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x886C0),pPatch7_D2Common,16);
	
	static BYTE pPatch8_D2Common[5] =
	{
		0xE9, 0x75, 0xD5, 0x06, 0x00
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x1B166),pPatch8_D2Common,5);
	
	static BYTE pPatch9_D2Common[16] =
	{
		0xFF, 0x74, 0x24, 0x0C, 0xFF, 0x15, 0xF0, 0x86,
		0xDD, 0x6F, 0xC2, 0x0C, 0x00, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x886E0),pPatch9_D2Common,16);
	
	static BYTE pPatch10_D2Common[4] =
	{
		0x33, 0xF6, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x4BA66),pPatch10_D2Common,4);
	
	static BYTE pPatch11_D2Common[4] =
	{
		0x33, 0xC0, 0x90, 0x90
	};		
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x4BB10),pPatch11_D2Common,4);
	
	static BYTE pPatch12_D2Common[5] =
	{
		0xE9, 0x76, 0xCC, 0x03, 0x00
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x4BA85),pPatch12_D2Common,5);
	
	static BYTE pPatch13_D2Common[16] =
	{
		0xFF, 0x74, 0x24, 0x0C, 0xFF, 0x15, 0x10, 0x87,
		0xDD, 0x6F, 0xC2, 0x0C, 0x00, 0x90, 0x90, 0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x88700),pPatch13_D2Common,16);
	
	static BYTE pPatch14_D2Common[5] =
	{
		0xE9, 0x9A, 0xCB, 0x03, 0x00
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x4BB81),pPatch14_D2Common,5);
	
	static BYTE pPatch15_D2Common[16] =
	{
		0xFF, 0x74, 0x24, 0x0C, 0xFF, 0x15, 0x30, 0x87,
		0xDD, 0x6F, 0xC2, 0x10, 0x00, 0x90, 0x90, 0x90
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[3] + 0x88720),pPatch15_D2Common,16);
	
	*reinterpret_cast<DWORD*>(ghDllFiles[3] + 0x886B0) = SetViewBounds;
	*reinterpret_cast<DWORD*>(ghDllFiles[3] + 0x886D0) = SetDisplayRect;
	*reinterpret_cast<DWORD*>(ghDllFiles[3] + 0x886F0) = SetDisplayRect;
	*reinterpret_cast<DWORD*>(ghDllFiles[3] + 0x88710) = FillDisplayBounds;
	*reinterpret_cast<DWORD*>(ghDllFiles[3] + 0x88730) = SetDisplayRectEx;

	static BYTE pPatch1_Direct3D[67] =
	{
		0x89, 0x35, 0x38, 0x31, 0x8B, 0x6F, 0x50, 0x50,
		0xFF, 0x15, 0xF0, 0xFC, 0x88, 0x6F, 0xA3, 0x64,
		0x92, 0x89, 0x6F, 0xFF, 0x15, 0xF4, 0xFC, 0x88,
		0x6F, 0xA3, 0xF4, 0x96, 0x89, 0x6F, 0xEB, 0x14,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90	
	};	
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[9] + 0xFCCC),pPatch1_D2Direct3D,67);	
	
	*reinterpret_cast<DWORD*>(ghDllFiles[9] + 0xFCF0) = GetWidth;
	*reinterpret_cast<DWORD*>(ghDllFiles[9] + 0xFCF4) = GetHeight;	
	
	static BYTE pPatch1_D2DDraw[73] =
	{
		0x57, 0x50, 0x50, 0xFF, 0x15, 0x18, 0x8D, 0x8C,
		0x6F, 0x8B, 0xF8, 0xFF, 0x15, 0x1C, 0x8D, 0x8C,
		0x6F, 0xA3, 0xD8, 0xFD, 0x8C, 0x6F, 0x8B, 0xCF,
		0x5F, 0x8B, 0xD0, 0x89, 0x0D, 0xC8, 0xFD, 0x8C,
		0x6F, 0x89, 0x0D, 0xE8, 0xFE, 0x8C, 0x6F, 0xA1,
		0x0C, 0x02, 0x8D, 0x6F, 0x89, 0x15, 0xCC, 0xFD,
		0x8C, 0x6F, 0xEB, 0x15, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
		0x90
	};
	
	memcpy(reinterpret_cast<void*>(ghDllFiles[8] + 0x8CE2),pPatch1_D2DDraw,73);
	
	*reinterpret_cast<DWORD*>(ghDllFiles[8] + 0x8D18) = GetWidth;
	*reinterpret_cast<DWORD*>(ghDllFiles[8] + 0x8D1C) = GetHeight;	
	
	D2GetRoom = D2CommonBase + 0x575B0;
	D2GetAdjacentRooms = D2CommonBase + 0x55820;
	D2CopyCoords = D2CommonBase + 0x55860;
	D2GetFloorTiles = D2CommonBase + 0x55950;
	D2IterateRooms = D2CommonBase + 0x55550;
	D2GetResMode = D2GFXBase + 0x8E60;
	D2LoadUIImage = D2ClientBase + 0x8C170;
	D2FreeCellFile = D2CMPBase + 0x9600;
	D2Alloc = D2FogBase + 0x14C10;
	D2DrawImage = D2GFXBase + 0x7EC0;
	D2DrawUnit = D2ClientBase + 0x68980;
	D2SetFont = D2WinBase + 0x108D0;
	D2DrawText = D2WinBase + 0x10890;
	D2DrawRect = D2GFXBase + 0x7D10;
	D2CheckPerspective = D2GFXBase + 0x8DE0;
	D2LoadArchive = D2WinBase = 0x7E40;
	D2RegGetValue = D2StormBase + 0x1B670;
	D2RegSetValue = D2StormBase + 0x1B520;
	D2ResizeWindow = D2ClientBase + 0x12630;
	
	int nRes;
	if(D2RegGetValue("Diablo II","Resolution",0,&nRes) && nRes > 1)
	{
		D2RegSetValue("Diablo II","Resolution",1);
		nRes = 1;
	}

	int nValue;
	if(!D2RegGetValue("Diablo II","D2RMRes",0,&nValue)
		D2RegSetValue("Diablo II","D2RMRes",nRes);
	
	Log("D2MultiRes Initialization Completed...");
	return TRUE;
}

//10006BF4                    .  E8 17FDFFFF        CALL D2MultiR.10006910
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, void* pReserved)
{
	switch(dwReason)
	{
		case 1:
		{
			if(MultiResLoad())
				return TRUE;
		}
		
		case 0:
		{
			if(gpLogFile != NULL)
			{
				fclose(gpLogFile);
				gpLogFile = NULL;
			}
			
			break;
		}
	}
	
	return TRUE;
}

/*
<D2Mult_1.D2ClientBase> 1000BBE8              .  0000AB6F                   DD D2Client.6FAB0000
<D2Mult_1.D2GFXBase> 1000BBEC                 .  0000A86F                   DD D2gfx.6FA80000
<D2Mult_1.D2GDIBase> 1000BBF0                 .  0000876F                   DD D2GDI.6F870000
<D2Mult_1.D2CommonBase> 1000BBF4              .  0000D56F                   DD D2Common.6FD50000
<D2Mult_1.D2CMPBase> 1000BBF8                 .  0000E16F                   DD D2CMP.6FE10000
<D2Mult_1.D2FogBase> 1000BBFC                 .  0000F56F                   DD Fog.6FF50000
<D2Mult_1.D2WinBase> 1000BC00                 .  00008E6F                   DD D2Win.6F8E0000
<D2Mult_1.D2StormBase> 1000BC04               .  0000BF6F                   DD OFFSET Storm.#553
<D2Mult_1.D2DDrawBase> 1000BC08               .  00008C6F                   DD D2DDraw.6F8C0000
<D2Mult_1.D2Direct3DBase> 1000BC0C            .  0000886F                   DD D2Direct.6F880000
<D2Mult_1.gdwResolutions> 1000BC10            .  03000000                   DD 00000003
<D2Mult_1.gdwKeyDown> 1000BC14                .  00000000                   DD 00000000
<D2Mult_1.ghWIndow> 1000BC18                  .  00000000                   DD 00000000
<D2Mult_1.gpWndProc> 1000BC1C                 .  00000000                   DD 00000000
<D2Mult_1.GetPlayer> 1000BC20                 .  A0110010                   DD D2Mult_1.100011A0
<D2Mult_1.GetView> 1000BC24                   .  B0110010                   DD D2Mult_1.100011B0
<D2Mult_1.GetViewWidth> 1000BC28              .  C0110010                   DD D2Mult_1.100011C0
<D2Mult_1.GetViewHeight> 1000BC2C             .  D0110010                   DD D2Mult_1.100011D0
<D2Mult_1.D2GetRoom> 1000BC30                 .  B075DA6F                   DD D2Common.#10366
<D2Mult_1.D2GetAdjacentRooms> 1000BC34        .  2058DA6F                   DD D2Common.#10915
<D2Mult_1.D2CopyCoords> 1000BC38              .  6058DA6F                   DD D2Common.#10692
<D2Mult_1.D2GetFloorTiles> 1000BC3C           .  5059DA6F                   DD D2Common.#10828
<D2Mult_1.D2GetResMode> 1000BC40              .  608EA86F                   DD D2gfx.#10043
<D2Mult_1.D2DrawUnit> 1000BC44                .  8089B16F                   DD D2Client.6FB18980                                   ;  Entry address
<D2Mult_1.D2IterateRooms> 1000BC48            .  5055DA6F                   DD D2Common.#10104
<D2Mult_1.D2LoadUIImage> 1000BC4C             .  70C1B36F                   DD D2Client.6FB3C170                                   ;  Entry address
<D2Mult_1.D2FreeCellFile> 1000BC50            .  0096E16F                   DD D2CMP.#10106
<D2Mult_1.D2Alloc> 1000BC54                   .  104CF66F                   DD Fog.#10043
<D2Mult_1.D2DrawImage> 1000BC58               .  C07EA86F                   DD D2gfx.#10024
<D2Mult_1.D2SetFont> 1000BC5C                 .  D0088F6F                   DD D2Win.#10010
<D2Mult_1.D2DrawText> 1000BC60                .  90088F6F                   DD D2Win.#10001
<D2Mult_1.D2DrawRect> 1000BC64                .  107DA86F                   DD D2gfx.#10062
<D2Mult_1.D2GetSetValue> 1000BC68             .  20B5C06F                   DD Storm.#426
<D2Mult_1.D2ResizeWindow> 1000BC6C            .  3026AC6F                   DD D2Client.6FAC2630                                   ;  Entry address
<D2Mult_1.D2LoadArchive> 1000BC70             .  407E8E6F                   DD D2Win.6F8E7E40
<D2Mult_1.D2RegGetValue> 1000BC74             .  70B6C06F                   DD Storm.#423
<D2Mult_1.D2CheckPerspective> 1000BC78        .  E08DA86F                   DD D2gfx.#10071
<D2Mult_1.gpArchive> 1000BC7C                 .  00000000                   DD 00000000
*/
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

d1ck
Posts: 36
Joined: Wed Mar 09, 2011 7:12 pm

Re: Porting d2multires to 1.13

Post by d1ck » Fri Jun 29, 2012 10:40 pm

holy motherload of patches

Slice
Posts: 1
Joined: Fri Feb 26, 2010 12:43 am

Re: Porting d2multires to 1.13

Post by Slice » Thu Jul 05, 2012 2:11 am

I would like to be able to use Hi res for D2, but have no idea how. I'm assuming the code that Necrolis posted is what I would need to use, but how?

Thanks in advance.

Slice

*edit* should have mentioned, I would like it for 1.13d.

kalans
Posts: 72
Joined: Sun Jul 31, 2011 11:51 am

Re: Porting d2multires to 1.13

Post by kalans » Fri Jul 13, 2012 3:58 am

I would love the person that ports this for 1.09D, and will host their site for free! :) Unlimited FTP/Bandwidth/Storage.

Sammy
Posts: 14
Joined: Fri Jun 22, 2012 4:47 am

Re: Porting d2multires to 1.13

Post by Sammy » Fri Jul 20, 2012 9:52 pm

Are you still interested in doing this kidpaddle94?

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Porting d2multires to 1.13

Post by kidpaddle94 » Sat Jul 21, 2012 1:08 am

Yes, me and the user d1ck are working on this. I'm currently making the list of pointers to update, should be up soon. Would have been done before if I wasn't busy with my own projects xd I will try to finish that this weekend.

gothic251
Posts: 1
Joined: Sat Sep 08, 2012 3:31 pm

Re: Porting d2multires to 1.13

Post by gothic251 » Sat Sep 08, 2012 3:37 pm

Is there any chance work is still being done on this? More people are playing D2 now than before D3 released, and I know a hell of a lot more people than just myself would DIE for the chance to play 1.13 in proper widescreen.

User.
Posts: 1
Joined: Sat Sep 08, 2012 9:30 am

Re: Porting d2multires to 1.13

Post by User. » Sat Sep 08, 2012 3:48 pm

message for: kidpaddle94 & d1ck please post here and do some publicity when this job is finished

jean10451
Posts: 14
Joined: Sun Nov 18, 2012 6:52 am

Re: Porting d2multires to 1.13

Post by jean10451 » Sun Nov 18, 2012 6:57 am

Is this project still alive?

This is probably the last attempt at a multiresolution mod there will ever be for d2 and many of those unhappy with d3 would surely appreciate it that they can try d2 again and are not trapped into playing 640*480 or 800*600

Many are willing to help if the work that needs to be done is layed out

User avatar
kidpaddle94
Forum Legend
Principality
Posts: 2057
Joined: Thu Aug 13, 2009 2:54 pm
Location: localhost
Canada

Re: Porting d2multires to 1.13

Post by kidpaddle94 » Sun Nov 18, 2012 6:59 am

would like to. But I have no time for that. That's a lot of pointers to update.
I also lost all the pointers I had collected in a backup loss, so I would have to go back check all pointers/patches that need to be updated, and so on.

jean10451
Posts: 14
Joined: Sun Nov 18, 2012 6:52 am

Re: Porting d2multires to 1.13

Post by jean10451 » Wed Dec 12, 2012 9:17 pm

I played around with this and managed to increase the visual area without messing up the interface, all the buttons worked, etc, only problem is that two black bars appear near the skills which can probably be fixed by putting in two new dc6 files and there is a black border when you open up windows.

Basically I found around 6-8 edits you need to make to increase the resolution for 640x480 by searching the internet. I noticed 1-2 of them broke plugy's buttons so I tired different combinations until I found that if I left out the ones that broke the buttons it worked fine. It messed up the 800x600 UI and resolution badly, but 640x480 was perfect. No need to change any locations or anything.

Increasing height past 700 causes distortion though, and taking it past around 768 crashes it so I left it at 1000x700

JayTee
Posts: 2
Joined: Wed Feb 25, 2015 1:59 am

Re: Porting d2multires to 1.13

Post by JayTee » Sun Mar 01, 2015 10:14 am

Hi guys,

I invested some time to port D2MultiRes to 1.13c, maybe anybody is still interested in this.
Nearly everything seems to work, but the original fancy border stuff in the side panels etc. was heavily misplaced. Feel free to try getting it work again, I removed/reduced it for the moment (same in the resolution dialog).

Tested with PlugY (DllToLoad=D2MultiRes_113c.dll, ActiveNewStatsInterface=0, NBPlayersByDefault=0)
http://jtee.bplaced.net/D2MR_113c.zip

Ripture
Posts: 2
Joined: Sun Jul 11, 2010 10:34 am

Re: Porting d2multires to 1.13

Post by Ripture » Sun Mar 01, 2015 10:29 am

JayTee" wrote:Hi guys,

I invested some time to port D2MultiRes to 1.13c, maybe anybody is still interested in this.
Nearly everything seems to work, but the original fancy border stuff in the side panels etc. was heavily misplaced. Feel free to try getting it work again, I removed/reduced it for the moment (same in the resolution dialog).

Tested with PlugY (DllToLoad=D2MultiRes_113c.dll, ActiveNewStatsInterface=0, NBPlayersByDefault=0)
http://jtee.bplaced.net/D2MR_113c.zip
You are a god. Works flawlessly. And I can't believe the timing of me finding this post here.

User avatar
luj1
Posts: 26
Joined: Tue Feb 17, 2015 6:03 pm

Re: Porting d2multires to 1.13

Post by luj1 » Sun Mar 01, 2015 1:58 pm

Really? Panels ok now?

User avatar
ChaosMarc
Dark Alliance Beta Test
Champion of the Light
Posts: 256
Joined: Fri May 28, 2004 2:00 pm
Germany

Re: Porting d2multires to 1.13

Post by ChaosMarc » Sun Mar 01, 2015 2:30 pm

here are 2 screenshots for all that dont wanna experient:
1.13 + plugy + multires: http://i.imgur.com/OyntU3L.jpg
opened char + skill menu: http://i.imgur.com/3vV4nIJ.jpg

User avatar
luj1
Posts: 26
Joined: Tue Feb 17, 2015 6:03 pm

Re: Porting d2multires to 1.13

Post by luj1 » Sun Mar 01, 2015 2:38 pm

looks good. cheers!

Sampson
Posts: 52
Joined: Mon Sep 30, 2013 2:22 am

Re: Porting d2multires to 1.13

Post by Sampson » Sun Mar 01, 2015 7:11 pm

I've tested this briefly.

When "ActiveNewStatsInterface=0" is set to "1" it doesn't seem to cause any problems that I can see.
When "NBPlayersByDefault=0" is set to anything other than 0, it won't load though.

Giving the error:
Patch D2Client for init default nb /players. (SendPlayersCommand)
Error : Read access missing to patch memory at 6FB739F2.
Please install a clean version of Lord of Destruction

Probably one missing patch for the d2client.dll (I think at C39F2 in d2client.dll as d2client.dll starts at 6FAB0000)
This mod doesn't seem to have any of the distortion that the "Eps1024x768" resolution mod has, so it's a big improvement.

User avatar
luj1
Posts: 26
Joined: Tue Feb 17, 2015 6:03 pm

Re: Porting d2multires to 1.13

Post by luj1 » Mon Mar 02, 2015 12:00 am

Indeed

User avatar
ChaosMarc
Dark Alliance Beta Test
Champion of the Light
Posts: 256
Joined: Fri May 28, 2004 2:00 pm
Germany

Re: Porting d2multires to 1.13

Post by ChaosMarc » Mon Mar 02, 2015 9:00 am

@Sampson:
both settings were broken in the 1.12 version already

the game crashes on start when changing NBPlayersByDefault to anything else than 0.
on higher resolutions the buttons to switch stats pages (ActiveNewStatsInterface) are becoming less possible to click as the clickable area seems to shift away from the button (on 1920x1080 it is impossible)

User avatar
eps2
Posts: 53
Joined: Thu Jul 27, 2006 6:19 pm
Location: Poland

Re: Porting d2multires to 1.13

Post by eps2 » Tue Mar 03, 2015 9:54 am

Sampson" wrote:Giving the error:
Patch D2Client for init default nb /players. (SendPlayersCommand)
Error : Read access missing to patch memory at 6FB739F2.
Please install a clean version of Lord of Destruction

Probably one missing patch for the d2client.dll (I think at C39F2 in d2client.dll as d2client.dll starts at 6FAB0000)
Correct address is C39F1.
6FB739F1 |. E8 B896F4FF CALL <JMP.&D2gfx.#10031>

Cai_Miao-BTH
Posts: 90
Joined: Mon Sep 23, 2013 10:04 am
Location: China
China

Re: Porting d2multires to 1.13

Post by Cai_Miao-BTH » Sun May 03, 2015 7:39 pm

in fact a chinese guy made it and released without source. it can change in game from 640x480 up to 1980 (if i remember it right).
Translator for Simplified Chinese.
Discord: cai_miao#0861
Translated BTH by onyx, HU by Soulmancer (until 2.x),
LRdO (approved) by Xaphan and Median XL: Sigma by the MXL community.
D2MFC & D2FTM, Modern Font Customize solution for Diablo II

Future project:
- Set of Font with FULL Latin, CHI, JAP and RUS character support. To much time needed.
- BFE by TrueMage - to Simplified Chinese from English
- ES (original) by PerfectCell to Simplified Chinese from English/Japanese
-Touhou Diablo by Bishibosh-A - to English/Japanese from Chinese

JayTee
Posts: 2
Joined: Wed Feb 25, 2015 1:59 am

Re: Porting d2multires to 1.13

Post by JayTee » Sun May 03, 2015 8:04 pm

The original D2Multires patch for 1.12 was released by Sluggy without any sources (full credits and admiration to him), but I'm not aware of his nationality. I did pure asm-based modding on his binary to adjust the patch offsets and fix some minor regressions to make it work with 1.13.

I believe in open source and stuff, but there is nothing to publish here. If anybody is interested in details, please feel free to ask. The n-players-in-game-option is simply broken because PlugY uses one of the patched offsets for achieving it.

Post Reply

Return to “Code Editing”