wine source code, Bug6971, suse 12.1,kde

Questions about Wine on Linux
Locked
Lord_Valarian
Level 2
Level 2
Posts: 34
Joined: Sat Apr 16, 2011 3:00 pm

wine source code, Bug6971, suse 12.1,kde

Post by Lord_Valarian »

Hello all...

If should be for another message board, tell me.

http://wiki.winehq.org/Bug6971

I'v tried wine 1.3.34, wine 1.3.34_rawinput2, and wine1.3.35. They all have the same bad mouse behavior in Empire Earth I.

The effect is this(about for x or y):
12" mouse movement-> 1" on screen

Wine changes absolute movement to relative. So, changing the scaling should be the solution in the "mouse.c" wine source code. I'v done programing, but it will take me some time to figure out how it works. The patch code changes specific things related to ABS vs REL mouse positioning. So, it will help to look at it.

I can't see what values the mouse makes. So, I need to print values. Also, adding a registry entry "mouse sensitivity" to make it flexible for any game. I couldn't find anything in wine.

Can someone help?
Lord_Valarian
Level 2
Level 2
Posts: 34
Joined: Sat Apr 16, 2011 3:00 pm

Mouse source code, need help.

Post by Lord_Valarian »

I'm making progress in EE1. I need help making sense of mouse code.There are almost no comments in the code. I'm not new to programing, but new to mouse coding. I need to know where to find where mouse values start and are translated out to mswin. I'm stuck... Thanks.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: wine source code, Bug6971, suse 12.1,kde

Post by vitamin »

Lord_Valarian wrote:I'm making progress in EE1. I need help making sense of mouse code.There are almost no comments in the code. I'm not new to programing, but new to mouse coding. I need to know where to find where mouse values start and are translated out to mswin. I'm stuck... Thanks.
I thought that Empire Earth 1 was fixed a while ago. I guess not, or it was broken again.

As I recall, timing & Wine warping mouse were the main issues with this game. It warps mouse itself, so most mouse move events were lost. The current Wine code isn't all that much better. Yes, it's using XInput 2 but still messing with pointer position, warping mouse, breaks timing between different mouse position change events.

The fist thing you can do is to try native dinput.dll. If it works, then you know that built-in could be fixed without touching anything else (won't really be that easy of course). But if it doesn't, then you'll have to mess with x11drv, server, user32.

First thing first, I'd recommend you opening a bug in bugzilla for your specific game.
Lord_Valarian
Level 2
Level 2
Posts: 34
Joined: Sat Apr 16, 2011 3:00 pm

wine source code, Bug6971, suse 12.1,kde

Post by Lord_Valarian »

This is what i'v done so far. The POL script by me and another for the GOG version - gold edition. Run playonlinux install script and compile wine 1.3.36

I'm not doing this by hand. The POL script is already there. It will run without crashing. Mouse won't work except on multii-player. I'v already changed "dinput.dll"

Code: Select all

#wget http://sourceforge.net/projects/wine/files/Source/wine-1.3.36.tar.bz2
#tar xjvf wine-1.3.36.tar.bz2

cd wine-1.3.36

./configure
#make depend    doesn't work
make

mv -v '/home/username/bin/wine-1.3.36/dlls/dinput/dinput.dll.fake' '/home/username/bin/wine-1.3.36/dlls/dinput/dinput.dll'
mv -v '/home/username/bin/wine-1.3.36/dlls/dinput/dinput.dll' '/home/username/.PlayOnLinux/wine/linux-x86/1.3.36/lib/wine/fakedlls/'

Either directory linux-x86 or amd64 won't do anything. I download and unzip using the above. I make these changes:

/home/username/bin/wine-1.3.36/dlls/dinput/mouse.c

Code: Select all

   switch(wparam) {
        case WM_MOUSEMOVE:
        {
            POINT pt, pt1;

            if (This->clipped) pt = This->mapped_center;
            else GetCursorPos(&pt);
	    
	    //mouse patch
	    pt.x = hook->pt.x - pt.x;    // this makes pt.x a relative movement.
	    This->m_state.lX=This->m_state.lX + (pt.x * 100);// add relative movement to your structure

	    pt.y = hook->pt.y - pt.y;    // this makes pt.y a relative movement.
	    This->m_state.lY=This->m_state.lY + (pt.y * 100);// add relative movement to your structure	    

That dll is only code being changed. So, I overwrite the dll with the patched dll. I start POL and launch "empire earth". This doesn't work. Will this setup allow me to alter the mouse code? No changes are having any effect.

All POL script options have no effect. MSWIN does work. So, the emulation is wrong(clearly). I don't know enough find the problem.
I thought that Empire Earth 1 was fixed a while ago. I guess not, or it was broken again.
I'v read everything I could find. The mouse problems were never fixed, only the graphical glitches.
You can move the mouse. It takes very large fast movements to get a small effect, about 15 to 1. The raw input patch has no effect.

http://wiki.winehq.org/Bug6971
As I recall, timing & Wine warping mouse were the main issues with this game. It warps mouse itself, so most mouse move events were lost. The current Wine code isn't all that much better. Yes, it's using XInput 2 but still messing with pointer position, warping mouse, breaks timing between different mouse position change events.
Mouse warping? center it on the screen by resetting the mouse position. Also, I can compile it, but in configure it's giving me many warnings.

I'm noob to mouse coding, slow down. So, mswin is able to read the data correctly. How does it read the data?

Read absolute xy from linux-->wine converts it to mswin format-->sends to empire earth

Maybe EE could be patched to match what is patched in the muli-player lobby(AOC). Can you explain in detail what is going wrong in conversion from linux wine to mswin?

The mouse code has almost no comments. So, it make it nearly impossible to figure out what's going on or how to print mouse values. I can't fix what I don't understand.
The first thing you can do is to try native dinput.dll. If it works, then you know that built-in could be fixed without touching anything else (won't really be that easy of course). But if it doesn't, then you'll have to mess with x11drv, server, user32.
First, try fixing the wine mouse code.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: wine source code, Bug6971, suse 12.1,kde

Post by vitamin »

Lord_Valarian wrote:The POL script by me
Don't waste our time. You either use plain Wine or you go to POL's support forum.
Lord_Valarian
Level 2
Level 2
Posts: 34
Joined: Sat Apr 16, 2011 3:00 pm

Re: wine source code, Bug6971, suse 12.1,kde

Post by Lord_Valarian »

vitamin wrote:
Lord_Valarian wrote:The POL script by me
Don't waste our time. You either use plain Wine or you go to POL's support forum.
I asked about mouse coding, not POL scripting.
jjmckenzie
Moderator
Moderator
Posts: 1153
Joined: Wed Apr 27, 2011 11:01 pm

wine source code, Bug6971, suse 12.1,kde

Post by jjmckenzie »

On Sat, Jan 14, 2012 at 6:41 PM, Lord_Valarian
<[email protected]> wrote:
vitamin wrote:
Lord_Valarian wrote:
The POL script by me
Don't waste our time. You either use plain Wine or you go to POL's support forum.
I asked about mouse coding, not POL scripting.
Vitamin has a valid point. Use plain Wine and then tell us what
does/does not work. If you want to use POLs scripts then you have to
go to them for support. This is by agreement between the Wine
Developers and the POL Developers.

So, please start all over with vanilla Wine and follow what is given
in the bug reports and in the Applications Database.

James
jjmckenzie
Moderator
Moderator
Posts: 1153
Joined: Wed Apr 27, 2011 11:01 pm

wine source code, Bug6971, suse 12.1,kde

Post by jjmckenzie »

On Sat, Jan 14, 2012 at 2:41 PM, Lord_Valarian
<[email protected]> wrote:
This is what i'v done so far.  The POL script by me and another for the GOG version - gold edition. Run playonlinux install script and compile wine 1.3.36

I'm not doing this by hand. The POL script is already there. It will run without crashing. Mouse won't work except on multii-player. I'v already changed "dinput.dll"


Code:
#wget http://sourceforge.net/projects/wine/fi ... 36.tar.bz2
#tar xjvf wine-1.3.36.tar.bz2
Are you doing this as root? This is not recommended.

The sequence:

Log in as a normal user;

$tar -xjvf wine-1.3.3.6.tar.bz2
$cd wine-1.3.36
$configure
$make
$sudo make install

make depend is not needed anymore and has not been so for a long time.

James
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: wine source code, Bug6971, suse 12.1,kde

Post by vitamin »

Lord_Valarian wrote:I asked about mouse coding, not POL scripting.
All POL script options have no effect. MSWIN does work. So, the emulation is wrong(clearly). I don't know enough find the problem.
You said it yourself - you don't know nothing except some POL script that modifies something.
Lord_Valarian wrote:Read absolute xy from linux-->wine converts it to mswin format-->sends to empire earth
I wish it would be that easy. I gave you the direction. You have to know much more about Wine and specifically how mouse input is handled before we can continue "how to fix Wine" conversation.
Locked