Commit Graph

10509 Commits

Author SHA1 Message Date
Tillmann Karras ee21cbe2d1 Add phire's more accurate DoubleToSingle version
This method doesn't involve messing around with the quirks of the x87
FPU and should be reasonably fast. As a bonus, it does the correct thing
for out-of-range doubles.

However, it is also a little slower and only benefits programs that rely
on undefined behavior so it is disabled for now.
2014-02-23 04:13:47 +01:00
Scott Mansell 7062cf8657 Interpeter: Fixed ConvertToDouble to match the manual.
Also added some documntation comments.
2014-02-12 23:12:17 +01:00
Scott Mansell cf5938c4df x64Emitter: Fix the PSUBQ instruction's opcode 2014-02-12 23:12:17 +01:00
Scott Mansell 1eb8168488 x64Emitter: Add the xmm, xmm form of PSRLQ instruction. 2014-02-12 23:12:16 +01:00
Tillmann Karras 1f34ed2c25 Re-enable non-IEEE mode support 2014-02-12 23:12:16 +01:00
Tillmann Karras f6897039c7 Interpreter: fix float conversions
Can't use simple casting, otherwise we get the same problems as in Jit64.
2014-02-12 23:12:15 +01:00
Tillmann Karras db196d8c5b Jit64[IL]: fix float conversions
Floating-point is complicated...

Some background: Denormals are floats that are too close to zero to be
stored in a normalized way (their exponent would need more bits). Since
they are stored unnormalized, they are hard to work with, even in
hardware.  That's why both PowerPC and SSE can be configured to operate
in faster but non-standard-conpliant modes in which these numbers are
simply rounded ('flushed') to zero.

Internally, we do the same as the PowerPC CPU and store all floats in
double format. This means that for loading and storing singles we need a
conversion. The PowerPC CPU does this in hardware. We previously did
this using CVTSS2SD/CVTSD2SS. Unfortunately, these instructions are
considered arithmetic and therefore flush denormals to zero if non-IEEE
mode is active. This normally wouldn't be a problem since the next
arithmetic floating-point instruction would do the same anyway but as it
turns out some games actually use floating-point instructions for
copying arbitrary data.

My idea for fixing this problem was to use x87 instructions since the
x87 FPU never supported flush-to-zero and thus doesn't mangle denormals.
However, there is one more problem to deal with: SNaNs are automatically
converted to QNaNs (by setting the most-significant bit of the
fraction). I opted to fix this by manually resetting the QNaN bit of all
values with all-1s exponent.
2014-02-12 23:12:15 +01:00
Tillmann Karras c25c4a6e20 x64: add support for some x87 instructions 2014-02-12 22:45:01 +01:00
Tillmann Karras 3218f6cca8 x64: drop instructions that don't exist
These instructions don't exist in hardware although I agree that they
would be useful for our purposes ;)
2014-02-11 05:22:53 +01:00
lioncash d2038049f5 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
degasus 532cd44003 Use float to calculate the fps/vps
This will round internally, so 59.99 fps will now be shown as 60 fps.
2014-02-10 16:08:03 +01:00
degasus a51b5f7815 Drop framelimit by fps
Framelimit by fps can't be done per coretiming
2014-02-10 16:08:03 +01:00
degasus f7dc918057 Throttle by coretiming event instead of VI
VI isn't called as regular as we want to, so we have to create a new throttling event called regularly by coretiming.

Atm we throttle every 1 ms when we are too fast and skip throttling when we lack 40ms (to avoid fast boosts after slowdowns)
2014-02-10 16:08:03 +01:00
lioncash f5408c3f52 Clarify an if statement in NetPlayClient.cpp. See: https://github.com/LaurentGomila/SFML/issues/26.
This was simply an error in documentation. It actually returns an sf::Socket::Status enum value as a result.
2014-02-10 09:26:29 -05:00
Matthew Parlane 32bfcc034f Some tidy up of sprintf to StringFromFormat
Includes a small fix to SetupWiiMemory
2014-02-10 17:25:18 +13:00
Ryan Houdek 8d25e12085 Merge pull request #54 from lioncash/cleanup
Cleanup mismatching struct/enum indentations.
2014-02-09 19:26:15 -06:00
Pierre Bourdon 28b5c8be47 Merge pull request #53 from lioncash/remove-another-xchg
Remove function Xchg from SWStatistics.cpp.
2014-02-10 02:01:21 +01:00
Lioncash fc30597f7a Remove function Xchg from SWStatistics.cpp. Like the one previous, this can be replaced with std::swap 2014-02-09 19:55:44 -05:00
Lioncash ebb48d019e Clean up some struct indentations
Also cleaned up the indentations of some variable declarations.
2014-02-09 19:40:11 -05:00
Ryan Houdek 0030784cbf Merge pull request #38 from Sonicadvance1/GLExt-lessfail
Cleanup GLExtensions on how it fails.
Fixes Mesa with buffer_storage patches and no direct_state_access.
2014-02-09 17:48:34 -06:00
Lioncash 40182a48a5 Cleanup enum indentations. 2014-02-09 16:16:10 -05:00
Pierre Bourdon e59f770ccb Revert "Merge pull request #49 from Parlane/sprintf_tidy"
Change broke the build on Debian stable.

This reverts commit 28755439b3, reversing
changes made to 64e01ec763.
2014-02-09 16:14:13 +01:00
Pierre Bourdon 9da6900595 Merge pull request #12 from Armada651/osx_rumble
OS X Rumble Support
2014-02-09 16:10:07 +01:00
Jules Blok 2063eddfa3 ForceFeedback: Fixed scoping bug
Previous code relied on a destroyed variable to still be valid.
2014-02-09 17:04:05 +09:00
Jules Blok 992b91c082 ForceFeedback: Don't depend on the force_type_name index.
Instead use a for-each loop, compare GUIDs and save the name pointers.
2014-02-09 17:01:45 +09:00
Jules Blok c6d650c058 ForceFeedback: Add OSX rumble support 2014-02-09 17:01:45 +09:00
Jules Blok 02a95c139e ControllerInterface: Move DInput ForceFeedback support to a seperate class 2014-02-09 17:01:38 +09:00
Ryan Houdek 6a5cd02629 Cleanup GLExtensions on how it fails.
If there is an issue with a reported extension, disable it instead of failing out entirely.
Fixes an issue with buffer_storage that I had overlooked as well.
2014-02-08 19:50:12 -06:00
Ryan Houdek 9f91769def Improve GLExtensions compile time.
This changes from using logical and to bitwise and, which causes the compile time to drop from an absurd amount of time to around five seconds on my
crappy laptop.
2014-02-08 15:04:17 -06:00
Matthew Parlane ebff7974c3 Some tidy up of sprintf to StringFromFormat 2014-02-08 14:32:48 +13:00
Matthew Parlane 64e01ec763 Merge pull request #48 from Parlane/SetupWiiMemory_tidy
Tidy up SetupWiiMemory
2014-02-08 00:22:24 +13:00
Pierre Bourdon 4f97666bfd Merge pull request #20 from degasus/pulseaudioRewrite
Pulseaudio: rewrite the pa backend with the async api
2014-02-07 11:51:25 +01:00
Matthew Parlane 6b980cbf30 Tidy up SetupWiiMemory 2014-02-07 19:00:34 +13:00
Pierre Bourdon 70e2ed320d Revert "Merge pull request #47 from lioncash/remove-stringfromint"
Breaks Android build.

This reverts commit 12d026c544, reversing
changes made to 6d678490f5.
2014-02-07 00:26:33 +01:00
degasus ab124b96c4 Atomic Stores / Loads 2014-02-07 00:20:10 +01:00
degasus 5c646d334a Pulseaudio: rewrite the pa backend with the async api
The default async api allow us to set some latency options. The old one (simple API) was the lazy way to go for usual audio where latency doesn't matter.

This also streams audio, so it should be a bit faster then the old one.
2014-02-07 00:20:10 +01:00
Pierre Bourdon 12d026c544 Merge pull request #47 from lioncash/remove-stringfromint
Remove function StringFromInt from StringUtil.cpp/.h. C++11 has std::to_string for this now.
2014-02-07 00:19:15 +01:00
Pierre Bourdon 6d678490f5 Merge pull request #46 from Sonicadvance1/Android-removeDLCache
Remove Cache DL option from Android UI
2014-02-07 00:18:40 +01:00
Pierre Bourdon 4c6d4cc270 Merge pull request #41 from Parlane/printf_warnings
Give StringFromFormat a printf format attribute.
2014-02-07 00:18:12 +01:00
Lioncash 05742ffd48 Remove function StringFromInt from StringUtil.cpp/.h. C++11 has std::to_string for this now. 2014-02-06 18:08:31 -05:00
Ryan Houdek 3666178f85 Remove Cache DL option from Android UI
This option has been removed entirely from Dolphin, so remove the option from Android
2014-02-06 17:02:38 -06:00
Ryan Houdek 7a9f7bfa83 Fix a typo in EGL.h for setting mode.
Seems to have been a copy and paste issue where SetMode would always set to DETECT
This isn't right since mode should be set correctly by SetMode
2014-02-06 21:41:11 +00:00
Matthew Parlane 70d2592ffb Fix warnings found by StringFromFormat having printf style checking. 2014-02-07 01:38:08 +13:00
Matthew Parlane 09cc7e2ddf Give StringFromFormat a printf format attribute.
It gives StringFromFormat printf style arguments that should be type-checked against a format string.
2014-02-07 01:10:04 +13:00
Lioncash 9ac6e35b5f Add static and const qualifiers to the maps. 2014-02-06 03:23:13 -05:00
Lioncash 78356ce184 Simplified GetAreaCode() and GetHardwareModel() to simply use a map in comparisons. 2014-02-05 19:59:13 -05:00
Pierre Bourdon 9a24ba343b Merge pull request #34 from lioncash/geckocode-foreach
Change some for+iterator loops in GeckoCode.cpp and GeckoCodeConfig.cpp into foreach loops.
2014-02-05 17:07:40 +01:00
Lioncash 249b00c469 Change the modified parameter in the Clamp function to be a pointer.
Makes it easier to identify the one being modified.
2014-02-05 04:04:35 -05:00
Lioncash 6b87a0ef20 Introduce a generic clamp function to clean up some similarly duplicated code. 2014-02-04 20:43:07 -05:00
Lioncash 8039963858 Add const qualifiers to two foreach loop variables for consistency.
Also fix a vector include I happened to notice. Should be "<vector>" not "vector"
2014-02-04 19:44:02 -05:00