Empire earth in wine, suse 12.1,kde

Hello all. This a C coding question. I’v already posted on wine forums, no responses yet.

Empire Earth I has a mouse bug with wine. The effect is this(about for x or y):
12" mouse movement-> 1/2" on screen

I’v tried wine v1.3.34, wine v1.3.34_rawinput2, and wine v1.3.35. They both have the same bad mouse behavior.

Bug6971 - The Official Wine Wiki

I’v been doing some reading. Wine changes absolute movement to relative. So, I think 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, mentioned on the bug page, changes specific things related to ABS vs REL mouse positioning.

I understand some of the wine mouse code. I need help making sense of it to find the code section i’m looking to change. Also, I need to send mousexy to the console. Can someone help?

I’d like to add a registry entry “mouse sensitivity” to make it flexible for any game. I couldn’t find anything in the wine app.

Thanks.

Hi,

I don’t think I can help you much with that, but could you check whether this is wine- or application specific?

I.e. do other applications you run under wine have the same behaviour or only this game?

HTH

Lenwolf

Hi,

after a quick look at the mouse.c file, the “dinput_mouse_hook” function seems promising for you (have a look at case WM_MOUSEMOVE:).

HTH

Lenwolf

Thanks for the help. If you read the bugs link, it’s games that use REL positioning that run into trouble with wine. The rawinput patch doesn’t fix it for Empire earth. So, I read everything I could find, mouse warping, etc. I tested it and found a possible solution(ABS <->REL mouse positioning). Also, the modern game I have mouse works fine with playonlinux/wine.

Can you tell me in general what this section is doing? Break it down. I have some understanding of pointer variables. IMHO, this needs much more commenting. Which is the mouse raw input from suse linux? Ending with what gets send to wine then empire earth.

        case WM_MOUSEMOVE:
         {
             POINT pt, pt1;
 
             if (This->clipped) pt = This->mapped_center;
            else GetCursorPos(&pt);
             This->m_state.lX += pt.x = hook->pt.x - pt.x;
             This->m_state.lY += pt.y = hook->pt.y - pt.y;
 
            if (This->base.data_format.user_df->dwFlags & DIDF_ABSAXIS)
            {
                 pt1.x = This->m_state.lX;
                 pt1.y = This->m_state.lY;
             } else
                pt1 = pt;

            if (pt.x)
             {
                 inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_X_AXIS_INSTANCE) | DIDFT_RELAXIS;
                 wdata = pt1.x;
             }
             if (pt.y)
             {
                 /* Already have X, need to queue it */
                 if (inst_id != -1)
                    queue_event(iface, inst_id,
                                 wdata, GetCurrentTime(), This->base.dinput->evsequence);
                 inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS;
                 wdata = pt1.y;
            }

            if (pt.x || pt.y)
            {
                 if ((This->warp_override == WARP_FORCE_ON) ||
                     (This->warp_override != WARP_DISABLE && (This->base.dwCoopLevel & DISCL_EXCLUSIVE)))
                     This->need_warp = TRUE;
             }
             break;
         }

Hi,

well, have a look at the code at the beginning :


            POINT pt, pt1;
 
             if (This->clipped) pt = This->mapped_center;
            else GetCursorPos(&pt);
             This->m_state.lX += pt.x = hook->pt.x - pt.x;
             This->m_state.lY += pt.y = hook->pt.y - pt.y;
 

This obviously gets the mouse pointer position if the window isn’t clipped (getCursorPos (&pt))

The pointer pos is then put into a structure “m_state” after making it not an absolute pointer position, but a relative move compared to the last pointer position, so that the structure contains, again, an “absolute” position (I put absolute into quotes as I haven’t looked at how the m_state structure is initialized). Is this clear to you?

HTH

Lenwolf

Lenwolf> I put absolute into quotes as I haven’t looked at how the m_state structure is initialized.

It uses a structure that is pointer Q(first-in first-out), as I understand it. Also, empire earth in game has a mouse sensitivity values. For this code, i’ll set them to zero. They don’t work anyway. I’ll need to add something to set this var. Like a command line code(–mouse_sensitivity X) .

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

I think I understand. If absolute mouse → mouse delta/relative is the problem, it needs to scaled up. It needs a mouse sensitivity variable. Also, It might need some error correction too. Correct me if i’m wrong.


            POINT pt, pt1;
 
             if (This->clipped) pt = This->mapped_center;
            else GetCursorPos(&pt);
             This->m_state.lX += pt.x = (hook->pt.x - pt.x) * mouse_sensitivity;
             This->m_state.lY += pt.y = (hook->pt.y - pt.y) * mouse_sensitivity;
 

No, I don’t think that this structure is a queue, really, not in the sense that you put values in which are queued and then retrieved.
Try to find the definition of the structure somewhere in the source code.

Interesting - and probably the source of your problem. Have you tried setting these values to high/low values in the game?
You still haven’t replied to this question :

could you check whether this is wine- or application specific?

I’ll need to add something to set this var. Like a command line code(–mouse_sensitivity X) .

This is a command line for what? For wine or your program? If this is supposed to be for the program, I fail to see how you could achieve this unless you have access to the source code. If the hack you proposed is for wine, you’re probably better off to make yourself a special version of wine with the mouse sensitivity you want, just for that game.

I think I understand. If absolute mouse -> mouse delta/relative is the problem, it needs to scaled up. It needs a mouse sensitivity variable. Also, It might need some error correction too. Correct me if i’m wrong.

That seems about right.


            POINT pt, pt1;
 
             if (This->clipped) pt = This->mapped_center;
            else GetCursorPos(&pt);
             This->m_state.lX += pt.x = (hook->pt.x - pt.x) * mouse_sensitivity;
             This->m_state.lY += pt.y = (hook->pt.y - pt.y) * mouse_sensitivity;
 

Yes that could work. Just try setting the mouse sensitivity in the source code and recompile yourself a version of wine.
Try it out and see what works.

HTH

Lenwolf

75 /* This is for mouse reporting. */
76 DIMOUSESTATE2 m_state;

2114 /* “Standard” Mouse report for DInput 7… */
2115 typedef struct DIMOUSESTATE2 {
2116 LONG lX;
2117 LONG lY;
2118 LONG lZ;
2119 BYTE rgbButtons[8];
2120 } DIMOUSESTATE2;

Interesting - and probably the source of your problem. Have you tried setting these values to high/low values in the game?

As I said, these settings have no effect. High mouse sensitivity has no effect in the EE menu.

You still haven’t replied to this question:

Sorry, I must have deleted the answer. On playonlinux, FARCRY2 mouse works normally. The bug page mentioned how older games use REL mouse positioning instead of ABS mouse positioning.

This is a command line for what? For wine or your program? If this is supposed to be for the program, I fail to see how you could achieve this unless you have access to the source code. If the hack you proposed is for wine, you’re probably better off to make yourself a special version of wine with the mouse sensitivity you want, just for that game.

Yes, I plan to use the instructions on the bug page to recompile wine for EE. If I have any problems, i’ll ask on here. I need to be able to adjust the mouse_sensitivity var so don’t I have to recompile it each time. Also, playonlinux offers a build service to store special versions of wine specific to a game(s).

Ok, this seems straightforward enough…

Yes, I plan to use the instructions on the bug page to recompile wine for EE. If I have any problems, i’ll ask on here. I need to be able to adjust the mouse_sensitivity var so don’t I have to recompile it each time. Also, playonlinux offers a build service to store special versions of wine specific to a game(s).

That will mean that you also have to find the section that reads command line options and stores them somewhere…

HTH

Lenwolf

Now, I need to compile wine and overwrite the current wine in Playonlinux with the patched version. I’m looking for that now. Playonlinux can download and install many different versions of wine.

I need to compile wine for SUSE. I’v found many links to how it can be done. The bug page has one. What’s the best method to install it for suse?

Hi,
I don’t know about wine specifically. In general terms, there should be configure, make and makeinstall scripts provided.
You download the sourcecode to a directory where you, as a non root user, have read/writ acess.

Once downloaded, cd into the directory.

type “./configure”.
this will start configuring the sources.
then type “./make”
then type “sudo make install”.

Here are some links for compiling wine under openSUSE:

WineOn64bit - The Official Wine Wiki

and also ;

Wine - openSUSE

HTH

Lenwolf

Here’s what’s on the bug page:

wget http://downloads.sourceforge.net/project/wine/Source/wine-1.1.34.tar.bz2
tar xjvf wine-1.1.34.tar.bz2
cd wine-1.1.34
wget http://bugs.winehq.org/attachment.cgi?id=25097 -O mousewarp-1.1.34.patch
### Download other patches you may want at this point ###
patch -p1 < mousewarp-1.1.34.patch
autoreconf
./configure
make depend
make -j 2
checkinstall -D --install=no

Gives an error. I’m reading up on how to now. I’m new at this. I don’t need the patch it doesn’t work anyway. Dependencies? Needed include files? I’m a bit lost here.

I added this Repo to Yast:

http://download.opensuse.org/repositories/Emulators:/Wine/openSUSE_12.1/

Gives an error. I’m reading up on how to now. I’m new at this. I don’t need the patch it doesn’t work anyway. Dependencies? Needed include files? I’m a bit lost here.

I added this Repo to Yast:

Index of /repositories/Emulators:/Wine/openSUSE_12.1

You don’t say what where and when gives what error.

Forget about the patch right now. Download the sources and just try to compile them as they are. Have you checked all of the dependencies, as listed in the links i gave you?

HTH

Lenwolf

I’v been reading this thread.

http://forums.opensuse.org/english/get-technical-help-here/applications/428984-configuring-wine-patch-problems.html

I’v installed a few packages. I’m struggling through this.

./configure
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for cpp... cpp
checking whether gcc -m32 works... yes
checking for the directory containing the Wine tools... $(TOPOBJDIR)
checking for flex... no
configure: error: no suitable flex found. Please install the 'flex' package.

Hi, did you follow my advise :

Did you load all the packages listed in the link I gave you?

Obviously not, since flex IS listed there as a necessary package!!!

Please do load all the required packages before going any further.

HTH

Lenwolf

FYI, I did all those packages. Wine needed many more. mingw for one. Where do I find that? I’m learning more as I go.

I had to do clean install for suse. I have to start over again. :stuck_out_tongue:

I’m having a problem starting POL now. I usually just click on the playonlinux shell script icon inside the folder for the generic version(python). Thanks, i’ll post again once I get caught up. —pause—

I

Hi,

OK, fine I’ll check here from time to time to see whether you’ve come back.

Good luck!

Lenwolf

WineOn64bit - The Official Wine Wiki

Wine - openSUSE

From here I was able to install most in yast, but those not marked with #. Doing a software search found some of remaining packages.

    #bison
    #capi4linux-32bit
    #cups-libs-32bit
    #flex
    #fontconfig-devel-32bit
    #freeglut-devel-32bit
    #freetype2-devel-32bit
    #gcc
    #gcc-32bit
    #giflib-devel-32bit
    #glibc-devel-32bit
    #hal-32bit
    #hal-devel
    libjpeg-devel-32bit
    #liblcms-devel-32bit
    libpng-devel-32bit
    #libxml2-devel-32bit
    #libxslt-devel-32bit
    #make
    #mesa-devel-32bit
    #ncurses-devel-32bit
    #openldap2-devel-32bit
    #openssl-devel-32bit
    sane-32bit
    #unixODBC-devel-32bit
    #xorg-x11-devel-32bit
    #xorg-x11-libICE-32bit
    #xorg-x11-libICE-devel-32bit
    #xorg-x11-libSM-devel-32bit
    #xorg-x11-libX11-devel-32bit
    #xorg-x11-libXext-32bit
    #xorg-x11-libXext-devel-32bit
    #xorg-x11-libXp-32bit
    #xorg-x11-libXrender-devel-32bit
    #xorg-x11-libXt-32bit
    #zlib-devel-32bit Additional for SuSE 11.x:
    #libasound2-32bit
    #libcom_err-devel-32bit
    libgnutls26-32bit
    #libgphoto2-32bit
    #libopenssl0_9_8-32bit 

Where do I find the last ones? Thanks.

Hi,

Hmmm, I can see many of those (e.g. libjpeg-devel-32 bits, libgnutils26-32 bit etc) when I search for them in yast.

(Tip : only search for the first word, eg libjpeg and then choose…).

For others, you can go to :software.opensuse.org: Search Results

and search there.

HTH

lenwolf

#capi4linux-32bit
#cups-libs-32bit
#fontconfig-devel-32bit
#freeglut-devel-32bit
#freetype2-devel-32bit
#gcc-32bit
#giflib-devel-32bit
#glibc-devel-32bit
#hal-32bit
#libjpeg8-devel-32bit
#liblcms-devel-32bit
#libpng14-devel-32bit
#libxml2-devel-32bit
#libxslt-devel-32bit
#Mesa-devel-32bit
#ncurses-devel-32bit
#openldap2-devel-32bit
#openssl-devel-32bit
sane-32bit
#unixODBC-devel-32bit
#xorg-x11-devel-32bit
#xorg-x11-libICE-32bit
#xorg-x11-libICE-devel-32bit
#xorg-x11-libSM-devel-32bit
#xorg-x11-libX11-devel-32bit
#xorg-x11-libXext-32bit
#xorg-x11-libXext-devel-32bit
#xorg-x11-libXp-32bit
#xorg-x11-libXrender-devel-32bit
#xorg-x11-libXt-32bit
#zlib-devel-32bit Additional for SuSE 11.x:
#libasound2-32bit
#libcom_err-devel-32bit
#libgnutls26-32bit
#libgphoto2-32bit
#libopenssl0_9_8-32bit 

Sane isn’t listed in yast or suse downloads. The specific package isn’t listed. Here’s the package list:

Status Package | Summary | Installed (Available) | Size

[Keep] hplip-sane | Only plain scanning with HPLIP scan d… | 3.11.10-3.1.2 | 149.0 KiB
[Keep] libksane0 | KDE scan library | 4.7.2-2.1.2 | 286.0 KiB
[Keep] sane-backends | SANE (Scanner Access Now Easy) Scanne… | 1.0.22-15.1.2 | 13.7 MiB
[Keep] sane-backends-autoconfig | USB Scanner Autoconfiguration | 1.0.22-15.1.2 | 46.0 KiB
[Do Not Install] ksaneplugin | A plugin that implements the scanning… | (4.7.2-2.1.2) | 27.0 KiB
[Do Not Install] libksane-devel | KDE scan library - Development Files | (4.7.2-2.1.2) | 17.0 KiB
[Do Not Install] perl-common-sense | Save a tree AND a kitten (sane defaul… | (3.4-3.1.2) | 44.0 KiB
[Do Not Install] python-imaging-sane | Python SANE module | (1.1.7-8.1.2) | 59.0 KiB
[Do Not Install] sane-backends-32bit | SANE (Scanner Access Now Easy) Scanne… | (1.0.22-15.1.2) | 8.1 MiB
[Do Not Install] sane-backends-devel | Development files for sane-backends | (1.0.22-15.1.2) | 32.0 KiB
[Do Not Install] xsane | A GTK-Based Graphical Scanning Front-… | (0.998-8.1.2) | 4.9 MiB

Here’s the config results clipped with only missing items:

checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking sys/exec_elf.h usability... no
checking sys/exec_elf.h presence... no
checking for sys/exec_elf.h... no
checking sys/filio.h usability... no
checking sys/filio.h presence... no
checking for sys/filio.h... no
checking sys/limits.h usability... no
checking sys/limits.h presence... no
checking for sys/limits.h... no
checking sys/link.h usability... no
checking sys/link.h presence... no
checking for sys/link.h... no
checking sys/modem.h usability... no
checking sys/modem.h presence... no
checking for sys/modem.h... no
checking sys/protosw.h usability... no
checking sys/protosw.h presence... no
checking for sys/protosw.h... no
checking sys/scsiio.h usability... no
checking sys/scsiio.h presence... no
checking for sys/scsiio.h... no
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking sys/strtio.h usability... no
checking sys/strtio.h presence... no
checking for sys/strtio.h... no
checking sys/tihdr.h usability... no
checking sys/tihdr.h presence... no
checking for sys/tihdr.h... no
checking sys/timeout.h usability... no
checking sys/timeout.h presence... no
checking for sys/timeout.h... no
checking sys/vm86.h usability... no
checking sys/vm86.h presence... no
checking for sys/vm86.h... no
checking valgrind/memcheck.h usability... no
checking valgrind/memcheck.h presence... no
checking for valgrind/memcheck.h... no
checking valgrind/valgrind.h usability... no
checking valgrind/valgrind.h presence... no
checking for valgrind/valgrind.h... no
checking whether stat file-mode macros are broken... no
checking for net/if_dl.h... no
checking for net/if_types.h... no
checking for netinet/if_inarp.h... no
checking for netinet/in_pcb.h... no
checking for netinet/ip_var.h... no
checking for netinet/tcp_timer.h... no
checking for netinet/udp_var.h... no
checking for netinet/icmp_var.h... no
checking for netinet/tcp_var.h... no
checking for mach-o/dyld_images.h... no
checking for sys/thr.h... no
checking for pthread_np.h... no
checking for linux/videodev.h... no
checking for ldd... /usr/bin/ldd
checking for i686-pc-mingw32-gcc... no
checking for i586-pc-mingw32-gcc... no
checking for i486-pc-mingw32-gcc... no
checking for i386-pc-mingw32-gcc... no
checking for i686-mingw32msvc-gcc... no
checking for i586-mingw32msvc-gcc... no
checking for i486-mingw32msvc-gcc... no
checking for i386-mingw32msvc-gcc... no
checking for i686-mingw32-gcc... no
checking for i586-mingw32-gcc... no
checking for i486-mingw32-gcc... no
checking for i386-mingw32-gcc... no
checking for X... libraries , headers 
checking for -lX11... libX11.so.6
checking for -lXext... libXext.so.6
checking for X11/Xlib.h... yes
checking for X11/XKBlib.h... yes
checking for X11/Xutil.h... yes
checking for -lXcursor... libXcursor.so.1
checking for -lXi... not found
checking for -lXxf86vm... libXxf86vm.so.1
checking for -lXrender... libXrender.so.1
checking for -lXrandr... libXrandr.so.2
checking for -lXinerama... libXinerama.so.1
checking for -lXcomposite... libXcomposite.so.1
checking for -lGL... libGL.so.1
checking for -lGLU... libGLU.so.1
checking audio/audiolib.h usability... no
checking audio/audiolib.h presence... no
checking for audio/audiolib.h... no
checking for -lxslt... libxslt.so.1
checking dbus/dbus.h usability... no
checking dbus/dbus.h presence... no
checking for dbus/dbus.h... no
checking hal/libhal.h usability... no
checking hal/libhal.h presence... no
checking for hal/libhal.h... no
checking gnutls/gnutls.h usability... no
checking gnutls/gnutls.h presence... no
checking for gnutls/gnutls.h... no
checking for -lncurses... libncurses.so.5
checking for sane-config... no
checking sane/sane.h usability... no
checking sane/sane.h presence... no
checking for sane/sane.h... no
checking for gphoto2-config... no
checking for gphoto2-port-config... no
checking gphoto2-camera.h usability... no
checking gphoto2-camera.h presence... no
checking for gphoto2-camera.h... no
checking for freetype-config... freetype-config
checking for -lfreetype... libfreetype.so.6
checking for freetype/internal/sfnt.h... no
checking for pthread_attr_get_np... no
checking for pthread_get_stackaddr_np... no
checking for pthread_get_stacksize_np... no
checking for esd-config... no
checking esd.h usability... no
checking esd.h presence... no
checking for esd.h... no
checking cups/cups.h usability... no
checking cups/cups.h presence... no
checking for cups/cups.h... no
checking for -lfontconfig... libfontconfig.so.1
checking for -lssl... libssl.so.1.0.0
checking for -lcrypto... libcrypto.so.1.0.0
checking for -ljpeg... libjpeg.so.8
checking for -lpng... not found
checking for -lodbc... libodbc.so.1
checking for gcc strength-reduce bug... no
checking for broken string.h that generates warnings... no
checking for ms_hook_prologue attribute... yes
checking whether external symbols need an underscore prefix... no
checking whether external symbols need stdcall decoration... no
checking how to define a function in assembly code... .type @function
checking for _pclose... no
checking for _popen... no
checking for _snprintf... no
checking for _spawnvp... no
checking for _strdup... no
checking for _stricmp... no
checking for _strnicmp... no
checking for _strtoi64... no
checking for _strtoui64... no
checking for _vsnprintf... no
checking for chsize... no
checking for dlopen... no
checking for fpclass... no
checking for gettid... no
checking for kqueue... no
checking for port_create... no
checking for setproctitle... no
checking for spawnvp... no
checking for thr_kill2... no
checking for library containing gethostbyname... none required
checking for library containing connect... none required
checking for library containing inet_aton... none required
checking for ldap_parse_sort_control... no
checking for ldap_parse_vlv_control... no
checking whether mkdir takes only one argument... no
checking for inline... inline
checking for request_sense... no
checking for struct xinpgen... no
checking for struct statfs.f_favail... no
checking for struct msghdr.msg_accrights... no
checking for struct sockaddr.sa_len... no
checking for struct sockaddr_un.sun_len... no
checking for scsireq_t.cmd... no
checking for struct mtget.mt_blksiz... no
checking for struct icmpstat.icps_outhist... no
checking whether we need to define __i386__... no
configure: creating ./config.status

config.status: creating Make.rules
config.status: creating dlls ...
config.status: creating documentation/Makefile
config.status: creating fonts/Makefile
config.status: creating include/Makefile
config.status: creating libs/  ..
config.status: creating loader/Makefile
config.status: creating programs/  ...
config.status: creating server/Makefile
config.status: creating tools/ ...
config.status: creating tools/widl/Makefile
config.status: creating tools/winebuild/ ....
config.status: creating include/config.h
config.status: executing include/stamp-h commands
config.status: executing dlls/gdi32/enhmfdrv commands .....
config.status: executing include/wine commands

configure: libxi 32-bit development files not found, the Xinput extension won't be supported.
configure: libhal/libdbus 32-bit development files not found, no dynamic device support.
configure: libgnutls 32-bit development files not found, no schannel support.
configure: libsane 32-bit development files not found, scanners won't be supported.
configure: libgphoto2 32-bit development files not found, digital cameras won't be supported.
configure: libcapi20 32-bit development files not found, ISDN won't be supported.
configure: libcups 32-bit development files not found, CUPS won't be supported.
configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported.
configure: libmpg123 32-bit development files not found (or too old), mp3 codec won't be supported.
configure: libopenal 32-bit development files not found (or too old), OpenAL won't be supported.

configure: WARNING: libpng 32-bit development files not found, PNG won't be supported.

configure: Finished.  Do 'make depend && make' to compile Wine.