Commit Graph

14001 Commits

Author SHA1 Message Date
comex 7fb6628789 Merge pull request #1024 from comex/abi-cleanup
ABI cleanup
2014-09-08 01:03:36 -04:00
comex 4dc090643d Remove ABI_AlignStack/ABI_RestoreStack and the noProlog option to ABI_CallFunctionRR.
The latter being true was the only case where the former would do
anything, and it was never true.  They became obsolete with x86's
removal.
2014-09-08 01:00:10 -04:00
comex c5c0b36046 Remove the inaccurately named ABI_PushAllCalleeSavedRegsAndAdjustStack (it didn't preserve FPRs!) and replace with ABI_PushRegistersAndAdjustStack.
To avoid FPRs being pushed unnecessarily, I checked the uses: DSPEmitter
doesn't use FPRs, and VertexLoader doesn't use anything but RAX, so I
specified the register list accordingly.  The regular JIT, however, does
use FPRs, and as far as I can tell, it was incorrect not to save them in
the outer routine.  Since the dispatcher loop is only exited when
pausing or stopping, this should have no noticeable performance impact.
2014-09-08 01:00:10 -04:00
comex 2dafbfb3ef Improve code and clarify parameters to ABI_Push/PopRegistersAndAdjustStack.
- Factor common work into a helper function.
- Replace confusingly named "noProlog" with "rsp_alignment".  Now that
x86 is not supported, we can just specify it explicitly as 8 for
clarity.
- Add the option to include more frame size, which I'll need later.
- Revert a change by magumagu in March which replaced MOVAPD with MOVUPD
on account of 32-bit Windows, since it's no longer supported.  True,
apparently recent processors don't execute the former any faster if the
pointer is, in fact, aligned, but there's no point using MOVUPD for
something that's guaranteed to be aligned...

(I discovered that GenFrsqrte and GenFres were incorrectly passing false
to noProlog - they were, in fact, functions without prologs, the
original meaning of the parameter - which caused the previous change to
break.  This is now fixed.)
2014-09-08 00:58:56 -04:00
skidau 262fa1de02 Merge pull request #1026 from lioncash/str
DolphinWX: Use std::string over char arrays in MemoryView
2014-09-08 10:40:16 +10:00
Lioncash 9db370ea40 DolphinWX: Use std::string over char arrays in MemoryView 2014-09-07 20:36:02 -04:00
skidau c70f31cca9 Merge pull request #1016 from lioncash/vardecl
Common: Inline declare some loop variables in ArmEmitter
2014-09-08 10:24:38 +10:00
Lioncash 6ea82790ba Merge pull request #1020 from lioncash/gets
DolphinWX: Remove unnecessary unique_ptr get calls in InputConfigDiag
2014-09-07 02:08:53 -04:00
Lioncash e218c38721 DolphinWX: Remove unnecessary unique_ptr get calls in InputConfigDiag 2014-09-07 01:59:56 -04:00
skidau d12d4a558b Merge pull request #978 from skidau/emu-wiimote-speaker
Hooked up the emulated Wiimote speaker.
2014-09-07 15:54:21 +10:00
Lioncash a38093729e Common: Inline declare some loop variables in ArmEmitter 2014-09-07 00:26:26 -04:00
skidau 7863295555 Used a constant for the default high value. 2014-09-07 14:25:06 +10:00
skidau 8abe9622fd Route the wiimote speaker to the sound mixer (the host system's speakers). Emulated Wiimote speaker sounds will go to the host system's speakers. Real Wiimotes will continue to use their own speaker for Wiimote speaker sounds. All Wiimote speaker sound can be disabled by unchecking the "Enable Speaker Data" option.
Each emulated Wiimote can have its speaker routed from left to right via the "Speaker Pan" setting in the emulated wiimote settings dialog.  Use any value from -127 for leftmost to 127 for rightmost with 0 being the centre.

Added code in the InputConfig to use a spin control for non-boolean values.

Defaulted the setting of "Enable Speaker Data" to disabled.
2014-09-07 14:16:20 +10:00
skidau 3caab10df8 Hooked up the emulated Wiimote speaker.
The Wiimotes are positioned as follows:
Wiimote 0 = Center
Wiimote 1 = Left
Wiimote 2 = Right
Wiimote 3 = Center

The Wiimote speaker output can be disabled via the "Enable Speaker Data" checkbox in the Wiimote settings.
2014-09-07 14:16:20 +10:00
skidau b801c7f8f1 Merge pull request #1015 from zhuowei/update_debugger_menu_at_startup
Update debugger button states at startup to disable non-functional JIT menu items
2014-09-07 14:14:11 +10:00
skidau a21ad12f1e Merge pull request #1014 from RachelBryk/active-movie
Add an IsMovieActive function.
2014-09-07 14:05:59 +10:00
Rachel Bryk 5a163ec5e6 Add an IsMovieActive function.
Makes things a bit simpler, since this is a common check.
2014-09-06 23:44:25 -04:00
skidau 741c0e2d50 Merge pull request #587 from RachelBryk/recording-race
Don't allow starting recording in states that will cause a crash or othe...
2014-09-07 13:41:57 +10:00
Zhuowei Zhang e0a909c076 Update debugger button states at startup to disable non-functional JIT menu entries 2014-09-06 23:38:22 -04:00
skidau 213c9a6ba7 Merge pull request #1011 from zhuowei/remove_twi_spam
Downgrade the ERROR log printed when twi is executed in interpreter to DEBUG
2014-09-07 13:33:31 +10:00
skidau 28253f4538 Merge pull request #1013 from lioncash/string
AudioCommon: Use std::string for the filename parameter of StartLogAudio
2014-09-07 13:32:55 +10:00
Lioncash daddc3317e AudioCommon: Use std::string for the filename parameter of StartLogAudio 2014-09-06 23:26:08 -04:00
Zhuowei Zhang 2ac2cbbcf6 Downgrade the ERROR log printed when twi is executed in interpreter to DEBUG 2014-09-06 22:36:17 -04:00
shuffle2 562c0d7ad7 Merge pull request #1007 from shuffle2/reorder-warning-shush
Quiet initialization order warning in CFrame
2014-09-06 13:10:30 -07:00
Shawn Hoffman 9a9fd8752a Quiet initialization order warning in CFrame 2014-09-06 13:01:24 -07:00
shuffle2 9302218a19 Merge pull request #851 from lioncash/logg
Common: Kill off duplicate log warning definitions
2014-09-06 12:35:19 -07:00
Ryan Houdek 01b90c1007 Fix ArmEmitter's asserts from failing to compile.
Changed them all from debug asserts to regular asserts, since they shouldn't only be run at debug time.
2014-09-06 15:11:39 -04:00
Lioncash 690ed8580c Common: Kill off duplicate log warning definitions
Also embed the log checks rather than using macros
2014-09-06 15:11:29 -04:00
shuffle2 85fd8c2bec Merge pull request #983 from lioncash/lol-str
Common: Fix a potential infinite loop in ReplaceAll
2014-09-06 12:00:23 -07:00
shuffle2 227b79bf84 Merge pull request #1004 from comex/warning-fixes-2
Two trivial warning fixes
2014-09-06 11:56:32 -07:00
shuffle2 1b23432d34 Merge pull request #990 from rohit-n/fix-formatting
Fix formatting
2014-09-06 11:54:17 -07:00
shuffle2 218adb5515 Merge pull request #1003 from lioncash/wii-save-import
DolphinWX: Fix Wii save importing
2014-09-06 11:52:33 -07:00
shuffle2 d0d6f70980 Merge pull request #996 from RachelBryk/clear-mc-bongos
Clear movie variables that might have been set from a previous run.
2014-09-06 11:46:21 -07:00
shuffle2 f2237ecd64 Merge pull request #985 from skidau/dsp-loop-hle
Moved the loop check back to a post-loop condition in DSP HLE AX ucode.
2014-09-06 11:44:27 -07:00
shuffle2 87b6c8d991 Merge pull request #988 from shuffle2/hide-menubar
Fix render to main crashing in fullscreen.
2014-09-06 11:43:50 -07:00
comex e8aa1fe052 Merge pull request #1005 from comex/revert-993
Revert "Merge pull request #993 from phire/fix_getOpInfo"
2014-09-06 14:02:40 -04:00
comex 30e577fda7 Revert "Merge pull request #993 from phire/fix_getOpInfo"
This reverts commit a8f724e7c2, reversing
changes made to 7a1eca149f.

For why I'm reverting this entirely, see pull request 997.
2014-09-06 13:46:17 -04:00
comex 48ef6fcad1 Fix signed/unsigned warning in GeckoCode.cpp.
No actual bug here.
2014-09-06 13:34:00 -04:00
comex 917c6d324a Remove unused functions in TextureDecoder. 2014-09-06 13:32:54 -04:00
comex 6c382f6627 Merge pull request #926 from comex/ppcstate-reg
PowerPCState register (and rationalize register usage, and add some registers to replace it)
2014-09-06 13:24:38 -04:00
comex 6fd0333c14 Symbolicize explicit uses of x86 registers where possible (GPRs only for now).
Uses are split into three categories:

- Arbitrary (except for size savings) - constants like RSCRATCH are
used.

- ABI (i.e. RAX as return value) - ABI_RETURN is used.

- Fixed by architecture (RCX shifts, RDX/RAX for some instructions) -
explicit register is kept.

In theory this allows the assignments to be modified easily.  I verified
that I was able to run Melee with all the registers changed, although
there may be issues if RSCRATCH[2] and ABI_PARAM{1,2} conflict.
2014-09-06 13:18:31 -04:00
comex 100a7ac97b Actually add RCX, plus RDI and RSI on Unix.
And switch to a register order that consistently prefers callee-save to
caller-save.  phire suggested putting rdi/rsi first, even though they're
caller-save, to save code space; this is more conservative and I can do
that later.
2014-09-06 13:16:21 -04:00
comex 8dea26762d Rationalize temporary register usage.
Rather than using a variety of registers including RSI, ABI_PARAM1
(either RCX or RDI), RCX, and RDX, the rule is:

- RDI and RSI are never used.  This allows them to be allocated on Unix,
bringing parity with Windows.

- RDX is a permanent temporary register along with RAX (and is thus not
FlushLocked).  It's used frequently enough that allocating it would
probably be a bad idea, as it would constantly get flushed.

- RCX is allocatable, but is flushed in two situations:
    - Non-immediate shifts (rlwnm), because x86 requires RCX to be used.
    - Paired single loads and stores, because they require three
    temporary registers: the helper functions take two integer
    arguments, and another register is used as an index to get the
    function address.
These should be relatively rare.

While we're at it, in stores, use the registers directly where possible
rather than always using temporaries (by making SafeWriteRegToReg
clobber less).  The address doesn't need to be clobbered in the usual
case, and on CPUs with MOVBE, neither does the value.

Oh, and get rid of a useless MEMCHECK.

This commit does not actually add new registers to the allocation order;
it is intended to test for any performance or correctness issues
separately.
2014-09-06 13:16:20 -04:00
comex 67cdb6e07a Factor code from ABI_CallFunctionRR and GetWriteTrampoline into a helper, and fix a special case.
The special case is where the registers are actually to be swapped (i.e.
func(ABI_PARAM2, ABI_PARAM1); this was previously impossible but would
be ugly not to handle anyway.
2014-09-06 13:16:20 -04:00
comex 487eb967eb Fix a bug with update loads in memcheck mode.
In two cases, my old code was using a temporary register but not saving
it properly; it basically worked by accident (an otherwise useless
FlushLock was causing CallerSavedRegistersInUse to think it was in use
by the GPR cache, even though it was actually a temporary).

I'm going to modify this in the next commit to use RDX, but I didn't
want to leave a broken revision in the middle.
2014-09-06 13:16:20 -04:00
comex 48891c6359 Reserve a register for ppcState.
The register is RBP, previously in the GPR allocation order.  The next
commit will investigate whether there are too few GPRs (now or before),
but for now there is no replacement.

Previously, it was accessed RIP relatively; using RBP, anything in the
first 0x100 bytes of ppcState (including all the GPRs) can be accessed
with three fewer bytes.  Code to access ppcState is generated constantly
(mostly by register save/load), so in principle, this should improve
instruction cache footprint significantly.  It seems that this makes a
significant performance difference in practice.

The vast majority of this commit is mechanically replacing
M(&PowerPC::ppcState.x) with a new macro PPCSTATE(x).

Version 2: gets most of the cases which were using the register access
macros.
2014-09-06 13:16:18 -04:00
Lioncash 5b837a11e4 DolphinWX: Fix Wii save importing
Calls to reserve don't resize the array to accomodate the given data size.
These vectors should be initialized with the size directly.
2014-09-06 12:44:11 -04:00
Pierre Bourdon d75bb614e7 Merge pull request #998 from waddlesplash/wx-fixup
Migrate PNGs from DolphinWX to the Data/Resources directory.
2014-09-06 18:07:20 +02:00
Pierre Bourdon 06bdc49957 Merge pull request #999 from lioncash/copy-assign
AudioCommon: Make WaveFileWriter inherit NonCopyable
2014-09-06 17:52:11 +02:00
Pierre Bourdon 2333532aab Merge pull request #1000 from lioncash/preproc
Common: Remove HAVE_CXX11_SYNTAX define from Common.h
2014-09-06 17:50:15 +02:00