Warcraft II Forum

Warcraft II => Server.War2.ru => Topic started by: iL on December 11, 2015, 08:05:42 PM

Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 11, 2015, 08:05:42 PM
Thanks a lot to aqrit (http://forum.war2.ru/index.php?action=profile;u=563), i think he is the most experienced developer for all that ddraw things.

He just released the new version of his well-known ddraw.dll specially for war2.

I checked it on different systems: WinXP x64, Win Vista x32, Win7 x32, Win7 x64, Win10 R2 x64, Win2012 R2 x64.
Some of them as virtual machines, some on real computers.

This DLL works exactly as declared on all the systems i tried. And war2 behaviour is exactly the same for every OS:
Palette have been correct for all tests: alt-tab never broke it, creating game and back to chat never broke it. Random palette breaks have no been happened for me also.
PrtScr works fine in-game and saves the same picture that you can see during the game.

But here's the bug still exists while making SS in-chat: it saves cyan screen in-chat to PCX. That is a declared behaviour and works the same on all the checked systems.
But here's a way to bypass broken SS in-chat: You can use Alt-PrtSrc instead of PrtSrc, then screenshot will be copied to clipboard instead of PCX-file, then you can Alt-Tab, run "mspaint" or any other graphics editor and paste (Ctrl-V) the clipboard content. It's also aqrit's idea published here: http://forum.war2.ru/index.php/topic,897.msg12196.html#msg12196 (http://forum.war2.ru/index.php/topic,897.msg12196.html#msg12196)

Here's also a small problem with warvideo appeared: saved video is blinking. That is expected problem, but i don't think it's critical. Just to let you know.
Also need to try live streaming software with this DLL. It's quite possible it will be blinking also, i'll check that later. I never tried to stream videos... So would be great if someone experienced in live streaming check that faster.

Here are some screenshots to show what exactly have been fixed by this patch in win8.1/win10/win2012 (comparing with original clean version of war2). I made screenshots from windows 10:
mix of letters in connection window:
Spoiler
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=403)
fixed by ddraw.dll:
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=405)

No icons and black squares under button letters:
Spoiler
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=407)
fixed by ddraw.dll:
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=409)

PrtScr screenshot from bnet chat in origianl war2 with no ddraw:
Spoiler
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=411)
Cyan screen with ddraw.dll:
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=413)

Use Alt-PrtScr instead and paste your SS into mspaint to save it. I used that way to make 4 previous screenshots.

And here's the blinking warvideo sample: http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=415 (http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=415)


How to install this dll:
Just copy the file ddraw.dll to war2combat directory overwriting previous file if exists. Then you just can start war2 as usual and see the changes.


old version
Here's the dll file (enough to play):
"ftp://ftp.war2.ru/war2/ddraw3/ddraw.dll"
Here's the original archive including the source code (for depelovers):
"ftp://ftp.war2.ru/war2/ddraw3/war2_ddraw_test.zip"

And this is an original link to aqrit's version:
http://www.bitpatch.com/downloads/war2_ddraw_test.zip (http://www.bitpatch.com/downloads/war2_ddraw_test.zip)


fixed ftp links broken by smf -mousey

UPD by iL:
here's the updated blur-fixing version:
Here is the 10 second fix:
[url]http://www.bitpatch.com/downloads/war2_ddraw_test2.zip[/url] ([url]http://www.bitpatch.com/downloads/war2_ddraw_test2.zip[/url])
it uses hot-patching to hook some font functions to disable anti-aliasing.


UPD by iL:
the build with d3d
[url]http://www.bitpatch.com/downloads/war2_ddraw_test3.zip[/url] ([url]http://www.bitpatch.com/downloads/war2_ddraw_test3.zip[/url])

it adds an alt+enter shortcut to flip between windowed and fullscreen views.
edit: alt+enter seems to crash currently if used on the battle.net screen :(
edit: it is also missing one of the kludges to redraw the screen ... so yeah WIP


[url]http://www.bitpatch.com/downloads/war2_ddraw_test4.zip[/url]
 
This *barely tested* build should have a nice speed up ( not measured ) from using a pixel shader.
It has some additional system requirements but I'm guessing everyone should still be able to run it.

Also have some problems with alt-tab.

Here is a "pass-thru" version for Win8 and Win10 users, who aren't happy with the full version.
[url]http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip[/url] ([url]http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip[/url])


Source code on github for developers:
https://github.com/aqrit/war2_ddraw (https://github.com/aqrit/war2_ddraw)
https://github.com/aqrit/war2_ddraw/tree/minimal (https://github.com/aqrit/war2_ddraw/tree/minimal)

ddraw is also compatible with starcraft broodwar, discussion: http://www.teamliquid.net/forum/brood-war/499943-ddraw-fix-by-aqrit (http://www.teamliquid.net/forum/brood-war/499943-ddraw-fix-by-aqrit)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 11, 2015, 08:11:21 PM
some additional files to add...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 11, 2015, 08:33:09 PM
Very nice.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 11, 2015, 08:40:31 PM
@aqrit What's the license for your source code? Please add one to be explicit
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on December 11, 2015, 08:58:47 PM
Omg I can't wait to get home. I knew that guy had some experience because his post in development section. The community thanks you greatly bro. So did he emulation the old parameters for the GDI causing the broken display?

Once again thank you sir. Any donations he can collect??
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 11, 2015, 09:59:53 PM
Seems to also work for StarCraft!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on December 11, 2015, 10:16:32 PM
great my sc is messed up in 7!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 11, 2015, 10:29:21 PM

Seems to also work for StarCraft!

Great, you playing on USeast?


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Nox on December 11, 2015, 10:42:05 PM
Fixing the staff is possible??!!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 11, 2015, 10:46:33 PM

Seems to also work for StarCraft!

Great, you playing on USeast?


Sent from my Motorola DynaTAC 8000X using Tapatalk
no
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 11, 2015, 10:47:07 PM


Seems to also work for StarCraft!

Great, you playing on USeast?


Sent from my Motorola DynaTAC 8000X using Tapatalk
no

Lame [emoji24]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 11, 2015, 10:48:03 PM
Works great on 10 Pro. Nice job.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 11, 2015, 11:19:59 PM
Warvideo does have that blinking problem, not a game killer tho.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on December 12, 2015, 04:18:52 AM
Wow, I did not expect this!!  This is enormous for the future of the game!  Lol @ Warvid :(
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 12, 2015, 05:59:30 AM

Fixing the staff is possible??!!

[emoji23][emoji23]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: RipE[Eur0] on December 12, 2015, 07:22:44 AM
"ftp://ftp.war2.ru/war2/ddraw3/ddraw.dll"
the link doesnt work for me right now at least. ftp down????

why cant u add all these kinda new things automaticly to "War2PLoader.exe" ?????

when i start war2 it says in the main screen version 2.02. is this the latest lol???

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: RipE[Eur0] on December 12, 2015, 07:24:42 AM
oh the link works in firefox without
"ftp://"

:P

ok. i have it. lets try it.

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: RipE[Eur0] on December 12, 2015, 07:27:56 AM
so. nice.

it works.

it fixes the alt tab shit and u can take screeniez from the chat. this is nice. ive missed so many hilarious screenies from the chat cuz of the bug :D:D:D:DDDD


however. the screen is somehow a bit blurry. hurts eyes :S.

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Warchief Lightbringer- on December 12, 2015, 11:23:29 AM
Thank you so much Aquit for caring for this minuscule community :)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 12, 2015, 01:44:30 PM
Quote
however. the screen is somehow a bit blurry. hurts eyes :S.
GDI takes the liberty of doing antialiasing around text when drawing in 32-bit color depth.
It might be possible to correct with copious WM_SETFONT messages?

Quote
What's the license for your source code?
GPLv2 is good
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: tk[as] on December 12, 2015, 03:45:08 PM
another "outsider" taking care of the community

thanks aqrit ... good looking out.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: tolsty on December 12, 2015, 05:53:18 PM
Works. But on a static picture (the text) is visible behind the letters for a couple of pixels the shadow is reddish. The text seemed to be floating. On the dynamic picture is not noticeable.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Warchief Lightbringer- on December 13, 2015, 12:32:40 AM
however. the screen is somehow a bit blurry. hurts eyes :S.

Try this? Might help...
http://windows.microsoft.com/en-us/windows/make-text-easier-read-cleartype#1TC=windows-7 (http://windows.microsoft.com/en-us/windows/make-text-easier-read-cleartype#1TC=windows-7)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 13, 2015, 01:28:23 AM
Quote
Try this?
don't bother.
Here is the 10 second fix:
http://www.bitpatch.com/downloads/war2_ddraw_test2.zip (http://www.bitpatch.com/downloads/war2_ddraw_test2.zip)
it uses hot-patching to hook some font functions to disable anti-aliasing.
which makes it a lot more invasive than the version in OP.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 13, 2015, 04:35:59 AM
Nice job bro!


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on December 13, 2015, 08:00:25 AM
Hey do you guys think this fixed the banner bug? So we can use the animated ones now? And where is your donation page?

Also do you think you can make window mode sizeable???
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on December 13, 2015, 10:06:14 AM
Quote
Try this?
don't bother.
Here is the 10 second fix:
[url]http://www.bitpatch.com/downloads/war2_ddraw_test2.zip[/url] ([url]http://www.bitpatch.com/downloads/war2_ddraw_test2.zip[/url])
it uses hot-patching to hook some font functions to disable anti-aliasing.
which makes it a lot more invasive than the version in OP.

What are the drawbacks of this being more invasive?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Warchief Lightbringer- on December 13, 2015, 11:13:02 AM
Aquit....Will my solution work by using the less 'invasive' version?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on December 13, 2015, 11:49:44 AM
i could of swore i seen a .gif before tupac but maybe been tripping.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 13, 2015, 12:16:45 PM
@Lightbringer
It is probably possible to turn of Anti-Aliasing system wide...
but I don't know if what you linked does that or not.

@Blid
More invasive makes it more likely to trip anti-cheat and anti-virus.
It also makes it a bit fragile, for example it won't work on some versions of Windows.

@tupac
I've done size-able windowed modes for games in the past... I currently have no interest in doing that for war2.  DxWnd is probably the best bet for that.

The banner bug might be fixed. Not having the screen in 8bpp should prevent a lot of outside interference. Also not using ddraw's 'built-in' 256 colors compatibility hack might help as well. I'm too lazy to setup a pvpgn server to test.

I am not accepting donations.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on December 13, 2015, 01:39:26 PM
Alright thanks once again man!! I might actually start playing again you made it work right.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on December 13, 2015, 01:42:30 PM
it did fix my sc1  8) so anyone wanna play in ru holler! so giving a thx.i got paypal only if u like a pizza or something.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on December 13, 2015, 01:54:35 PM
Yeah at least a charity of choice.

Anyways looks like team liquid is happy and some people are experiencing some lag for sc though. I haven't tried the fix yet but will check it out tonight. I'm also wondering who is aqrit he comes in here and fix shit like it was nothing. Very cool!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 13, 2015, 02:16:08 PM
aqrit, so your DLL is too slow for competitive play in StarCraft, is there anything you could do? Also, what should I change so I could use the C/C++ standard library?

Also, would it be possible to hook the DirectDraw functions in memory at a later point in time(after the loading screen) rather than make a redirect DLL?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on December 13, 2015, 03:48:32 PM
This is so cool! Tried it out and it's working great. Props to aqrit for releasing this fix! c:

Also need to try live streaming software with this DLL. It's quite possible it will be blinking also, i'll check that later. I never tried to stream videos... So would be great if someone experienced in live streaming check that faster.

Tried out OBS and it seems fine -- no blinking like in the warvid. Everyone needs to set up streaming (http://en.war2.ru/tutorials/how-to-live-stream-warcraft-2/) right away, this is now the optimal replay recording strategy!

But here's the bug still exists while making SS in-chat: it saves cyan screen in-chat to PCX. That is a declared behaviour and works the same on all the checked systems.But here's a way to bypass broken SS in-chat: You can use Alt-PrtSrc instead of PrtSrc, then screenshot will be copied to clipboard instead of PCX-file, then you can Alt-Tab, run "mspaint" or any other graphics editor and paste (Ctrl-V) the clipboard content.

Another workaround is to install the free app Greenshot (http://getgreenshot.org/downloads/), you can configured it to use a custom hotkey (https://i.imgur.com/QZSvb3a.png) for full screen capture (e.g. an unused function key or ctrl+alt+something), and to automatically save to desktop (https://i.imgur.com/Yuj0rNc.png) without a prompt, works great. Don't set it to PrtScr to avoid the save as box popping up though.


Hey do you guys think this fixed the banner bug? So we can use the animated ones now?

Checked last night, and it seems yes! I don't think we'll be able to use rotating banners for the forseeable future though because it's such a bad glitch without the new ddraw fix, and it'll take a while for the fix to be widely distributed. Plus like xboi209 says, the fix causes some slight lag that interferes with competitive play? Swift & Joe were saying in channel last night that they won't use it, it makes gamplay "spongy".
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on December 13, 2015, 04:13:17 PM
all i could tell was in sc1 not war2.sc1 is lagged unplayable.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 13, 2015, 04:37:23 PM
Quote
C/C++ standard library?
why would you want to?
rename DllEntryPoint to DllMain then set the appropriate linker options.

Quote
hook the DirectDraw functions in memory at a later point in time(after the loading screen) rather than make a redirect DLL?
anything is possible... IMO it is best to hook DirectDrawCreate at the very beginning then redirect internally between real and emulated functions. Using a "ddraw.dll" file is optional, if one wants to inject some other way. A full answer to this question would be a long essay :p

Quote
too slow for competitive play
The game(s) actually do all their ddraw drawing in software.
They only uses ddraw as a way to copy "the output" to video memory.

War2 does not use GDI in-game (I assume). So plain ddraw only output could be ported away from the emulated ddraw and to anything one wants... The patch current uses GDI for "in-game" "output", which is notoriously slow(?)... Using OpenGL, Direct2D, Direct3D, D3DKMT,  or (insert favorite graphics api here ) would probably be faster at the needed tasks: DMA, color conversion, and optionally updating only the dirty rectangles. We could even switch back and use real ddraw in-game on Win8 and Win10.

If starcraft mixes GDI and DDraw "in-game" then things don't look too good. The mixed gdi and ddraw areas are the frustrating part of this patch... as GDI can not be easily redirected. I don't know how well the other APIs would mix with GDI, they might have the same compatibility problems as ddraw. Which forces us to keep using GDI to do output...  However, one could try different GDI functions like MaskBlt instead of GdiTransparentBlt or try blitting only dirty rectangles instead of the whole screen, etc.. One could also try to beat GDIs performance by doing color converstion and detecting dirty rects by hand using SSE2, thread tiling, etc.

The performance of FindWindowEx is unknown. The function could probably be replaced, if needed.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: tolsty on December 14, 2015, 03:25:15 AM
Quote
Here is the 10 second fix:
[url]http://www.bitpatch.com/downloads/war2_ddraw_test2.zip[/url] ([url]http://www.bitpatch.com/downloads/war2_ddraw_test2.zip[/url])

put the shadow was gone, the clarity was the same as was on the original library. Thank you.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 14, 2015, 04:47:26 AM
If starcraft mixes GDI and DDraw "in-game" then things don't look too good. The mixed gdi and ddraw areas are the frustrating part of this patch...

Not sure if that could help, but maybe to use an idea from cpu savior? http://forum.war2.ru/index.php/topic,409.0.html (http://forum.war2.ru/index.php/topic,409.0.html)
The idea was to add sleep 1ms in each gdi drawing loop or w/e.
If it redraws mixed ddraw+GDI millions times per second, it causes CPU utilization. If you add timeout into the graphics loop, if will free the CPU.
Another idea is to enforce your code 1 time of 1000, not every time. Then interface will be fixed not in realtime but with a little delay.

Anyways, your code if perfect already for war2, that is what we've been need for all these years since vista have been released.

however. the screen is somehow a bit blurry. hurts eyes :S.

put the shadow was gone, the clarity was the same as was on the original library. Thank you.

Looks like you're talking about the same thing, can you see that on my screenshots in my 1-st post here? I didn't see any problems with fonts on my ss. I'm not careful or it didn't appear for me?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on December 14, 2015, 06:36:06 AM
Looks like you're talking about the same thing, can you see that on my screenshots in my 1-st post here? I didn't see any problems with fonts on my ss. I'm not careful or it didn't appear for me?

It does show up in screenshots but it's very slight. You have to zoom way in to really see but it makes the text very slightly blurry.

(https://i.imgur.com/20vXIO0.png)

Right half is with ddraw2 that aqrit posted earlier.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: tk[as] on December 14, 2015, 07:12:53 AM
FTP link broke
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 14, 2015, 07:51:57 AM
FTP link broke
works perfect for me...
oh the link works in firefox without
"ftp://"

:P

ok. i have it. lets try it.


this?

Right half is with ddraw2 that aqrit posted earlier.
ah, thx, i'll look at that more careful...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Fredrik Eriksson on December 14, 2015, 12:40:49 PM
For me, it dont know if this is better :)

Thing is, I have never had a problem with the colors except when I "alt tab". Replaced the file and now "alt tab" seems working fine. The problem is that the graphics in the chat is worse than before, everything is a little fuzzier. I havent check if it is same when playing, will be back.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Fredrik Eriksson on December 14, 2015, 12:45:00 PM
I havent check if it is same when playing, will be back.

Ok, tested and graphics is fine in game mode :)

Thanks for this!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 14, 2015, 02:30:20 PM
Not sure if that could help, but maybe to use an idea from cpu savior? [url]http://forum.war2.ru/index.php/topic,409.0.html[/url] ([url]http://forum.war2.ru/index.php/topic,409.0.html[/url])
The idea was to add sleep 1ms in each gdi drawing loop or w/e.
If it redraws mixed ddraw+GDI millions times per second, it causes CPU utilization. If you add timeout into the graphics loop, if will free the CPU.
Another idea is to enforce your code 1 time of 1000, not every time. Then interface will be fixed not in realtime but with a little delay.

The CPU utilization doesn't slow things down since the majority of the stuff is single threaded. I'm not completely sure but I think the for loop that erases the video memory in ToScreen() is partly responsible for slowly down the code. Oddly, replacing that loop with std::memset() from the standard library doesn't work as expected for some reason. I'm thinking of having multiple threads erase different parts of the video memory at the same time since it's erasing 76800 bytes of memory one byte at a time which is quite a lot.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 14, 2015, 05:53:07 PM
its erasing 307200 bytes ( 76800 dwords ), is this the problem with how your using memset?

anyways... this would probably beat out the library function anyways.
Code: [Select]
__asm{
mov eax, pvBmpBits
pcmpeqw xmm0,xmm0
psllw xmm0,1
packsswb xmm0,xmm0
mov ecx, 640*480/128
lbl_loop:
movntdq 0[eax], xmm0;
movntdq 16[eax], xmm0;
movntdq 32[eax], xmm0;
movntdq 48[eax], xmm0;
movntdq 64[eax], xmm0;
movntdq 80[eax], xmm0;
movntdq 96[eax], xmm0;
movntdq 112[eax], xmm0;
add eax,128
dec ecx
jnz lbl_loop
}

It could be done on a separate thread because we don't need the surface again until the next dd->Lock call.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 14, 2015, 06:33:37 PM
Oh I see my mistake with memset() now, and it's much much slower than the for loop too(edit: my computer is just slow right now). Is your assembly code even more optimized than the for loop?
Is there any other code that could move onto a concurrently running thread?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 15, 2015, 01:38:49 AM
@xboi
I'll sink some time into this project since there seems to be some interest now...
Hold off on any threading changes... there are still lots of bigger issues.

1. Does "in-game" Broodwar have any open SDlgDialog windows?

2. For Each SDlgDialog window GdiTransparentBlt color converts the same 640x480 from 8bpp to 32bpp each time... Would it be faster to color convert once then GdiTransparentBlt out to all the windows?

3. Would it be faster to GdiTransparentBlt only the changed portions of the screen instead of the entire screen to every window... Unfortunately the game locks the entire screen so we don't immediately know where changes occur. However, since we know every unchanged scan line will be all 0xFE bytes... it should be possible to do a quick hash of a scan line to  know if anything on that line has changed... which would allow us to quickly determine a bounding rect around changes which we could then intersect with the window rects thus allowing us to move much fewer bytes around.

4. The only thing we can do for "ddraw only mode" is switch to uploading to video memory with a real API, not GDI. But that means when switching from "mixed mode gdi/ddraw" to "ddraw only" we need to clear any gdi stuff...  can we just paint the main window with a NULL_BRUSH or do we have to destroy and re-create the main window?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 15, 2015, 02:31:03 AM
1. Does "in-game" Broodwar have any open SDlgDialog windows?
I have no idea, and don't know how to check. My best guess is probably yes when you click on the menu button.

2. For Each SDlgDialog window GdiTransparentBlt color converts the same 640x480 from 8bpp to 32bpp each time... Would it be faster to color convert once then GdiTransparentBlt out to all the windows?
Not a graphics programmer, but to check if anything is faster, you would profile the code.

3. Would it be faster to GdiTransparentBlt only the changed portions of the screen instead of the entire screen to every window... Unfortunately the game locks the entire screen so we don't immediately know where changes occur. However, since we know every unchanged scan line will be all 0xFE bytes... it should be possible to do a quick hash of a scan line to  know if anything on that line has changed... which would allow us to quickly determine a bounding rect around changes which we could then intersect with the window rects thus allowing us to move much fewer bytes around.
Updating only parts of the screen is what modern video encoding libraries and game developers do nowadays so it should be faster. Maybe it's even faster to just check the first few bytes of a line for 0xFE bytes instead of hashing the whole line, what would go wrong if this assumption is incorrect?

4. The only thing we can do for "ddraw only mode" is switch to uploading to video memory with a real API, not GDI. But that means when switching from "mixed mode gdi/ddraw" to "ddraw only" we need to clear any gdi stuff...  can we just paint the main window with a NULL_BRUSH or do we have to destroy and re-create the main window?
Are you suggesting to interpret the DirectDraw calls and use something like OpenGL or DirectX to draw to the screen instead?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 15, 2015, 02:59:38 AM
if this code: "for( i = 0; i < 640 * 480 / 4; i++ ) p [ i ] = 0xFEFEFEFE;" is a bottleneck, then here's my not so experienced opinion about optimizations:
1. never use p [ i ]. You lose performance on each cycle of the loop. Use *p instead.
this code:
p = (DWORD*) pvBmpBits;
for( i = 0; i < 640 * 480 / 4; i++ ) p [ i ] = 0xFEFEFEFE;
need to be changed to something like:
for(p= (DWORD*) pvBmpBits + 640 * 480 - 1; p < (DWORD*) pvBmpBits ; p--) *p = 0xFEFEFEFE;
(fix the syntax if wrong, i didn't check that)

2. use "rep stosd" instead. Since it's 1 CPU command, i think that's the fastest way to fill the array:
mov eax, 0fefefefeh
mov ecx, 640*480
lea di, pvBmpBits
rep stosd
(i also didn't check that code, just an idea, syntax should be checked)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 15, 2015, 04:56:21 AM
@iL
everything you posted would all compile to the same code :P

I checked earlier today and
Code: [Select]
for( i = 0; i < 640 * 480 / 4; i++ ) p [ i ] = 0xFEFEFEFE;compiles to 
Code: [Select]
mov eax, 0xfefefefeh
mov ecx, 640*480/4
lea edi, pvBmpBits
rep stosd
or w/e

IMO the sse2 code that I posted is as fast as it gets.

p.s. this may all be pointless... I've just ported the game to d3d9... it looks like gdi text only shows up over the game when it is windowed... So fullscreen d3d9 might be great, if I can copy gdi onto d3d instead of the other way around, I can ignore all this crap. I won't have much time to look into it for the rest of the week though.

edit:
never-mind, I would still have black boxes around text if I did that :(
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: GaNzTheLegend on December 15, 2015, 10:10:44 AM
Tested on 8.1 and it seems to work perfectly.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 15, 2015, 11:23:51 AM

Tested on 8.1 and it seems to work perfectly.

Bitchin!

Now you probably coming out of retirement [emoji16]




Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on December 15, 2015, 11:38:01 PM
Cool works great!!!

Only small problem i see is my desktop becomes visible briefly where all text is displayed when i click join/cancel in lobby. Not really a problem at all!

Windows 10
64 - bit
used fix 2

Bug2/3: if you hit print screen and get the dialog box the box is hidden and lobby is normal. But this will cause join / create to halt and enter to not send text from text box. So example scenario for me would be load war2, login, hit print screen, save box appears, then war2 minimizes because one drive wants to be default screenshot manager. So looks like something that forces war2 to minimize will break banner until next rotation and put the save dialog box behind the war2 window causing enter key and join / create to not work.... easy fix alt f4 one time or reload war2.


Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 16, 2015, 02:16:03 AM
Visible desktop occurs when tab in and out of war2.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 16, 2015, 02:16:22 AM
Fixable by joining or creating a game though


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on December 16, 2015, 09:17:56 AM
It's on after I clicked join or cancel it bugs out for me for a second or so. Alt tab seemed fine for me.
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 16, 2015, 09:35:18 AM
Hmm probably because I got more than one monitor running at the same time?

Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on December 16, 2015, 10:37:50 AM
Could be i have my standdard laptop screen with duplicate settings to my 55 inch NEC monitor lol
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 16, 2015, 11:20:11 AM

Could be i have my standdard laptop screen with duplicate settings to my 55 inch NEC monitor lol

55" really? Lol

I still have a old 13" 4:3 NEC that I use for my home server [emoji14].




Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 18, 2015, 04:17:40 PM
Any progress aqrit?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 18, 2015, 09:09:56 PM
not really ;-/

but here is the build with d3d
http://www.bitpatch.com/downloads/war2_ddraw_test3.zip (http://www.bitpatch.com/downloads/war2_ddraw_test3.zip)

it adds an alt+enter shortcut to flip between windowed and fullscreen views.
edit: alt+enter seems to crash currently if used on the battle.net screen :(
edit: it is also missing one of the kludges to redraw the screen ... so yeah WIP

I put the source up on github, just in case anyone wants to help.
https://github.com/aqrit/war2_ddraw (https://github.com/aqrit/war2_ddraw)

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 20, 2015, 05:15:53 PM
Here's another problem reported from newbie: a notebook (he didn't call a model), resolution 1366х786 , win 8.1.
He got fresh war2 at 1/4 of screen, also your ddraw.dll didn't resolve the problem.
But another project called ddhack10 helped him.

At the same time ddhack10 is unplayable as known, but maybe there's something to get from that project and to add to war2_ddraw_test to ToSceen?

Also, to everyone: please, notify us if you have the same problem with war2_ddraw_test2. Need to have a system to test.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 20, 2015, 06:34:02 PM
Here's another problem reported from newbie: a notebook (he didn't call a model), resolution 1366х786 , win 8.1.
He got fresh war2 at 1/4 of screen, also your ddraw.dll didn't resolve the problem.
But another project called ddhack10 helped him.

At the same time ddhack10 is unplayable as known, but maybe there's something to get from that project and to add to war2_ddraw_test to ToSceen?

Also, to everyone: please, notify us if you have the same problem with war2_ddraw_test2. Need to have a system to test.
He needs to configure the scaling options for his graphics card. There's instructions on Google for this.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 20, 2015, 07:24:15 PM
He needs to configure the scaling options for his graphics card. There's instructions on Google for this.
But why did ddhack10 helped him?
Why 95% videocards are configured already and 5% have to be configured manually?

Which graphics card causes a problem?

Honestly, i'd prefer to add proper configuration for graphics cards during the installation process (or to ddraw). Otherwise we will lose some % of non-experienced users with such problem on war2-only. But need to understand the problem in details to add such config to installer...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 20, 2015, 10:17:23 PM
Intel: http://teamwindows8.com/2012/11/how-to-run-full-screen-games-in-windows-8/ (http://teamwindows8.com/2012/11/how-to-run-full-screen-games-in-windows-8/)
Nvidia: http://us.battle.net/en/forum/topic/18300189156 (http://us.battle.net/en/forum/topic/18300189156)
AMD: http://support.amd.com/en-us/kb-articles/Pages/UnableToSetGPUScaling.aspx (http://support.amd.com/en-us/kb-articles/Pages/UnableToSetGPUScaling.aspx)

A lot of graphics cards are smart enough to automatically lower the resolution and either scale the game to fullscreen or leave black bars on the sides to maintain aspect ratio.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: tk[as] on December 20, 2015, 10:33:31 PM
there is currently no fix to scale windows 10 full screen

ive looked

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 21, 2015, 01:01:37 AM
there is currently no fix to scale windows 10 full screen

ive looked


The issue is not due to the OS, but instead your graphics card settings.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 21, 2015, 01:07:02 AM

there is currently no fix to scale windows 10 full screen

ive looked


The issue is not due to the OS, but instead your graphics card settings.




Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on December 21, 2015, 01:07:30 AM
there is currently no fix to scale windows 10 full screen

ive looked

Ur a dumbass, [emoji29]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on December 21, 2015, 02:10:36 AM
Intel: [url]http://teamwindows8.com/2012/11/how-to-run-full-screen-games-in-windows-8/[/url] ([url]http://teamwindows8.com/2012/11/how-to-run-full-screen-games-in-windows-8/[/url])
Nvidia: [url]http://us.battle.net/en/forum/topic/18300189156[/url] ([url]http://us.battle.net/en/forum/topic/18300189156[/url])
AMD: [url]http://support.amd.com/en-us/kb-articles/Pages/UnableToSetGPUScaling.aspx[/url] ([url]http://support.amd.com/en-us/kb-articles/Pages/UnableToSetGPUScaling.aspx[/url])

A lot of graphics cards are smart enough to automatically lower the resolution and either scale the game to fullscreen or leave black bars on the sides to maintain aspect ratio.

Thanks, looks like a good point to start my research for that.
But I'm not about to write instructions for users, i'm about to just start the game and get it fullscreened.
Ordinary players just want to play and don't want to config anything...

The question is why ddhack10 fixes that issue, maybe it's easy to add some additional code to switch the resolution if current way didn't act?
If it's not, i'll look at some possible checks during installation or launching process...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 26, 2015, 12:33:53 AM
The new code on github calls ChangeDisplaySettings() directly. If the user's device doesn't support 640x480 resolution then they will have to play in windowed mode. Scaling the ddraw graphics to fit the screen is trivial. Scaling the mouse input should be fairly easy. However, scaling the child and sibling windows on the battle.net screens will probably be very hard, this is not something I plan to do.

the current todo list for a stable version:
use d3d shader to color convert.
alt+enter on battle.net screen. (windows getting resized on WM_DISPLAYCHANGE???) done (?)
upon prntscr detection, set "import_gdi_bits = TRUE" for a few frames. done (?)
implement "wait for vsync" and "get vsync status". optional.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 29, 2015, 05:19:56 AM
I just compiled your latest commit and it seems like there's still a performance issue. It's as if a few frames are dropped at times
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 30, 2015, 03:19:00 AM
thanks for testing xboi.
I just pushed a commit that might help:
while "in-game", GdiFlush doesn't need to be called at all...
so calling it every frame was probably an expensive mistake.

also... I've not sure if mca64Launcher stuff would conflict with my stuff
so please be clear if you're using or not using that.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on December 30, 2015, 04:07:45 AM
Not using any other tools when testing. So your latest commit cleared up the stutter but there's still an overall lag added, very noticeable when you scroll the screen. It's acceptable when playing on custom maps for fun but is still unacceptable for serious gameplay. It also breaks Korean font somewhere but don't worry about that right now.

- The unlock function averages 980 microseconds per call from a data set of 23,849 calls.
- The set_palette function averages 880 microseconds per call from a data set of 13,911 calls.

I just checked the unlock function and it seems that if (SDlgDialog_count == 0) is always true from my testing so I decided to go profile this for statement located inside that if statement:
Quote
for (int i = 0; i < 480; i++) // for each scanline
         color_convert(&dib_bits[i * 640], bmi.palette, (DWORD*)(((BYTE*)rc.pBits) + (rc.Pitch * i)), 640 / 4);
and it averages 320 microseconds for the entire loop from a data set of 59,404 calls.

Could you write some pseudo code or even C++ code for color_convert() so that I could understand it? I'm still interested in moving code onto multiple threads.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on December 30, 2015, 08:39:47 AM
 :)

Quote
Could you write some pseudo code or even C++ code for color_convert()

Code: [Select]
void __cdecl
color_convert( BYTE* src, RGBQUAD* pal, DWORD* dst, DWORD cnt )
{
do{
dst[0] = pal[src[0]];
dst[1] = pal[src[1]];
dst[2] = pal[src[2]];
dst[3] = pal[src[3]];
dst = &dst[4];
src = &src[4];
} while( --cnt );
}

Quote
I'm still interested in moving code onto multiple threads.
don't ... the next item on my todo list is:
Quote
use d3d shader to color convert.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 02, 2016, 11:58:33 AM
http://www.bitpatch.com/downloads/war2_ddraw_test4.zip (http://www.bitpatch.com/downloads/war2_ddraw_test4.zip)
 
This *barely tested* build should have a nice speed up ( not measured ) from using a pixel shader.
It has some additional system requirements but I'm guessing everyone should still be able to run it.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on January 02, 2016, 04:54:30 PM
[url]http://www.bitpatch.com/downloads/war2_ddraw_test4.zip[/url] ([url]http://www.bitpatch.com/downloads/war2_ddraw_test4.zip[/url])
 
This *barely tested* build should have a nice speed up ( not measured ) from using a pixel shader.
It has some additional system requirements but I'm guessing everyone should still be able to run it.


I have no idea what related to starcraft you made with that version, but looks like prtscr in chat is fixed for war2!
Just checked in win8.1 and winxp 64.

I missed if you announced such behaviour, but did you really fixed that? So, will working prtscr be inherited in future versions?

UPD: i see, this commit: https://github.com/aqrit/war2_ddraw/commit/59cdc85f8c3f52d8dd0b93cfa09116f75bb54108 (https://github.com/aqrit/war2_ddraw/commit/59cdc85f8c3f52d8dd0b93cfa09116f75bb54108)
just the flag if prtscr is pressed.
So, my feedback is it's working perfectly.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 02, 2016, 07:20:43 PM
So is there a new version of patch I should be using?


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on January 02, 2016, 08:22:57 PM
This looks really smooth to me. Someone else asked if it were possible to somehow only have the code executed when not in-game since there aren't any graphical bugs in-game?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on January 02, 2016, 08:38:54 PM
I got another unpleasant bug with test4:
Situation:
- war2 is running with ddraw.dll
- several more applications also running
- i alt-tab out of war2 to my desktop (so, war2 window is minimized)

then i try to click to any other application in my taskbar and it temporary switches into war2 windows, that causes turn to black screen, then back and then opens window of application i clicked to.
The situation happens only if i click to the task bar.
If i use alt-tab instead or switching cascaded windows on my desktop, it never activates war2 screen.

Checked on winxp x64.
Never happened if delete ddraw.dll.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on January 02, 2016, 09:08:15 PM
I got another unpleasant bug with test4:
Situation:
- war2 is running with ddraw.dll
- several more applications also running
- i alt-tab out of war2 to my desktop (so, war2 window is minimized)

then i try to click to any other application in my taskbar and it temporary switches into war2 windows, that causes turn to black screen, then back and then opens window of application i clicked to.
The situation happens only if i click to the task bar.
If i use alt-tab instead or switching cascaded windows on my desktop, it never activates war2 screen.

Checked on winxp x64.
Never happened if delete ddraw.dll.
This doesn't happen on Windows 10 using BW.........but why are you even testing with Windows XP?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on January 02, 2016, 09:26:45 PM
sc1 works perfectly!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on January 02, 2016, 09:43:52 PM
Dude this guy is bad ass!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on January 03, 2016, 12:13:04 AM
I got another unpleasant bug with test4:
Situation:
- war2 is running with ddraw.dll
- several more applications also running
- i alt-tab out of war2 to my desktop (so, war2 window is minimized)

then i try to click to any other application in my taskbar and it temporary switches into war2 windows, that causes turn to black screen, then back and then opens window of application i clicked to.
The situation happens only if i click to the task bar.
If i use alt-tab instead or switching cascaded windows on my desktop, it never activates war2 screen.

Checked on winxp x64.
Never happened if delete ddraw.dll.
This doesn't happen on Windows 10 using BW.........but why are you even testing with Windows XP?
true, windows xp doesnt need any version edits to run properly
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 03, 2016, 12:26:52 AM
People still use Windows XP? Who and why? Lol


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 03, 2016, 11:59:19 AM
Quote
only have the code executed when not in-game since there aren't any graphical bugs in-game?
This would be pointless on Vista and Win7. On Win8 and Win10 it could be be done... but is there a confirmed reason to do so?

Quote
set_palette function... from a data set of 13,911 calls.
I might need to clean-up this function if it is getting called in-game.

Quote
XP alt+tab
that is fairly strange behavior... does it happen only while on the bnet screens or does it also happen when alt-tabbing out from single player campaign?

Quote
ClearType fonts (x-post)
I haven't tested but...
enabling anti-aliased fonts probably risks breaking the built-in screenshots on the bnet screens, because there will be more than 256 colors on screen and gdi will probably screw up the color conversion.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on January 03, 2016, 02:46:59 PM
but why are you even testing with Windows XP?
I test everything related to war2 on every version since XP. Some people even asked me why loader is not woking on win 95...
That behaviour means that something goes wrong with that dll. At least need to understand what it is and why it causes such behaviour for winxp and if that can cause something in win7-8-10...

true, windows xp doesnt need any version edits to run properly
XP sometimes also had a problem with palette in war2. (Not sure if it was some driver or anything else). Also not sure if this dll fixes that for winxp, but i think it should.

that is fairly strange behavior... does it happen only while on the bnet screens or does it also happen when alt-tabbing out from single player campaign?
It happens even on the main menu screen.
I also checked on some more systems: never happened on win 8.1, but the same bug on different computer with clean winxp x32 (with last updates).
Looks like when i click the taskbar button i activate one of war2 layer windows. It changes the screen resolution (turns screen to black) and then turns it back to activated application. Also if i close that active application, it switches to war2 screen.

Appeared in test4, didn't happen for test3.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on January 03, 2016, 04:48:52 PM
Quote (selected)
only have the code executed when not in-game since there aren't any graphical bugs in-game?
This would be pointless on Vista and Win7. On Win8 and Win10 it could be be done... but is there a confirmed reason to do so?
It'd guarantee no additional lag from this DLL(even though from my testing, your latest update seems flawless to me).

Quote (selected)
set_palette function... from a data set of 13,911 calls.
I might need to clean-up this function if it is getting called in-game.
The calls were recorded from the time when the game's process is started until a minute or so after playing an actual game so I don't know how many, if any of those calls are being called in-game.

Quote from: xboi209 on January 02, 2016, 06:08:15 PM
but why are you even testing with Windows XP?
I test everything related to war2 on every version since XP. Some people even asked me why loader is not woking on win 95...
That behaviour means that something goes wrong with that dll. At least need to understand what it is and why it causes such behaviour for winxp and if that can cause something in win7-8-10...
Well the DLL isn't intended for anything older than Windows Vista so it makes completely no sense to include it on Windows XP computers because the best it can do is slow down the game, even if not very noticeable.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on January 03, 2016, 11:07:27 PM
I have never ever had a problem with War2 on WinXP on this computer, but after getting the latest requested update, I do.

After having run War2 properly for the last 10 years on this machine, I can't now.  I don't know what you did but for WinXP it was bad.  Please don't do this to WinXP computers.

(http://i.imgur.com/VfHqrcp.png)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on January 03, 2016, 11:08:56 PM
I have never ever had a problem with War2 on WinXP on this computer, but after getting the latest requested update, I do.

After having run War2 properly for the last 10 years on this machine, I can't now.  I don't know what you did but for WinXP it was bad.  Please don't do this to WinXP computers.

([url]http://i.imgur.com/VfHqrcp.png[/url])

this problem is newly created.  It never existed previously ever

I got winxp put on this computer well after win7 was released, because I knew winxp worked best with War2.  That has now changed :X
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 04, 2016, 12:54:33 AM

I have never ever had a problem with War2 on WinXP on this computer, but after getting the latest requested update, I do.

After having run War2 properly for the last 10 years on this machine, I can't now.  I don't know what you did but for WinXP it was bad.  Please don't do this to WinXP computers.

([url]http://i.imgur.com/VfHqrcp.png[/url])

this problem is newly created.  It never existed previously ever

I got winxp put on this computer well after win7 was released, because I knew winxp worked best with War2.  That has now changed :X


sign from the heavens, time to upgrade hoe.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on January 04, 2016, 10:41:32 AM
nooo!
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 04, 2016, 10:42:43 AM
nooo!

Btw Windows 7/10 has a cool in house Windows XP emulation service [emoji14]

I guess I can make a trivia question, what's blid's favorite operating system? Worth 48373828838383 points. Watch it stump the masses [emoji16]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on January 04, 2016, 10:52:57 AM
I have Win7 enterprise edition at work and I haev to say they really got win7 right.  win98, winxp, win7 are all pretty solid but i DONT want to get anywhere near 8 or 10
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 04, 2016, 11:05:58 AM
I have Win7 enterprise edition at work and I haev to say they really got win7 right.  win98, winxp, win7 are all pretty solid but i DONT want to get anywhere near 8 or 10

Have you even tried Windows 10? The underlying OS code is way more efficient than 7. I prefer it to 7 when I do development and have multiple programs running in the background. Plus multi monitor support is MUCH MUCH better on 10 than 7. Running 3 monitors on 7 was a nightmare.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on January 04, 2016, 11:08:46 AM
ive seen windows 10 somewhere im sure.  i just want the damn tiles to go away forever so i can use the desktop properly!!!
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 04, 2016, 11:21:59 AM
ive seen windows 10 somewhere im sure.  i just want the damn tiles to go away forever so i can use the desktop properly!!!

You mean the app tiles we saw in 8?


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 04, 2016, 11:30:35 AM
Plus you get to stream Xbox from any room as long as your connected to your network. [emoji14]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 05, 2016, 02:16:20 AM
@Blid
The obvious fix is just to delete the ddraw.dll from the game directory...

The first message box you should have seen would have read  "Display Failure!", "aqrit's compat mod".
From there I return an error code to the game which is why you see the msgbox that was posted.

The likely culprit is not WinXP but your graphic card.
It must support 2.0 Pixel Shaders and a 1024x1024 8-bit luminance surface.
I also force hardware vertex processing "pure device" for no apparent reason... maybe your card doesn't support that?
Make sure you have DirectX9.0c install and no weird options set in the registry, etc.

I'll try to add more error messages sometime in a future version.

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Certified MENSA Genius Brain (smart) on January 05, 2016, 08:47:41 AM
Well, after I rebooted I was able to open War2 again.  Can il confirm that he included test4 or another of the fixes in one of the Combat updates?  Maybe he didn't.  I mean, I'm not sure why else that would have happened for the first time ever right after an update but it seems okay now
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: MaStA{hR} on January 08, 2016, 03:47:52 PM
So I am on my new computer which has windows 10. There are major glitches in the chat channel. I am a computer scrub and find the initial instructions hard to follow. Can anyone clear up/help me fix these issues/installation procedures please!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 08, 2016, 04:49:36 PM

So I am on my new computer which has windows 10. There are major glitches in the chat channel. I am a computer scrub and find the initial instructions hard to follow. Can anyone clear up/help me fix these issues/installation procedures please!

Download the newest ddraw to fix the issues. I think there is a link in the OP with instructions.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on January 08, 2016, 07:59:54 PM
Just put the dll in your war2 folder and done.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on January 08, 2016, 08:17:16 PM

Just put the dll in your war2 folder and done.

Bitchin!


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 09, 2016, 11:31:40 PM
Here is a "pass-thru" version for Win8 and Win10 users, who aren't happy with the full version.
http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip (http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip)

It should be active only in the multi-player lobby.
In-game behavior should be identical to how it would be without this dll.

The minimal version is not suitable for use on Win7 or below.

source code: https://github.com/aqrit/war2_ddraw/tree/minimal (https://github.com/aqrit/war2_ddraw/tree/minimal)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on January 10, 2016, 09:42:53 AM
Yeah have some weird things happen to me. Sometime when I alt tab then go back to war2 the game will crash, also sometimes when I alt tab the game will no be in full screen it will have my normal desktop resolutions and war 2 on the left at its resolution. Nothing big though thanks for the work.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 10, 2016, 10:30:32 AM
Lost surfaces are not handled in the minimal version because I assumed that win8 doesn't discard video memory... I'll look into it, if that is the version your talking about ?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on January 10, 2016, 02:02:44 PM
I am using windows 10 currently and maybe the second fix? I will check this one out and check back up after a few days.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on January 11, 2016, 05:44:48 AM
aqrit, thx a lot for your research!
[url]http://www.bitpatch.com/downloads/war2_ddraw_test4.zip[/url]
 
This *barely tested* build should have a nice speed up ( not measured ) from using a pixel shader.
It has some additional system requirements but I'm guessing everyone should still be able to run it.


Are there any performance problems with previous version in war2 or in starcraft only?

So, looks like we got several problems with version 4. but there were ok in version 3:
problem 1:
I have never ever had a problem with War2 on WinXP on this computer, but after getting the latest requested update, I do.

After having run War2 properly for the last 10 years on this machine, I can't now.  I don't know what you did but for WinXP it was bad.  Please don't do this to WinXP computers.

([url]http://i.imgur.com/VfHqrcp.png[/url])

this problem is newly created.  It never existed previously ever

I got winxp put on this computer well after win7 was released, because I knew winxp worked best with War2.  That has now changed :X

problem 2:
then i try to click to any other application in my taskbar and it temporary switches into war2 windows, that causes turn to black screen, then back and then opens window of application i clicked to.
The situation happens only if i click to the task bar.
If i use alt-tab instead or switching cascaded windows on my desktop, it never activates war2 screen.

Checked on winxp x64.

problem 3?
Yeah have some weird things happen to me. Sometime when I alt tab then go back to war2 the game will crash, also sometimes when I alt tab the game will no be in full screen it will have my normal desktop resolutions and war 2 on the left at its resolution. Nothing big though thanks for the work.

Did that ever happen with version 3 or with version 4 only?

I'd say, let's return back to version 3 if it doesn't cause any glitches and have performance lower down for starcraft only?

The minimal version is not suitable for use on Win7 or below.

That's sad to exclude fixes for win7. Is that necessary to exclude that win7 code to improve the performance?

So I am on my new computer which has windows 10. There are major glitches in the chat channel. I am a computer scrub and find the initial instructions hard to follow. Can anyone clear up/help me fix these issues/installation procedures please!

Which version of ddraw? 3? 4? Also can you make a photo of the screen with that glitches?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on January 11, 2016, 09:48:20 AM
the ddraw test4, sc1 plays nice! i do have a xp machine but its not on yet..maybe 2 different versions of war2ru? for xp users.

my win7 really never had prob's with war2. but sc1 did.
mainly for fixing windows 10 users.. what a pos os :P

if ddraw3 is the best use it!

most def test4 for sc1 way better speed.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 11, 2016, 12:26:22 PM
test3 has known issues...
broken screenshots,
broken bnet screens,
broken alt + enter,
poor performance,
not recommended.

Quote
That's sad to exclude fixes for win7. Is that necessary to exclude that win7 code to improve the performance?
It wasn't done for performance, it was done mostly for compatibility with mcalauncher.  All Win8 and Win10 need is the menu fix, so just a menu fix gives people less things to complain about. Also it still annoys me that I need to manually issue redraw calls when a window is destroyed... so I was playing with that.

Quote
Are there any performance problems with previous version in war2 or in starcraft only?
sc1 has faster mouse scroll which makes low fps more noticeable... but there are no sc1 only features.
Performance improvements should speed up war2 and sc1 equally. Too many GdiFlush() calls in anything before test4 may cause noticeable "shudder" while scrolling the in-game view in war2, for instance.

Quote
So, looks like we got several problems with version 4. but there were ok in version 3
It is not clear what version (if any) are being used by Blid, tupac, or MaStA{hR}.
Which leaves alt+tab on XP as the only confirmed bug, currently.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on January 11, 2016, 05:31:47 PM
I was using the 2nd fix since it's release. And the newest combat so unless an update replaced the .dll I'm number 2. I use window 10.

Ohhh let me hint you this I discovered this only happends to me when warcraft is in game lobby not Chat channels.

Edit: I'm seeing if 4 will fix it since it only doing its magic when only in chat now? Testing now brb

Edit2: Looks like there was an update to my "ddraw.dll". It was last modified 12/27/2015 maybe he deployed version 3 on us? I just replaced it with fix 4.

Edit3: Alt tab problems are still here BTW just happened Game lobby alt tab only though keep altab it will break eventually sometimes crash, or just retrying alttab would fix it.

Fix4: now has all the chat, icon, buttons, boxes are black when you connect to server, click join, flashes back temporarily then correct its self. Either the font is ugly as shit or it changed the color of the text and looks less quality now.


iL what version did you push with the client update if you did? 3? I'd stick with that one for now. 
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 11, 2016, 11:17:10 PM
the font is provably identical across test2,3,4 for me on win8.
looks like I need to get win10 sometime?
please check ddraw.dll's properties to see if the file version is 0.0.0.4 or blank
also a ss both with and without would be appreciated.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on January 12, 2016, 05:26:18 AM
test3 has known issues...
broken screenshots,
broken bnet screens,
broken alt + enter,
poor performance,
not recommended.

Ah, i see, missed your post about crashing alt+enter, i didn't check it, my fault, sorry then...

It wasn't done for performance, it was done mostly for compatibility with mcalauncher.  All Win8 and Win10 need is the menu fix, so just a menu fix gives people less things to complain about. Also it still annoys me that I need to manually issue redraw calls when a window is destroyed... so I was playing with that.

i see, testing for starcraft is also important thing for the project.
That's really annoying that here's no easy solution to make it work perfectly on every single computer and every single point requires such dirty hack like checking if prtscr is pressed...

iL what version did you push with the client update if you did?

I still didn't

report from russian tester tolsty: http://www.war2.ru/modules/newbb_plus/viewtopic.php?forum=1&topic_id=2183&sortname=&sortorder=&sortdays=&viewmode=flat&order=0&start=10 (http://www.war2.ru/modules/newbb_plus/viewtopic.php?forum=1&topic_id=2183&sortname=&sortorder=&sortdays=&viewmode=flat&order=0&start=10)
tested version 4:
win7, alt-tab doesn't work. If he press ctrl-alt-del it works and the game mininizes. After that he switches into war2 and alt-tab works sometimes and sometimes not.
Sometimes after alt-tab war2 can't be restored by clicking the taskbar.

Anyway, aqrit, great job with your project! I hope you will find the best way to handle all the bugs and make it work perfectly!
That would be great to make one version for both war2 and starcraft working on every OS since XP to 10/2012 and videocard, but i can also put different versions for each OS into installer and select proper version during installation.

I also think that's a good idea to make the same version for both war2 and starcraft to get more testers.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on January 12, 2016, 05:46:00 AM
win7 home premium sp1(english),nvidia gt520
war2combat
alt+tab =works no errors at all
alt+enter=works no error at all
randomly click channels made game/exit etc trying to make color distort as it used to do=no errors at all
im not finding anything wrong with build 4

"Either the font is ugly as shit or it changed the color of the text and looks less quality now."
less sharpness, i kinda like it
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on January 13, 2016, 12:22:09 AM
It wasn't done for performance, it was done mostly for compatibility with mcalauncher.
Surely it can't be the launcher itself causing a problem, it's probably one of its options.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 13, 2016, 02:22:18 AM
I have not ever used mca64launcher, nor delved too deep into its source code. 

The war2_ddraw_minimal version just reduces the surface area for issues:
bad fonts... can't be a thing with the minimal version
bad window placement... can't be a thing with the minimal version
bad fps... can't be a thing with the minimal version
bad alt+tab... (hopefully) can't be a thing with the minimal version
etc.

also things like:
Quote
feature from mca64launcher ... to chat while being alt+tabbed out of starcraft
are more likely to work.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on January 25, 2016, 04:39:55 PM
a new minimal version for Win8/10 was uploaded (same url) on the 20th

I plan on re-writing the main version again...
goals:
1. remove redraw kludge
2. real full-screen mode
3. switch to D3D9Ex or D3D11 for triple buffering with vsync

The "vista platform update for SP2" back ported DX11 but it isn't clear to me if the Win7 DX9Ex FLIPEX stuff was also back ported at the same time.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 04, 2016, 05:00:28 PM
(http://s16.postimg.org/94uz36gph/alttab.png)
Ill try the newest fix and see if it still happends
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 05, 2016, 01:52:13 AM
([url]http://s16.postimg.org/94uz36gph/alttab.png[/url])
Ill try the newest fix and see if it still happends

tupac, would be good if you find a way to get an address where war2 have been crashed.

Most likely if you press "Debug" button on clean windows it will be useless, i think you should install some kind of debugger (some kind of IDE or third-party debugger) to look into stack trace.

Maybe it will help aqrit to catch an error.

Unfortunately i never had war2 crashes with any of aqrit's versions, so i can't try to catch that myself.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on February 05, 2016, 01:54:57 AM
([url]http://s16.postimg.org/94uz36gph/alttab.png[/url])
Ill try the newest fix and see if it still happends

tupac, would be good if you find a way to get an address where war2 have been crashed.

Most likely if you press "Debug" button on clean windows it will be useless, i think you should install some kind of debugger (some kind of IDE or third-party debugger) to look into stack trace.

Maybe it will help aqrit to catch an error.

Unfortunately i never had war2 crashes with any of aqrit's versions, so i can't try to catch that myself.

Or write the steps to reproduce the crash
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 05, 2016, 02:09:07 AM
simple keep alt tabing i get this most time when im in game lobby.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 07, 2016, 05:10:20 PM
simple keep alt tabing i get this most time when im in game lobby.
Still hope on your report about stack trace with some kind of debugger... Of course if you can reproduce that crash..
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on February 08, 2016, 01:19:57 AM
Could not reproduce the crash on my Windows 10 system using version 0.04 of Aqrit's DirectDraw DLL.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 08, 2016, 01:22:06 AM
I'll try out the minimal with a fresh install of 4.0.1. See if it still happend then I'll go from there.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 08, 2016, 02:46:03 AM
I'll try out the minimal with a fresh install of 4.0.1. See if it still happend then I'll go from there.
Just keep your OS where you can reproduce that crash plz. The main question is not to just resolve an error on you own computer, but to catch the situations where war2 crashes with ddraw.
As soon as you're one of the most experienced guy in debugging/programming in our community, your help with this error would be very useful.

Let me look into debugging software for win if you have problems with that. Stack trace is what we exactly need here.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 08, 2016, 04:01:41 AM
Just googled an instruction for debugging applications in win vista/7+
http://blogs.technet.com/b/yongrhee/archive/2010/12/29/drwtsn32-on-windows-vista-windows-server-2008-windows-7-windows-server-2008-r2.aspx (http://blogs.technet.com/b/yongrhee/archive/2010/12/29/drwtsn32-on-windows-vista-windows-server-2008-windows-7-windows-server-2008-r2.aspx)
https://msdn.microsoft.com/en-us/library/bb787181%28VS.85%29.aspx (https://msdn.microsoft.com/en-us/library/bb787181%28VS.85%29.aspx)

I didn't check that on my OS, but my HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\ doesn't contain LocalDumps section. Not sure, maybe need to create it.
I'd recommend you to install some debugger as described at the end of article:
Quote
Alternativerly you have all these other post mortem debugger:
Adplus
ProcDump
DebugDiag

Or something known (i'd use visual studio with it's debugger)

I hope to get a stack trace from you after war2 crash. Or at least a dump-file to check a stack-trace myself...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 08, 2016, 12:08:09 PM
I'll try to generate a report my self with that method. Also I haven't seen the crash but I have new install the last few days. It might of been my old .cfg files from other versions window mode or ddraw.dll. I'll update after work.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 16, 2016, 07:19:14 PM

Code: [Select]
PROGRAM VERSION: 2.0.2.0
COMPUTER NAME: P*************
USER NAME: ************
TIME: 02/16/16 00:34:06.250
INFO:

Exception code: C0000005 ACCESS_VIOLATION
Fault address: 5FD43AEB 01:00072AEB C:\WINDOWS\SYSTEM32\igdumdim32.dll

Registers:
EAX:00000000
EBX:00000000
ECX:E9E9EBEF
EDX:005CD980
ESI:00647150
EDI:0019EBCC
CS:EIP:0023:5FD43AEB
SS:ESP:002B:0019EB1C EBP:0019EBA0
DS:002B ES:002B FS:0053 GS:002B
Flags:00010246
Call stack:
Address  Frame    Logical addr  Module
5FD43AEB 0019EBA0 0001:00072AEB C:\WINDOWS\SYSTEM32\igdumdim32.dll
65C375F7 0019EC10 0001:000465F7 C:\WINDOWS\system32\ddraw.dll
65C3739E 0019EC2C 0001:0004639E C:\WINDOWS\system32\ddraw.dll
65C36F39 0019ECA8 0001:00045F39 C:\WINDOWS\system32\ddraw.dll
65C3279F 0019ECC8 0001:0004179F C:\WINDOWS\system32\ddraw.dll
65C30910 0019ED00 0001:0003F910 C:\WINDOWS\system32\ddraw.dll
6DA78CDE 0019ED20 0001:00057CDE C:\WINDOWS\system32\apphelp.dll
6DA80A50 0019ED40 0001:0005FA50 C:\WINDOWS\system32\apphelp.dll
10001284 0019ED54 0001:00000284 C:\War2anti\ddraw.dll

Stack bytes:
0x0019eb1c: 88 82 5c 00  40 3f d4 5f  78 ec 19 00  10 00 00 00  ..\.@?._x.......
0x0019eb2c: cc eb 19 00  00 00 00 00  b0 71 64 00  90 d9 5c 00  .........qd...\.
0x0019eb3c: 00 00 00 00  00 00 00 00  00 00 00 00  80 d9 5c 00  ..............\.
0x0019eb4c: 17 ae a6 ed  6c eb 19 00  9e 73 c3 65  00 00 00 00  ....l....s.e....
0x0019eb5c: c0 bf 5f 00  3c ec 19 00  00 00 00 00  a0 c0 5f 00  .._.<........._.
0x0019eb6c: f8 eb 19 00  8e 70 c2 65  38 1c c7 65  00 00 00 00  .....p.e8..e....
0x0019eb7c: a0 c0 5f 00  00 00 00 00  78 ec 19 00  00 00 00 00  .._.....x.......
0x0019eb8c: c0 bf 5f 00  a4 eb 19 00  fb e1 c1 65  88 82 5c 00  .._........e..\.
0x0019eb9c: d8 89 f0 20  10 ec 19 00  f7 75 c3 65  80 d9 5c 00  ... .....u.e..\.
0x0019ebac: cc eb 19 00  78 ec 19 00  f8 2e 5c 00  c0 bf 5f 00  ....x.....\..._.
0x0019ebbc: 0e 00 00 00  58 7f 59 00  88 82 5c 00  00 00 00 00  ....X.Y...\.....
0x0019ebcc: 50 71 64 00  00 00 00 00  00 00 00 00  00 00 00 00  Pqd.............
0x0019ebdc: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0x0019ebec: 00 00 00 00  00 00 00 00  00 00 00 00  80 00 00 00  ................
0x0019ebfc: 14 ec 19 00  b2 2a a3 6d  00 00 00 00  0c ed 19 00  .....*.m........
0x0019ec0c: 57 af a6 ed  2c ec 19 00  9e 73 c3 65  58 7f 59 00  W...,....s.eX.Y.
0x0019ec1c: f8 2e 5c 00  c0 bf 5f 00  cf a8 a6 ed  5c ec 19 00  ..\..._.....\...
0x0019ec2c: a8 ec 19 00  39 6f c3 65  78 ec 19 00  60 ed 19 00  ....9o.ex...`...
0x0019ec3c: c0 bf 5f 00  40 df 5b 00  48 49 59 00  00 00 00 00  .._.@.[.HIY.....
0x0019ec4c: 98 12 5c 00  03 00 0e 00  c0 56 5b 00  0e 00 00 00  ..\......V[.....
0x0019ec5c: 80 ec 19 00  a9 b4 99 77  00 00 59 00  40 9b 40 09  .......w..Y.@.@.
0x0019ec6c: 30 4b 5c 00  f8 48 59 00  00 00 00 00  b0 76 5c 00  0K\..HY......v\.
0x0019ec7c: c0 bf 5f 00  00 00 00 00  00 00 00 00  00 00 00 00  .._.............
0x0019ec8c: 00 00 00 00  00 00 00 00  48 c1 5f 00  00 00 00 00  ........H._.....
0x0019ec9c: 00 00 00 00  00 00 00 00  43 a8 a6 ed  c8 ec 19 00  ........C.......
0x0019ecac: 9f 27 c3 65  f8 b5 5f 00  c0 bf 5f 00  f8 b5 5f 00  .'.e.._..._..._.
0x0019ecbc: 90 16 ef e1  a0 c0 5f 00  b0 76 5c 00  00 ed 19 00  ......_..v\.....
0x0019eccc: 10 09 c3 65  eb a9 a6 ed  b0 07 c3 65  00 00 00 00  ...e.......e....
0x0019ecdc: f8 b5 5f 00  c0 bf 5f 00  f8 b5 5f 00  d0 ec 19 00  .._..._..._.....
0x0019ecec: 28 e5 19 00  34 f0 19 00  f0 74 c0 65  a3 f3 79 88  (...4....t.e..y.
0x0019ecfc: fe ff ff ff  20 ed 19 00  de 8c a7 6d  f8 b5 5f 00  .... ......m.._.
0x0019ed0c: 60 ed 19 00  00 00 00 00  58 6c 59 00  b0 07 c3 65  `.......XlY....e
0x0019ed1c: 44 17 ef e1  40 ed 19 00  50 0a a8 6d  50 c6 59 00  D...@...P..mP.Y.
0x0019ed2c: 60 ed 19 00  b0 07 c3 65  c2 01 76 88  20 ee 19 00  `......e..v. ...
0x0019ed3c: 24 17 ef e1  54 ed 19 00  84 12 00 10  50 c6 59 00  $...T.......P.Y.
0x0019ed4c: 60 ed 19 00  00 00 00 00  01 00 00 00  62 34 01 15  `...........b4..
0x0019ed5c: 40 21 00 10  00 00 00 00  02 00 00 00  e7 f2 00 15  @!..............
0x0019ed6c: 00 00 00 00  48 c1 5f 00  01 00 00 00  b8 00 23 02  ....H._.......#.
0x0019ed7c: 00 00 00 00  00 00 00 00  35 1e 04 bc  00 00 00 00  ........5.......
0x0019ed8c: 48 c1 5f 00  00 00 00 00  01 00 00 00  00 00 00 00  H._.............
0x0019ed9c: 01 00 00 00  20 ee 19 00  02 00 00 00  80 01 00 00  .... ...........
0x0019edac: f0 ff ff ff  f0 ff ff ff  ec ed 19 00  4b df ca 75  ............K..u
0x0019edbc: d9 ee 00 15  90 ee 19 00  80 02 00 00  04 29 24 02  .............)$.
0x0019edcc: b8 08 f8 01  88 ee 19 00  55 00 00 00  00 00 00 00  ........U.......
0x0019eddc: 00 00 00 00  00 00 00 00  20 00 cc 00  10 ee 19 00  ........ .......
0x0019edec: 98 00 23 02  03 30 00 00  00 00 00 00  d0 9a 03 15  ..#..0..........
0x0019edfc: 10 1c 01 e5  9c 08 f8 01  2a 0c 9e 00  10 00 00 00  ........*.......
0x0019ee0c: 00 00 00 00  0a 00 00 00  ae 01 00 00  40 ee 19 00  ............@...

Code bytes:
0x5fd43aeb: 83 79 08 01  74 18 8b 41  10 25 00 80  e0 04 f7 d8  .y..t..A.%......
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on February 16, 2016, 07:33:05 PM
Debugging in Visual Studio with the symbols file would be most preferrable.
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on February 16, 2016, 07:40:30 PM
Debugging in Visual Studio with the symbols file would be most preferrable.

[emoji106][emoji122]



Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 16, 2016, 07:48:00 PM
Debugging in Visual Studio with the symbols file would be most preferrable.

I cant because the broken war2 makes my mouse and window, bugged out so if i get the app open i cant click anything
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: {Lance} on February 16, 2016, 09:10:03 PM
You need symbols to make any debug output useful.  Without them you'll just get a garbled up mess.  Compile it with debugging symbols enabled.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 16, 2016, 09:26:54 PM
You need symbols to make any debug output useful.  Without them you'll just get a garbled up mess.  Compile it with debugging symbols enabled.
I cant because  when it crashes i loose control of windows and cant use software after...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 17, 2016, 06:07:47 AM
That was my idea to look into ERR-file from war2-directory.
It have been generated by war2 process during crash.
Not sure it's possible to add symbols for that ERR-file.

I spent last several evenings with experiments on dump-files.
If crash causes inside war2 process, you will not be able to find symbols for war2.
I don't think we need symbols from microsoft because we don't plan to debug windows ddls.

I cant because the broken war2 makes my mouse and window, bugged out so if i get the app open i cant click anything
Yes, when you get war2 crashed you press debug and then you are not able to use your GUI. I made my experiments with war2 loading in window mode. (That will not a goal for this situation).
Appreciate any ideas how to simply bypass that GUI blocking.

I also tried ProcDump by Mark Russinovich to get DMP-file, but stack trace in my test contained 1 address only. Instead of visual studio debugger in window mode (about 10 addresses in stack trace).
And then i looked into my ERR-file in war2 directory. In contained all the addresses i saw in visual studio debugger. Much more info than in full memory dump in DMP.

Maybe aqrit (or anybody else) can look into that addresses to find the problem.
As i understood from this log, the problem is related to this line:
Quote
10001284 0019ED54 0001:00000284 C:\War2anti\ddraw.dll
More precisely, it's already broken here, so need to look to the previous address (not listed in stack trace).
I'd say call for 0019ED54 looks like located here:
Quote
0x0019ebfc: 14 ec 19 00  b2 2a a3 6d  00 00 00 00  0c ed 19 00  .....*.m........
So location for previous call located here:
Quote
0x0019ec0c: 57 af a6 ed  2c ec 19 00  9e 73 c3 65  58 7f 59 00  W...,....s.eX.Y.
So, i'd look into aqrit's ddraw.dll, into function begin at 0019ec2c to check what happens there before call to 0019ed0c
Of course, 0019ED54 is also interesting address to look into...

Debugging in Visual Studio with the symbols file would be most preferrable.
If anybody can make symbols for current ddraw.dll, and explain how to enable it for degubbing that file, that would be appreciated.
Not sure if symbols can be built after ddraw.dll or both ddraw.dll and it's symbols should be created simultaneously...

Code:
Also, tupac, what version did you use for that log?
Also, can you attach your ddraw.dll  you used for that? (Not sure if aqrit rebuilt that dll and updated the link recently).
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 17, 2016, 01:36:27 PM
a new minimal version for Win8/10 was uploaded (same url) on the 20th

I plan on re-writing the main version again...
goals:
1. remove redraw kludge
2. real full-screen mode
3. switch to D3D9Ex or D3D11 for triple buffering with vsync

The "vista platform update for SP2" back ported DX11 but it isn't clear to me if the Win7 DX9Ex FLIPEX stuff was also back ported at the same time.

http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip (http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on February 17, 2016, 04:57:58 PM
Quote
10001284 0019ED54 0001:00000284 C:\War2anti\ddraw.dll
the return address doesn't line up for the current version...?
if the local ddraw.dll loaded at address 0x10000000 then the return address should be 0x10001288 not 0x10001284 ?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on February 18, 2016, 04:24:07 PM
Use this DLL: http://www.mediafire.com/download/pf5q8jh9yysatfh/ddraw_xboi_debug.zip (http://www.mediafire.com/download/pf5q8jh9yysatfh/ddraw_xboi_debug.zip)
Put the .pdb in the same folder as the DLL. When W2 crashes, you should click on the Debug button from the dialog that pops up and open with Visual Studio. If not, try ctrl+alt+del to open the task manager, go to the processes tab, right click on the W2 process, and click Create a dump file and/or click Debug.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 19, 2016, 03:32:01 AM
the return address doesn't line up for the current version...?
if the local ddraw.dll loaded at address 0x10000000 then the return address should be 0x10001288 not 0x10001284 ?
Checked also, 1284 point to the middle of operand, looks like different version.
Also, can you attach your ddraw.dll  you used for that? (Not sure if aqrit rebuilt that dll and updated the link recently).
Looks like exactly what i talked about: you dl'ed file, got an error, and after that aqrit rebuild ddraw and reupload it to the same url. So your dump is useless without your dll.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 19, 2016, 04:10:58 AM
BTW: report from kapsersky antivirus for war2_ddraw_minimal.zip: HEUR:Trojan.Win32.Generic

No such warning for other versions: test2,3,4 and ddraw_xboi_debug

Just checked:
https://www.virustotal.com/ru/file/30ef4474d3149cc430fd644d9d0a540a1794bef2127e3077c2f7b7eed68365f4/analysis/1455873140/ (https://www.virustotal.com/ru/file/30ef4474d3149cc430fd644d9d0a540a1794bef2127e3077c2f7b7eed68365f4/analysis/1455873140/)

https://www.virustotal.com/ru/file/4eabd28c314993032d4dd13b03ac4072b07cfbac24151058d085b9453b4a5423/analysis/1455873209/ (https://www.virustotal.com/ru/file/4eabd28c314993032d4dd13b03ac4072b07cfbac24151058d085b9453b4a5423/analysis/1455873209/)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: {Lance} on February 19, 2016, 11:27:31 AM
That is a common false positive for anything that manipulates memory in a non-standard'ish fashion.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 19, 2016, 01:19:45 PM
Use this DLL: [url]http://www.mediafire.com/download/pf5q8jh9yysatfh/ddraw_xboi_debug.zip[/url] ([url]http://www.mediafire.com/download/pf5q8jh9yysatfh/ddraw_xboi_debug.zip[/url])
Put the .pdb in the same folder as the DLL. When W2 crashes, you should click on the Debug button from the dialog that pops up and open with Visual Studio. If not, try ctrl+alt+del to open the task manager, go to the processes tab, right click on the W2 process, and click Create a dump file and/or click Debug.

Your ddraw was error for me...... i cant use task manager, or use visual studio or i would :( war2 frozen on top of all those windows and i cant get control when debugging...

(http://s18.postimg.org/mtaz4jx49/crash.png)

Code: [Select]

------------------------------------------------------
PROGRAM VERSION: 2.0.2.0
COMPUTER NAME: POWERMACHINE
USER NAME:
TIME: 02/19/16 13:05:38.103
INFO:

Exception code: C0000005 ACCESS_VIOLATION
Fault address: 72433204 01:00042204 C:\WINDOWS\system32\ddraw.dll

Registers:
EAX:00000000
EBX:00004000
ECX:00853E68
EDX:80808080
ESI:00853E68
EDI:80808080
CS:EIP:0023:72433204
SS:ESP:002B:0019EA38 EBP:0019EA80
DS:002B ES:002B FS:0053 GS:002B
Flags:00210246
Call stack:
Address  Frame    Logical addr  Module
72433204 0019EA80 0001:00042204 C:\WINDOWS\system32\ddraw.dll
7242B47D 0019EAB4 0001:0003A47D C:\WINDOWS\system32\ddraw.dll
75CB84F3 0019EAE0 0001:000374F3 C:\WINDOWS\SYSTEM32\USER32.dll
75C96C40 0019EB88 0001:00015C40 C:\WINDOWS\SYSTEM32\USER32.dll
75C96820 0019EBE8 0001:00015820 C:\WINDOWS\SYSTEM32\USER32.dll
75C9D169 0019EC28 0001:0001C169 C:\WINDOWS\SYSTEM32\USER32.dll
779D8E76 0019EC94 0001:00077E76 C:\WINDOWS\SYSTEM32\ntdll.dll
75C9CBC4 0019ECCC 0001:0001BBC4 C:\WINDOWS\SYSTEM32\USER32.dll
15010DC9 004AD984 0001:0000FDC9 C:\War2Combat401\Storm.dll

Stack bytes:
0x0019ea38: 78 ad 7c 00  a0 7c 7a 00  58 ea 7c 00  1c 2b 43 72  x.|..|z.X.|..+Cr
0x0019ea48: 01 00 00 00  60 30 7d 00  7c ba 42 72  01 00 00 00  ....`0}.|.Br....
0x0019ea58: fa 0d cd 00  78 ad 7c 00  58 ea 7c 00  01 00 00 00  ....x.|.X.|.....
0x0019ea68: 40 7a 7a 00  00 00 00 00  60 30 7d 00  01 00 00 00  @zz.....`0}.....
0x0019ea78: 00 00 00 00  01 00 00 00  b4 ea 19 00  7d b4 42 72  ............}.Br
0x0019ea88: 00 00 00 00  01 00 00 00  20 b0 42 72  00 00 00 00  ........ .Br....
0x0019ea98: 70 17 00 00  00 00 00 00  3e 11 00 00  d0 ef 45 00  p.......>.....E.
0x0019eaa8: 00 00 00 00  51 70 4d 35  00 00 00 00  e0 ea 19 00  ....QpM5........
0x0019eab8: f3 84 cb 75  fa 0d cd 00  1c 00 00 00  00 00 00 00  ...u............
0x0019eac8: 70 17 00 00  00 00 00 00  cd ab ba dc  70 17 00 00  p...........p...
0x0019ead8: 20 b0 42 72  00 00 00 00  88 eb 19 00  40 6c c9 75   .Br........@l.u
0x0019eae8: 20 b0 42 72  fa 0d cd 00  1c 00 00 00  00 00 00 00   .Br............
0x0019eaf8: 70 17 00 00  96 c8 8a 35  00 00 00 00  00 00 00 40  p......5.......@
0x0019eb08: 1c 00 00 00  24 00 00 00  01 00 00 00  00 00 00 00  ....$...........
0x0019eb18: 00 00 00 00  30 00 00 00  ff ff ff ff  ff ff ff ff  ....0...........
0x0019eb28: 18 6b c9 75  00 00 00 00  00 00 00 00  00 00 00 00  .k.u............
0x0019eb38: 00 00 00 00  20 b0 42 72  00 00 00 00  00 00 00 00  .... .Br........
0x0019eb48: 00 00 00 00  f8 09 a2 00  00 00 00 00  00 00 00 00  ................
0x0019eb58: 01 00 00 00  00 00 00 00  00 00 00 00  fa 0d cd 00  ................
0x0019eb68: 00 00 00 00  96 c8 8a 35  00 00 00 00  68 e4 19 00  .......5....h...
0x0019eb78: d8 eb 19 00  f0 e5 cb 75  36 08 42 40  00 00 00 00  .......u6.B@....
0x0019eb88: e8 eb 19 00  20 68 c9 75  20 b0 42 72  00 00 00 00  .... h.u .Br....
0x0019eb98: 1c 00 00 00  00 00 00 00  70 17 00 00  00 80 25 00  ........p.....%.
0x0019eba8: 01 00 00 00  f6 c8 8a 35  00 00 00 00  90 ad 9e 77  .......5.......w
0x0019ebb8: 01 00 00 00  11 00 00 00  00 00 00 00  00 00 00 00  ................
0x0019ebc8: fa 0d cd 00  00 00 00 00  ac eb 19 00  68 e4 19 00  ............h...
0x0019ebd8: 38 ec 19 00  f0 e5 cb 75  16 08 42 40  fe ff ff ff  8......u..B@....
0x0019ebe8: 28 ec 19 00  69 d1 c9 75  00 02 c7 00  00 00 00 00  (...i..u........
0x0019ebf8: 1c 00 00 00  00 00 00 00  70 17 00 00  20 b0 42 72  ........p... .Br
0x0019ec08: ec ec 19 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
0x0019ec18: f0 ee 85 00  00 00 00 00  00 00 00 00  36 cf 8a 35  ............6..5
0x0019ec28: 94 ec 19 00  76 8e 9d 77  44 ec 19 00  20 00 00 00  ....v..wD... ...
0x0019ec38: a0 ef 19 00  c0 8d 9d 77  68 ec 19 00  00 02 c7 00  .......wh.......
0x0019ec48: 00 00 00 00  1c 00 00 00  00 00 00 00  70 17 00 00  ............p...
0x0019ec58: 20 b0 42 72  90 ad 9e 77  00 00 00 00  1c 89 cb 75   .Br...w.......u
0x0019ec68: ce cd c9 75  ec ec 19 00  00 00 00 00  00 00 00 00  ...u............
0x0019ec78: 00 00 00 00  01 00 00 00  d0 c1 c7 00  00 80 25 00  ..............%.
0x0019ec88: 00 05 10 01  ec ec 19 00  00 00 00 00  cc ec 19 00  ................
0x0019ec98: c4 cb c9 75  00 00 00 00  00 00 00 00  01 00 00 00  ...u............
0x0019eca8: 01 00 00 00  f0 08 7a 00  f2 04 c1 00  e0 fc ca 75  ......z........u
0x0019ecb8: ac 8b cb 75  00 00 00 00  d0 c1 c7 00  00 80 25 00  ...u..........%.
0x0019ecc8: b0 c0 00 01  84 d9 4a 00  c9 0d 01 15  ec ec 19 00  ......J.........
0x0019ecd8: 00 00 00 00  00 00 00 00  00 00 00 00  01 00 00 00  ................
0x0019ece8: f2 04 c1 00  14 fd ca 75  f2 04 c1 00  b0 c0 00 00  .......u........
0x0019ecf8: f2 04 c1 00  84 d9 4a 00  78 13 01 15  f2 04 c1 00  ......J.x.......
0x0019ed08: 70 13 01 15  84 d9 4a 00  f0 08 7a 00  50 f6 19 00  p.....J...z.P...
0x0019ed18: 6e 00 00 00  75 7d 00 19  00 00 40 00  78 ad 04 19  n...u}....@.x...
0x0019ed28: f0 08 7a 00  80 c0 00 19  50 f6 19 00  e0 29 cb 75  ..z.....P....).u

Code bytes:
0x72433204: f6 47 04 02  0f 95 c1 f6  c2 20 0f 94  c0 84 c8 75  .G....... .....u

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 19, 2016, 03:09:27 PM
ddraw.dll
Hm, well, the same file...
But wrong return address, why?..
Maybe stack rewritten already? But looks almost properly.

Can you try on the same config to compare dumps?

i cant use task manager, or use visual studio or i would
try ProcDump: https://technet.microsoft.com/en-us/sysinternals/dd996900.aspx
procdump.exe -e -w -ma -x . "Warcraft II BNE.exe"
That will autogenegate .dmp-file in war2 directory on crash.
You have to start war2 directly without any loaders, so you should mount/insert war2 cd before.

15010DC9 004AD984 0001:0000FDC9 C:\War2Combat401\Storm.dll
hm, ddraw.dll is not represented at all, what does it mean?...

That is a common false positive for anything that manipulates memory in a non-standard'ish fashion.
I see, but that will alienate most ordinary users. They prefer to not use something detected as virus.
Also, previous version are not detected, so maybe injection mechanizm have been changed?
Not a problem while it's still in a test stage.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: {Lance} on February 19, 2016, 03:33:37 PM
Tupac, there is actually a fix for the control issue in my bot.  You can take a look at it this and make your own version of it.  All it does is change the state of the war2 window to minimized which in turn gives you control over windows again so you can access whatever is behind war2 window.  I ran into the same problem and this was the quick-fix I came up with:

'There is a weird bug that causes War2 to Maximize incorrectly when it's in a Non-War2 Game screen such as BNE Chat,  Login screen, etc.  You cant minimize anything with mouse or keys, so this fixes that bug.  This forces War2 into minimized state.  It will eventually fix itself when games are started, etc. -Lance
Sub MinimizeWar2()
   oAutoIt.WinSetState "Warcraft II", "", 6
End Sub
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 19, 2016, 05:31:04 PM
Tupac, there is actually a fix for the control issue in my bot.  You can take a look at it this and make your own version of it.  All it does is change the state of the war2 window to minimized which in turn gives you control over windows again so you can access whatever is behind war2 window.  I ran into the same problem and this was the quick-fix I came up with:

'There is a weird bug that causes War2 to Maximize incorrectly when it's in a Non-War2 Game screen such as BNE Chat,  Login screen, etc.  You cant minimize anything with mouse or keys, so this fixes that bug.  This forces War2 into minimized state.  It will eventually fix itself when games are started, etc. -Lance
Sub MinimizeWar2()
   oAutoIt.WinSetState "Warcraft II", "", 6
End Sub

Yeah tried things like that but war2 is so persistence over everything. my best bet is to make a bat file leave it open and execute it on crash. Ill edit back.


OKAY FOUND HUGE BUG!!!!
CLICK LADDER THEN ALT TAB REAL FAST. Look like war2 is window mode... but when i click join or create it goes full screen again.. This is what happens when the game crashes..... HIT LADDER THE ALT TAB REAL FAST IT LOOK LIKE WINDOW MODE..........
ddraw.dll

Hm, well, the same file...
But wrong return address, why?..
Maybe stack rewritten already? But looks almost properly.

Can you try on the same config to compare dumps?

i cant use task manager, or use visual studio or i would

try ProcDump: [url]https://technet.microsoft.com/en-us/sysinternals/dd996900.aspx[/url] ([url]https://technet.microsoft.com/en-us/sysinternals/dd996900.aspx[/url])
procdump.exe -e -w -ma -x . "Warcraft II BNE.exe"
That will autogenegate .dmp-file in war2 directory on crash.
You have to start war2 directly without any loaders, so you should mount/insert war2 cd before.

15010DC9 004AD984 0001:0000FDC9 C:\War2Combat401\Storm.dll

hm, ddraw.dll is not represented at all, what does it mean?...

That is a common false positive for anything that manipulates memory in a non-standard'ish fashion.

I see, but that will alienate most ordinary users. They prefer to not use something detected as virus.
Also, previous version are not detected, so maybe injection mechanizm have been changed?
Not a problem while it's still in a test stage.

I dont get crash with the cd mounted and load war2.exe from same crashing one...

window mode for channel LOOOL!!!!
Click join then alt tab real fast go back then click cancel. LOL COOL
(http://s13.postimg.org/udaamo58n/buggggg.png)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 19, 2016, 06:27:06 PM
OKAY FOUND HUGE BUG!!!!
CLICK LADDER THEN ALT TAB REAL FAST. Look like war2 is window mode... but when i click join or create it goes full screen again.. This is what happens when the game crashes..... HIT LADDER THE ALT TAB REAL FAST IT LOOK LIKE WINDOW MODE..........
Nice!
Looks like working for me too!

This ddraw makes redrawing the interface extremely slow, so if i alt-tab during redrawing, that cause crash eighter in alt-tab to win or in alt-tab back to game.
Works for me when i join chat, it begins to draw and then i alt-tab. Also works when i click create/join and alt-tab while redrawing. Also when i click Laddder.
Testing on winxp.

Not sure if that's actual for clean war2 without ddraw, it redraws extremely fast, so i have no time to alt-tab during redraw.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: {Lance} on February 20, 2016, 12:13:40 PM
Tupac,  if you use AutoIt,  like the bot, you dont have to create a batch file.  You can bind it to a hotkey and that will solve the issue.  you wont be able to move the war2 window around, but you will break the cursor out of the window which will allow you to move other windows and they WILL be placed over the top of the war2 window which is your goal so that you can read debug info.  See the "6" at the end of the line,  there are 32 states that you can try,  6 happened to be the one that worked for me,  but one of them may work for you,  play with them all.  When alt-tabbing caused the war2 window to get stuck in the top left corner and the cursor could not be grabbed, there were only 2 fixes.  Change the window state and then alt-tab back into the game, or create a game and then alt-tab back into the game.  I use both methods in the bot.  AutoIt just makes it quick and easy to bind a window state change to a hotkey which is why I suggest it as a quick fix.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on February 20, 2016, 04:30:49 PM
Tupac,  if you use AutoIt,  like the bot, you dont have to create a batch file.  You can bind it to a hotkey and that will solve the issue.  you wont be able to move the war2 window around, but you will break the cursor out of the window which will allow you to move other windows and they WILL be placed over the top of the war2 window which is your goal so that you can read debug info.  See the "6" at the end of the line,  there are 32 states that you can try,  6 happened to be the one that worked for me,  but one of them may work for you,  play with them all.  When alt-tabbing caused the war2 window to get stuck in the top left corner and the cursor could not be grabbed, there were only 2 fixes.  Change the window state and then alt-tab back into the game, or create a game and then alt-tab back into the game.  I use both methods in the bot.  AutoIt just makes it quick and easy to bind a window state change to a hotkey which is why I suggest it as a quick fix.
No it don't work like I have the mouse out easy.

War2 crashes you are prompted with msg box debug or close. So I click debug it's opens visual studio but when I click anything war2 get its windows top priority, even if I change it boom happends again war2 is on top now. I have an idea I will use cheat engine and try to make war2 invisible then maybe create an .net file to manually set my debugger on top every second idk I'll be back.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: {Lance} on February 20, 2016, 05:54:53 PM
Lol,  no need to use Cheat engine.  Just try the AutoIt fix,  it will work.  I know exactly what issue you are running into, I had the same problem.  The AutoIt window state fix does work, you just have to try it thats all.  It will work regardless of it's running state (whether its crashed or not).  War2 does crash and I've had to work around the debug window popup with the bot in order to restart war2.  The first problem was the mouse control was stuck in the war2 window space.  Once that was fixed, I was able to force clicks outside the window.  I could also manually move windows around (not something I needed, but did work).
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on February 21, 2016, 02:05:47 AM
Again, try to get a dump file from the crash
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on February 22, 2016, 05:59:23 PM
Sub MinimizeWar2()
   oAutoIt.WinSetState "Warcraft II", "", 6
End Sub
I just tried autoit, had to change it to WinSetState("Warcraft II", "", 6) (not sure if that syntax means something)
And it works fine while war2 is working, but don't help after crash.

As soon as i can reproduce tupac's error, i'll try to find any other way to make a crash dump.
I'm thinking about remote debugging as the best way. Never tried that...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on March 16, 2016, 01:50:51 PM
Anyone seen this bug on Win10? Does it always happen?

(http://i.imgur.com/jgvYJFz.png)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on March 16, 2016, 01:54:02 PM

Anyone seen this bug on Win10? Does it always happen?

([url]http://i.imgur.com/jgvYJFz.png[/url])


You alt tab out of the game?


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on March 16, 2016, 01:56:07 PM
Many times
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on March 16, 2016, 01:57:42 PM
Many times

Still not understanding what the problem is, are you talking about the off set graphics? Is the game frozen and you can't return to desktop?

Off set graphics is a problem when you leave war2 alt tab in and out. Join/create  random game to fix it.

Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on March 16, 2016, 02:53:52 PM
Yes, the offset. Okay, thanks. Is it win8/10 specific? Never happens on my Win7 computer.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on March 16, 2016, 02:58:21 PM

Yes, the offset. Okay, thanks. Is it win8/10 specific? Never happens on my Win7 computer.

It's not a problem on Windows 7. I haven't tested it myself on 8, it is a common problem on 10.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on March 16, 2016, 10:55:46 PM
Anyone seen this bug on Win10? Does it always happen?

([url]http://i.imgur.com/jgvYJFz.png[/url])

Watch out for that TeamSpeak server make sure it's not archer trying to back door our people.
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on March 16, 2016, 10:59:14 PM
I already told iL about it, he's thinking whether or not to lock it. It seems malicious, from the messages I have received from him so all I can do is advice...if it takes him this long to act not my fault [emoji53]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on March 16, 2016, 11:21:38 PM
Login from a VM and see if it matches this version.
http://forum.war2.ru/index.php/topic,1867.0.html (http://forum.war2.ru/index.php/topic,1867.0.html)

If it is we need to inform players to wipe system or run my steps one by one if they connected. He purchased a crytper  and showed me before so it will bypass all AV's.

I will try to verify here in a bit
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: crazyman2581 on March 27, 2016, 04:23:26 PM
I'm having a hard time figuring this out can someone help?????
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: crazyman2581 on March 27, 2016, 04:36:20 PM
can someone if on help me figure this out. how to fix the problem I'm just not getting it =(
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on March 27, 2016, 04:44:50 PM
On ru mainpage I think its in download section delete the replace the ddraw in it with agrits on a phkne can't do much here
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on March 27, 2016, 05:18:48 PM
can someone if on help me figure this out. how to fix the problem I'm just not getting it =(
Just download the file extract it to desktop copy that .dll file then paste into your warcraft 2 folder. Done.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: crazyman2581 on March 27, 2016, 06:01:24 PM
download what one I see there is a few to pick from
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on March 27, 2016, 06:06:46 PM
1 sec I'll edit this post.

http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip (http://www.bitpatch.com/downloads/war2_ddraw_minimal.zip)

Thats the version for win 8 10 minimal. Extract then place .dll in war2 folder.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: crazyman2581 on March 27, 2016, 06:12:20 PM
ok I dled it I opened the folder now what do I do I'm sorry I'm being a pain in the ass tupac
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on March 27, 2016, 06:15:12 PM
ok I dled it I opened the folder now what do I do I'm sorry I'm being a pain in the ass tupac
Download it try to open it? It's a zip files so you need to extract it to desktop, etc. Then put the .dll into the war2 folder. Done go play.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: crazyman2581 on March 27, 2016, 06:18:32 PM
that time it worked I guess I was just doing it wrong the 1st few 100 times lol thanks again
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on March 27, 2016, 06:19:26 PM
that time it worked I guess I was just doing it wrong the 1st few 100 times lol thanks again
Lol maybe you didn't extract it last time lol

Have fun gaming and bugs report them here. Have fun :)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on April 06, 2016, 04:07:44 AM
So, current state of ddraw project:
There are 2 different versions: full and minimal

Both versions have the same bug discorevered by typac and reproduced by me on different platforms:
If you alt-tab during redrawing chat elements (right after joining chat or pressing create/join game and then exiting back to chat or w/e), the game crashing.

Both versions are quite slow. full is slower than minimal.

The most important problem is crashing during redraw. I have no idea how to fix that, maybe you too, but would be important to do something with that.
Another offer: aqrit, can you merge both projects: full and minimal into one project? As i understood, they have some common part for win8/10 and full has some additional part for win7, right?
I mean to use something like "#ifdef MINIMAL ... #endif" or "#ifdef FULL ... #endif" inside one common project.
That would let you support 1 project instead of 2 and keep both of them up to date.

I also have intentions to build and check your project carefully, to add some debugging logs for my own understanding. Unfortunately i understand almost nothing in your code. My too bad experience in ddraw things and windows hooks. May i ask you to add some comments for inobvious parts of code or at least to answer my newbish stupid questions i'll ask then?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on April 06, 2016, 11:56:56 AM
Quote
Both versions have the same bug.. alt+tab chat crash
the minimal version is doing basically nothing...
I can add some checks to the user32/GDI function calls, but I thought they were fairly safe even when they fail.

Quote
full is slower than minimal
That whole part of the full version should be ported to a d3d shader instead of trying to use SIMD

Quote
merge both projects: full and minimal
The full version changes color-depth the minimal version is a study of how DWM broke the game.
There is an overlap between the two if the user doesn't support SSE2, but if that section is ported to a d3d shader then the overlap would be cut from the code.
They should not be merged.

Quote
comments or questions
I'll answer questions...

---

I have to do something to fix the Korean text in Starcraft (broken by changing color depth), doing that might inspire me to put some more time into this project.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on April 11, 2016, 05:39:17 PM
the minimal version is doing basically nothing...
I can add some checks to the user32/GDI function calls, but I thought they were fairly safe even when they fail.
Sorry, i've been wrong.
Crash happens on minimal version and XP only for me during alt-tab.

I start war2 on XP with minimal ddraw, it works, but redraws extremely slow (corrent behavior?). It i alt-tab any time on XP, i get war2 crashed.
I just installed and configured a remote debugger, so blocking input devices is not a problem anymore. Crash causes on storm.dll: 15012F78  call        dword ptr [ecx+6Ch]
Maybe also correct behavior? No support in XP for d3d shader or w/e.
I can post detailed stack trace if needed, but maybe just some simple check possible to prevent crash?

I haven't been able to reproduce crash in full version under XP.

When i try minimal on win7 i also haven't been able to reproduce crash and drawing works much faster than on XP.

Interesting if one can confirm/reproduce my crash or to get different behavior.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on April 12, 2016, 01:50:58 AM
that crash is expected behavior for the "minimal" version on XP.
the "minimal" version is for win8+ only...

the "full" version will never encounter this issue...
as it will never return DDERR_SURFACELOST

If we cared...??? to get the minimal version to not crash on XP we just need to forward the dds->Restore function.

15012F62 == dds->Lock call
15012F78 == dds->Restore call
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on April 12, 2016, 11:58:02 AM
If we cared...??? to get the minimal version to not crash on XP we just need to forward the dds->Restore function.
I see: 0, //Restore,                   // 0x6C
Each 0 value in dds_vtbl[] array will cause crash if that function will be called, right?
Same as different arrays: dd_vtbl[] and ddp_vtbl[].

Not sure how you can be so sure that other functions will never be called, but i'd forward all of these functions...

Let's wait for tupac, he said that he got crashes in several different places, i hope he will be able to give us some reproduceable crash or even setup the remote debugging on his side, but i'd say user-friendly application should never crash, even on improper system.

I can add some checks to the user32/GDI function calls, but I thought they were fairly safe even when they fail.
I'd actually prefer some checks with logging any impossible situation...

The full version changes color-depth the minimal version is a study of how DWM broke the game.
There is an overlap between the two if the user doesn't support SSE2, but if that section is ported to a d3d shader then the overlap would be cut from the code.
They should not be merged.
I looked into your projects for a long time, but i still didn't understand how it works. Your programming experience is MUCH higher than mine...

So, let me try to explain how i understood your projects and you say if i'm right or not, ok?

As i remember from your comments, you went from 8 bpp palette to 32 bpp, that helped for all palette problems, but required to convert each pixel for the whole region every frame. That extremely slowed down the performance.
Then you used SSE2 just to make that converts 8->32bpp faster. And then you used d3d shaders to make it work faster, but on systems not supporting SSE2, right?

That 8->32bpp conversion have been applied to restore a bug with bitblt in windows7.
Windows since 8 has that bug already fixed, so no need that 8->32bpp conversions, the only problem is wrong z-order between ddraw and GUI layers.
That problem appears because of DWM thing firstly appeared in win vista and became mandatory since win8. That DWM makes players icons behind ddraw layer, causes black background for letters above buttons, etc.

So, the mini version allows to bypass DWM and it's the only thing it does? As soon as other ddraw bugs have been fixed after win7? No any conversions from 8 to 32 bpp?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on April 12, 2016, 02:07:45 PM
Quote
Then you used SSE2 just to make that converts 8->32bpp faster. And then you used d3d shaders to make it work faster, but on systems not supporting SSE2, right?

No, SSE2 is used to do a transparent BitBlt.  If SSE2 is not supported it falls back to some GDI operations.

though, on the bnet menu screens...
color conversion is done with regular 386 instructions, instead of using the d3d shader.
because originally I wasn't planning on using d3d at all.

---

Everything else you posted seems correct.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on April 12, 2016, 04:11:22 PM
In 0.4 the 32bpp surface is not locked, only the 8bpp texture is locked...
so color converting anything by hand is a giant WTF!
How it doesn't crash or produce visual garbage is currently a mystery...

Stayed tuned for a fix for this :p
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on April 16, 2016, 07:25:31 PM
Windows 10 Home 64bit


war2_ddraw_test2:
Alt + Tab Bug dosent seem to exist here.
Haven't had a crash
Font to me looks nicer
Executing war2 patcher gave me a black screen and stayed for 30 seconds then looks like it auto closes.

war2_ddraw_test3:
Causes crash on my machine i clicked join and alt tab real fast instant crash for me.
Alt tab bug looks like exists in this version!
Also had black screen for running with patcher!
Dump file was pretty big on size so let me know if i should up load it.
C:\War2Combat401>procdump.exe -e -w -ma -x . "Warcraft II BNE.exe"

ProcDump v7.1 - Writes process dump files
Copyright (C) 2009-2014 Mark Russinovich
Sysinternals - www.sysinternals.com (http://www.sysinternals.com)
With contributions from Andrew Richards

Process:               Warcraft II BNE.exe (652)
CPU threshold:         n/a
Performance counter:   n/a
Commit threshold:      n/a
Threshold seconds:     10
Hung window check:     Disabled
Log debug strings:     Disabled
Exception monitor:     Unhandled
Exception filter:      *
Terminate monitor:     Disabled
Cloning type:          Disabled
Concurrent limit:      n/a
Avoid outage:          n/a
Number of dumps:       1
Dump folder:           .\
Dump filename/mask:    PROCESSNAME_YYMMDD_HHMMSS


Press Ctrl-C to end monitoring without terminating the process.

[19:41:41] Exception: C0000005.ACCESS_VIOLATION
[19:41:41] Unhandled: C000041D
[19:41:41] Dump 1 initiated: .\Warcraft II BNE.exe_160416_194141.dmp
[19:41:44] Dump 1 writing: Estimated dump file size is 163 MB.
[19:41:50] Dump 1 complete: 163 MB written in 8.8 seconds
[19:41:50] Dump count reached.


C:\War2Combat401>

war2_ddraw_test4:
Font looks good
Didn't crash yet think i need to play the game with this version maybe it caused my random crashes also?
Also there is a new bug it breaks mouse over picture.
I expect alt tab bug here too also just could not get it to bug out.
(http://s9.postimg.org/fzcb5nt4v/bugtest4.png)

Minimal Verson 8 - 10:
Has alt tab bug but no crash so far im sure there is just havent used the .dll long enough.


Will update with windows 7 and xp results. Let me try to get a proper crash dump.




Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on May 02, 2016, 05:41:47 PM
Found another bug for windows 8/10 minimal.

So some times after coming back from an alt tab i go to type text in war2 channel which does not go into the text box like it war2 got maximized but not focused and when i hit enter to send the text war2 looks like its in windows mode now :) and have to close war2 to fix it.

It actually becomes window mode LOL cool thing is everything is NOT broken haahaha i cant move it around though only thing missing to make this window mode.

LOOOL

ALT + ENTER with 8/10 minimal will make it window mode and you can toggle it back! COOL!!!!!!!!!!!!!!!!!!!!!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: sascha on May 24, 2016, 12:32:45 PM
Is there any chance you include the possibility to launch WC2 in windowed mode officially? Found a ddraw.dll that has windowed mode by configuring it via ddraw.ini but includes all the glitches that have been fixed by the ddraw.dll in this thread.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on May 24, 2016, 12:47:14 PM
Is there any chance you include the possibility to launch WC2 in windowed mode officially? Found a ddraw.dll that has windowed mode by configuring it via ddraw.ini but includes all the glitches that have been fixed by the ddraw.dll in this thread.
In the color fix for win 8 and 10 minimal just hit alt + enter.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on June 02, 2016, 06:40:57 PM
Several people have asked about this fix recently. I have this page http://en.war2.ru/ddraw (http://en.war2.ru/ddraw) that explains how to use it, right now the only version it links to is the second one that fixes the blurry text (war2_ddraw_test2.zip). So questions:

- Is that the best version to be distributing as of right now?
- Is that version okay for Win8/10? Or is it better for them to use the pass-thru version? (war2_ddraw_minimal.zip, http://forum.war2.ru/index.php/topic,1790.msg32593.html#msg32593 (http://forum.war2.ru/index.php/topic,1790.msg32593.html#msg32593))
- Does that pass-thru version also include the alt+enter shortcut? Sounds like yes based on tupac's previous posts?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on August 10, 2016, 07:02:59 PM
I cleaned up some of the code, updated project files for Visual Studio 2015, enabled optimizations, added better error messages, and created a fallback CreateDevice() call so that the DLL could work on a wider variety of systems. Windows XP not supported (could easily be supported if you change a compiler option).
Source code included.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on August 10, 2016, 08:41:13 PM
I cleaned up some of the code, updated project files for Visual Studio 2015, enabled optimizations, added better error messages, and created a fallback CreateDevice() call so that the DLL could work on a wider variety of systems. Windows XP not supported (could easily be supported if you change a compiler option).
Source code included.

dam that just gave me a boner. [emoji106]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on August 10, 2016, 08:43:37 PM
not me...:( gonna miss alt+ enter back xp single core amd :(  ;D and im poking shit fuck vista and above lol  ;D but gj man!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on August 10, 2016, 09:55:10 PM
And SOS Aqrit, I don't know why but Korean text is broken in StarCraft.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on August 11, 2016, 03:11:54 PM
And SOS Aqrit, I don't know why but Korean text is broken in StarCraft.

Uh?


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on August 11, 2016, 06:18:29 PM
And SOS Aqrit, I don't know why but Korean text is broken in StarCraft.

Uh?


Sent from my Motorola DynaTAC 8000X using Tapatalk
Yeah I saw that mentioned on teamliquid or whatever it's called. Those people should be able to make their own color fix idk though.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on August 12, 2016, 11:16:44 PM
thx again man back on 7...thought i could live without the window mode but i cant :P works great!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on August 13, 2016, 03:50:28 PM
thx again man back on 7...thought i could live without the window mode but i cant :P works great!
Yeah I totally agree with you there. Very hand for development, etc.
Title: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on August 13, 2016, 05:50:16 PM
thx again man back on 7...thought i could live without the window mode but i cant :P works great!
Yeah I totally agree with you there. Very hand for development, etc.

Or just get two monitors [emoji58]


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on August 13, 2016, 07:19:25 PM
It also causes my 2nd monitor to go black when I alt tab for a few seconds in and out. Had my laptop running to my 55in NEC monitor. Another reason I use window mode ;)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: EviL~Ryu on August 13, 2016, 07:20:33 PM
It also causes my 2nd monitor to go black when I alt tab for a few seconds in and out. Had my laptop running to my 55in NEC monitor. Another reason I use window mode ;)

You need to fix that in your graphics card control panel.


Sent from my Motorola DynaTAC 8000X using Tapatalk
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on August 14, 2016, 12:10:23 AM
@xboi

I keep trying to improve this project by hooking WM_DRAWITEM and WM_PAINT messages...
which eventually causes me to rage quit.  >:(

fixing the Korean text is trivial, if using invasive hooking...
if you're going to build a launcher then this would be good practice for you :p

The only non-invasive way to fix the KR font, that I can think of, would be to override the Ariel font with a custom one. However, I've never tried that out.

other known issues:
1. D3DCREATE_FPUPRESERVE flag is missing
2. In 0.4 the 32bpp surface is not locked, only the 8bpp texture is locked...
so color converting anything by hand is a giant WTF!
How it doesn't crash is currently a mystery...

Do you think the new official 1.1.17 Starcraft patch is waiting on the HD upgrade?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on August 14, 2016, 02:11:28 AM
Could you tell me how to fix the Korean text using invasive hooking? I think I'll just separate it into another DLL. Don't bother with overriding the Arial font, StarCraft uses custom font files embedded inside its data files.

Regarding #2, how easy would it be to lock the 32bpp surface?

The 1.17.0 patch along with the HD announcement seems like it's weird timing. There are a few scenarios I have in mind about what Blizzard would do, and releasing the 1.17.0 patch alongside the HD version (that should be backwards compatible with original BW players) is one possibility. I'd like to see your code become compatible with 1.17.0 though because the windowed mode hack that the community uses is broken with 1.17.0.

And FYI, I profiled the code and this is the result:
(http://i.imgur.com/1xXM0EG.png)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: aqrit on August 16, 2016, 02:59:55 AM
> Could you tell me how to fix the Korean text using invasive hooking?
http://www.teamliquid.net/forum/viewpost.php?post_id=25568672 (http://www.teamliquid.net/forum/viewpost.php?post_id=25568672)
IIRC, the game creates an offscreen gdi surface the same color depth as the display
it draws the korean text to that surface using gdi
then it just does a straight memcpy of those bits to the (8bpp) ddraw surface.

it all happens around the GetBitmapBits() call

so pick one of the following:
A) hook some gdi calls so the gdi surface is 8bpp
B) color convert the data as it is moved between the 32bpp gdi surface and the 8bpp ddraw surface
C) output the text straight to the 32bpp d3d surface
D) replace the whole function with custom "draw string" code

> Regarding #2, how easy would it be to lock the 32bpp surface?
we DON'T want to lock the 32bpp surface.
instead we want to remove all calls to color_convert() and multiblt()
...
If you really want to lock the 32bpp surface... IIRC, the previous versions did it so check the git commit history.

> profiled the code
seems to be missing :p
but this project is not at the optimization stage...
it still has other fundamental issues :-/

Assuming the palette code gets optimized...

then the only thing going on in-game really is the mapping between video memory and system memory for the 8bpp texture? I don't know much about it and the docs seems vague on what is actually going on behind the scenes...

You can try using different texture creation flags, or different color format for the 32bpp surface or something, idk.

One could switch between exclusive mode in-game then pop back to normal mode on the menu...
which kinda leads to what I was saying about hooking WM_DRAWITEM/PAINT because (afaik) thats the only way to stay in exclusive mode 100% of the time.

/random
I was wondering awhile ago, if one flipped the GDI primary to the ddraw back buffer... could it be accessed simultaneous by ddraw and gdi? I suspect that behavior has also been broken, though.

> windowed mode
if the drawing was fixed in the 1.17 (alpha?) couldn't one just use dxwnd again?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: xboi209 on August 16, 2016, 06:01:09 PM
so pick one of the following:
A) hook some gdi calls so the gdi surface is 8bpp
B) color convert the data as it is moved between the 32bpp gdi surface and the 8bpp ddraw surface
C) output the text straight to the 32bpp d3d surface
D) replace the whole function with custom "draw string" code
I wouldn't really know how to do any of that without some really specific details :/
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on August 16, 2016, 08:19:44 PM
> Could you tell me how to fix the Korean text using invasive hooking?
[url]http://www.teamliquid.net/forum/viewpost.php?post_id=25568672[/url] ([url]http://www.teamliquid.net/forum/viewpost.php?post_id=25568672[/url])
IIRC, the game creates an offscreen gdi surface the same color depth as the display
it draws the korean text to that surface using gdi
then it just does a straight memcpy of those bits to the (8bpp) ddraw surface.

it all happens around the GetBitmapBits() call

so pick one of the following:
A) hook some gdi calls so the gdi surface is 8bpp
B) color convert the data as it is moved between the 32bpp gdi surface and the 8bpp ddraw surface
C) output the text straight to the 32bpp d3d surface
D) replace the whole function with custom "draw string" code

> Regarding #2, how easy would it be to lock the 32bpp surface?
we DON'T want to lock the 32bpp surface.
instead we want to remove all calls to color_convert() and multiblt()
...
If you really want to lock the 32bpp surface... IIRC, the previous versions did it so check the git commit history.

> profiled the code
seems to be missing :p
but this project is not at the optimization stage...
it still has other fundamental issues :-/

Assuming the palette code gets optimized...

then the only thing going on in-game really is the mapping between video memory and system memory for the 8bpp texture? I don't know much about it and the docs seems vague on what is actually going on behind the scenes...

You can try using different texture creation flags, or different color format for the 32bpp surface or something, idk.

One could switch between exclusive mode in-game then pop back to normal mode on the menu...
which kinda leads to what I was saying about hooking WM_DRAWITEM/PAINT because (afaik) thats the only way to stay in exclusive mode 100% of the time.

/random
I was wondering awhile ago, if one flipped the GDI primary to the ddraw back buffer... could it be accessed simultaneous by ddraw and gdi? I suspect that behavior has also been broken, though.

> windowed mode
if the drawing was fixed in the 1.17 (alpha?) couldn't one just use dxwnd again?



Dxwnd never worked for battle.net.... yours is perfect just need to add a frame so we can move the window.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on January 02, 2017, 11:25:18 AM
Just tried war2 with all versions of ddraw.dll on my computer: core i5-4460, win7 x64, integrated video adapter (generic vga).
Dxdiag shows directx 11.

Test2 works fine. Test3 and test4 causes ddraw error. Test4 minimal causes black screen. (Also test4 causes a kaspersky antivirus false-positive: win32 trojan-generic).
I just planned to use something working with windowed mode by alt-enter (test 3 and test 4 should work, as i remember).

So, looks like all these tests are still far from production. Need some final product from tests.
Otherwise i can't implement it to new combat.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Delete mine too on January 02, 2017, 12:57:52 PM
Just tried war2 with all versions of ddraw.dll on my computer: core i5-4460, win7 x64, integrated video adapter (generic vga).
Dxdiag shows directx 11.

Test2 works fine. Test3 and test4 causes ddraw error. Test4 minimal causes black screen. (Also test4 causes a kaspersky antivirus false-positive: win32 trojan-generic).
I just planned to use something working with windowed mode by alt-enter (test 3 and test 4 should work, as i remember).

So, looks like all these tests are still far from production. Need some final product from tests.
Otherwise i can't implement it to new combat.
Why would you test them of windows 7? This is a Windows 8.1, 10, etc fix.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on January 03, 2017, 06:53:34 PM
Why would you test them of windows 7? This is a Windows 8.1, 10, etc fix.
Because i try everything everywhere.
My motherboard is asus h81m-k.

Well, test4_minimal is a windows 8+ fix, that's ok, but test 3, test 4 should work everywhere. And they don't on my configuration.

The problem is gone when inserting external video card (NVIDIA Quadro FX 4500), both test3 and test4 work perfect on win7. (test4_minimal works also, but crashes on alt-tab). But sad that only test2 works with integrated video.
Not user-friendly behavior for new users. I even have no idea how to detect proper version for win-7 in new combat.
"Just to try test4, if not working, then try test3, if not working try test2"? Sad.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on March 11, 2017, 10:54:33 AM
Not sure if it's been noticed before, but just helped burton install I think test2 (the version that fixes blurry text) and it crashes war2 when UAC is enabled. Win7 x64
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on August 20, 2018, 05:28:45 PM
new ddraw version released by @FF on discord!

Quote from: FF
forked the ddraw and made a release with fps limiter for those having performance issues

https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on August 28, 2018, 09:42:39 AM
Wow!
Interesting, someone tries to continue that great job!

Need to test that new versions carefully, the main thing is stability.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: mousEtopher on September 07, 2018, 01:18:26 PM
@FF aka fois[as] continuing to release updated versions of the ddraw that provide cool new features, now including toggleable window mode
https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases

(https://i.imgur.com/wN1yEPy.png)

(https://i.imgur.com/1PhpAxN.png)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 15, 2019, 03:49:12 AM
Latest version comes now with a resizable window, It does also remember the window position now and comes with a new settings file with additional settings for fine tuning.

https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases

(https://i.imgur.com/6vkGjFh.png)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 15, 2019, 04:37:59 AM
Latest version comes now with a resizable window, It does also remember the window position now and comes with a new settings file with additional settings for fine tuning.
Wow! Even 2 days ago, right after i looked into GOG Diablo release, i began to look into ddraw to maybe rewrite it myself!
And now you appear with your update! Thanks!
Please, post your updates here, i even didn't know about your project.

What i liked in GOG ideas: using current resolution, to not switch the game to 640x480 or w/e. That's great and very pleasant. What i disliked: that works for single player only, now for bnet chat.
Quote
This ddraw is meant to be used for online games only
That will be very interesting to look, how you released a resizable window with GDI elements for bnet-chat. I thought about that, but i still didn't make even a 1-st step that way...

Also thanks a lot for the opensource project: GOG's didn't make their code sources, they even used some kind of angry cryptor, so debugger can just see unlimited list of senseless jmps and calls...

UPD: also another interesting question:
which aqrit version it based on?
test2, test3, test4?
As i don't see d3d shaders, i'd suppose it's test2? Not so quick as test4 which supports d3d, but compatible with all videocards?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 15, 2019, 04:53:15 AM
@fois, i looked into your repositories and see one forked from narzoul/DDrawCompat. I also looked into narzoul's thing, to adapt it to war2. I like their coding style and lots complicated bugfixes. What do you think about to use fork from DDrawCompat for war2?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on March 15, 2019, 10:20:41 AM
omg! best performance love it!!!!

omg!!!!!!! like omg i need some beer!!!! thanks for the options!!!! i can use my little widgets!!


1 more thing,i have a dosbox that uses, i think its called scalers, im not sure..like 2x eagle2xsai,mame stuff..that makes the graphics almost perfect but no biggie cool as hell!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 15, 2019, 03:17:13 PM
What i liked in GOG ideas: using current resolution, to not switch the game to 640x480 or w/e. That's great and very pleasant. What i disliked: that works for single player only, now for bnet chat.

Yeah, you can also do that in fullscreen with the updated one I linked and with cnc-ddraw too just like in the gog version.


Example war2_ddraw.ini:

[ddraw]
Windowed=Yes
MaintainAspectRatio=Yes
AlwaysOnTop=Yes
ShowWindowFrame=No
Width=1920
Height=1080


Example ddraw.ini for cnc-ddraw:

[ddraw]
fullscreen=true
maintas=true


UPD: also another interesting question:
which aqrit version it based on?
test2, test3, test4?
As i don't see d3d shaders, i'd suppose it's test2? Not so quick as test4 which supports d3d, but compatible with all videocards?

I use test2 because it's faster than test3 and test4 and it always works fine, even if you don't have graphic drivers installed and even if your hardware doesn't support dx9.

I tested a lot with GDI, Direct3D9 and OpenGL... GDI is always faster at low resolutions like 640x480 for our use case. I tried it with other games that support higher resolutions and found out that Direct3D9 and OpenGL will start to become faster than GDI at 1280x720 and above, but warcraft 2 only supports 1 resolution (640x480) so that means there is currently no use for Test3 and Test4.


@fois, i looked into your repositories and see one forked from narzoul/DDrawCompat. I also looked into narzoul's thing, to adapt it to war2. I like their coding style and lots complicated bugfixes. What do you think about to use fork from DDrawCompat for war2?

DDrawCompat is nice and has good performance, but I don't think we will need it for war2 (It has no windowed mode and no scaling).



omg! best performance love it!!!!

omg!!!!!!! like omg i need some beer!!!! thanks for the options!!!! i can use my little widgets!!


1 more thing,i have a dosbox that uses, i think its called scalers, im not sure..like 2x eagle2xsai,mame stuff..that makes the graphics almost perfect but no biggie cool as hell!


That's a nice idea with the widgets! :D


You can also use shaders with cnc-ddraw, but it does only work for single player right now (no bnet).

Step 1

Get cnc-ddraw here
https://github.com/CnCNet/cnc-ddraw/releases


Step 2


Download the shader you like to use
https://github.com/libretro/glsl-shaders

I think xBR looks the best with war2, eagle and sai don't give as good results. xBRZ is nice too.


Step 3

Configure ddraw.ini for 2x scaling with xBR

[ddraw]
width=1280
height=960
windowed=true
boxing=true
shader=Shaders\xbr-lv2.glsl
renderer=opengl
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 16, 2019, 09:47:16 PM
I was just playing around with cnc-ddraw and I think I got it finally working on bnet for online games...

If someone wants to give it a try, extract cnc-ddraw.zip into your game folder. (It's attached below)


This one is preconfigured for scaling with xBR shader, it might show you the most beautiful warcraft 2 you have ever seen :)

This config runs at double resolution (or more), which is 1280x960. Will work fine if your monitor supports high resolutions such as 1920x1080 or above, otherwise you can't really use it with this config. Scaling via xBR requires somewhat good hardware with OpenGL 3.0 support.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on March 16, 2019, 11:20:14 PM
nice!!! kinda "hot wax" look

looks great,and plays well, im going with 800x600 not the best hardware here.

my .jpg doesnt give justice lol.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 17, 2019, 12:07:36 AM
nice!!! kinda "hot wax" look

looks great,and plays well, im going with 800x600 not the best hardware here.

my .jpg doesnt give justice lol.

You might be able to use a different shader on your hardware, xBR is good looking but pretty slow... try "shader=Shaders\cubic.glsl" maybe.




I attached some pictures in case someone is interested how xBR looks like.

Picture 1 shows how the game looks like if you play in a window without scaling.
Picture 2 shows how the game looks like if you play fullscreen without cnc-ddraw xBR (Typical blurry graphics card scaling)
Picture 3 shows how the game looks like with cnc-ddraw + xBR
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 26, 2019, 08:45:41 PM
Just tried FunkyFr3sh/Aqrit-DDraw-Hack 0.1.5.2 - looks like the best ddraw!

Agree, test2 (ddraw to DIB) is faster. Also tried aqrit's test4 on weak computer - it's very slow. .

Report from one of our gamers: sometimes (not possible to repeat) mouse becomes blocked. Most likely when exiting from the game to bnet chat. Most likely in window mode. Possibly after alt-tab. Not sure. Not after every game.

Questions from me:
Is that possible to make bnet-chat also movable and resizable in window mode?
Is that possible to repair printscreen (instead of alt-printscreen) in bnet-chat mode?
1 more bug from me: after i exit the game, top banner apperared with broken palette. That happened in full-screen. Alt-enter didn't help. Chat have been ok.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 26, 2019, 08:59:38 PM
I was just playing around with cnc-ddraw and I think I got it finally working on bnet for online games...

If someone wants to give it a try, extract cnc-ddraw.zip into your game folder. (It's attached below)


This one is preconfigured for scaling with xBR shader, it might show you the most beautiful warcraft 2 you have ever seen :)

This config runs at double resolution (or more), which is 1280x960. Will work fine if your monitor supports high resolutions such as 1920x1080 or above, otherwise you can't really use it with this config. Scaling via xBR requires somewhat good hardware with OpenGL 3.0 support.
Is it designed to x2-x3-xN resolution only? I use 1600x1200 and i tried it, it shows a picture looks like 640x480*2 with a black border around.

At the same time, everything looks perfect, except very small bnet-chat in top-left corner of the screen.
Also, as i understand, this version doesn't support windows mode, fullscreen only, is it?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 27, 2019, 08:08:26 AM

Report from one of our gamers: sometimes (not possible to repeat) mouse becomes blocked. Most likely when exiting from the game to bnet chat. Most likely in window mode. Possibly after alt-tab. Not sure. Not after every game.

Blocked as in the mouse can't leave the window? In the menus i wanted the mouse to be free and in game we need it locked so you can scroll around, that's why I made it so a right-click will lock the mouse into the window.

Maybe he did a right-click in the menus and it locked it? Ctrl+Tab can unlock the cursor btw



Questions from me:
Is that possible to make bnet-chat also movable and resizable in window mode?
Is that possible to repair printscreen (instead of alt-printscreen) in bnet-chat mode?
1 more bug from me: after i exit the game, top banner apperared with broken palette. That happened in full-screen. Alt-enter didn't help. Chat have been ok.

Movable bnet might be possible, but someone has to do some research and find out how exactly the bnet window works. I tried to move it before and it just crashed the game, don't really know yet why it didn't work.

Resizable bnet is too difficult cause it creates multiple windows and layers them on top of each other and it creates buttons and other stuff that would need to be resized one by one too. I don't think anyone will get that done in perfection.

I didn't notice any palette issues yet with the banner, but I will try to pay more attention to it. I know aqrit made one palette entry transparent for his bnet trick, maybe the banner was using it and that's why it looked weird..



Is it designed to x2-x3-xN resolution only? I use 1600x1200 and i tried it, it shows a picture looks like 640x480*2 with a black border around.

At the same time, everything looks perfect, except very small bnet-chat in top-left corner of the screen.
Also, as i understand, this version doesn't support windows mode, fullscreen only, is it?

The example settings file I included was set up for integer scaling (2x 3x...) because I wanted to show how awesome the xBR shader looks :)
You can remove the xBR shader, just set "shader=" and then "boxing=false", now it will work with any resolution just like the gog ddraw does.

It works in window mode too, you have to set "fullscreen=false" and "windowed=true", but I didn't optimize it for windowed mode yet like I did with test2, that means you will see 2 windows on the screen when you open bnet (It's easy to fix it though)




BTW, I tested test2, my updated test2 and cnc-ddraw on linux with latest combat edition and it worked nice :) The installer would need a little modification to make it perfect though, not sure if you're interested on mac/linux, but I could give you the code for inno setup if you need it.

Here is how it looks https://cdn.discordapp.com/attachments/452933261266518016/558568420405411850/unknown.png
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 27, 2019, 10:27:44 AM
Movable bnet might be possible, but someone has to do some research and find out how exactly the bnet window works. I tried to move it before and it just crashed the game, don't really know yet why it didn't work.

Resizable bnet is too difficult cause it creates multiple windows and layers them on top of each other and it creates buttons and other stuff that would need to be resized one by one too. I don't think anyone will get that done in perfection.
I see, i just thought it could be easy to hook some GDI functions to change their coords "on the fly". If that crashed the game, so, ok, not a big deal...

I didn't notice any palette issues yet with the banner, but I will try to pay more attention to it. I know aqrit made one palette entry transparent for his bnet trick, maybe the banner was using it and that's why it looked weird..
I see, i just got a quick look onto your ddraw yesterday. I plan to use it as the main ddraw for war2, so i'll check everything carefully next times.

The example settings file I included was set up for integer scaling (2x 3x...) because I wanted to show how awesome the xBR shader looks :)
You can remove the xBR shader, just set "shader=" and then "boxing=false", now it will work with any resolution just like the gog ddraw does.

It works in window mode too, you have to set "fullscreen=false" and "windowed=true", but I didn't optimize it for windowed mode yet like I did with test2, that means you will see 2 windows on the screen when you open bnet (It's easy to fix it though)
Wow! That works for me! Thanks! I tried to use different options yesterday, but i didn't know how to do what i want.
Looks like i need some additional understanding how it works and how to handle it.
Nice to have the source code for your ddraws and be able to build them myself with any changes, for debugging purposes for example, if required.

BTW, I tested test2, my updated test2 and cnc-ddraw on linux with latest combat edition and it worked nice :) The installer would need a little modification to make it perfect though, not sure if you're interested on mac/linux, but I could give you the code for inno setup if you need it.

Here is how it looks https://cdn.discordapp.com/attachments/452933261266518016/558568420405411850/unknown.png
Sure! I'm interested to populate combat everywhere: on all windows, on linux, mac - that would be perfect!
I just didn't know i can do any modifications to make it work better under wine. Let me know if you have any ideas how to make it better!

BTW:
It there any simple way to check that ddraws compatibility with current computer before copy ddraw? I mean, to make sure proper version of OpenGL of  w/e other technologies are being supported.
To let installer check ddraw and disable incompatible components while installing?
As i understand, Aqrit-DDraw-Hack (same as test2) is compatible with every hardware, so no checks required (if windows is newer than XP), but CNC should support something else.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 27, 2019, 11:51:54 AM
You don't need to add any checks, cnc-ddraw for example will check if opengl is supported on its own, if not then it will switch to GDI automatically. Updated test2 also doesn't need any checks.

I compiled both with visual studio 2017, that means you need to have at least win xp service pack 3, you can check the MinVersion like this:

Code: [Select]
[Files]
Source: Resources\cnc-ddraw.dll; DestDir: "{app}"; DestName: "ddraw.dll"; Flags: ignoreversion; MinVersion: 5.1sp3



To get it working on wine you will have to add a dll override for ddraw to make sure wine is loading our ddraws and not the wine ddraw:

Code: [Select]
[Registry]
Root: HKCU; Subkey: Software\Wine\AppDefaults\Warcraft II BNE.exe\DllOverrides; ValueType: string; ValueName: "ddraw"; ValueData: "native, builtin"; Check: RunsOnWine


[code]
function GetModuleHandleA(lpLibFileName: PAnsiChar): THandle;
external 'GetModuleHandleA@kernel32.dll stdcall';
function GetProcAddress(Module: THandle; ProcName: PAnsiChar): Longword;
external 'GetProcAddress@kernel32.dll stdcall';

function RunsOnWine: boolean;
begin
  Result := GetProcAddress(GetModuleHandleA('ntdll.dll'), 'wine_get_version')<> 0;
end;
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 27, 2019, 06:11:41 PM
Thanks a lot for wine code! Added it and rebuilt 3 en and 3 ru versions (still didn't change ddraws to your versions as i need to check them carefully before).

You don't need to add any checks, cnc-ddraw for example will check if opengl is supported on its own, if not then it will switch to GDI automatically. Updated test2 also doesn't need any checks.
Then need to test opengl version with no opengl support...
I compiled both with visual studio 2017, that means you need to have at least win xp service pack 3, you can check the MinVersion like this:
Yes, i see, i also built both with visual studio 2017.

Also, is that work fine under XP? As i remember, aqrit didn't recommend to use his ddraws for xp, as war2 works fine under XP without any ddraws.
So, did you try XP with your ddraws?
I use MinVersion: 6.0;
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 27, 2019, 07:58:36 PM
The example settings file I included was set up for integer scaling (2x 3x...) because I wanted to show how awesome the xBR shader looks :)
You can remove the xBR shader, just set "shader=" and then "boxing=false", now it will work with any resolution just like the gog ddraw does.

It works in window mode too, you have to set "fullscreen=false" and "windowed=true", but I didn't optimize it for windowed mode yet like I did with test2, that means you will see 2 windows on the screen when you open bnet (It's easy to fix it though)
Is there an additional description for all the possible parameters?
It's quite difficult to understand things even for me, after reading the source code, so i think it will be much more difficult for ordinary players.
1. What is maintas and boxing? Which one is required/better and when or no one? As i see from source, they exclude each other.
2. What maxfps would be the best for war2?
3. Which set of mouse options are optimal for war2?
4. How to understand which renderer is used as auto? Are there any logs anywhere?
When i use auto, looks like d3d or w/e applied, as when i select opengl, that looks different.
5. If renderer is selected as opengl, but opengl is not supported - will gdi be used? Or some unknown error appears?
6. I want to start war2 in fullscreen mode with resolution similar to my default screen resolution. And alt-enter to window mode as something small, like 640x480 or configurable. Is that possbile or need to be updated?
7. GoG contains parameters: anisotropic, antialiasing, gamma. Do they have any analogs here?

Maybe need to fix:
8. When i use width=0 height=0 it works as my default resolution with renderer auto, but not works the same with opengl. For opengl i have to write width=1600 height=1200
9. ddraw.ini contains bnetHack option, but no that option in the source code. Is it different build there is binary code?

Also a wish:
10. to add graphics utility to configure options, similar to GoG's one. Not sure we really need that, but maybe something already exists?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 27, 2019, 08:14:54 PM
Blocked as in the mouse can't leave the window? In the menus i wanted the mouse to be free and in game we need it locked so you can scroll around, that's why I made it so a right-click will lock the mouse into the window.

Maybe he did a right-click in the menus and it locked it? Ctrl+Tab can unlock the cursor btw
Sorry, wrong info:
mouse have not been blocked, but looks like pointer appears behind the screen, became invisible (working though). Usually can be fixed by creating/joining the game and then returning back. But sometimes - that doesn't help.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 28, 2019, 07:00:35 AM
Thanks a lot for wine code! Added it and rebuilt 3 en and 3 ru versions (still didn't change ddraws to your versions as i need to check them carefully before).

Nice! Is it on the website already? Will do a test run to make sure it works..


Also, is that work fine under XP? As i remember, aqrit didn't recommend to use his ddraws for xp, as war2 works fine under XP without any ddraws.
So, did you try XP with your ddraws?
I use MinVersion: 6.0;

You don't actually need it on XP for compatibility reasons, but now they're useful because we have windowed mode and stretching. I Always test everything on XP and 10, so yeah, it works fine :)


Is there an additional description for all the possible parameters?
It's quite difficult to understand things even for me, after reading the source code, so i think it will be much more difficult for ordinary players.

...
10. to add graphics utility to configure options, similar to GoG's one. Not sure we really need that, but maybe something already exists?

No, only what is written inside of ddraw.ini. Normally you don't have to change any settings, unless you're wanting to change something specific like the mouse speed or scaling.
A config program would be very useful. If you want to have all features of both ddraws available in war2 combat then we'll have to make a config program! If you only want to include the updated test2, then I don't think we need a config program.

There are some config programs already available that can change the cnc-ddraw settings, but they're for other games and have game specific settings so we can't use them directly (We could modify them, but they need the .NET framework 2.0).


1. What is maintas and boxing? Which one is required/better and when or no one? As i see from source, they exclude each other.

That's all personal preference, none is better. But most people will want maintas=true.


2. What maxfps would be the best for war2?

war2 needs at least 60 FPS, but it's no problem to set it higher. I usually set it to the double of what the game needs to get less input lag.


3. Which set of mouse options are optimal for war2?

If your mouse is too fast (That can happen because the game runs on 640x480), then set fullscreen=true and adjmouse=true to slow your mouse down (It will then have the same speed as in windows).


4. How to understand which renderer is used as auto? Are there any logs anywhere?
When i use auto, looks like d3d or w/e applied, as when i select opengl, that looks different.

If you set it to auto then it will try to use Direct3D, if that fails then it will try OpenGL and if that fails too then it will use GDI. It will show you a message when it's switching the renderer, you will know about it.
On linux it will use OpenGL and if that fails GDI (Direct3D is windows only).

For war2 we only need GDI, cause it's the fastest on low resolutions. OpenGL is only useful if you enable stretching cause it can apply shaders for better image quality. There are also shaders that can apply other effects without stretching (e.g. make the image brighter).


5. If renderer is selected as opengl, but opengl is not supported - will gdi be used? Or some unknown error appears?

It will automatically switch to GDI then, no need to change any settings. No error message :) I coded everything in a way that your game will always start and work fine, it will detect if something doesn't work and use different settings automatically.


6. I want to start war2 in fullscreen mode with resolution similar to my default screen resolution. And alt-enter to window mode as something small, like 640x480 or configurable. Is that possbile or need to be updated?

That is currently not possible, it will switch to windowed mode but the window will be stretched and big... But it's a good idea, I have to think about a solution for this...


7. GoG contains parameters: anisotropic, antialiasing, gamma. Do they have any analogs here?

You can do all that via shader= too. Each shader has a different effect.

gog's scaling looks blurry like this "shader=Shaders\cubic.glsl"

You can also make it look like an old CRT monitor "shader=Shaders\crt-lottes-fast-no-warp.glsl"

There are 100+ shaders you can download here https://github.com/libretro/glsl-shaders


8. When i use width=0 height=0 it works as my default resolution with renderer auto, but not works the same with opengl. For opengl i have to write width=1600 height=1200

Oh, are you sure you had 'fullscreen=true' set? That should always work with 0,0 on all renderers.


9. ddraw.ini contains bnetHack option, but no that option in the source code. Is it different build there is binary code?

The cnc-ddraw I linked here was a new test build, you have to switch the branch from "master" to "diablo_warcraft2" to see the new code.

Here is a direct link to the code of the new branch https://github.com/CnCNet/cnc-ddraw/archive/diablo_warcraft2.zip


Sorry, wrong info:
mouse have not been blocked, but looks like pointer appears behind the screen, became invisible (working though). Usually can be fixed by creating/joining the game and then returning back. But sometimes - that doesn't help.

I will do some testing. So this was the new test2 or cnc-ddraw? It only happens in windowed mode?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: tk[as] on March 28, 2019, 07:57:38 AM
fois is a beast
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 28, 2019, 08:29:08 AM
Nice! Is it on the website already? Will do a test run to make sure it works..
Sure, i updated it on ftp! Didn't update version of file, war2combat is still 4.3.3 since several more releases...
In versions en/ru lite/full/std.

You don't actually need it on XP for compatibility reasons, but now they're useful because we have windowed mode and stretching. I Always test everything on XP and 10, so yeah, it works fine :)
Yes, the main reason is window mode. Also some palette troubles happened in XP also. Nice to see you test it on XP also!
My main test comp in win7.
BTW, one of our testers still uses XP SP2, no way to update it to SP3 for some reasons. As i understand, need to rebuild ddraws with vstudio 2015 to use it on XP SP2, is that a good idea?

No, only what is written inside of ddraw.ini. Normally you don't have to change any settings, unless you're wanting to change something specific like the mouse speed or scaling.
I see, np, i'll try to understand that myself asking you. Looks like you understand that ddraw-gdi-dib-opengl-d3d things very well! I still continue looking into the source code and not understand what each command means and what effect it causes...

There are some config programs already available that can change the cnc-ddraw settings, but they're for other games and have game specific settings so we can't use them directly (We could modify them, but they need the .NET framework 2.0).
I see, i don't think we need to do something with that right now.
But for future i think that could be useful to make that module configurable.
Are there source codes for that framework 2.0 settings config utilities?
I'm about CNC ddraw most likely, i agree there's almost nothing to configure in arqit's ddraw.

war2 needs at least 60 FPS, but it's no problem to set it higher. I usually set it to the double of what the game needs to get less input lag.
I tried it with 1600x1200x32, used cubic.glsl shader as the most beatiful for me and with default 125 fps, and looks like it lagged on my core i5 processor. Then i decreased fps to 30 or w/e and lags disappeared. So, i think fps can be important.

For war2 we only need GDI, cause it's the fastest on low resolutions. OpenGL is only useful if you enable stretching cause it can apply shaders for better image quality. There are also shaders that can apply other effects without stretching (e.g. make the image brighter).
You mean a war2 resolution or screen one? Because i used opengl to scale war2 to 1600x1200x32. I didn't test cnc-GDI for such resolution. Should i?

That is currently not possible, it will switch to windowed mode but the window will be stretched and big... But it's a good idea, I have to think about a solution for this...
Yes, as i understand, there's only 1 current resolution for both fullscreen and windows mode. So, my idea is to set 1600x1200x32 (similar as default monitor in windows) to enjoy fast alt-tab between war2 and windows without switch videomode. And need another resolution for window mode.

You can do all that via shader= too. Each shader has a different effect.

gog's scaling looks blurry like this "shader=Shaders\cubic.glsl"
I see. I don't think that's important to make it "same as in GOG", just asked. So, i see they also should use some kind on shaders also.

Oh, are you sure you had 'fullscreen=true' set? That should always work with 0,0 on all renderers.
Hm, i've been sure yesterday when i checked. But now looks like everything is fine. resolution is auto: 0x0x0, fullscreen=true, windowed=false, boxing=false, shader=Shaders\cubic.glsl, renderer=opengl, and everything works fine!
So, i'll let you know if something become wrong.

The cnc-ddraw I linked here was a new test build, you have to switch the branch from "master" to "diablo_warcraft2" to see the new code.

Here is a direct link to the code of the new branch https://github.com/CnCNet/cnc-ddraw/archive/diablo_warcraft2.zip
Ah, i ddin't see that, thx!

I will do some testing. So this was the new test2 or cnc-ddraw? It only happens in windowed mode?
It was test2. That is a floating error, so he have no idea when is happened, but most likely in windowed mode. If you have no idea what is can be, then np.
I'll try to test it myself and give it to several more beta-testers. I hope they will quickly find bugs if they exist...

Also, an idea:
maybe would be good to write logs somewhere like ddraw.log or war2_ddraw.log, for debug purposes? Then people can send that reports to you, to let you look and check what happens on their side.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 28, 2019, 09:34:07 AM
fois is a beast

true :)

Gonna make the game working with these ddraws on any pc first and then maybe next we'll have to look into the hosting issues...


Sure, i updated it on ftp! Didn't update version of file, war2combat is still 4.3.3 since several more releases...
In versions en/ru lite/full/std.

Just tested it on Linux Mint 19, works great now!

If anyone is interested, for Mint 19 and the latest ubuntu versions you'll have to type one command:

sudo apt install wine-stable wine32 fonts-wine


That's it, just download the installer now and run it.

I recorded a video of it too: https://drive.google.com/file/d/1_Bt1Q49XGUJ75xLUJvz-ltgS3V32nbxp/view


Yes, the main reason is window mode. Also some palette troubles happened in XP also. Nice to see you test it on XP also!
My main test comp in win7.
BTW, one of our testers still uses XP SP2, no way to update it to SP3 for some reasons. As i understand, need to rebuild ddraws with vstudio 2015 to use it on XP SP2, is that a good idea?

I think 2015 also supports only XP SP3, you probably need a very old version like VS 2008 or 2010. But I also included a makefile for gcc, this one should work even on win 2000, I attach a gcc build to this post if someone wants to try it.


I see, i don't think we need to do something with that right now.
But for future i think that could be useful to make that module configurable.
Are there source codes for that framework 2.0 settings config utilities?
I'm about CNC ddraw most likely, i agree there's almost nothing to configure in arqit's ddraw.

I try to put something together :)


I tried it with 1600x1200x32, used cubic.glsl shader as the most beatiful for me and with default 125 fps, and looks like it lagged on my core i5 processor. Then i decreased fps to 30 or w/e and lags disappeared. So, i think fps can be important.

1600x1200x32 with 125 fps might not work on intel graphics cards, so yeah, lower FPS can help in case you don't have a AMD/Nvidia card.


maybe would be good to write logs somewhere like ddraw.log or war2_ddraw.log, for debug purposes? Then people can send that reports to you, to let you look and check what happens on their side.

Yeah that's possible, I got debug code that you can enable in debug.h. But usually only useful for crashes (It's also very slow...)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 28, 2019, 10:12:59 AM
Gonna make the game working with these ddraws on any pc first and then maybe next we'll have to look into the hosting issues...

Wow! Fixing hosting - network functions hooking? Would be very interesting to look! I just began to look into world of dll, but you are very experienced in that!

Just tested it on Linux Mint 19, works great now!

If anyone is interested, for Mint 19 and the latest ubuntu versions you'll have to type one command:

sudo apt install wine-stable wine32 fonts-wine


That's it, just download the installer now and run it.

I recorded a video of it too: [url]https://drive.google.com/file/d/1_Bt1Q49XGUJ75xLUJvz-ltgS3V32nbxp/view[/url] ([url]https://drive.google.com/file/d/1_Bt1Q49XGUJ75xLUJvz-ltgS3V32nbxp/view[/url])

Wow!
Much easier instruction than previous one: http://en.war2.ru/tutorials/setting-up-linux-ubuntu-to-play-warcraft-ii-bne/ (http://en.war2.ru/tutorials/setting-up-linux-ubuntu-to-play-warcraft-ii-bne/)

I think 2015 also supports only XP SP3, you probably need a very old version like VS 2008 or 2010. But I also included a makefile for gcc, this one should work even on win 2000, I attach a gcc build to this post if someone wants to try it.

Hmm... I read somewhere 2015 supports SP2, but maybe they are wrong. At the same time looks like your current dll works on XP SP2...

I don't want to ask you about some additional work with makefiles or w/e. But is it compatible with gcc? I always have porblems when i try to build something developed for some version of visual studio on different version, or especially on another compiler. So, i have all visual studios since 6.0 installed on my computer and select version for each project.

I try to put something together :)

Sure! That would be great, for some future releases. Task 1 is to check every version on every computer, to get feedback everything is fine everywhere, then we can use that for combat.
1600x1200x32 with 125 fps might not work on intel graphics cards, so yeah, lower FPS can help in case you don't have a AMD/Nvidia card.

Interesting! I've been sure it's related to CPU performance, not a chipset. But yes, you right, my chipset: Intel(R) HD Graphics 4600
Yeah that's possible, I got debug code that you can enable in debug.h. But usually only useful for crashes (It's also very slow...)

Well, i don't think we need to enable some kind of very slow debug log. Let's check if somebody will have problems, then decide what to do with that!

Oh, 1 more thing to look:
warvideo.
Warvideo with aqrit ddraws saves video with blinking. Looks like something with switching surfaces in ddraw, broken sync between them or w/e.
So, can you please look if there is a simple way to fix it?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 28, 2019, 11:50:02 AM
Wow! Fixing hosting - network functions hooking? Would be very interesting to look! I just began to look into world of dll, but you are very experienced in that!

Yeah, I have done some testing already using a wsock32 proxy dll, it should work fine. I have a plan for it, but didn't start working on it yet, just wanted to know if my wsock32 idea could in theory work :)


Hmm... I read somewhere 2015 supports SP2, but maybe they are wrong. At the same time looks like your current dll works on XP SP2...

I don't want to ask you about some additional work with makefiles or w/e. But is it compatible with gcc? I always have porblems when i try to build something developed for some version of visual studio on different version, or especially on another compiler. So, i have all visual studios since 6.0 installed on my computer and select version for each project.

Well, if it works on SP2 then it's all good I guess! I never actually tried if it works on SP2 myself, was only reading the microsoft documentation about it

makefile is already included btw, should work fine.


Oh, 1 more thing to look:
warvideo.
Warvideo with aqrit ddraws saves video with blinking. Looks like something with switching surfaces in ddraw, broken sync between them or w/e.
So, can you please look if there is a simple way to fix it?

I never used this yet, is the source code for it available? Might be interesting to put a recorder into the ddraw, using x264 codec... I have to think about that :D
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 28, 2019, 12:36:10 PM
Yeah, I have done some testing already using a wsock32 proxy dll, it should work fine. I have a plan for it, but didn't start working on it yet, just wanted to know if my wsock32 idea could in theory work :)
That looks like one of the most important project for our game! Right after ddraw!

I thought to try to do something like lat trick (udp ping to other players to let them connect the game). So, if you need that player ip list to send UDP pings, let me know to give them to you (as a php-page from the server i think).

Well, if it works on SP2 then it's all good I guess! I never actually tried if it works on SP2 myself, was only reading the microsoft documentation about it

makefile is already included btw, should work fine.
That's great! If we get a feedback for winXP with SP1/2 or with no SP, we can always try to rebuild it.
As i understand, build it with gcc and makefile should not cause any problems with work somewhere? Like windows 10 or anywhere else?
Of course, i think if some code will on more systems (like oldest winxp or win2000) and works the same on others, it's always better!

I never used this yet, is the source code for it available? Might be interesting to put a recorder into the ddraw, using x264 codec... I have to think about that :D
Not sure x264 will be better than it works now, it uses it's own codec, but warvideo can still be a very interesting thing. Check PM...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 29, 2019, 12:42:15 PM
That looks like one of the most important project for our game! Right after ddraw!

I thought to try to do something like lat trick (udp ping to other players to let them connect the game). So, if you need that player ip list to send UDP pings, let me know to give them to you (as a php-page from the server i think).

Oh, I think I can do it without any ip list, thanks. Don't think there is any need to do any kind of changes on the server


That's great! If we get a feedback for winXP with SP1/2 or with no SP, we can always try to rebuild it.
As i understand, build it with gcc and makefile should not cause any problems with work somewhere? Like windows 10 or anywhere else?
Of course, i think if some code will on more systems (like oldest winxp or win2000) and works the same on others, it's always better!

Yeah please let me know if you find someone who tested it on SP1/SP2, I never tried it myself and it's kinda interesting to know.

I used to build cnc-ddraw with gcc all the time, I think I switched to visual studio on version 1.3.0.0 of cnc-ddraw (The performance is better with the VS build).
So yeah, it works fine on any version of windows including 10, it's just a bit slower
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 29, 2019, 01:45:55 PM
Oh, I think I can do it without any ip list, thanks. Don't think there is any need to do any kind of changes on the server
So, i don't understand how you plan to make such fix. Anyways, will be interesting to look if you release it.

Yeah please let me know if you find someone who tested it on SP1/SP2, I never tried it myself and it's kinda interesting to know.
Yes, one of our active testers use XP SP2, he is quite smart guy and do thing carefully. So it some bugs can happen on his computer, he will report that.

I used to build cnc-ddraw with gcc all the time, I think I switched to visual studio on version 1.3.0.0 of cnc-ddraw (The performance is better with the VS build).
So yeah, it works fine on any version of windows including 10, it's just a bit slower
Is that an archive winxp-cnc-ddraw.zip you attached 2 messages ago? Looks like that works worse than original: "blackscreen instead of bne in fullscreen, blue line in windowed mode".
Why the performance differences? VS compiler makes better optimizations? I think performance is more important than old XP releases then.

Another question about 0.1.5.2 release from github:

New (Optional) settings file "war2_ddraw.ini"
Code: [Select]
[ddraw]
Windowed=No
MaintainAspectRatio=Yes
AlwaysOnTop=Yes
ShowWindowFrame=Yes
Width=640
Height=480
PosX=-32000
PosY=-32000
And autogenerated file is:
Code: [Select]
[ddraw]
PosX=##saved  from last resize/move
PosY=##saved  from last resize/move
Windowed=No
ShowWindowFrame=Yes
Width=##saved  from last resize/move
Height=##saved  from last resize/move
So, my question is: which ini-file is better?
Should i include war2_ddraw.ini with ddraw.dll when installing war2combat with ddraw or just use ddraw.dll itself, with autogerenated ini?
Another words: what does options "MaintainAspectRatio=Yes" and "AlwaysOnTop=Yes" do? I tried both and didn't find any differences.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 29, 2019, 03:52:39 PM
Is that an archive winxp-cnc-ddraw.zip you attached 2 messages ago? Looks like that works worse than original: "blackscreen instead of bne in fullscreen, blue line in windowed mode".
Why the performance differences? VS compiler makes better optimizations? I think performance is more important than old XP releases then.

Oh, I didn't actually test the gcc build for some time, maybe it's broken.. Will check it later

Not sure exactly why it's faster, I know the memcpy is pretty good in VS and that one is used a lot :)


Another question about 0.1.5.2 release from github:

New (Optional) settings file "war2_ddraw.ini"

So, my question is: which ini-file is better?
Should i include war2_ddraw.ini with ddraw.dll when installing war2combat with ddraw or just use ddraw.dll itself, with autogerenated ini?
Another words: what does options "MaintainAspectRatio=Yes" and "AlwaysOnTop=Yes" do? I tried both and didn't find any differences.

I just fixed that, it will generate the exact same file now https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases

For MaintainAspectRatio, try to run the game in a window and resize it, you will see what happens! AlwaysOnTop can be tested in windowed mode too, try to place another window on top of the game window when it's enabled
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 29, 2019, 05:13:45 PM
I just fixed that, it will generate the exact same file now https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases

For MaintainAspectRatio, try to run the game in a window and resize it, you will see what happens! AlwaysOnTop can be tested in windowed mode too, try to place another window on top of the game window when it's enabled
oh, i see, you are quick!
For MaintainAspectRatio, try to run the game in a window and resize it, you will see what happens! AlwaysOnTop can be tested in windowed mode too, try to place another window on top of the game window when it's enabled
i see, so, your newly configured default options will be the best!

Also, trying this version for several days: everything looks perfect for me!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on March 30, 2019, 06:23:47 PM
Bug detected: aqrit version.
not sure how that worked in test2, but here's it:

start war2, join bnet part, press printscreen. Save file dialog appears.
Then alt-tab to windows, return back to war2, and that dialog hides under the screen or w/e.
After that chat works as before, but when you try to create/join game, it shows background screen only, with no game.
Only alt-f4 helps to exit the whole war2 application.

Tried without ddraw: after alt-tab save dialog still here.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Incos on March 31, 2019, 11:58:47 AM
is there a working ddraw for windows mode ? so i can stream.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on April 01, 2019, 06:45:11 AM
is there a working ddraw for windows mode ? so i can stream.
Both of them do. Aqrit and CnC.
Just use alt+enter
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: {Lance} on April 01, 2019, 12:41:59 PM
It depends on your setup that you use for streaming.  If you use a single monitor and full screen,  you can use OBS with the "UScreenCapture" plugin that was designed for SC1 and Diablo.  If you want to stream in Windowed mode,  you can use either of these 2 DDraw files and then use Alt+Enter to enter windowed moded.  I find that UScreenCapture is the BEST method for streaming because it doesnt suffer from any performance loss that you will experience when you run in windowed mode (screen stutter,  inaccurate mouse scrolling,  etc).  None of which you would notice if you're just playing casually such as playing through the scenarios.  But if you're trying to play online vs real people,  you definately need to be using UScreenCapture and full screen on a windows 7 machine.

@iL   Speaking of which,  we really need to get UScreenCapture on the downloads page before it disappears for good.  It's hard to find as it is already.  Download it here:  https://www.videohelp.com/download/UScreenCapture2015.zip?r=hswlrskmwcK (https://www.videohelp.com/download/UScreenCapture2015.zip?r=hswlrskmwcK)   and modify the link here:  http://en.war2.ru/tutorials/how-to-live-stream-warcraft-2/ (http://en.war2.ru/tutorials/how-to-live-stream-warcraft-2/) to point to the server.war2.en location.  The mouse plugin is already on our server,  but uscreencapture is not.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on April 01, 2019, 01:25:21 PM
Download it here:  [url]https://www.videohelp.com/download/UScreenCapture2015.zip?r=hswlrskmwcK[/url] ([url]https://www.videohelp.com/download/UScreenCapture2015.zip?r=hswlrskmwcK[/url])   and modify the link here:  [url]http://en.war2.ru/tutorials/how-to-live-stream-warcraft-2/[/url] ([url]http://en.war2.ru/tutorials/how-to-live-stream-warcraft-2/[/url]) to point to the server.war2.en location.  The mouse plugin is already on our server,  but uscreencapture is not.

Uploaded to utils on ftp.
I'll begin to make fixes on the site a little later...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Incos on April 01, 2019, 02:37:22 PM
I use two monitors- one for twitch one for gaming. Thanks Il
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on April 04, 2019, 01:01:33 PM
Bug detected: aqrit version.
not sure how that worked in test2, but here's it:

start war2, join bnet part, press printscreen. Save file dialog appears.
Then alt-tab to windows, return back to war2, and that dialog hides under the screen or w/e.
After that chat works as before, but when you try to create/join game, it shows background screen only, with no game.
Only alt-f4 helps to exit the whole war2 application.

Tried without ddraw: after alt-tab save dialog still here.

I'll have a look into it, but I fear, it won't be easy to fix... Maybe we could just prevent that dialog from showing up? Do you really need to have it?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on April 04, 2019, 01:03:32 PM
New release is out!

There was a bug where the cursor could leave the screen on multi monitor setups in Fullscreen and WindowedFullscreen modes.


https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: woofy on April 06, 2019, 07:57:11 PM
hmm not working on war2combat44 standard install. still leaves screen on multiscreen setups
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on April 06, 2019, 08:04:58 PM
hmm not working on war2combat44 standard install. still leaves screen on multiscreen setups

It should be able to leave the screen on bnet (that's intentional), but once in game the cursor should be locked.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: woofy on April 06, 2019, 08:44:38 PM
oh, in that case, that's awesome!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: iL on May 30, 2019, 03:30:49 PM
Hi, @fois
We made some tests with aqrits' ddraw versions and scaling:

1-st image is war2 windowed mode with your version 154 (based on test2), scaled to 800x600:
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=3024)
2-nd image is war2 windowed mode with aqrit's test4 version scaled to 800x600 (by 3-rd part software as it doesn't support scaling itself).
Interesting thing is it uses such smooth scaling on intel videocards only, but not so smooth on nvidias.
(http://forum.war2.ru/index.php?action=dlattach;topic=1790.0;attach=3026)

And we can see: test4 support smooth scaling, but your version have some distortions.
So:
is that possible to make your 154 version as beautiful as test4, keeping it based on test2?

Would be great to use such smooth scaling on your ddraw, also being kept compatible with all computers, even with no shader support
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on May 30, 2019, 10:43:53 PM
Yeah it's possible to have cubic/bilinear scaling without hardware acceleration, but it's very slow and might cause online games to lag if someone with a slow computer is trying to use it.

I think it's better to use cnc-ddraw instead for scaling, it can do smooth scaling and if no hardware acceleration is available it will automatically switch to nearest neighbor scaling.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on May 31, 2019, 06:43:01 AM
cnc has a bug for me when i alt tab and alt tab back to the game..it loses a catch function and u cant type with keyboard.

just a good stable ru release as its what i give to all the gog users when they pop up,blizzard and other game companies are pushing that place to grow to compete with steam.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on June 29, 2019, 12:30:49 PM
cnc has a bug for me when i alt tab and alt tab back to the game..it loses a catch function and u cant type with keyboard.

just a good stable ru release as its what i give to all the gog users when they pop up,blizzard and other game companies are pushing that place to grow to compete with steam.

oh, I do some testing...

Already noticed that you can't alt+tab when the bnet chat window is showing (unless you have stretching enabled, then it works).
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on August 02, 2019, 07:55:51 PM
New release for windowed mode users -> Battle.net lobby is not locked to the top left anymore and can now be moved around the screen

https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases (https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases)



Config program was updated too http://forum.war2.ru/index.php/topic,5015.0.html (http://forum.war2.ru/index.php/topic,5015.0.html)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on August 03, 2019, 09:29:03 PM
New release for windowed mode users -> Battle.net lobby is not locked to the top left anymore and can now be moved around the screen

[url]https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases[/url] ([url]https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases[/url])



Config program was updated too [url]http://forum.war2.ru/index.php/topic,5015.0.html[/url] ([url]http://forum.war2.ru/index.php/topic,5015.0.html[/url])



Fixed some bugs that were reported, please re-download!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Lambchops on August 04, 2019, 07:57:09 AM
Fixed some bugs that were reported, please re-download!

Well done for keeping up with support :thumbsup:

This ddraw is the only reason a large amount of the community can play WC2 on their OS. Your hard work is appreciated.

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on September 07, 2019, 05:31:47 AM
@Available Let's continue to talk here so we don't spam the war2combat release thread.

"AntiAliasedFonts=Yes", you can enable it if you prefer the look of it.

Oh, lol, quick response :)
I personally prefer real fonts w/o additional processing, but some people (Vity, Ragner, etc...) will happy to use this option.



No need to have multiple ddraws just for that

Still need some option to restrict switching to fullscreen and back,
to block accidental mode switching when someone prefer to play all the time windowed OR all the time fullscreen.
something like:
"AllowModeSwitching=Yes/No" or "IgnoreAltEnter=Yes/No"




...
1.6.3 same bug as previous test:
when finally switches to desktop (by "windows" key or some another hotkey)
and clicked on _another program icon_ in taskbar, somehow that switching back to war2, not to clicked program.
but i clearly NOT clicked on "war2 button" in taskbar.


Why need to use test4 behavior for Alt-Tab?
1.6.2 version was better in this part.




I added "IgnoreAltEnter=Yes" as a new .ini setting.

I want to keep the cnc-ddraw/test4 Alt-Tab behavior since it doesn't rely on the original system ddraw and is more future proof. Win7 did the same for me, when I Alt+Tab out of the game to another window and then I close the other window Win7 will automatically switch back to the game even though I didn't click on the game. I added a workaround for it now.

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: jaiaeiararhe on November 14, 2019, 07:29:03 AM
@fois

4 bugs with your ddraw OpenGL mode

1) In window mode just alt+tab stays in same window, have to press alt+tab+tab to successfully switch to next window

2) In window mode bnet chat, window lags when moving it around

3) The most annoying one, can hurt gameplay: Sometimes, depending on how you click on the window (maybe depends if mouse locked or not, have to click on it after focusing), alt key stays locked and pressing "Enter" to chat switches between window or fullscreen mode. So you can be playing in fullscreen, building tower, press enter to chat and suddenly it changes to window mode and wastes a few seconds where you can't play.

3.a) Does this mean mouse should just be auto locked and alt key assumed to be off by default instead of caught like that? Why the need to click twice?

4) Sometimes program breaks while in bnet chat screen after trying to join or host a game, the bnet buttons become non-functional and you have to restart War2

And would it be possible to change options so sound plays while the window doesn't have focus?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on November 15, 2019, 02:08:22 AM

3) The most annoying one, can hurt gameplay: Sometimes, depending on how you click on the window (maybe depends if mouse locked or not, have to click on it after focusing), alt key stays locked and pressing "Enter" to chat switches between window or fullscreen mode. So you can be playing in fullscreen, building tower, press enter to chat and suddenly it changes to window mode and wastes a few seconds where you can't play.

3.a) Does this mean mouse should just be auto locked and alt key assumed to be off by default instead of caught like that? Why the need to click twice?


Can't reproduce that Alt+Enter bug, but I added a few more checks, maybe it works.
War2 Config: http://forum.war2.ru/index.php/topic,5015.0.html (http://forum.war2.ru/index.php/topic,5015.0.html)
Or just cnc-ddraw: https://github.com/CnCNet/cnc-ddraw/archive/master.zip (https://github.com/CnCNet/cnc-ddraw/archive/master.zip)

The first click is supposed to be ignored (it will lock the cursor into the window), is that what you mean? Not sure if it's a good idea to change that, have to think about it a bit.


And would it be possible to change options so sound plays while the window doesn't have focus?


I'm not sure if this can be changed via a ddraw. The ddraw is already lying to the game and pretends that the focus was never lost so the game keeps drawing. Somehow the sound stops anyways, not sure how that part works.



About all the other problems you reported, I can't reproduce any of them. What OS are you using?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: jaiaeiararhe on November 15, 2019, 05:47:56 AM
About all the other problems you reported, I can't reproduce any of them. What OS are you using?

Windows 7 with Aero disabled
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: shesycompany on November 17, 2019, 04:57:20 PM
oh i apologize  :o  noone gave it to you...having to much fun but dump that in your war2 folder.

the files go where the war2.exe is the main folder...it should give you alt enter... to minimize the screen also.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Available on December 13, 2019, 11:31:19 AM
Or report the problems so they can be fixed

Two issues:

Is there a way to ignore "Doubleclicking" on window header, so let window keep its normal size? Especially because no way to return in previous size. :/

Being in game Main menu and clicking "close" on window button resulting absolutely "lost/hang" mouse, hotkeys still working. Current solution: alt+enter then back to previous.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 13, 2019, 12:54:27 PM
Is there a way to ignore "Doubleclicking" on window header, so let window keep its normal size? Especially because no way to return in previous size. :/

Yeah I will disable it in the next version


Being in game Main menu and clicking "close" on window button resulting absolutely "lost/hang" mouse, hotkeys still working. Current solution: alt+enter then back to previous.

Doesn't happen for me (tested on win 10 and XP)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 16, 2019, 12:25:51 PM
@Available

New version is out with double click on title bar disabled.

I also tried to fix that other bug you reported some time ago where alt+tab didn't work on win7 if there was no other window on the screen, can you confirm that it works now for you?

https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Available on December 17, 2019, 02:43:46 PM
New version is out with double click on title bar disabled.
Good news.

Tested last 1.6.4
Behaves slightly better than version 1.6.3. in common.
i didn't notice anything wrong with it, except same drawing bug in "resources" field after game type changing.

here is one common remark for both new 164 and old 163

in regular windows mode:
need to press alt+tab twice to set focus on desktop

when using DISABLEDWM compatibility parameter:
all ok, once to switch to desktop from fullscreen back and forth


But there is also bad news.
Some "laggy graphics" and black-screen issues reported by some players for 163 and almost same with 164.
Don't know about "black screen", but sad thing that last version not having "laggy graphics" problem is 1.6.2.  :(


Also, when testing there is a problem how to distinguish fast several different versions 0.1.6.3 for example,
maybe let resulting dll file size grow with every change by at least NN bytes? :)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 17, 2019, 03:57:14 PM
i didn't notice anything wrong with it, except same drawing bug in "resources" field after game type changing.

Got that fixed, attached new file below


here is one common remark for both new 164 and old 163

in regular windows mode:
need to press alt+tab twice to set focus on desktop

when using DISABLEDWM compatibility parameter:
all ok, once to switch to desktop from fullscreen back and forth

On what version on windows does that happen?


But there is also bad news.
Some "laggy graphics" and black-screen issues reported by some players for 163 and almost same with 164.
Don't know about "black screen", but sad thing that last version not having "laggy graphics" problem is 1.6.2.  :(


Also, when testing there is a problem how to distinguish fast several different versions 0.1.6.3 for example,
maybe let resulting dll file size grow with every change by at least NN bytes? :)


When does the blackscreen happen? Right when you start the game or while playing?

What do you mean with laggy graphics? Can you give me some more details about this so I can test it?


Yeah, I will now always change the version number when i publish a new test build somewhere so it's easier to know what changes the file got
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 17, 2019, 06:08:27 PM
Here is another version with DISABLEDWM built in, does this also fix the "laggy graphics"? With "laggy graphics" you meant a delayed mouse cursor?


On windows 10 there is no difference, the cursor is always laggy with all versions because you can't disable DWM. That's why we need the OpenGL and Direct3d renderer for win10 to have a fast cursor, GDI can't do it on 10

On XP the cursor is always fast cause XP got no DWM
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 17, 2019, 07:37:23 PM
And here another test version (0.1.6.7) that restores the behavior from 0.1.6.2.

Do you notice any difference between 0.1.6.6 and 0.1.6.7 related to laggy graphics?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Available on December 17, 2019, 09:40:13 PM
On what version on windows does that happen?
w7-64, but this is not a big problem.

When does the blackscreen happen? Right when you start the game or while playing
Yes, sometimes at game start, screen keeps black (win10)
On some computers when pressed join/create, black screen appears for several seconds, then continues in the normal mode (win7)
it's all about 1.6.3 version.
users with it was returned to 1.6.2

any difference between 0.1.6.6 and 0.1.6.7 related to laggy graphics?
Ok, we will test it

Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 26, 2019, 07:46:22 AM
How to configure it to 1024x768 in full screen mode?

How to edit the source code for ddraw.dll? Use Visual Studio?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 27, 2019, 10:45:07 PM
@Available Any news? Does 0.1.6.7 work? Might have to release a new combat 4.6.1 soon with the fixed version...


@Muz Why would you want to do that? The game would still run at 640x480, the ddraw can only upscale it to 1024x768
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 28, 2019, 02:18:32 AM
@Available Any news? Does 0.1.6.7 work? Might have to release a new combat 4.6.1 soon with the fixed version...


@Muz Why would you want to do that? The game would still run at 640x480, the ddraw can only upscale it to 1024x768
So that I can emulate like the old CRT monitor from the current modern monitors. The texture looks a bit unsmooth when increase from the original 640 with modern monitors. Why do CRT shows smooth display even though with larger resolutions?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 28, 2019, 02:26:32 AM
Oh ic.. You can use Warcraft II Config.exe in your game folder to configure upscaling + how it looks like. If you don't have Warcraft II Config.exe then either install the new combat or get the config from here: http://forum.war2.ru/index.php/topic,5015.0.html (http://forum.war2.ru/index.php/topic,5015.0.html)

Use the following settings:

Renderer       = OpenGL
DisplayMode = Stretched
Filter              = Try all of them until you found one you like

crt-lottes-fast will emulate a old CRT monitor, but you can also try the other ones
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 28, 2019, 02:39:06 AM
Which of those configs should I put it in? ddraw.ini or war2_ddraw.ini? Did you make the config using Visual Studio? Which ddraw file should I use?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Available on December 28, 2019, 12:16:30 PM
Does 0.1.6.7 work? Might have to release a new combat 4.6.1 soon with the fixed version..
Yes, 1.6.7 works good with win7.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 28, 2019, 05:36:34 PM
Notice the two screenshots, the original is 640 and the other is stretch larger than 640, which is close to 1024. Why the larger screenshot, looks a bit pixelated and unsmooth?

(https://i.postimg.cc/1nrFh32p/warcraft-2.jpg) (https://postimg.cc/1nrFh32p)
(https://i.postimg.cc/kD78NWRw/warcraft-2-2.jpg) (https://postimg.cc/kD78NWRw)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 28, 2019, 07:12:45 PM
Does 0.1.6.7 work? Might have to release a new combat 4.6.1 soon with the fixed version..
Yes, 1.6.7 works good with win7.

cool

Which of those configs should I put it in? ddraw.ini or war2_ddraw.ini? Did you make the config using Visual Studio? Which ddraw file should I use?

Don't think I said anything about any ini files or ddraw files in my reply (nor is anything written about it in the link i posted!)

Notice the two screenshots, the original is 640 and the other is stretch larger than 640, which is close to 1024. Why the larger screenshot, looks a bit pixelated and unsmooth?

(https://i.postimg.cc/1nrFh32p/warcraft-2.jpg) (https://postimg.cc/1nrFh32p)
(https://i.postimg.cc/kD78NWRw/warcraft-2-2.jpg) (https://postimg.cc/kD78NWRw)

That's exactly what I explained you in my reply
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 28, 2019, 11:21:11 PM
Ok, I have tried the shader. It looks bit like CRT. But I like to it to have 1024 x 768 pixel like the CRT monitor size in full screen mode. I can have it 1024 in Window mode though.

When I try to take screenshot of it in full screen, and I paste it into image editor, it shows black screen, so I cannot show the full screen screenshot here.

It does show 1024 when I first start the game, but when I switch between Window and full screen mode, it switches back to 640, in full screen. The only way to get 1024 in full screen is when first starting the game.

(https://i.postimg.cc/Pp0xPL9G/warcraft2-3.jpg) (https://postimg.cc/Pp0xPL9G)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 28, 2019, 11:55:33 PM
Yeah Alt+Enter doesn't remember upscaling with custom width/height at the moment
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 29, 2019, 12:21:14 AM
Yes. it reverts to the normal 640 after returning from Battle.net.

(https://i.postimg.cc/dh8w9Hfx/battle-net.jpg) (https://postimg.cc/dh8w9Hfx)
(https://i.postimg.cc/QFLj1Gf7/battle-net-2.jpg) (https://postimg.cc/QFLj1Gf7)
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 29, 2019, 12:23:45 AM
Oh right, battle.net is also using the Alt+Enter code... Anyways, I attached a fixed version for your special usecase
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 29, 2019, 12:37:56 AM
Ok, now it shows 1024 in full screen, also whenever I return from Battle.net. How to edit the source code of ddraw.dll? Is there any particular software to view it?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on December 29, 2019, 12:42:18 AM
Cool!

You can use visual studio community edition which is free https://visualstudio.microsoft.com/vs/community/

cnc-ddraw source: https://github.com/CnCNet/cnc-ddraw/archive/master.zip
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on December 29, 2019, 12:49:41 AM
Do you prefer desktop or laptop for this kind of editing stuff?

I was wondering if there is CRT theme for whole Windows 10 itself. I mean Windows 10 displayed in CRT...

Is there any way to use the CRT shaders in DOSBox?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 01, 2020, 08:28:37 PM
Just made a experimental version that fixes the laggy cursor (input lag) on windows 8 / 10


Note: OBS doesn't support this version
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: fois on March 04, 2020, 02:55:06 AM
Here another experimental version of the other ddraw (cnc-ddraw) that also fixes the laggy cursor on win 8/10.

This version also adds support for the OBS "Game Capture" capture source so livestreaming without having to play with a disadvantage is now possible as well!
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on November 14, 2020, 10:37:18 PM
What is the best CRT shader currently?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on November 15, 2020, 03:40:45 AM
I have a question, how to set 640x480 in Windowed mode, and 1024x768 in Full Screen mode?
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Available on November 15, 2020, 05:04:48 AM
I have a question, how to set 640x480 in Windowed mode, and 1024x768 in Full Screen mode?

Windowed mode is already 640,
but if you fked it up, drag window border resize window to minimal possible = 640.

About 1024 (why?)
Use opengl-> fullscreen, then manually edit ddraw.ini file:
width=1024
height=768
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on November 15, 2020, 05:48:00 AM
I have a question, how to set 640x480 in Windowed mode, and 1024x768 in Full Screen mode?

Windowed mode is already 640,
but if you fked it up, drag window border resize window to minimal possible = 640.

About 1024 (why?)
Use opengl-> fullscreen, then manually edit ddraw.ini file:
width=1024
height=768


To emulate CRTs...
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Available on November 15, 2020, 11:26:22 AM
To emulate CRTs...
No need to do ugly scaling then. Even worst CRT was much better quality that scaled to 1024.
Just use fullscreen 640, let the display hardware work on scaling. then some filter to make it look like a CRT.

If for some reason you still want to scale before filters applying, use 1280x960 (doubled original) for best image quality.
Title: Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
Post by: Muz on November 15, 2020, 12:22:33 PM
Are there any way to adjust the glsl shader brightness and contrast?