Author Topic: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed  (Read 260165 times)

Offline crazyman2581

  • Peon
  • **
  • Posts: 6
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #165 on: March 27, 2016, 06:01:24 PM »
download what one I see there is a few to pick from

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #166 on: March 27, 2016, 06:06:46 PM »
1 sec I'll edit this post.

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

Thats the version for win 8 10 minimal. Extract then place .dll in war2 folder.
« Last Edit: March 27, 2016, 06:10:05 PM by tupac »

Offline crazyman2581

  • Peon
  • **
  • Posts: 6
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #167 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

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #168 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.
« Last Edit: March 27, 2016, 06:16:51 PM by tupac »

Offline crazyman2581

  • Peon
  • **
  • Posts: 6
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #169 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

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #170 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 :)

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #171 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?
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline aqrit

  • Peon
  • **
  • Posts: 41
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #172 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.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #173 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.
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline aqrit

  • Peon
  • **
  • Posts: 41
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #174 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
« Last Edit: April 12, 2016, 01:52:59 AM by aqrit »

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #175 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?
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline aqrit

  • Peon
  • **
  • Posts: 41
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #176 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.

Offline aqrit

  • Peon
  • **
  • Posts: 41
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #177 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

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #178 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
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.


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.




« Last Edit: April 16, 2016, 07:44:21 PM by tupac »

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #179 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!!!!!!!!!!!!!!!!!!!!!
« Last Edit: May 03, 2016, 07:46:56 PM by tupac »