76 Commits

Author SHA1 Message Date
Léo Lam
72e3f1ecec Remove unnecessary ConfigManager includes
Making changes to ConfigManager.h has always been a pain, because
it means rebuilding half of Dolphin, since a lot of files depend on
and include this header.

However, it turns out some includes are unnecessary. This commit
removes ConfigManager includes from files which don't contain
SConfig or GPUDeterminismMode or GPU_DETERMINISM (which means the
ConfigManager include is not used).

(I've also had to get rid of some indirect includes.)
2016-11-27 22:38:38 +01:00
Léo Lam
39fd6dcd5b Fix missing includes
Aren't indirect includes great?
2016-10-07 23:46:41 +02:00
magumagu
d557310371 Support for dynamic BAT modification (dynamic-bat).
Fundamentally, all this does is enforce the invariant that we always
translate effective addresses based on the current BAT registers and
page table before we do anything else with them.

This change can be logically divided into three parts.  The first part is
creating a table to represent the current BAT state, and keeping it up to
date (PowerPC::IBATUpdated, PowerPC::DBATUpdated, etc.).  This does
nothing by itself, but it's necessary for the other parts.

The second part (mostly in MMU.cpp) is simply removing all the hardcoded
checks for specific untranslated addresses, and consistently translating
addresses using the current BAT configuration. Very straightforward, but a
lot of code changes because we hardcoded assumptions all over the place.

The third part (mostly in Memmap.cpp) is making the fastmem arena reflect
the current BAT configuration.  We do this by redoing the mapping (calling
memmap()) based on the BAT table whenever it changes.

One additional minor change is that translation can fail in two ways:
either the segment is a direct store segment, or page table lookup failed.
The difference doesn't usually matter, but the difference affects cache
instructions, like dcbz.
2016-09-06 08:43:22 +02:00
Lioncash
8b5e94a102 FifoPlayer: const correctness 2016-08-01 18:33:46 -04:00
Rohit Nirmal
bb52aad546 Fix building with PCH disabled. 2016-07-12 12:43:03 -05:00
JosJuice
f3e459091b Merge pull request #3874 from dolphin-emu/revert-3873-argh
Revert "Undo the addition of a translatable string during the string freeze"
2016-07-05 12:07:53 +02:00
Matthew Parlane
7ad74832e6 Revert "Undo the addition of a translatable string during the string freeze" 2016-07-05 21:44:38 +12:00
Lioncash
9bfafed5b8 FifoPlayer: Get rid of semicolons on namespace braces 2016-07-01 04:36:05 -04:00
Lioncash
06ccfef1c1 FifoPlayer: Get rid of unnecessary includes 2016-07-01 04:25:40 -04:00
Lioncash
396ae89e5c FifoDataFile: Convert FifoFrameInfo's fifoData member into a vector 2016-06-29 02:54:49 -04:00
Lioncash
437b1294bb FifoDataFile: Convert MemoryUpdate data member to std::vector 2016-06-29 02:29:34 -04:00
Lioncash
8943d23a4c FifoDataFile: Make Load return a unique_ptr 2016-06-28 21:23:55 -04:00
Lioncash
1dee75a68e FifoRecorder: Use lock_guard instead of explicit lock/unlock 2016-06-27 04:15:16 -04:00
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
JosJuice
e5ffc91265 Undo the addition of a translatable string during the string freeze 2016-05-30 22:41:08 +02:00
EmptyChaos
c1922783f8 Core: Threadsafety Synchronization Fixes (Frame Advance / FifoPlayer)
Fix Frame Advance and FifoPlayer pause/unpause/stop.

CPU::EnableStepping is not atomic but is called from multiple threads
which races and leaves the system in a random state; also instruction
stepping was unstable, m_StepEvent had an almost random value because
of the dual purpose it served which could cause races where CPU::Run
would SingleStep when it was supposed to be sleeping.

FifoPlayer never FinishStateMove()d which was causing it to deadlock.
Rather than partially reimplementing CPU::Run, just use CPUCoreBase
and then call CPU::Run(). More DRY and less likely to have weird bugs
specific to the player (i.e the previous freezing on pause/stop).

Refactor PowerPC::state into CPU since it manages the state of the
CPU Thread which is controlled by CPU, not PowerPC. This simplifies
the architecture somewhat and eliminates races that can be caused by
calling PowerPC state functions directly instead of using CPU's
(because they bypassed the EnableStepping lock).
2016-05-13 09:23:44 +10:00
JosJuice
2db2672810 Always clear memory when booting
Reading uninitalized memory is non-deterministic. We used to only
clear the memory when using EmulatedBS2_GC or FifoPlayer, but we
now do it during Memory::Init instead so it always gets done.
2016-04-01 21:35:26 +02:00
degasus
a4a2928905 FifoPlayer: Sleep while high watermark is set. 2016-01-27 07:23:17 +01:00
degasus
159d83c5a9 FifoPlayer: Use more enums. 2016-01-26 19:19:21 +01:00
Lioncash
f45e1bff37 VideoInterface: Change a global into a translation-unit local variable 2016-01-21 00:39:24 -05:00
Lioncash
f2038b9e90 HW: Remove unnecessary header inclusions 2016-01-13 02:47:32 -05:00
Scott Mansell
790a836736 FifoAnalyzer: Fix a few warnings that visual studio missed. 2015-12-28 20:20:30 +13:00
Scott Mansell
02f476cd09 FifoRecorder: Fix bug with normal vertex arrays.
Detected by the previous commit. We had forgotten to make sure the
Vertex Loader's table of normal sizes is initilzied, resulting in
the wrong offsets/sizes being used for vertices with normals.
2015-11-23 23:02:42 +13:00
Scott Mansell
3a36bfbcbb FifoAnalyzer: Double check command size while recording.
Since we now return the value, might as well check it's correct.
2015-11-23 23:02:41 +13:00
Scott Mansell
17b7102b35 FifoAnalyzer: Remove layer of indirection. 2015-11-23 23:02:40 +13:00
Scott Mansell
9872f5b518 FifoAnalyzer: Remove old code that was meant to handle EFB copies
It wasn't working, I'm not really sure why.
Since #2997 we rely on video common to mark efb copies 'written'
during recording, and for old dffs we just ignore the bad texture
while playing back in the texture cache.
2015-11-23 23:02:39 +13:00
Scott Mansell
0367c3107d FifoAnalyzer: Unify DecodeOp/DecodeCommand
We actually discovered a bug while combining the two functions with
FifoRecordAnalzyer's vertex array loading code. If per-vertex
postion or texture matrices were enabled and vertex arrays in use
then the wrong data would be used to calculate the minimum/maxmium
indices, which would result in either too much or too little vertex
data being included in the dff.

So this commit also increments the dff version number, so we can
identify old broken dffs later.
2015-11-23 23:02:38 +13:00
Scott Mansell
1656b2788d FifoAnalyzer: Convert FifoPlaybackAnalyzer to namespace 2015-11-23 23:02:38 +13:00
Scott Mansell
da7fb568de FifoAnalyzer: Convert FifoRecordAnalyzer to namespace.
And a few minor cleanups.
2015-11-23 23:02:37 +13:00
Scott Mansell
9b60fd2381 FifoAnalyzer: remove un-implemented header 2015-11-23 23:02:35 +13:00
Scott Mansell
e6274284b0 Fifoplayer: Load the Correct version number. 2015-11-08 01:24:08 +13:00
Scott Mansell
008386fc7f Just a minor cleanup. Totally not the cause of random FifoCi failures.
This 'absolutely not' a read of uninitialized memory is '100% not'
the cause of our non-deterministic behavior on the Intel NUC.

If there was a such an error, it would show up on all FifoCi
backends equally. This is 'probably' unrelated to the fact that
the Intel NUC is the only fifoci runner not running under virtualization.
2015-11-04 23:23:35 +13:00
Lioncash
695ffefef7 FifoAnalyzer: Replace loop with std::accumulate 2015-10-19 10:29:00 -04:00
Pierre Bourdon
a2b3cdc393 FifoDataFile: Revert PadFile changes from 4.0-1127.
Fixes #9006.
2015-10-04 13:53:01 +02:00
Lioncash
19ac565e0d Common: Move asserts to their own header 2015-09-26 18:51:27 -04:00
Tillmann Karras
aba083dd3a FifoPlayer: remove leftover code 2015-09-24 05:09:41 +02:00
Scott Mansell
aa1fec6fc3 FifoPlayer: Fixup style of types. 2015-09-23 00:03:43 +12:00
Scott Mansell
a355d9868e FifoRecorder: Use Video Common to record efb2ram correctly.
Texture updates have been moved into TextureCache, while
TMEM updates where moved into bpmem. Code for handling
efb2ram updates was added to TextureCache.

There was a bug for preloaded RGBA8 textures, it only copied
half the texture. The TODO was wrong too.
2015-09-22 23:59:16 +12:00
Scott Mansell
ac467d9fb9 FifoPlayer: Don't check efb copy hashes when plaing back a broken dff 2015-09-07 05:20:25 +12:00
Lioncash
633be0387d General: Remove unimplemented function prototypes 2015-09-05 22:01:07 -04:00
booto
f6e4a8e680 FifoPlayer: Use VI derived timing, not hardcoded 60Hz 2015-09-01 20:24:42 +08:00
degasus
c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
Rohit Nirmal
c59bfd2b7f Fix building with PCH disabled. 2015-05-26 22:44:51 -05:00
Tillmann Karras
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Lioncash
56df9b7508 GPFifo: Remove unused parameters from Write[x] functions 2015-04-21 23:01:25 -04:00
Lioncash
b0613bb1c8 General: Apply the const specifier where applicable 2015-04-15 02:04:03 -04:00
magumagu
ac54c6a4e2 Make address translation respect the CPU translation mode.
The PowerPC CPU has bits in MSR (DR and IR) which control whether
addresses are translated. We should respect these instead of mixing
physical addresses and translated addresses into the same address space.

This is mostly mass-renaming calls to memory accesses APIs from places
which expect address translation to use a different version from those
which do not expect address translation.

This does very little on its own, but it's the first step to a correct BAT
implementation.
2015-02-11 13:56:22 -08:00
Tillmann Karras
873902b4a3 VertexLoader: remove non-JIT SSE code 2015-01-20 01:51:07 +01:00
skidau
d02eb3ca59 Merge pull request #1640 from rohit-n/switch-default
Silence some -Wswitch-default warnings.
2014-12-13 19:47:06 +11:00