diff options
Diffstat (limited to 'contrib')
40 files changed, 1080 insertions, 2969 deletions
diff --git a/contrib/aruco/README.txt b/contrib/aruco/README.txt new file mode 100644 index 00000000..8029a6e3 --- /dev/null +++ b/contrib/aruco/README.txt @@ -0,0 +1,2 @@ +Note, the utility only creates .bmp files. Trying to produce a `.png` or jpeg +file will make it error out. diff --git a/contrib/cfs3/readme.txt b/contrib/cfs3/readme.txt deleted file mode 100644 index e51cebfa..00000000 --- a/contrib/cfs3/readme.txt +++ /dev/null @@ -1,27 +0,0 @@ -FaceTrackNoIR for - - * Combat Flight Simulator 3 (also works for Over Flanders Fields) - * Wings of War - * NASCAR Racing Season 2003 - * Colin McRae Rally 4 - * Race Driver 2 - * F1 Challenge - * Richard Burns Rally - -FaceTrackNoIR was made compatible with these programs with the help of the functions TrackIR provides in the dll TIRViews.dll. -This dll can be downloaded from the TrackIR website: http://www.naturalpoint.com/trackir/06-support/support-download-software-and-manuals.html - -To make the functions work, copy the dll in the FaceTrackNoIR installation folder. Then tick the 'use TIRViews.dll' checkbox for the 'fake TrackIR' game protocol. - -Please let us know if you like the program, if you have ideas for improvements or any questions you might have. - - - -The FaceTrackNoIR team: - -Wim Vriend -Ron Hendriks - - - -Disclaimer: For usage of 3rd party software like FlightGear, the FaceTrackNoIR team is not responsible. Use it at your own risk.
\ No newline at end of file diff --git a/contrib/cfs3/tirviews.dll b/contrib/cfs3/tirviews.dll Binary files differdeleted file mode 100644 index a1fb306f..00000000 --- a/contrib/cfs3/tirviews.dll +++ /dev/null diff --git a/contrib/freepie-udp/FreePIE_IMU_Android9.apk b/contrib/freepie-udp/FreePIE_IMU_Android9.apk Binary files differnew file mode 100644 index 00000000..cab42006 --- /dev/null +++ b/contrib/freepie-udp/FreePIE_IMU_Android9.apk diff --git a/contrib/freepie-udp/com.freepie.android.imu.apk b/contrib/freepie-udp/com.freepie.android.imu.apk Binary files differdeleted file mode 100644 index b1f052aa..00000000 --- a/contrib/freepie-udp/com.freepie.android.imu.apk +++ /dev/null diff --git a/contrib/freepie-udp/com.wishsalad.wishimu-debug.apk b/contrib/freepie-udp/com.wishsalad.wishimu-debug.apk Binary files differnew file mode 100644 index 00000000..a09bd0a3 --- /dev/null +++ b/contrib/freepie-udp/com.wishsalad.wishimu-debug.apk diff --git a/contrib/freepie-udp/src-WishIMU.zip b/contrib/freepie-udp/src-WishIMU.zip Binary files differnew file mode 100644 index 00000000..f60ce3b7 --- /dev/null +++ b/contrib/freepie-udp/src-WishIMU.zip diff --git a/contrib/libusbK-dev-kit/libusbK-3.1.0.0-setup.exe b/contrib/libusbK-dev-kit/libusbK-3.1.0.0-setup.exe Binary files differnew file mode 100644 index 00000000..17d13b16 --- /dev/null +++ b/contrib/libusbK-dev-kit/libusbK-3.1.0.0-setup.exe diff --git a/contrib/libusbK-inf-wizard/libusbK-inf-wizard.exe b/contrib/libusbK-inf-wizard/libusbK-inf-wizard.exe Binary files differnew file mode 100644 index 00000000..47c9f175 --- /dev/null +++ b/contrib/libusbK-inf-wizard/libusbK-inf-wizard.exe diff --git a/contrib/libusbK-inf-wizard/license/AUTHORS-libusb0.txt b/contrib/libusbK-inf-wizard/license/AUTHORS-libusb0.txt new file mode 100644 index 00000000..3ad12f72 --- /dev/null +++ b/contrib/libusbK-inf-wizard/license/AUTHORS-libusb0.txt @@ -0,0 +1,20 @@ +This software is distributed under the following licenses: +Driver: GNU General Public License (GPL) +Library: GNU Lesser General Public (LGPL) +Test Files: GNU Lesser General Public (LGPL) +Filter Installer: GNU Lesser General Public (LGPL) + +Library, Test Programs: + +Stephan Meyer, <ste_meyer@web.de> +Johannes Erdfelt, <johannes@erdfelt.com> +Thomas Sailer, <sailer@ife.ee.ethz.ch> + +Drivers, Installer: + +Stephan Meyer, <ste_meyer@web.de> +Travis Robinson, <libusbdotnet@gmail.com> + +Testing, Technical support: + +Xiaofan Chen, <xiaofanc@gmail.com> diff --git a/contrib/libusbK-inf-wizard/license/AUTHORS-libusbK.txt b/contrib/libusbK-inf-wizard/license/AUTHORS-libusbK.txt new file mode 100644 index 00000000..99f27a45 --- /dev/null +++ b/contrib/libusbK-inf-wizard/license/AUTHORS-libusbK.txt @@ -0,0 +1,40 @@ +CONTRIBUTORS +----------------------------------------------------------------------- +Development : Travis Lee Robinson (libusbdotnet@gmail.com) +Testing : Xiaofan Chen (xiaofanc@gmail.com) + +LICENSE +----------------------------------------------------------------------- +Copyright (c) 2011-2012 Travis Lee Robinson. All rights reserved. + +APPLICABLE FOR ALL LIBUSBK BINARIES AND SOURCE CODE UNLESS OTHERWISE +SPECIFIED. PLEASE SEE INDIVIDUAL COMPONENTS LICENSING TERMS FOR DETAILS. + +NOTE: Portions of dpscat use source code from libwdi which is licensed +for LGPL use only. (See dpscat.c) + +NOTE: libusbK-inf-wizard.exe is linked to libwdi which is licensed for +LGPL use only. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Travis Lee Robinson nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TRAVIS ROBINSON BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. diff --git a/contrib/libusbK-inf-wizard/license/LICENSE-bsd.txt b/contrib/libusbK-inf-wizard/license/LICENSE-bsd.txt new file mode 100644 index 00000000..b80c667f --- /dev/null +++ b/contrib/libusbK-inf-wizard/license/LICENSE-bsd.txt @@ -0,0 +1,33 @@ +Copyright (c) 2011-2012 Travis Lee Robinson. All rights reserved. + +APPLICABLE FOR ALL LIBUSBK BINARIES AND SOURCE CODE UNLESS OTHERWISE +SPECIFIED. PLEASE SEE INDIVIDUAL COMPONENTS LICENSING TERMS FOR DETAILS. + +NOTE: Portions of dpscat use source code from libwdi which is licensed +for LGPL use only. (See dpscat.c) + +NOTE: libusbK-inf-wizard.exe is linked to libwdi which is licensed for +LGPL use only. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Travis Lee Robinson nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TRAVIS ROBINSON BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. diff --git a/contrib/libusbK-inf-wizard/license/LICENSE-gpl3.txt b/contrib/libusbK-inf-wizard/license/LICENSE-gpl3.txt new file mode 100644 index 00000000..eff3f9ac --- /dev/null +++ b/contrib/libusbK-inf-wizard/license/LICENSE-gpl3.txt @@ -0,0 +1,686 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TRAVIS ROBINSON BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/contrib/libusbK-inf-wizard/license/LICENSE-lgpl3.txt b/contrib/libusbK-inf-wizard/license/LICENSE-lgpl3.txt new file mode 100644 index 00000000..65c5ca88 --- /dev/null +++ b/contrib/libusbK-inf-wizard/license/LICENSE-lgpl3.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/contrib/npclient/COMPILE.TXT b/contrib/npclient/COMPILE.TXT new file mode 100644 index 00000000..aee101d0 --- /dev/null +++ b/contrib/npclient/COMPILE.TXT @@ -0,0 +1,21 @@ +#!/bin/sh + +# This makes small binaries: + +CC=clang + +CFLAGS=' \ +-Wall -Wextra -Wpedantic -Os -fomit-frame-pointer -mtune=generic \ +-ffunction-sections -fdata-sections -fvisibility=hidden \ +-Wl,--kill-at,--nxcompat,--dynamicbase,--as-needed,--gc-sections \ +-Wl,--no-insert-timestamp \ +-fno-math-errno -fno-trapping-math -fmerge-all-constants \ +-fno-stack-protector \ +' + +STRIP='strip --strip-all --remove-section=.eh_frame' + +cd -- "$(dirname -- "$0")" && +PATH=/mingw32/bin:"$PATH" sh -c "$CC -m32 -march=pentium4 $CFLAGS -mdll -o NPClient.dll npclient.c && $STRIP NPClient.dll" && +PATH=/mingw64/bin:"$PATH" sh -c "$CC -m64 -Wl,--high-entropy-va $CFLAGS -mdll -o NPClient64.dll npclient.c && $STRIP NPClient64.dll" && +ls -l NPClient{,64}.dll && openssl md5 NPClient{,64}.dll && mv NPClient{,64}.dll ../../bin/ diff --git a/contrib/very-important-source-code/README-CREDIT.txt b/contrib/npclient/README-CREDIT.txt index 82214139..82214139 100644 --- a/contrib/very-important-source-code/README-CREDIT.txt +++ b/contrib/npclient/README-CREDIT.txt diff --git a/contrib/very-important-source-code/npclient.c b/contrib/npclient/npclient.c index 3878f809..03fa589a 100644 --- a/contrib/very-important-source-code/npclient.c +++ b/contrib/npclient/npclient.c @@ -1,14 +1,21 @@ +#define _USE_MATH_DEFINES + #include <stdarg.h> #include <stdlib.h> -#include <stdio.h> +#include <stdbool.h> +#include <math.h> #include <string.h> +#include <stdio.h> + #include <windows.h> -#include <tchar.h> #define FREETRACK_MUTEX "FT_Mutext" #define FT_MM_DATA "FT_SharedMem" -typedef struct TFreeTrackData { +#define UNUSED(var) (void)var + +typedef struct TFreeTrackData +{ int DataID; int CamWidth; int CamHeight; @@ -34,24 +41,25 @@ typedef struct TFreeTrackData { float Y4; } TFreeTrackData; -typedef struct FTMemMap { +typedef struct FTMemMap +{ TFreeTrackData data; __int32 GameId; unsigned char table[8]; __int32 GameId2; } FTMemMap; -static BOOL bEncryptionChecked = FALSE; +static bool bEncryptionChecked = false; static double r = 0, p = 0, y = 0, tx = 0, ty = 0, tz = 0; #define NP_DECLSPEC __declspec(dllexport) #define NP_EXPORT(t) t NP_DECLSPEC __stdcall -#define NP_AXIS_MAX 16383 +#define NP_AXIS_MAX 16383 -static BOOL FTCreateMapping(void); +static bool FTCreateMapping(void); static void FTDestroyMapping(void); -static __inline double scale2AnalogLimits( double x, double min_x, double max_x ); -static __inline double getDegreesFromRads ( double rads ); +static __inline double clamp(double x, double xmin, double xmax); +static __inline double clamp_(double x); #if DEBUG static FILE *debug_stream; @@ -60,29 +68,38 @@ static FILE *debug_stream; #define dbg_report(...) #endif +typedef enum npclient_status_ { + NPCLIENT_STATUS_OK, + NPCLIENT_STATUS_DISABLED +} npclient_status; + static HANDLE hFTMemMap = 0; -static FTMemMap *pMemData = 0; -static HANDLE hFTMutex = 0; -static BOOL bEncryption = FALSE; +static FTMemMap volatile * pMemData = 0; +static bool bEncryption = false; static unsigned char table[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -typedef struct tir_data{ +typedef struct tir_data +{ short status; short frame; - unsigned int cksum; + unsigned cksum; float roll, pitch, yaw; float tx, ty, tz; float padding[9]; } tir_data_t; -typedef struct tir_signature{ +typedef struct tir_signature +{ char DllSignature[200]; char AppSignature[200]; } tir_signature_t; BOOL DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - switch (fdwReason) { + UNUSED(lpvReserved); + + switch (fdwReason) + { case DLL_PROCESS_ATTACH: #if DEBUG debug_stream = fopen("c:\\NPClient.log", "a"); @@ -95,14 +112,18 @@ BOOL DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) dbg_report("DllMain: (%p, %ld, %p)\n", (void*) hinstDLL, (long) fdwReason, lpvReserved); dbg_report("DllMain: Attach request\n"); DisableThreadLibraryCalls(hinstDLL); +#if 0 timeBeginPeriod(1); +#endif break; case DLL_PROCESS_DETACH: dbg_report("DllMain: Detach\n"); dbg_report("DllMain: (%p, %ld, %p)\n", (void*) hinstDLL, (long) fdwReason, lpvReserved); dbg_report("==========================================================================================\n"); +#if 0 timeEndPeriod(1); +#endif FTDestroyMapping(); break; } @@ -180,7 +201,7 @@ NP_EXPORT(int) NPPriv_SetVersion(void) } /* TIR5 requires a checksum to be calculated over the headpose-data and to be relayed to the game. */ -static unsigned int cksum(unsigned char buf[], unsigned int size) +static unsigned cksum(unsigned char buf[], unsigned size) { int rounds = size >> 2; int rem = size % 4; @@ -188,11 +209,11 @@ static unsigned int cksum(unsigned char buf[], unsigned int size) int c = size; int a0, a2; - if((size == 0) || (buf == NULL)){ + if (size == 0 || buf == NULL) return 0; - } - while(rounds != 0){ + while (rounds != 0) + { a0 = *(short int*)buf; a2 = *(short int*)(buf+2); buf += 4; @@ -203,7 +224,8 @@ static unsigned int cksum(unsigned char buf[], unsigned int size) c += (c >> 11); --rounds; } - switch(rem){ + switch (rem) + { case 3: a0 = *(short int*)buf; a2 = *(signed char*)(buf+2); @@ -227,9 +249,8 @@ static unsigned int cksum(unsigned char buf[], unsigned int size) default: break; } - if(rem != 0){ + if(rem != 0) c+=a2; - } c ^= (c << 3); c += (c >> 5); @@ -238,28 +259,29 @@ static unsigned int cksum(unsigned char buf[], unsigned int size) c ^= (c << 25); c += (c >> 6); - return (unsigned int)c; + return (unsigned)c; } -static __inline void enhance(unsigned char buf[], unsigned int size, - unsigned char table[], int table_size) +static __inline void enhance(unsigned char buf[], unsigned size, unsigned char table[], unsigned table_size) { - unsigned int table_ptr = 0; + unsigned table_ptr = 0; unsigned char var = 0x88; unsigned char tmp; - if((size <= 0) || (table_size <= 0) || - (buf == NULL) || (table == NULL)){ + + if (size <= 0 || table_size <= 0 || buf == NULL || table == NULL) return; - } - do{ + + do + { tmp = buf[--size]; buf[size] = tmp ^ table[table_ptr] ^ var; var += size + tmp; ++table_ptr; - if(table_ptr >= table_size){ + + if (table_ptr >= table_size) table_ptr -= table_size; - } - }while(size != 0); + } + while (size != 0); } /****************************************************************** @@ -279,48 +301,53 @@ NP_EXPORT(int) NP_GetData(tir_data_t * data) return 0; } - if (pMemData && hFTMutex && WaitForSingleObject(hFTMutex, 15) == WAIT_OBJECT_0) { + if (pMemData) + { #if DEBUG recv = 1; #endif - y = getDegreesFromRads( pMemData->data.Yaw ); - p = getDegreesFromRads( pMemData->data.Pitch ); - r = getDegreesFromRads( pMemData->data.Roll ); - tx = pMemData->data.X; - ty = pMemData->data.Y; - tz = pMemData->data.Z; - - if (!bEncryptionChecked) { + y = pMemData->data.Yaw * NP_AXIS_MAX / M_PI; + p = pMemData->data.Pitch * NP_AXIS_MAX / M_PI; + r = pMemData->data.Roll * NP_AXIS_MAX / M_PI; + + tx = pMemData->data.X * NP_AXIS_MAX / 500.; + ty = pMemData->data.Y * NP_AXIS_MAX / 500.; + tz = pMemData->data.Z * NP_AXIS_MAX / 500.; + + if (pMemData->GameId == pMemData->GameId2 && !bEncryptionChecked) + { dbg_report("NP_GetData: game = %d\n", pMemData->GameId); - memcpy(table, pMemData->table, 8); + bEncryptionChecked = true; + memcpy(table, (void*)pMemData->table, 8); for (i = 0; i < 8; i++) if (table[i]) { - bEncryption = TRUE; + bEncryption = true; break; } dbg_report("NP_GetData: Table = %02d %02d %02d %02d %02d %02d %02d %02d\n", table[0],table[1],table[2],table[3],table[4],table[5], table[6], table[7]); - bEncryptionChecked = pMemData->GameId2 == pMemData->GameId; } - - ReleaseMutex(hFTMutex); } - data->frame = frameno += 1; - data->status = 0; + frameno++; + data->frame = frameno; + + bool running = y != 0 || p != 0 || r != 0 || + tx != 0 || ty != 0 || tz != 0; + + data->status = running ? NPCLIENT_STATUS_OK : NPCLIENT_STATUS_DISABLED; data->cksum = 0; - data->roll = scale2AnalogLimits (r, -180.0, 180.0); - data->pitch = scale2AnalogLimits (p, -180.0, 180.0); - data->yaw = scale2AnalogLimits (y, -180.0, 180.0); + data->roll = clamp_(r); + data->pitch = clamp_(p); + data->yaw = clamp_(y); - data->tx = scale2AnalogLimits (tx, -500.0, 500.0); - data->ty = scale2AnalogLimits (ty, -500.0, 500.0); - data->tz = scale2AnalogLimits (tz, -500.0, 500.0); + data->tx = clamp_(tx); + data->ty = clamp_(ty); + data->tz = clamp_(tz); - for(i = 0; i < 9; ++i) { + for(i = 0; i < 9; ++i) data->padding[i] = 0.0; - } #if DEBUG dbg_report("GetData: rotation: %d %f %f %f\n", recv, data->yaw, data->pitch, data->roll); @@ -328,11 +355,10 @@ NP_EXPORT(int) NP_GetData(tir_data_t * data) data->cksum = cksum((unsigned char*)data, sizeof(tir_data_t)); - if(bEncryption) { + if (bEncryption) enhance((unsigned char*)data, sizeof(tir_data_t), table, sizeof(table)); - } - return 0; + return running ? NPCLIENT_STATUS_OK : NPCLIENT_STATUS_DISABLED; } /****************************************************************** * NP_GetParameter (NPCLIENT.9) @@ -340,6 +366,7 @@ NP_EXPORT(int) NP_GetData(tir_data_t * data) NP_EXPORT(int) NP_GetParameter(int arg0, int arg1) { + UNUSED(arg0); UNUSED(arg1); dbg_report("GetParameter request: %d %d\n", arg0, arg1); return (int) 0; } @@ -434,8 +461,6 @@ NP_EXPORT(int) NP_GetSignature(tir_signature_t * sig) sig->DllSignature[i] = part1_2[i] ^ part1_1[i]; for (i = 0; i < 200; i++) sig->AppSignature[i] = part2_1[i] ^ part2_2[i]; - memset(sig->DllSignature + strlen(sig->DllSignature), 0, 200 - strlen(sig->DllSignature)); - memset(sig->AppSignature + strlen(sig->AppSignature), 0, 200 - strlen(sig->AppSignature)); return 0; } @@ -472,6 +497,7 @@ NP_EXPORT(int) NP_RegisterProgramProfileID(unsigned short id) NP_EXPORT(int) NP_RegisterWindowHandle(HWND hwnd) { + UNUSED(hwnd); dbg_report("RegisterWindowHandle request: %p\n", (void*) hwnd); return (int) 0; } @@ -481,6 +507,7 @@ NP_EXPORT(int) NP_RegisterWindowHandle(HWND hwnd) NP_EXPORT(int) NP_RequestData(unsigned short req) { + UNUSED(req); dbg_report("RequestData request: %d\n", req); return (int) 0; } @@ -490,6 +517,7 @@ NP_EXPORT(int) NP_RequestData(unsigned short req) NP_EXPORT(int) NP_SetParameter(int arg0, int arg1) { + UNUSED(arg0); UNUSED(arg1); dbg_report("SetParameter request: %d %d\n", arg0, arg1); return (int) 0; } @@ -539,49 +567,43 @@ NP_EXPORT(int) NP_UnregisterWindowHandle(void) return (int) 0; } -static BOOL FTCreateMapping(void) +static bool FTCreateMapping(void) { - BOOL bMappingExists = FALSE; - if (pMemData) - return TRUE; + return true; dbg_report("FTCreateMapping request (pMemData == NULL).\n"); - hFTMutex = CreateMutexA(NULL, FALSE, FREETRACK_MUTEX); - hFTMemMap = CreateFileMappingA( INVALID_HANDLE_VALUE, 00, PAGE_READWRITE, 0, sizeof( FTMemMap ), (LPCSTR) FT_MM_DATA ); - pMemData = (FTMemMap *) MapViewOfFile(hFTMemMap, FILE_MAP_WRITE, 0, 0, sizeof( FTMemMap ) ); - return pMemData != NULL && hFTMutex != NULL; + HANDLE hFTMutex = CreateMutexA(NULL, FALSE, FREETRACK_MUTEX); + CloseHandle(hFTMutex); + + hFTMemMap = CreateFileMappingA(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, sizeof(FTMemMap), (LPCSTR) FT_MM_DATA); + pMemData = (FTMemMap *) MapViewOfFile(hFTMemMap, FILE_MAP_WRITE, 0, 0, sizeof(FTMemMap)); + return pMemData != NULL; } static void FTDestroyMapping(void) { - if ( pMemData != NULL ) { - UnmapViewOfFile ( pMemData ); - } + if (pMemData != NULL) + UnmapViewOfFile((void*)pMemData); - CloseHandle( hFTMutex ); - CloseHandle( hFTMemMap ); + CloseHandle(hFTMemMap); pMemData = 0; hFTMemMap = 0; } -static __inline double getDegreesFromRads ( double rads ) { - return (rads * 57.295781); -} +static __inline double clamp(double x, double xmin, double xmax) +{ + if (x > xmax) + return xmax; -static __inline double scale2AnalogLimits( double x, double min_x, double max_x ) { - double y; - double local_x; + if (x < xmin) + return xmin; - local_x = x; - if (local_x > max_x) { - local_x = max_x; - } - if (local_x < min_x) { - local_x = min_x; - } - y = ( NP_AXIS_MAX * local_x ) / max_x; + return x; +} - return y; +static __inline double clamp_(double x) +{ + return clamp(x, -NP_AXIS_MAX, NP_AXIS_MAX); } diff --git a/contrib/opentrack-231-logo.jpg b/contrib/opentrack-231-logo.jpg Binary files differdeleted file mode 100644 index 1b4ecc2b..00000000 --- a/contrib/opentrack-231-logo.jpg +++ /dev/null diff --git a/contrib/ppjoy/ppjoy mapping for facetracknoir.jpg b/contrib/ppjoy/ppjoy mapping for facetracknoir.jpg Binary files differdeleted file mode 100644 index 052c6899..00000000 --- a/contrib/ppjoy/ppjoy mapping for facetracknoir.jpg +++ /dev/null diff --git a/contrib/ppjoy/readme.txt b/contrib/ppjoy/readme.txt deleted file mode 100644 index 20c52111..00000000 --- a/contrib/ppjoy/readme.txt +++ /dev/null @@ -1,24 +0,0 @@ -FaceTrackNoIR for PPJoy 'enabled' games/programs. - -FaceTrackNoIR was made compatible with the PPJoy virtual joystick(s), that can be used by various other programs as input. - -To start the PPJoy protocol-server in FaceTrackNoIR, select Virtual Joystick in the 'game-protocol' listbox. The -settings, necessary to configure PPJoy for FaceTrackNoIR as included in the PPJoy folder, in the file -PPJoy mapping for FaceTrackNoIR.jpg. - -PPJoy was made by Deon van der Westhuysen and is unfortunately not updated anymore. You can download it from the website -http://shareware.pcmag.com/free/Miscellaneous-Utilities/PPJoy/75176.html, but possibly from others as well... - - -Regards, - - -The FaceTrackNoIR team: - -Wim Vriend -Ron Hendriks - - - - -Disclaimer: For usage of 3rd party software like PPJoy, the FaceTrackNoIR team is not responsible. Use it at your own risk.
\ No newline at end of file diff --git a/contrib/translation-stub.sh b/contrib/translation-stub.sh deleted file mode 100644 index bb5ed51d..00000000 --- a/contrib/translation-stub.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -build_dir=build-msvc15 - -set -e - -dir="$(dirname -- "$0")" -cd "$dir/.." - -pushd "./$build_dir" >/dev/null -cmake --build . --target i18n >/dev/null -popd >/dev/null - -rel="$(git describe --tag --alw)" - -rm -f "$rel" -find . -wholename "?*/lang/stub.ts" | zip -q9 "$build_dir/$rel-i18n-stub.zip" -@ diff --git a/contrib/very-important-source-code/ft_tester/Makefile.am b/contrib/very-important-source-code/ft_tester/Makefile.am deleted file mode 100644 index 02747edb..00000000 --- a/contrib/very-important-source-code/ft_tester/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -noinst_SCRIPTS = -if WINE_PLUGIN - noinst_SCRIPTS += ftc.exe.so -endif #WINE_PLUGIN - -if DARWIN - LDFLAGS += -Wl,-no_arch_warnings -else - LDFLAGS += -Wl,--no-warn-search-mismatch -endif - -CC = winegcc - -CXX = wineg++ - -SUFFIXES = .o .cpp .c .rc - -.cpp.o : - $(CXX) -c $(CXXFLAGS_PRE) $(CXXFLAGS) $(CPPFLAGS) -m32 -o $@ $< - -.c.o : - $(CC) -c $(CFLAGS_PRE) $(CFLAGS) $(CPPFLAGS) -m32 -o $@ $< - -.rc.o : - wrc -o $@ $(RCFLAGS) $< - -CXXFLAGS_PRE = -g -DHAVE_CONFIG_H -I../../.. -I. -I@srcdir@/../.. -I@top_builddir@ -CFLAGS_PRE = -g -I../.. -I../../.. -DHAVE_CONFIG_H -I@srcdir@/../.. -I@top_builddir@ -RCFLAGS = -I @srcdir@ -#VPATH = ../..:@srcdir@/../..:@top_builddir@:@srcdir@ -vpath %.h @srcdir@/../.. -vpath %.h @top_builddir@ -vpath %.c @srcdir@ -vpath %.c @srcdir@/../.. - -ftc.exe.so : main.o fttester.o - wineg++ -g -o $@ -L. $(WINE_LIBS) $(LDFLAGS) -m32 -Wall -Wextra $^ - -fttester.o : fttester.rc resource.h config.h - -main.o : main.cpp - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -distclean-local: distclean-local-check -.PHONY: distclean-local-check -distclean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -EXTRA_DIST = resource.h fttester.rc main.cpp - diff --git a/contrib/very-important-source-code/ft_tester/Makefile.in b/contrib/very-important-source-code/ft_tester/Makefile.in deleted file mode 100644 index d1fff34d..00000000 --- a/contrib/very-important-source-code/ft_tester/Makefile.in +++ /dev/null @@ -1,491 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@WINE_PLUGIN_TRUE@am__append_1 = ftc.exe.so -@DARWIN_TRUE@am__append_2 = -Wl,-no_arch_warnings -@DARWIN_FALSE@am__append_3 = -Wl,--no-warn-search-mismatch -subdir = src/wine_bridge/ft_tester -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/fttester.rc.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = fttester.rc -CONFIG_CLEAN_VPATH_FILES = -SCRIPTS = $(noinst_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -depcomp = -am__depfiles_maybe = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BISON = @BISON@ -CC = winegcc -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = wineg++ -CXXCPP = @CXXCPP@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ $(am__append_2) $(am__append_3) -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIB32DIR = @LIB32DIR@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCFLAGS = @OBJCFLAGS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENCV_CFLAGS = @OPENCV_CFLAGS@ -OPENCV_LIBS = @OPENCV_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -QMAKE_PATH = @QMAKE_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WINE64_LIBS = @WINE64_LIBS@ -WINE_LIBS = @WINE_LIBS@ -XPL_CPPFLAGS = @XPL_CPPFLAGS@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_OBJC = @ac_ct_OBJC@ -am__leading_dot = @am__leading_dot@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -with_makensis = @with_makensis@ -with_wine64 = @with_wine64@ -noinst_SCRIPTS = $(am__append_1) -SUFFIXES = .o .cpp .c .rc -CXXFLAGS_PRE = -g -DHAVE_CONFIG_H -I../../.. -I. -I@srcdir@/../.. -I@top_builddir@ -CFLAGS_PRE = -g -I../.. -I../../.. -DHAVE_CONFIG_H -I@srcdir@/../.. -I@top_builddir@ -RCFLAGS = -I @srcdir@ -EXTRA_DIST = resource.h fttester.rc main.cpp -all: all-am - -.SUFFIXES: -.SUFFIXES: .o .cpp .c .rc -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/wine_bridge/ft_tester/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/wine_bridge/ft_tester/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -fttester.rc: $(top_builddir)/config.status $(srcdir)/fttester.rc.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(SCRIPTS) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-local - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distclean-local distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am - - -.cpp.o : - $(CXX) -c $(CXXFLAGS_PRE) $(CXXFLAGS) $(CPPFLAGS) -m32 -o $@ $< - -.c.o : - $(CC) -c $(CFLAGS_PRE) $(CFLAGS) $(CPPFLAGS) -m32 -o $@ $< - -.rc.o : - wrc -o $@ $(RCFLAGS) $< -#VPATH = ../..:@srcdir@/../..:@top_builddir@:@srcdir@ -vpath %.h @srcdir@/../.. -vpath %.h @top_builddir@ -vpath %.c @srcdir@ -vpath %.c @srcdir@/../.. - -ftc.exe.so : main.o fttester.o - wineg++ -g -o $@ -L. $(WINE_LIBS) $(LDFLAGS) -m32 -Wall -Wextra $^ - -fttester.o : fttester.rc resource.h config.h - -main.o : main.cpp - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -distclean-local: distclean-local-check -.PHONY: distclean-local-check -distclean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/contrib/very-important-source-code/ft_tester/fttester.rc.in b/contrib/very-important-source-code/ft_tester/fttester.rc.in deleted file mode 100644 index 332f3c73..00000000 --- a/contrib/very-important-source-code/ft_tester/fttester.rc.in +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by ResEdit 1.5.9
-// Copyright (C) 2006-2011
-// http://www.resedit.net
-
-#include <windows.h>
-#include <commctrl.h>
-#include <richedit.h>
-#include "resource.h"
-
-#ifdef HAVE_CONFIG_H
- #include "../../../config.h"
-#endif
-
-
-
-
-//
-// Dialog resources
-//
-//LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-IDD_DIALOG1 DIALOGEX 0, 0, 333, 183
-STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
-CAPTION "FreeTrack client test utility v@PACKAGE_VERSION@"
-FONT 8, "Ms Shell Dlg", 400, 0, 1
-{
- DEFPUSHBUTTON "Quit", IDQUIT, 262, 153, 50, 14
- PUSHBUTTON "Start", IDC_START, 199, 153, 50, 14
- EDITTEXT IDC_YAW, 38, 15, 48, 14, ES_AUTOHSCROLL
- RTEXT "Yaw", IDC_STATIC, 12, 17, 21, 14, SS_RIGHT
- EDITTEXT IDC_PITCH, 38, 38, 48, 14, ES_AUTOHSCROLL
- RTEXT "Pitch", IDC_STATIC, 16, 40, 17, 14, SS_RIGHT
- EDITTEXT IDC_ROLL, 38, 61, 48, 14, ES_AUTOHSCROLL
- RTEXT "Roll", IDC_STATIC, 20, 63, 13, 14, SS_RIGHT
- EDITTEXT IDC_X, 38, 84, 48, 14, ES_AUTOHSCROLL
- RTEXT "X", IDC_STATIC, 27, 86, 6, 14, SS_RIGHT
- EDITTEXT IDC_Y, 38, 107, 48, 14, ES_AUTOHSCROLL
- RTEXT "Y", IDC_STATIC, 27, 109, 6, 14, SS_RIGHT
- EDITTEXT IDC_Z, 38, 130, 48, 14, ES_AUTOHSCROLL
- RTEXT "Z", IDC_STATIC, 27, 132, 6, 14, SS_RIGHT
- EDITTEXT IDC_RYAW, 137, 15, 48, 14, ES_AUTOHSCROLL
- RTEXT "Raw Yaw", IDC_STATIC, 101, 17, 32, 8, SS_RIGHT
- EDITTEXT IDC_RPITCH, 137, 38, 48, 14, ES_AUTOHSCROLL
- RTEXT "Raw Pitch", IDC_STATIC, 99, 40, 34, 8, SS_RIGHT
- EDITTEXT IDC_RROLL, 137, 61, 48, 14, ES_AUTOHSCROLL
- RTEXT "Raw Roll", IDC_STATIC, 103, 63, 30, 8, SS_RIGHT
- EDITTEXT IDC_RX, 137, 84, 48, 14, ES_AUTOHSCROLL
- RTEXT "Raw X", IDC_STATIC, 111, 86, 22, 8, SS_RIGHT
- EDITTEXT IDC_RY, 137, 107, 48, 14, ES_AUTOHSCROLL
- RTEXT "Raw Y", IDC_STATIC, 111, 109, 22, 8, SS_RIGHT
- EDITTEXT IDC_RZ, 137, 130, 48, 14, ES_AUTOHSCROLL
- RTEXT "Raw Z", IDC_STATIC, 111, 132, 22, 8, SS_RIGHT
- EDITTEXT IDC_NUM, 264, 15, 48, 14, ES_AUTOHSCROLL
- RTEXT "Frame Number", IDC_STATIC, 212, 17, 47, 8, SS_RIGHT
- EDITTEXT IDC_RES, 264, 38, 48, 14, ES_AUTOHSCROLL
- RTEXT "Camera Resolution", IDC_STATIC, 199, 40, 60, 8, SS_RIGHT
- EDITTEXT IDC_PT0, 227, 61, 85, 14, ES_AUTOHSCROLL
- RTEXT "Point 1", IDC_STATIC, 199, 63, 23, 8, SS_RIGHT
- EDITTEXT IDC_PT1, 227, 84, 85, 14, ES_AUTOHSCROLL
- RTEXT "Point 2", IDC_STATIC, 199, 86, 23, 8, SS_RIGHT
- EDITTEXT IDC_PT2, 227, 107, 85, 14, ES_AUTOHSCROLL
- RTEXT "Point 3", IDC_STATIC, 199, 109, 23, 8, SS_RIGHT
- EDITTEXT IDC_PT3, 227, 130, 85, 14, ES_AUTOHSCROLL
- RTEXT "Point 4", IDC_STATIC, 199, 132, 23, 8, SS_RIGHT
- EDITTEXT IDC_TITLE, 38, 153, 147, 14, ES_AUTOHSCROLL
- RTEXT "Title", IDC_STATIC, 19, 155, 14, 8, SS_RIGHT
-}
-
diff --git a/contrib/very-important-source-code/ft_tester/main.cpp b/contrib/very-important-source-code/ft_tester/main.cpp deleted file mode 100644 index a737f88f..00000000 --- a/contrib/very-important-source-code/ft_tester/main.cpp +++ /dev/null @@ -1,211 +0,0 @@ -#define WIN32_LEAN_AND_MEAN - -#include <windows.h> -#include <cstdio> -#include <stdint.h> -#include <sstream> -#include <cstdlib> -#include <iomanip> - -#include "resource.h" - -HINSTANCE hInst; -UINT_PTR timer = 0; - -HMODULE ftclient; - -typedef struct -{ - unsigned int dataID; - int res_x; int res_y; - float yaw; // positive yaw to the left - float pitch;// positive pitch up - float roll;// positive roll to the left - float x; - float y; - float z; - // raw pose with no smoothing, sensitivity, response curve etc. - float ryaw; - float rpitch; - float rroll; - float rx; - float ry; - float rz; - // raw points, sorted by Y, origin top left corner - float x0, y0; - float x1, y1; - float x2, y2; - float x3, y3; -}FreeTrackData; - - -typedef bool (WINAPI *importGetData)(FreeTrackData * data); -typedef char *(WINAPI *importGetDllVersion)(void); -typedef void (WINAPI *importReportName)(char *name); -typedef char *(WINAPI *importProvider)(void); - -importGetData getData; -importGetDllVersion getDllVersion; -importReportName reportName; -importProvider provider; - - -char *client_path() -{ - HKEY hkey = 0; - RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Freetrack\\FreetrackClient", 0, - KEY_QUERY_VALUE, &hkey); - if(!hkey){ - printf("Can't open registry key\n"); - return NULL; - } - - BYTE path[1024]; - DWORD buf_len = 1024; - LONG result = RegQueryValueEx(hkey, "Path", NULL, NULL, path, &buf_len); - char *full_path = (char *)malloc(2048); - if(result == ERROR_SUCCESS && buf_len > 0){ - sprintf(full_path, "%s\\FreeTrackClient.dll", path); - } - RegCloseKey(hkey); - return full_path; -} - - -bool start(HWND hwnd) -{ - char *libname = client_path(); - if(libname == NULL){ - printf("Freetrack client not found!\n"); - return false; - } - ftclient = LoadLibrary(libname); - if(ftclient == NULL){ - printf("Couldn't load Freetrack client library '%s'!\n", libname); - return false; - } - printf("Freetrack client library %s loaded.\n", client_path()); - - - getData = (importGetData)GetProcAddress(ftclient, "FTGetData"); - getDllVersion = (importGetDllVersion)GetProcAddress(ftclient, "FTGetDllVersion"); - reportName = (importReportName)GetProcAddress(ftclient, "FTReportName"); - provider = (importProvider)GetProcAddress(ftclient, "FTProvider"); - - if((getData == NULL) || (getDllVersion == NULL) || (reportName == NULL) || (provider == NULL)){ - printf("Couldn't load Freetrack client functions!\n"); - FreeLibrary(ftclient); - return false; - } - - printf("Dll version: %s\n", getDllVersion()); - printf("Provider: %s\n", provider()); - char title[1024]; - GetDlgItemText(hwnd, IDC_TITLE, title, 1020); - reportName(title); - return true; -} - -void reportError(std::string msg) -{ - MessageBoxA(0, "FreeTrack client test", msg.c_str(), 0); -} -VOID CALLBACK TimerProcedure(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) -{ - (void) uMsg; - (void) idEvent; - (void) dwTime; - FreeTrackData d; - getData(&d); - SetDlgItemInt(hwnd, IDC_PITCH, d.pitch, true); - SetDlgItemInt(hwnd, IDC_ROLL, d.roll, true); - SetDlgItemInt(hwnd, IDC_YAW, d.yaw, true); - - SetDlgItemInt(hwnd, IDC_X, d.x, true); - SetDlgItemInt(hwnd, IDC_Y, d.y, true); - SetDlgItemInt(hwnd, IDC_Z, d.z, true); - - SetDlgItemInt(hwnd, IDC_RPITCH, d.rpitch, true); - SetDlgItemInt(hwnd, IDC_RROLL, d.rroll, true); - SetDlgItemInt(hwnd, IDC_RYAW, d.ryaw, true); - - SetDlgItemInt(hwnd, IDC_RX, d.rx, true); - SetDlgItemInt(hwnd, IDC_RY, d.ry, true); - SetDlgItemInt(hwnd, IDC_RZ, d.rz, true); - - std::ostringstream s; - s.str(std::string()); - s<<"("<<std::fixed<<std::setprecision(1)<<d.x0<<"; "<<d.y0<<")"; - SetDlgItemText(hwnd, IDC_PT0, s.str().c_str()); - - s.str(std::string()); - s<<"("<<std::fixed<<std::setprecision(1)<<d.x1<<"; "<<d.y1<<")"; - SetDlgItemText(hwnd, IDC_PT1, s.str().c_str()); - - s.str(std::string()); - s<<"("<<std::fixed<<std::setprecision(1)<<d.x2<<"; "<<d.y2<<")"; - SetDlgItemText(hwnd, IDC_PT2, s.str().c_str()); - - s.str(std::string()); - s<<"("<<std::fixed<<std::setprecision(1)<<d.x3<<"; "<<d.y3<<")"; - SetDlgItemText(hwnd, IDC_PT3, s.str().c_str()); - - s.str(std::string()); - s<<d.res_x<<"x"<<d.res_y; - SetDlgItemText(hwnd, IDC_RES, s.str().c_str()); - SetDlgItemInt(hwnd, IDC_NUM, d.dataID, true); -} - -BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - (void) lParam; - switch(uMsg) - { - case WM_INITDIALOG: - SetDlgItemText(hwndDlg, IDC_TITLE, "Default"); - return TRUE; - - case WM_CLOSE: - EndDialog(hwndDlg, 0); - return TRUE; - - case WM_COMMAND: - switch(LOWORD(wParam)) - { - /* - * TODO: Add more control ID's, when needed. - */ - case IDQUIT: - FreeLibrary(ftclient); - EndDialog(hwndDlg, 0); - return TRUE; - case IDC_START: - start(hwndDlg); -//l int ok; -// int num = GetDlgItemInt(hwndDlg, IDC_APPID, (BOOL*)&ok, false); - if(timer != 0){ - KillTimer(hwndDlg, timer); - timer = 0; - } - timer = SetTimer(hwndDlg, 0, 50, TimerProcedure); - break; - - } - } - - return FALSE; -} - - -int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) -{ - (void) hPrevInstance; - (void) lpCmdLine; - (void) nShowCmd; - hInst = hInstance; - - // The user interface is a modal dialog box - return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)DialogProc); -} - - diff --git a/contrib/very-important-source-code/ft_tester/resource.h b/contrib/very-important-source-code/ft_tester/resource.h deleted file mode 100644 index 8bba17b4..00000000 --- a/contrib/very-important-source-code/ft_tester/resource.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef IDC_STATIC -#define IDC_STATIC (-1) -#endif - -#define IDD_DIALOG1 100 -#define IDQUIT 1002 -#define IDC_YAW 1005 -#define IDC_PITCH 1023 -#define IDC_ROLL 1024 -#define IDC_X 1025 -#define IDC_Y 1026 -#define IDC_Z 1027 -#define IDC_RYAW 1028 -#define IDC_RPITCH 1029 -#define IDC_RROLL 1030 -#define IDC_RX 1031 -#define IDC_RY 1032 -#define IDC_RZ 1033 -#define IDC_NUM 1034 -#define IDC_RES 1035 -#define IDC_PT0 1036 -#define IDC_PT1 1037 -#define IDC_PT2 1038 -#define IDC_PT3 1039 -#define IDC_START 1040 -#define IDC_TITLE 1041 - diff --git a/contrib/very-important-source-code/important-stuff/NPClient.h b/contrib/very-important-source-code/important-stuff/NPClient.h deleted file mode 100644 index 770e1c71..00000000 --- a/contrib/very-important-source-code/important-stuff/NPClient.h +++ /dev/null @@ -1,17 +0,0 @@ - -extern int NP_RegisterWindowHandle (HWND hwnd); -extern int NP_UnregisterWindowHandle (void); -extern int NP_RegisterProgramProfileID (unsigned short id); -extern int NP_QueryVersion (unsigned short *version); -extern int NP_RequestData (unsigned short req); -extern int NP_GetSignature (tir_signature_t *sig); -extern int NP_GetData (tir_data_t *data); -extern int NP_GetParameter (void); -extern int NP_SetParameter (void); -extern int NP_StartCursor (void); -extern int NP_StopCursor (void); -extern int NP_ReCenter (void); -extern int NP_StartDataTransmission (void); -extern int NP_StopDataTransmission (void); - - diff --git a/contrib/very-important-source-code/important-stuff/NPClient.spec b/contrib/very-important-source-code/important-stuff/NPClient.spec deleted file mode 100644 index 7fe5f1b4..00000000 --- a/contrib/very-important-source-code/important-stuff/NPClient.spec +++ /dev/null @@ -1,23 +0,0 @@ -# Generated from NPClient.dll by winedump - -1 stub NPPriv_ClientNotify -2 stub NPPriv_GetLastError -3 stub NPPriv_SetData -4 stub NPPriv_SetLastError -5 stub NPPriv_SetParameter -6 stub NPPriv_SetSignature -7 stub NPPriv_SetVersion -8 stdcall NP_GetData( ptr ) NPCLIENT_NP_GetData -9 stdcall NP_GetParameter( long long) NPCLIENT_NP_GetParameter -10 stdcall NP_GetSignature( ptr ) NPCLIENT_NP_GetSignature -11 stdcall NP_QueryVersion( ptr ) NPCLIENT_NP_QueryVersion -12 stdcall NP_ReCenter() NPCLIENT_NP_ReCenter -13 stdcall NP_RegisterProgramProfileID( long ) NPCLIENT_NP_RegisterProgramProfileID -14 stdcall NP_RegisterWindowHandle( ptr ) NPCLIENT_NP_RegisterWindowHandle -15 stdcall NP_RequestData( long ) NPCLIENT_NP_RequestData -16 stdcall NP_SetParameter( long long ) NPCLIENT_NP_SetParameter -17 stdcall NP_StartCursor() NPCLIENT_NP_StartCursor -18 stdcall NP_StartDataTransmission() NPCLIENT_NP_StartDataTransmission -19 stdcall NP_StopCursor() NPCLIENT_NP_StopCursor -20 stdcall NP_StopDataTransmission() NPCLIENT_NP_StopDataTransmission -21 stdcall NP_UnregisterWindowHandle() NPCLIENT_NP_UnregisterWindowHandle diff --git a/contrib/very-important-source-code/important-stuff/NPClient_dll.h b/contrib/very-important-source-code/important-stuff/NPClient_dll.h deleted file mode 100644 index b0bab5db..00000000 --- a/contrib/very-important-source-code/important-stuff/NPClient_dll.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * NPClient.dll - * - * Generated from NPClient.dll by winedump. - * - * DO NOT SEND GENERATED DLLS FOR INCLUSION INTO WINE ! - * - */ -#ifndef __WINE_NPCLIENT_DLL_H -#define __WINE_NPCLIENT_DLL_H - -#include "windef.h" -#include "wine/debug.h" -#include "winbase.h" -#include "winnt.h" - -#pragma pack(1) -typedef struct tir_data{ - short status; - short frame; - unsigned int cksum; - float roll, pitch, yaw; - float tx, ty, tz; - float padding[9]; -} tir_data_t; - -typedef struct tir_signature{ - char DllSignature[200]; - char AppSignature[200]; -} tir_signature_t; -#pragma pack(0) - - -/* __stdcall NPCLIENT_NPPriv_ClientNotify(); */ -/* __stdcall NPCLIENT_NPPriv_GetLastError(); */ -/* __stdcall NPCLIENT_NPPriv_SetData(); */ -/* __stdcall NPCLIENT_NPPriv_SetLastError(); */ -/* __stdcall NPCLIENT_NPPriv_SetParameter(); */ -/* __stdcall NPCLIENT_NPPriv_SetSignature(); */ -/* __stdcall NPCLIENT_NPPriv_SetVersion(); */ -int __stdcall NPCLIENT_NP_GetData(tir_data_t * data); -int __stdcall NPCLIENT_NP_GetParameter(int arg0, int arg1); -int __stdcall NPCLIENT_NP_GetSignature(tir_signature_t * sig); -int __stdcall NPCLIENT_NP_QueryVersion(unsigned short * version); -int __stdcall NPCLIENT_NP_ReCenter(void); -int __stdcall NPCLIENT_NP_RegisterProgramProfileID(unsigned short id); -int __stdcall NPCLIENT_NP_RegisterWindowHandle(HWND hwnd); -int __stdcall NPCLIENT_NP_RequestData(unsigned short req); -int __stdcall NPCLIENT_NP_SetParameter(int arg0, int arg1); -int __stdcall NPCLIENT_NP_StartCursor(void); -int __stdcall NPCLIENT_NP_StartDataTransmission(void); -int __stdcall NPCLIENT_NP_StopCursor(void); -int __stdcall NPCLIENT_NP_StopDataTransmission(void); -int __stdcall NPCLIENT_NP_UnregisterWindowHandle(void); - - - -#endif /* __WINE_NPCLIENT_DLL_H */ diff --git a/contrib/very-important-source-code/important-stuff/NPClient_main.c b/contrib/very-important-source-code/important-stuff/NPClient_main.c deleted file mode 100644 index f892f89e..00000000 --- a/contrib/very-important-source-code/important-stuff/NPClient_main.c +++ /dev/null @@ -1,444 +0,0 @@ -/* - * NPClient.dll - * - * Generated from NPClient.dll by winedump. - * - * DO NOT SUBMIT GENERATED DLLS FOR INCLUSION INTO WINE! - * - */ - -#include <linuxtrack.h> -#include "rest.h" -//#include "config.h" -#define __WINESRC__ - -#include <stdarg.h> -#include <string.h> -#include <stdbool.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include "windef.h" -#include "winbase.h" -#include "NPClient_dll.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(NPClient); - -bool crypted = false; -static unsigned char table[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static int dbg_flag; - -static void dbg_report(const char *msg,...) -{ - static FILE *f = NULL; - if(dbg_flag){ - if(f == NULL){ - f = fopen("NPClient.log", "w"); - } - va_list ap; - va_start(ap,msg); - vfprintf(f, msg, ap); - fflush(f); - va_end(ap); - } -} - - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); - - switch (fdwReason) - { - case DLL_WINE_PREATTACH: - return TRUE; - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - dbg_flag = getDebugFlag('w'); - dbg_report("Attach request\n"); - break; - case DLL_PROCESS_DETACH: - linuxtrack_shutdown(); - break; - } - - return TRUE; -} -/****************************************************************** - * NPPriv_ClientNotify (NPCLIENT.1) - * - * - */ -#if 0 -__stdcall NPCLIENT_NPPriv_ClientNotify() -{ - /* @stub in .spec */ -} -#endif -/****************************************************************** - * NPPriv_GetLastError (NPCLIENT.2) - * - * - */ -#if 0 -__stdcall NPCLIENT_NPPriv_GetLastError() -{ - /* @stub in .spec */ -} -#endif -/****************************************************************** - * NPPriv_SetData (NPCLIENT.3) - * - * - */ -#if 0 -__stdcall NPCLIENT_NPPriv_SetData() -{ - /* @stub in .spec */ -} -#endif -/****************************************************************** - * NPPriv_SetLastError (NPCLIENT.4) - * - * - */ -#if 0 -__stdcall NPCLIENT_NPPriv_SetLastError() -{ - /* @stub in .spec */ -} -#endif -/****************************************************************** - * NPPriv_SetParameter (NPCLIENT.5) - * - * - */ -#if 0 -__stdcall NPCLIENT_NPPriv_SetParameter() -{ - /* @stub in .spec */ -} -#endif -/****************************************************************** - * NPPriv_SetSignature (NPCLIENT.6) - * - * - */ -#if 0 -__stdcall NPCLIENT_NPPriv_SetSignature() -{ - /* @stub in .spec */ -} -#endif -/****************************************************************** - * NPPriv_SetVersion (NPCLIENT.7) - * - * - */ -#if 0 -__stdcall NPCLIENT_NPPriv_SetVersion() -{ - /* @stub in .spec */ -} -#endif - -static float limit_num(float min, float val, float max) -{ - if(val < min) return min; - if(val > max) return max; - return val; -} - -static unsigned int cksum(unsigned char buf[], unsigned int size) -{ - if((size == 0) || (buf == NULL)){ - return 0; - } - - int rounds = size >> 2; - int rem = size % 4; - - int c = size; - int a0, a2; -// printf("Orig: "); -//for(a0 = 0; a0 < (int)size; ++a0) -//{ -// printf("%02X", buf[a0]); -//} -//printf("\n"); - while(rounds != 0){ - a0 = *(short int*)buf; - a2 = *(short int*)(buf+2); - buf += 4; - c += a0; - a2 ^= (c << 5); - a2 <<= 11; - c ^= a2; - c += (c >> 11); - --rounds; - } - switch(rem){ - case 3: - a0 = *(short int*)buf; - a2 = *(signed char*)(buf+2); - c += a0; - a2 = (a2 << 2) ^ c; - c ^= (a2 << 16); - a2 = (c >> 11); - break; - case 2: - a2 = *(short int*)buf; - c += a2; - c ^= (c << 11); - a2 = (c >> 17); - break; - case 1: - a2 = *(signed char*)(buf); - c += a2; - c ^= (c << 10); - a2 = (c >> 1); - break; - default: - break; - } - if(rem != 0){ - c+=a2; - } - - c ^= (c << 3); - c += (c >> 5); - c ^= (c << 4); - c += (c >> 17); - c ^= (c << 25); - c += (c >> 6); - - return (unsigned int)c; -} - -static void enhance(unsigned char buf[], unsigned int size, - unsigned char codetable[], unsigned int table_size) -{ - unsigned int table_ptr = 0; - unsigned char var = 0x88; - unsigned char tmp; - if((size <= 0) || (table_size <= 0) || - (buf == NULL) || (codetable == NULL)){ - return; - } - do{ - tmp = buf[--size]; - buf[size] = tmp ^ codetable[table_ptr] ^ var; - var += size + tmp; - ++table_ptr; - if(table_ptr >= table_size){ - table_ptr -= table_size; - } - }while(size != 0); -} - - -/****************************************************************** - * NP_GetData (NPCLIENT.8) - * - * - */ -int __stdcall NPCLIENT_NP_GetData(tir_data_t * data) -{ - float r, p, y, tx, ty, tz; - unsigned int frame; - int res = linuxtrack_get_pose(&y, &p, &r, &tx, &ty, &tz, &frame); - memset((char *)data, 0, sizeof(tir_data_t)); - data->status = (linuxtrack_get_tracking_state() == RUNNING) ? 0 : 1; - data->frame = frame & 0xFFFF; - data->cksum = 0; - data->roll = r / 180.0 * 16383; - data->pitch = -p / 180.0 * 16383; - data->yaw = y / 180.0 * 16383; - data->tx = -limit_num(-16383.0, 15 * tx, 16383); - data->ty = limit_num(-16383.0, 15 * ty, 16383); - data->tz = limit_num(-16383.0, 15 * tz, 16383); - data->cksum = cksum((unsigned char*)data, sizeof(tir_data_t)); - //printf("Cksum: %04X\n", data->cksum); - if(crypted){ - enhance((unsigned char*)data, sizeof(tir_data_t), table, sizeof(table)); - } - return (res >= 0) ? 0: 1; -} -/****************************************************************** - * NP_GetParameter (NPCLIENT.9) - * - * - */ -int __stdcall NPCLIENT_NP_GetParameter(int arg0, int arg1) -{ - dbg_report("GetParameter request: %d %d\n", arg0, arg1); - TRACE("(void): stub\n"); - return (int) 0; -} - -/****************************************************************** - * NP_GetSignature (NPCLIENT.10) - * - * - */ -int __stdcall NPCLIENT_NP_GetSignature(tir_signature_t * sig) -{ - dbg_report("GetSignature request\n"); - if(getSomeSeriousPoetry(sig->DllSignature, sig->AppSignature)){ - printf("Signature result: OK\n"); - return 0; - }else{ - printf("Signature result: NOT OK!\n"); - return 1; - } -} -/****************************************************************** - * NP_QueryVersion (NPCLIENT.11) - * - * - */ -int __stdcall NPCLIENT_NP_QueryVersion(unsigned short * version) -{ - dbg_report("QueryVersion request\n"); - *version=0x0500; - return 0; -} -/****************************************************************** - * NP_ReCenter (NPCLIENT.12) - * - * - */ -int __stdcall NPCLIENT_NP_ReCenter(void) -{ - dbg_report("ReCenter request\n"); - linuxtrack_recenter(); - return 0; -} - -/****************************************************************** - * NP_RegisterProgramProfileID (NPCLIENT.13) - * - * - */ -int __stdcall NPCLIENT_NP_RegisterProgramProfileID(unsigned short id) -{ - dbg_report("RegisterProgramProfileID request: %d\n", id); - game_desc_t gd; - if(game_data_get_desc(id, &gd)){ - printf("Application ID: %d - %s!!!\n", id, gd.name); - if(game_data_get_desc(id, &gd)){ - crypted = gd.encrypted; - if(gd.encrypted){ - printf("Table: %02X %02X %02X %02X %02X %02X %02X %02X\n", table[0],table[1],table[2],table[3],table[4], - table[5], table[6], table[7]); - table[0] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[1] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[2] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[3] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[4] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - table[5] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - table[6] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - table[7] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - } - } - if(linuxtrack_init(gd.name) != 0){ - return 1; - } - }else{ - if(!linuxtrack_init("Default")){ - return 1; - } - } - linuxtrack_suspend(); - return 0; -} -/****************************************************************** - * NP_RegisterWindowHandle (NPCLIENT.14) - * - * - */ -int __stdcall NPCLIENT_NP_RegisterWindowHandle(HWND hwnd) -{ - dbg_report("RegisterWindowHandle request: 0x%X\n", hwnd); - TRACE("((HWND)%p): stub\n",hwnd); - return (int) 0; -} -/****************************************************************** - * NP_RequestData (NPCLIENT.15) - * - * - */ -int __stdcall NPCLIENT_NP_RequestData(unsigned short req) -{ - dbg_report("RequestData request: %d\n", req); - TRACE("((unsigned short)%d): stub\n",req); - return (int) 0; -} -/****************************************************************** - * NP_SetParameter (NPCLIENT.16) - * - * - */ -int __stdcall NPCLIENT_NP_SetParameter(int arg0, int arg1) -{ - dbg_report("SetParameter request: %d %d\n", arg0, arg1); - TRACE("(void): stub\n"); - return (int) 0; -} -/****************************************************************** - * NP_StartCursor (NPCLIENT.17) - * - * - */ -int __stdcall NPCLIENT_NP_StartCursor(void) -{ - dbg_report("StartCursor request\n"); - TRACE("(void): stub\n"); - return (int) 0; -} -/****************************************************************** - * NP_StartDataTransmission (NPCLIENT.18) - * - * - */ -int __stdcall NPCLIENT_NP_StartDataTransmission(void) -{ - dbg_report("StartDataTransmission request\n"); - linuxtrack_wakeup(); - return 0; -} -/****************************************************************** - * NP_StopCursor (NPCLIENT.19) - * - * - */ -int __stdcall NPCLIENT_NP_StopCursor(void) -{ - dbg_report("StopCursor request\n"); - TRACE("(void): stub\n"); - return (int) 0; -} -/****************************************************************** - * NP_StopDataTransmission (NPCLIENT.20) - * - * - */ -int __stdcall NPCLIENT_NP_StopDataTransmission(void) -{ - dbg_report("StopDataTransmission request\n"); - linuxtrack_suspend(); - return 0; -} -/****************************************************************** - * NP_UnregisterWindowHandle (NPCLIENT.21) - * - * - */ -int __stdcall NPCLIENT_NP_UnregisterWindowHandle(void) -{ - dbg_report("UnregisterWindowHandle request\n"); - TRACE("(void): stub\n"); - return (int) 0; -} - diff --git a/contrib/very-important-source-code/important-stuff/game_data.c b/contrib/very-important-source-code/important-stuff/game_data.c deleted file mode 100644 index 48774187..00000000 --- a/contrib/very-important-source-code/important-stuff/game_data.c +++ /dev/null @@ -1,166 +0,0 @@ -#define _GNU_SOURCE -#include <stdio.h> -#include <stdlib.h> -#include <mxml.h> -#include <stdbool.h> -#include <stdint.h> -#include <sys/stat.h> -#include <string.h> - -//First 5 bytes is MD5 hash of "NaturalPoint" -static uint8_t secret_key[] = {0x0e, 0x9a, 0x63, 0x71, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; -static uint8_t S[256] = {0}; - -static char *decoded = NULL; - -static mxml_node_t *xml = NULL; -static mxml_node_t *tree = NULL; - -static void ksa(uint8_t key[], size_t len) -{ - unsigned int i, j; - for(i = 0; i < 256; ++i){ - S[i] = i; - } - j = 0; - for(i = 0; i < 256; ++i){ - j = (j + S[i] + key[i % len]) % 256; - uint8_t tmp = S[i]; - S[i] = S[j]; - S[j] = tmp; - } -} - -static uint8_t rc4() -{ - static uint8_t i = 0; - static uint8_t j = 0; - - i += 1; - j += S[i]; - uint8_t tmp = S[i]; - S[i] = S[j]; - S[j] = tmp; - return S[(S[i] + S[j]) % 256]; -} - -static bool decrypt_file(const char *fname, bool from_update) -{ - uint32_t header[5]; - size_t datlen; - ksa(secret_key, 16); - FILE *inp; - struct stat fst; - - if((inp = fopen(fname, "rb")) == NULL){ - printf("Can't open input file '%s'", fname); - return false; - } - - if(fstat(fileno(inp), &fst) != 0){ - fclose(inp); - printf("Cannot stat file '%s'\n", fname); - return false; - } - - if(from_update){ - if(fread(&header, sizeof(uint32_t), 5, inp) != 5){ - fclose(inp); - printf("Can't read the header - file '%s' is less than 20 bytes long?\n", fname); - return false; - } - datlen = header[4]; - }else{ - datlen = fst.st_size; - } - if((decoded = (char *)malloc(datlen+1)) == NULL){ - printf("malloc failed!\n"); - return false; - } - memset(decoded, 0, datlen+1); - size_t i; - size_t len = fread(decoded, 1, datlen, inp); - (void) len; - for(i = 0; i < datlen; ++i) decoded[i] ^= rc4(); - fclose(inp); - - //inp = fopen("tmp.dump", "w"); - //fwrite(decoded, 1, datlen, inp); - //fclose(inp); - - return true; -} - -static bool game_data_init(const char *fname, bool from_update) -{ - static bool initialized = false; - if(initialized){ - return true; - } - if(!decrypt_file(fname, from_update)){ - printf("Error decrypting file!\n"); - return false; - } - xml = mxmlNewXML("1.0"); - tree = mxmlLoadString(xml, decoded, MXML_TEXT_CALLBACK); - return (tree != NULL); -} - -static void game_data_close() -{ - mxmlDelete(tree); - free(decoded); -} - -#define ltr_int_log_message(...) fprintf(stderr, __VA_ARGS__) - -static void remove_newlines(const char* str, char* out, int out_len) -{ - int i, j; - int len = strlen(str); - for (i = 0, j = 0; str[i] && j + 1 < out_len; i++) - { - if (str[i] == '\r' || str[i] == '\n') - continue; - out[j++] = str[i]; - } - if (j < out_len) - out[j] = '\0'; -} - -bool get_game_data(const char *input_fname, const char *output_fname, bool from_update) -{ - FILE *outfile = NULL; - if((outfile = (output_fname ? fopen(output_fname, "w") : stdout)) == NULL){ - ltr_int_log_message("Can't open the output file '%s'!\n", output_fname); - return false; - } - if(!game_data_init(input_fname, from_update)){ - ltr_int_log_message("Can't process the data file '%s'!\n", input_fname); - return false; - } - - mxml_node_t *game; - const char *name; - const char *id; - for(game = mxmlFindElement(tree, tree, "Game", NULL, NULL, MXML_DESCEND); - game != NULL; - game = mxmlFindElement(game, tree, "Game", NULL, NULL, MXML_DESCEND)) - { - name = mxmlElementGetAttr(game, "Name"); - id = mxmlElementGetAttr(game, "Id"); - - mxml_node_t *appid = mxmlFindElement(game, game, "ApplicationID", NULL, NULL, MXML_DESCEND); - char name_[256]; - remove_newlines(name, name_, sizeof(name_)); - if(appid == NULL) - fprintf(outfile, "%s \"%s\"\n", id, name_); - else - fprintf(outfile, "%s \"%s\" (%s)\n", id, name_, appid->child->value.text.string); - } - fclose(outfile); - game_data_close(); - return true; -} - -int main(int argc, char** argv) { return argc > 1 && get_game_data(argv[1], NULL, false); } diff --git a/contrib/very-important-source-code/important-stuff/game_data.h b/contrib/very-important-source-code/important-stuff/game_data.h deleted file mode 100644 index b71f7a15..00000000 --- a/contrib/very-important-source-code/important-stuff/game_data.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef GAME_DATA__H -#define GAME_DATA__H - -#include <stdbool.h> - -#ifdef __cplusplus -extern "C" { -#endif - -bool get_game_data(const char *input_fname, const char *output_fname, bool from_update); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/contrib/very-important-source-code/make-csv.pl b/contrib/very-important-source-code/make-csv.pl deleted file mode 100644 index 5dc265f8..00000000 --- a/contrib/very-important-source-code/make-csv.pl +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use List::Util qw'reduce'; - -use POSIX qw(locale_h); -setlocale(LC_ALL, "C"); - -sub get_games_1 -{ - my @games; - - open my $fd, "<", $ARGV[1] or die "open: $!"; - binmode $fd; - <$fd>; - - while (defined(my $line = <$fd>)) - { - $line =~ s/[\r\n]+$//s; - if ($line !~ /^(\d+)\s+"([^;"]+)"(?:\s+\(([0-9A-F]{16})\))?$/) - { - warn "Broken line"; - next; - } - next if $1 <= 0; - push @games, +{ id => $1, name => $2, key => $3 } - } - [sort { lc($a->{name}) cmp lc($b->{name}) } @games] -} - -sub get_games_2 -{ - open my $fd, "<", $ARGV[0] or die "open: $!"; - binmode $fd; - <$fd>; - my @games; - my %ids; - while (defined(my $line = <$fd>)) - { - $line =~ s/[\r\n]+$//s; - my @line = split/;/, $line; - if (@line != 8) - { - warn "Broken line"; - next; - } - my @cols = qw'no name proto since verified by id key'; - my $h = +{ map { $cols[$_] => $line[$_] } 0..$#cols }; - next if exists $ids{$h->{id}}; - $ids{$h->{id}} = undef; - next if $h->{id} <= 0; - push @games, $h; - } - [@games]; -} - -sub merge -{ - my ($new_games, $old_games) = @_; - my $no = (reduce { $a->{no} > $b->{no} ? $a : $b } +{id=>0}, @$old_games)->{no} + 1; - my %ids = map { $_->{id} => $_ } @$old_games; - binmode \*STDOUT; - for my $g (@$new_games) - { - my $id = $g->{id}; - my $no_ = $ids{$id} ? $ids{$id}->{no} : $no; - next if (exists($ids{$id}) && $ids{$id}->{verified} ne ''); - my $old = $ids{$id} || do { $no++; +{} }; - $ids{$id} = - +{ - no => $no_, - name => $g->{name}, - proto => 'FreeTrack20', - verified => '', - by => '', - id => $g->{id}, - %$old, - since => $g->{key} ? 'V170' : 'V160', - key => $g->{key} ? (sprintf "%04X", $no_) . $g->{key} . '00' : $old->{key} - }; - } - print "No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID\n"; - for (sort { $a->{no} <=> $b->{no} } values %ids) - { - my $g = {%$_}; - if (!defined $g->{key}) - { - $g->{key} = (sprintf "%04X", $g->{no}) . (join"", map { sprintf "%02X", int rand 256 } 0 .. 7) . '00'; - } - my @cols = qw'no name proto since verified by id key'; - print join";", map { $g->{$_} } @cols; - print "\n"; - } -} - -if (@ARGV != 2) -{ - warn "usage: $0 orig.csv dump.txt\n"; - exit 1; -} -else -{ - merge(get_games_1(), get_games_2()); - exit 0; -} diff --git a/contrib/very-important-source-code/tester/Makefile.am b/contrib/very-important-source-code/tester/Makefile.am deleted file mode 100644 index e025209a..00000000 --- a/contrib/very-important-source-code/tester/Makefile.am +++ /dev/null @@ -1,78 +0,0 @@ -noinst_SCRIPTS = -if WINE_PLUGIN - noinst_SCRIPTS += Tester.exe -if WINE64 - noinst_SCRIPTS += Tester64.exe -endif #WINE64 -endif #WINE_PLUGIN - -if DARWIN - LDFLAGS += -Wl,-no_arch_warnings -else - LDFLAGS += -Wl,--no-warn-search-mismatch -endif - -CC = winegcc - -CXX = wineg++ - -SUFFIXES = .o .cpp .c .rc 64.o - -.cpp.o : - $(CXX) -c $(CXXFLAGS) -m32 -o $@ $< - -.c.o : - $(CC) -c $(CFLAGS) -m32 -o $@ $< - -.cpp64.o : - $(CXX) -c $(CXXFLAGS) -o $@ $< - -.c64.o : - $(CC) -c $(CFLAGS) -o $@ $< - -.rc.o : - wrc -o $@ $(RCFLAGS) $< - -CXXFLAGS += -g -DHAVE_CONFIG_H -I../../.. -I. -I@srcdir@/../.. -I@top_builddir@ -CFLAGS += -g -I../.. -I../../.. -DHAVE_CONFIG_H -I@srcdir@/../.. -I@top_builddir@ -RCFLAGS = -I @srcdir@ -#VPATH = ../..:@srcdir@/../..:@top_builddir@:@srcdir@ -vpath %.h @srcdir@/../.. -vpath %.h @top_builddir@ -vpath %.c @srcdir@ -vpath %.c @srcdir@/../.. - - -Tester64.exe : main64.o rest64.o npifc64.o npview.o - wineg++ -g -o Tester64 -L. $(WINE64_LIBS) $(LDFLAGS) -Wall -Wextra $^ - -Tester.exe : main.o npview.o rest.o npifc.o - wineg++ -g -o Tester -L. $(WINE_LIBS) $(LDFLAGS) -m32 -Wall -Wextra $^ - -main.o : main.cpp Makefile - -main64.o : main.cpp Makefile - -npview.o : npview.rc - -rest.o : rest.c rest.h Makefile - -rest64.o : rest.c rest.h Makefile - -npifc.o : npifc.c npifc.h Makefile - -npifc64.o : CFLAGS+="-DFOR_WIN64=1" -npifc64.o : npifc.c npifc.h Makefile - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -distclean-local: distclean-local-check -.PHONY: distclean-local-check -distclean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -EXTRA_DIST = main.cpp npifc.c npifc.h resource.h rest.c rest.h - diff --git a/contrib/very-important-source-code/tester/Makefile.in b/contrib/very-important-source-code/tester/Makefile.in deleted file mode 100644 index cc49d754..00000000 --- a/contrib/very-important-source-code/tester/Makefile.in +++ /dev/null @@ -1,512 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -@WINE_PLUGIN_TRUE@am__append_1 = Tester.exe -@WINE64_TRUE@@WINE_PLUGIN_TRUE@am__append_2 = Tester64.exe -@DARWIN_TRUE@am__append_3 = -Wl,-no_arch_warnings -@DARWIN_FALSE@am__append_4 = -Wl,--no-warn-search-mismatch -subdir = src/wine_bridge/tester -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/npview.rc.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = npview.rc -CONFIG_CLEAN_VPATH_FILES = -SCRIPTS = $(noinst_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -depcomp = -am__depfiles_maybe = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BISON = @BISON@ -CC = winegcc -CFLAGS = @CFLAGS@ -g -I../.. -I../../.. -DHAVE_CONFIG_H \ - -I@srcdir@/../.. -I@top_builddir@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = wineg++ -CXXCPP = @CXXCPP@ -CXXFLAGS = @CXXFLAGS@ -g -DHAVE_CONFIG_H -I../../.. -I. \ - -I@srcdir@/../.. -I@top_builddir@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ $(am__append_3) $(am__append_4) -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIB32DIR = @LIB32DIR@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCFLAGS = @OBJCFLAGS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENCV_CFLAGS = @OPENCV_CFLAGS@ -OPENCV_LIBS = @OPENCV_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -QMAKE_PATH = @QMAKE_PATH@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WINE64_LIBS = @WINE64_LIBS@ -WINE_LIBS = @WINE_LIBS@ -XPL_CPPFLAGS = @XPL_CPPFLAGS@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -ac_ct_OBJC = @ac_ct_OBJC@ -am__leading_dot = @am__leading_dot@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -with_makensis = @with_makensis@ -with_wine64 = @with_wine64@ -noinst_SCRIPTS = $(am__append_1) $(am__append_2) -SUFFIXES = .o .cpp .c .rc 64.o -RCFLAGS = -I @srcdir@ -EXTRA_DIST = main.cpp npifc.c npifc.h resource.h rest.c rest.h -all: all-am - -.SUFFIXES: -.SUFFIXES: .o .cpp .c .rc 64.o -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/wine_bridge/tester/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/wine_bridge/tester/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -npview.rc: $(top_builddir)/config.status $(srcdir)/npview.rc.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(SCRIPTS) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-local mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-local - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distclean-local distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am - - -.cpp.o : - $(CXX) -c $(CXXFLAGS) -m32 -o $@ $< - -.c.o : - $(CC) -c $(CFLAGS) -m32 -o $@ $< - -.cpp64.o : - $(CXX) -c $(CXXFLAGS) -o $@ $< - -.c64.o : - $(CC) -c $(CFLAGS) -o $@ $< - -.rc.o : - wrc -o $@ $(RCFLAGS) $< -#VPATH = ../..:@srcdir@/../..:@top_builddir@:@srcdir@ -vpath %.h @srcdir@/../.. -vpath %.h @top_builddir@ -vpath %.c @srcdir@ -vpath %.c @srcdir@/../.. - -Tester64.exe : main64.o rest64.o npifc64.o npview.o - wineg++ -g -o Tester64 -L. $(WINE64_LIBS) $(LDFLAGS) -Wall -Wextra $^ - -Tester.exe : main.o npview.o rest.o npifc.o - wineg++ -g -o Tester -L. $(WINE_LIBS) $(LDFLAGS) -m32 -Wall -Wextra $^ - -main.o : main.cpp Makefile - -main64.o : main.cpp Makefile - -npview.o : npview.rc - -rest.o : rest.c rest.h Makefile - -rest64.o : rest.c rest.h Makefile - -npifc.o : npifc.c npifc.h Makefile - -npifc64.o : CFLAGS+="-DFOR_WIN64=1" -npifc64.o : npifc.c npifc.h Makefile - -clean-local: clean-local-check -.PHONY: clean-local-check -clean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -distclean-local: distclean-local-check -.PHONY: distclean-local-check -distclean-local-check: - rm -f *.exe* *.dll* *.sh *.o - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/contrib/very-important-source-code/tester/main.cpp b/contrib/very-important-source-code/tester/main.cpp deleted file mode 100644 index 95ca0d9b..00000000 --- a/contrib/very-important-source-code/tester/main.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#define WIN32_LEAN_AND_MEAN - -#include <windows.h> -#include <stdio.h> -#include <stdint.h> -#include "resource.h" -#include "rest.h" -#include "npifc.h" - -HINSTANCE hInst; -UINT_PTR timer = 0; - -VOID CALLBACK TimerProcedure(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) -{ - (void) uMsg; - (void) idEvent; - (void) dwTime; - tir_data_t td; - npifc_getdata(&td); - SetDlgItemInt(hwnd, IDC_PITCH, td.pitch, true); - SetDlgItemInt(hwnd, IDC_ROLL, td.roll, true); - SetDlgItemInt(hwnd, IDC_YAW, td.yaw, true); - - SetDlgItemInt(hwnd, IDC_X1, td.tx, true); - SetDlgItemInt(hwnd, IDC_Y1, td.ty, true); - SetDlgItemInt(hwnd, IDC_Z1, td.tz, true); - - SetDlgItemInt(hwnd, IDC_X2, td.padding[0], true); - SetDlgItemInt(hwnd, IDC_Y2, td.padding[1], true); - SetDlgItemInt(hwnd, IDC_Z2, td.padding[2], true); - SetDlgItemInt(hwnd, IDC_X3, td.padding[3], true); - SetDlgItemInt(hwnd, IDC_Y3, td.padding[4], true); - SetDlgItemInt(hwnd, IDC_Z3, td.padding[5], true); - SetDlgItemInt(hwnd, IDC_S, td.status, true); - SetDlgItemInt(hwnd, IDC_F, td.frame, true); -} - -BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - (void) lParam; - switch(uMsg) - { - case WM_INITDIALOG: - SetDlgItemInt(hwndDlg, IDC_APPID, 2307, true); - return TRUE; - - case WM_CLOSE: - EndDialog(hwndDlg, 0); - return TRUE; - - case WM_COMMAND: - switch(LOWORD(wParam)) - { - /* - * TODO: Add more control ID's, when needed. - */ - case IDQUIT: - npifc_close(); - EndDialog(hwndDlg, 0); - return TRUE; - case IDSTART: - int ok; - int num = GetDlgItemInt(hwndDlg, IDC_APPID, (BOOL*)&ok, false); - if(!ok){ - num = 2307; - } - game_desc_t gd; - if(timer != 0){ - KillTimer(hwndDlg, timer); - timer = 0; - } - if(game_data_get_desc(num, &gd)){ - printf("Application ID: %d - %s\n", num, gd.name); - if(npifc_init(hwndDlg, num)){ - timer = SetTimer(hwndDlg, 0, 50, TimerProcedure); - } - }else{ - printf("Unknown Application ID: %d\n", num); - } - break; - - } - } - - return FALSE; -} - - -int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) -{ - (void) hPrevInstance; - (void) lpCmdLine; - (void) nShowCmd; - hInst = hInstance; - - // The user interface is a modal dialog box - return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC)DialogProc); -} - - diff --git a/contrib/very-important-source-code/tester/npifc.c b/contrib/very-important-source-code/tester/npifc.c deleted file mode 100644 index b036464e..00000000 --- a/contrib/very-important-source-code/tester/npifc.c +++ /dev/null @@ -1,302 +0,0 @@ -#define _GNU_SOURCE -#include <stdio.h> -#include <stdint.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#include "npifc.h" -#include "rest.h" - - -tir_signature_t ts; -HMODULE npclient; -/* -typedef int (*NP_RegisterWindowHandle_t)(HWND hwnd); -typedef int (*NP_UnregisterWindowHandle_t)(void); -typedef int (*NP_RegisterProgramProfileID_t)(unsigned short id); -typedef int (*NP_QueryVersion_t)(unsigned short *version); -typedef int (*NP_RequestData_t)(unsigned short req); -typedef int (*NP_GetSignature_t)(tir_signature_t *sig); -typedef int (*NP_GetData_t)(tir_data_t *data); -typedef int (*NP_GetParameter_t)(void); -typedef int (*NP_SetParameter_t)(void); -typedef int (*NP_StartCursor_t)(void); -typedef int (*NP_StopCursor_t)(void); -typedef int (*NP_ReCenter_t)(void); -typedef int (*NP_StartDataTransmission_t)(void); -typedef int (*NP_StopDataTransmission_t)(void); -*/ -NP_RegisterWindowHandle_t NP_RegisterWindowHandle = NULL; -NP_UnregisterWindowHandle_t NP_UnregisterWindowHandle = NULL; -NP_RegisterProgramProfileID_t NP_RegisterProgramProfileID = NULL; -NP_QueryVersion_t NP_QueryVersion = NULL; -NP_RequestData_t NP_RequestData = NULL; -NP_GetSignature_t NP_GetSignature = NULL; -NP_GetData_t NP_GetData = NULL; -NP_GetParameter_t NP_GetParameter = NULL; -NP_SetParameter_t NP_SetParameter = NULL; -NP_StartCursor_t NP_StartCursor = NULL; -NP_StopCursor_t NP_StopCursor = NULL; -NP_ReCenter_t NP_ReCenter = NULL; -NP_StartDataTransmission_t NP_StartDataTransmission = NULL; -NP_StopDataTransmission_t NP_StopDataTransmission = NULL; - -bool crypted = false; - - - -unsigned char table[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -char *client_path() -{ - HKEY hkey = 0; - RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\NaturalPoint\\NATURALPOINT\\NPClient Location", 0, - KEY_QUERY_VALUE, &hkey); - if(!hkey){ - printf("Can't open registry key\n"); - return NULL; - } - - BYTE path[1024]; - DWORD buf_len = 1024; - LONG result = RegQueryValueEx(hkey, "Path", NULL, NULL, path, &buf_len); - char *full_path = NULL; - int res = -1; - if(result == ERROR_SUCCESS && buf_len > 0){ -#ifdef FOR_WIN64 - res = asprintf(&full_path, "%s/NPClient64.dll", path); -#else - res = asprintf(&full_path, "%s/NPClient.dll", path); -#endif - } - RegCloseKey(hkey); - if(res > 0){ - return full_path; - }else{ - return NULL; - } -} - -bool initialized = false; - -bool npifc_init(HWND wnd, int id) -{ - //table[] = {0xb3, 0x16, 0x36, 0xeb, 0xb9, 0x05, 0x4f, 0xa4}; - game_desc_t gd; - if(game_data_get_desc(id, &gd)){ - crypted = gd.encrypted; - if(gd.encrypted){ - table[0] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[1] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[2] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[3] = (unsigned char)(gd.key1&0xff); gd.key1 >>= 8; - table[4] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - table[5] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - table[6] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - table[7] = (unsigned char)(gd.key2&0xff); gd.key2 >>= 8; - } - } - printf("0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", - table[0], table[1], table[2], table[3], - table[4], table[5], table[6], table[7]); - - char *client = client_path(); - if(client == NULL){ - printf("Couldn't obtain client path!\n"); - return false; - } - npclient = LoadLibrary(client); - if(!npclient){ - printf("Can't load client %s\n", client); - return false; - } - - NP_RegisterWindowHandle = (NP_RegisterWindowHandle_t)GetProcAddress(npclient, "NP_RegisterWindowHandle"); - NP_UnregisterWindowHandle = (NP_UnregisterWindowHandle_t)GetProcAddress(npclient, "NP_UnregisterWindowHandle"); - NP_RegisterProgramProfileID = (NP_RegisterProgramProfileID_t)GetProcAddress(npclient, "NP_RegisterProgramProfileID"); - NP_QueryVersion = (NP_QueryVersion_t)GetProcAddress(npclient, "NP_QueryVersion"); - NP_RequestData = (NP_RequestData_t)GetProcAddress(npclient, "NP_RequestData"); - NP_GetSignature = (NP_GetSignature_t)GetProcAddress(npclient, "NP_GetSignature"); - NP_GetData = (NP_GetData_t)GetProcAddress(npclient, "NP_GetData"); - NP_GetParameter = (NP_GetParameter_t)GetProcAddress(npclient, "NP_GetParameter"); - NP_SetParameter = (NP_SetParameter_t)GetProcAddress(npclient, "NP_SetParameter"); - NP_StartCursor = (NP_StartCursor_t)GetProcAddress(npclient, "NP_StartCursor"); - NP_StopCursor = (NP_StopCursor_t)GetProcAddress(npclient, "NP_StopCursor"); - NP_ReCenter = (NP_ReCenter_t)GetProcAddress(npclient, "NP_ReCenter"); - NP_StartDataTransmission = (NP_StartDataTransmission_t)GetProcAddress(npclient, "NP_StartDataTransmission"); - NP_StopDataTransmission = (NP_StopDataTransmission_t)GetProcAddress(npclient, "NP_StopDataTransmission"); - if((NP_RegisterWindowHandle == NULL) || (NP_UnregisterWindowHandle == NULL) - || (NP_RegisterProgramProfileID == NULL) || (NP_QueryVersion == NULL) || (NP_RequestData == NULL) - || (NP_GetSignature == NULL) || (NP_GetData == NULL) || (NP_GetParameter == NULL) - || (NP_SetParameter == NULL) || (NP_StartCursor == NULL) || (NP_StopCursor == NULL) - || (NP_ReCenter == NULL) || (NP_StartDataTransmission == NULL) || (NP_StopDataTransmission == NULL)){ - printf("Couldn't bind all necessary functions!\n"); - return false; - } - tir_signature_t sig; - int res; - if((res = NP_GetSignature(&sig)) != 0){ - printf("Error retrieving signature! %d\n", res); - return false; - } - printf("Dll Sig:%s\nApp Sig2:%s\n", sig.DllSignature, sig.AppSignature); - NP_RegisterWindowHandle(wnd); - if(NP_RegisterProgramProfileID(id) != 0){ - printf("Couldn't register profile id!\n"); - return false; - } - printf("Program profile registered!\n"); - NP_RequestData(65535); - NP_StopCursor(); - NP_StartDataTransmission(); - initialized = true; - return true; -} - -void npifc_close() -{ - if(initialized){ - NP_StopDataTransmission(); - NP_StartCursor(); - NP_UnregisterWindowHandle(); - } - initialized = false; -} - -void c_encrypt(unsigned char buf[], unsigned int size, - unsigned char code_table[], unsigned int table_size) -{ - unsigned int table_ptr = 0; - unsigned char var = 0x88; - unsigned char tmp; - if((size <= 0) || (table_size <= 0) || - (buf == NULL) || (code_table == NULL)) - return; - do{ - tmp = buf[--size]; - buf[size] = tmp ^ code_table[table_ptr] ^ var; - var += size + tmp; - ++table_ptr; - if(table_ptr >= table_size){ - table_ptr -= table_size; - } - }while(size != 0); -} - - - -void decrypt(unsigned char buf[], unsigned int size, - unsigned char code_table[], unsigned int table_size) -{ - unsigned int table_ptr = 0; - unsigned char var = 0x88; - unsigned char tmp; - if((size <= 0) || (table_size <= 0) || - (buf == NULL) || (code_table == NULL)){ - return; - } - do{ - tmp = buf[--size]; - buf[size] = tmp ^ code_table[table_ptr] ^ var; - var += size + buf[size]; - ++table_ptr; - if(table_ptr >= table_size){ - table_ptr -= table_size; - } - }while(size != 0); -} - -unsigned int cksum(unsigned char buf[], unsigned int size) -{ - if((size == 0) || (buf == NULL)){ - return 0; - } - int rounds = size >> 2; - int rem = size % 4; - - int c = size; - int a0 = 0; - int a2 = 0; - - while(rounds != 0){ - a0 = *(short int*)buf; - a2 = *(short int*)(buf+2); - buf += 4; - c += a0; - a2 ^= (c << 5); - a2 <<= 11; - c ^= a2; - c += (c >> 11); - --rounds; - } - switch(rem){ - case 3: - a0 = *(short int*)buf; - a2 = *(signed char*)(buf+2); - c += a0; - a2 = (a2 << 2) ^ c; - c ^= (a2 << 16); - a2 = (c >> 11); - break; - case 2: - a2 = *(short int*)buf; - c += a2; - c ^= (c << 11); - a2 = (c >> 17); - break; - case 1: - a2 = *(signed char*)(buf); - c += a2; - c ^= (c << 10); - a2 = (c >> 1); - break; - default: - break; - } - if(rem != 0){ - c+=a2; - } - - c ^= (c << 3); - c += (c >> 5); - c ^= (c << 4); - c += (c >> 17); - c ^= (c << 25); - c += (c >> 6); - - return (unsigned int)c; -} - -int decode_frame(tir_data_t *td) -{ - //printf("0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", - // table[0], table[1], table[2], table[3], - // table[4], table[5], table[6], table[7]); - unsigned int csum; - decrypt((unsigned char*)td, sizeof(*td), table, sizeof(table)); - csum = td->cksum; - td->cksum = 0; - if(csum != cksum((unsigned char*)td, sizeof(*td))){ - printf("Problem with frame!\n"); - //int a0; - //printf("Dec: "); - //for(a0 = 0; a0 < (int)sizeof(tir_data_t); ++a0) - //{ - // printf("%02X", ((unsigned char *)td)[a0]); - //} - //printf("\n"); - //printf("Cksum: %04X vs computed: %04X\n", csum, cksum((unsigned char*)td, sizeof(*td))); - return -1; - } - //printf("Frame OK!\n"); - return 0; -} - -int npifc_getdata(tir_data_t *data) -{ - int res = NP_GetData(data); - if(crypted){ - decode_frame(data); - } - return res; -} - diff --git a/contrib/very-important-source-code/tester/npifc.h b/contrib/very-important-source-code/tester/npifc.h deleted file mode 100644 index d580e16d..00000000 --- a/contrib/very-important-source-code/tester/npifc.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef NPIFC__H -#define NPIFC__H - - -#include <stdbool.h> - -#ifdef __cplusplus -extern "C" { -#endif - bool npifc_init(HWND wnd, int id); - void npifc_close(); - -#pragma pack(1) -typedef struct tir_data{ - short status; - short frame; - unsigned int cksum; - float roll, pitch, yaw; - float tx, ty, tz; - float padding[9]; -} tir_data_t; - -typedef struct tir_signature{ - char DllSignature[200]; - char AppSignature[200]; -} tir_signature_t; -#pragma pack(0) - -int npifc_getdata(tir_data_t *data); - -typedef int __stdcall (*NP_RegisterWindowHandle_t)(HWND hwnd); -typedef int __stdcall (*NP_UnregisterWindowHandle_t)(void); -typedef int __stdcall (*NP_RegisterProgramProfileID_t)(unsigned short id); -typedef int __stdcall (*NP_QueryVersion_t)(unsigned short *version); -typedef int __stdcall (*NP_RequestData_t)(unsigned short req); -typedef int __stdcall (*NP_GetSignature_t)(tir_signature_t *sig); -typedef int __stdcall (*NP_GetData_t)(tir_data_t *data); -typedef int __stdcall (*NP_GetParameter_t)(void); -typedef int __stdcall (*NP_SetParameter_t)(void); -typedef int __stdcall (*NP_StartCursor_t)(void); -typedef int __stdcall (*NP_StopCursor_t)(void); -typedef int __stdcall (*NP_ReCenter_t)(void); -typedef int __stdcall (*NP_StartDataTransmission_t)(void); -typedef int __stdcall (*NP_StopDataTransmission_t)(void); - -extern NP_RegisterWindowHandle_t NP_RegisterWindowHandle; -extern NP_UnregisterWindowHandle_t NP_UnregisterWindowHandle; -extern NP_RegisterProgramProfileID_t NP_RegisterProgramProfileID; -extern NP_QueryVersion_t NP_QueryVersion; -extern NP_RequestData_t NP_RequestData; -extern NP_GetSignature_t NP_GetSignature; -extern NP_GetData_t NP_GetData; -extern NP_GetParameter_t NP_GetParameter; -extern NP_SetParameter_t NP_SetParameter; -extern NP_StartCursor_t NP_StartCursor; -extern NP_StopCursor_t NP_StopCursor; -extern NP_ReCenter_t NP_ReCenter; -extern NP_StartDataTransmission_t NP_StartDataTransmission; -extern NP_StopDataTransmission_t NP_StopDataTransmission; - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/contrib/very-important-source-code/tester/npview.rc.in b/contrib/very-important-source-code/tester/npview.rc.in deleted file mode 100644 index 231002f1..00000000 --- a/contrib/very-important-source-code/tester/npview.rc.in +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by ResEdit 1.5.9
-// Copyright (C) 2006-2011
-// http://www.resedit.net
-
-#include <windows.h>
-#include <commctrl.h>
-#include <richedit.h>
-#include "resource.h"
-
-#ifdef HAVE_CONFIG_H
- #include "../../../config.h"
-#endif
-
-
-
-//
-// Dialog resources
-//
-//LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-IDD_DIALOG1 DIALOGEX 0, 0, 379, 124
-STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
-CAPTION "NPTest v@PACKAGE_VERSION@"
-FONT 8, "Ms Shell Dlg", 400, 0, 1
-{
- DEFPUSHBUTTON "Quit", IDQUIT, 262, 102, 50, 14
- DEFPUSHBUTTON "Start", IDSTART, 7, 102, 50, 14
- EDITTEXT IDC_PITCH, 32, 32, 51, 14, ES_AUTOHSCROLL
- LTEXT "Pitch", IDC_STATIC, 11, 34, 20, 8, SS_LEFT
- LTEXT "Yaw", IDC_STATIC, 11, 59, 20, 8, SS_LEFT
- EDITTEXT IDC_YAW, 32, 57, 51, 14, ES_AUTOHSCROLL
- LTEXT "Roll", IDC_STATIC, 11, 84, 20, 8, SS_LEFT
- EDITTEXT IDC_ROLL, 32, 82, 51, 14, ES_AUTOHSCROLL
- LTEXT "X", IDC_STATIC, 101, 35, 6, 8, SS_LEFT
- EDITTEXT IDC_X1, 112, 32, 51, 14, ES_AUTOHSCROLL
- LTEXT "Y", IDC_STATIC, 101, 60, 6, 8, SS_LEFT
- EDITTEXT IDC_Y1, 112, 57, 51, 14, ES_AUTOHSCROLL
- LTEXT "Z", IDC_STATIC, 101, 85, 6, 8, SS_LEFT
- EDITTEXT IDC_Z1, 112, 82, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_X2, 172, 32, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_Y2, 172, 57, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_Z2, 172, 82, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_X3, 232, 32, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_Y3, 232, 57, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_Z3, 232, 82, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_S, 292, 32, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_F, 292, 57, 51, 14, ES_AUTOHSCROLL
- EDITTEXT IDC_APPID, 32, 12, 51, 12, ES_AUTOHSCROLL
- LTEXT "ID", IDC_STATIC, 17, 14, 8, 8, SS_LEFT
-}
diff --git a/contrib/very-important-source-code/tester/resource.h b/contrib/very-important-source-code/tester/resource.h deleted file mode 100644 index 328d9cb7..00000000 --- a/contrib/very-important-source-code/tester/resource.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef IDC_STATIC -#define IDC_STATIC (-1) -#endif - -#define IDD_DIALOG1 100 -#define IDQUIT 1002 -#define IDSTART 1003 -#define IDC_APPID 1016 -#define IDC_PITCH 1017 -#define IDC_YAW 1018 -#define IDC_ROLL 1019 -#define IDC_X1 1020 -#define IDC_X2 1021 -#define IDC_X3 1022 -#define IDC_Y1 1023 -#define IDC_Y2 1024 -#define IDC_Y3 1025 -#define IDC_Z1 1026 -#define IDC_Z2 1027 -#define IDC_Z3 1028 -#define IDC_S 1029 -#define IDC_F 1030 - |
