Empire Earth I in playonlinux, wine mouse fix code, opensuse 12.1-kde-64bit

Hello all. I’m on to the next step. This is what I have so far.

FYI, i’v posted messages on winehq with no responses. So, I’ll need help here.

I wrote a POL script with help. I have it running, but the mouse doesn’t work right. It takes huge mouse movements to get the mouse to move small amounts.

Run POL script and install with wine 1.3.36

#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

#To install wine (optional if you plan on running Wine from the build directory)

#sudo make install             skipped

I download and unzip using the above. I make these changes:

[home]/bin//wine-1.3.36/dlls/dinput/mouse.c

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

            if (This->clipped) pt = This->mapped_center;
            else GetCursorPos(&pt);
	    
	    //mouse patch
            This->m_state.lX += pt.x = ((hook->pt.x - pt.x) * 20);
            This->m_state.lY += pt.y = ((hook->pt.y - pt.y) * 20);


./configure
make

copy:
  [home]/bin/wine-1.3.36/dlls/dinput/dinput.dll.fakedll
  [home]/.PlayOnLinux/wine/linux-amd64/1.3.36/lib/wine/fakedlls/dinput.dll


That dll is only code being changed. So, I overwrite the dll with the patched dll. I start POL and launch “empire earth”. It doesn’t work. No surprise there. So, where is the problem?

	    //mouse patch
            This->m_state.lX += pt.x = hook->pt.x - pt.x;
            This->m_state.lY += pt.y = hook->pt.y - pt.y;

I’v seen this code before. I can’t fix what I don’t understand. "-> " are referencing pointer variables. A double equals in one line and =+ makes no sense to me. Can someone break it down into simpler code?

How do I print the mouse variables to the command line?

[QUOTE=lord_valarian;2428074]

	    //mouse patch
            This->m_state.lX += pt.x = hook->pt.x - pt.x;
            This->m_state.lY += pt.y = hook->pt.y - pt.y;

Hi,

the first line breaks down into the following two lines:


pt.x = hook->pt.x - pt.x;    // this makes pt.x a relative movement.
This->m_state.lX=This->m_state.lX+pt.x;// add relative movement to your structure

(a+=b means a=a+b)
Try to change your two lines to :


pt.x = hook->pt.x - pt.x;    // this makes pt.x a relative movement.
This->m_state.lX=This->m_state.lX+pt.x*20;// add relative movement to your structure

HTH

Lenwolf

New code:

	    //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 * 5000000);// 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 * 5000000);// add relative movement to your structure	    
	    //end

I was wrong about distance multiplier. Also, I noticed on the multi-player screen the mouse worked normally.

Move the mouse left to right 10" slow, no movement. Move the mouse fast and you get movement. I’v been raising the values, even this results in the same movement amount.

The mouse button will click with my hand off the buttons at random moments.

Any ideas? :stuck_out_tongue:

Hi,

no, not really.
I’m sorry, I don’t know wine so I don’t know where else this might go wrong.

However, I’d play around with the multiplier a bit, try to take it from 10 to 10000 in small steps, 500000 seems just too much.

Also, I noticed on the multi-player screen the mouse worked normally.

Even with the multiplier? This would seem to indicate that the mouse movement is read somewhere else?

HTH

Lenwolf

Hi, no, not really.
I’m sorry, I don’t know wine so I don’t know where else this might go wrong.

I don’t need help with wine. Just how the mouse code works. Wine takes the mouse values from linux and translates it. I understand some of it. There’s almost no commenting. I’m baffled. First, what does each function do in plain terms. Can you take a look at the mouse code? Knowing what’s their purpose will help. One step at time.

http://source.winehq.org/source/dlls/dinput/mouse.c

Where is the line where a mouse xy is send back to Empire Earth?

However, I’d play around with the multiplier a bit, try to take it from 10 to 10000 in small steps, 500000 seems just too much.

I did that in testing to see what would happen. You saw the results: 20, 100, 1000, 10000, 5000000 No effect.

Also, I noticed on the multi-player screen the mouse worked normally.
Even with the multiplier? This would seem to indicate that the mouse movement is read somewhere else?

I thought about that. This is the mouse code for wine. So, it has to be here. I need to print values from the console.

FIXME("(%p)->(%p,%s,%08x): semi-stub !
", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);

Can you breakdown this line? Thanks again. I can use this to print values.

I PRESUME that this works like printf - please look up printf and the parameter substitutions.

In short, this will print a text (probably “fixme”) followed by the string between the double quotes where, however, each of the parameters introduced with % is replaced by the corresponding parameter given at the end of the command :the first parameter in parenthesis (%p). This will be replaced by the value of the pointer" iface", tge seond %p will take the value of lpdiaf etc…

Err .am I at all clear ?

HTH

Lenwolf

This is what I changed.

        case WM_MOUSEMOVE:
        {
            POINT pt, pt1;

            if (This->clipped) pt = This->mapped_center;
            else GetCursorPos(&pt);
	    
	    FIXME("Mousexy: %d %d
",pt.x, pt.y);
	    //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 * 1);// 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 * 1);// add relative movement to your structure	    
	    //end

This doesn’t print anything. I’m baffled. Unless someone can figure out where empire earth is getting it’s mouse data, i’m stuck. I need to see what empire earth is sending to empire earth. I’m out of ideas.

OK, it seems to me that this, then, doesn’t control the mouse input.

You’ll have to find out where in the sources the mouse input ins handled, sorry.

Lenwolf

That’s it. Until I find out where empire earth is getting it’s mouse data, it’s game over. Pardon the pun. I’ll post on here again if I make any progress.

For anyone else, this is all I have done.

The POL script by me and another for the GOG version - gold edition. Run playonlinux install script and compile wine 1.3.36

#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

   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. Is the logic sound?

All POL script options have no effect. MSWIN does work. So, the emulation is wrong(clearly). I don’t know enough find the problem.

Bug6971 - The Official Wine Wiki

I can compile it, but in configure it’s giving me many warnings.

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).

The mouse works. It takes very large fast movements to move the mouse a very small distance. The mouse won’t work except on multi-player.