winmm/tests: Add Hadouken detection to the interactive joystick test

Bruno Jesus 00cpxxx at gmail.com
Tue Mar 31 14:47:08 CDT 2015


Wine code is exceedingly sober, to prove to users that we are more
than heatless (not heartless) code typists I'm sending a patch to
reduce the gap between programmers and users. It employs the most
advanced psychological studies from nobel scientists [1] that prove
challenging games like [2] are the best things ever invented to break
the ice and get better socializing levels. It will surely bring
attention of masses and boost Wine popularity.

Next patches include a player selection screen, advanced AI based on
minimax algorithm, network play with automatic overnet player
discovery and elastic band algorithms to reduce latency and wireframe
characters designed with the full range of UTF art possible (no ascii
limits), see a Yoga Flame in action at [3]. Everybody will switch to
Wine after that, why would you play mine field or solitaire when you
have a much better and open source choice?

Each developer will be allowed to play with its respective country
character [4] and tournaments will be held in the wine conf to adopt a
new tradition. In the absence of a character for your country a GIS
algorithm will be used based on your home position to find the closest
character from other country (requires some fixes to the location
API).

In order to increase chances of committing the patch Alexandre will be
able to override the system restraints and select any character and
can select Zangief as his opponent anytime.

[1] http://goo.gl/FA1utq
[2] http://en.wikipedia.org/wiki/Street_Fighter
[3] http://goo.gl/N8XE5Z
[4] http://goo.gl/fEG6F5
-------------- next part --------------
diff --git a/dlls/winmm/tests/joystick.c b/dlls/winmm/tests/joystick.c
index 2f235fa..b6d39a3 100644
--- a/dlls/winmm/tests/joystick.c
+++ b/dlls/winmm/tests/joystick.c
@@ -202,6 +202,7 @@ static void test_api(void)
     {
 #define MAX_TIME 15000
         DWORD tick = GetTickCount(), spent;
+        int hadouken = 0;
         infoex.ex.dwSize = sizeof(infoex.ex);
         infoex.ex.dwFlags = JOY_RETURNALL;
         do
@@ -216,6 +217,33 @@ static void test_api(void)
                        infoex.ex.dwRpos, infoex.ex.dwUpos, infoex.ex.dwVpos);
                 trace("BUTTONS: 0x%04X, BUTTON_COUNT: %2d, REMAINING: %d ms\n\n",
                        infoex.ex.dwButtons, infoex.ex.dwButtonNumber, MAX_TIME - spent);
+
+                /*
+                      Hadouken to exit
+
+                      o               o
+                      |=   D         /|\
+                     / \             / \
+                */
+                if (!infoex.ex.dwButtons) /* no button pressed */
+                {
+                    if (infoex.ex.dwYpos > 60000 && abs(infoex.ex.dwXpos - 32767) < 5000) /* down */
+                        hadouken = 1;
+                    else if (hadouken == 1 && infoex.ex.dwXpos > 60000 && infoex.ex.dwYpos > 60000) /* down right */
+                        hadouken = 2;
+                    else
+                        hadouken = 0;
+                }
+                else if (hadouken == 2) /* any button pressed */
+                {
+                    if (abs(infoex.ex.dwYpos - 32767) < 5000 && infoex.ex.dwXpos > 65000) /* right */
+                    {
+                        trace("Hadouken!!!\n");
+                        break;
+                    }
+                    hadouken = 0;
+                }
+                trace("Hadouken state: %d\n", hadouken);
             }
             Sleep(500);
         }


More information about the wine-patches mailing list