Commit Graph

53 Commits

Author SHA1 Message Date
da0927fe8f FifoPlayer: Actually exit on 'Stop' in dualcore
Quit the fifoplayer cpu idle loop if a shutdown has been requested
2018-08-09 01:08:21 -04:00
4288bfe0f9 Common: Move host communication enum to Host.h
Given this is actually a part of the Host interface, this should be
placed with it.

While we're at it, turn it into an enum class so that we don't dump its
contained values into the surrounding scope. We can also make
Host_Message take the enum type itself directly instead of taking a
general int value.

After this, it'll be trivial to divide out the rest of Common.h and
remove the header from the repository entirely
2018-05-28 14:34:59 -04:00
b9aad3310e PowerPC: Move MMU-specifics from PowerPC.h to MMU.h
PowerPC.h at this point is pretty much a general glob of stuff, and it's
unfortunate, since it means pulling in a lot of unrelated header
dependencies and a bunch of other things that don't need to be seen by
things that just want to read memory.

Breaking this out into its own header keeps all the MMU-related stuff
together and also limits the amount of header dependencies being
included (the primary motivation for this being the former reason).
2018-05-17 19:18:55 -04:00
0043b77ccd Gekko: Make UReg_MSR's single-argument constructor explicit
Prevents implicit construction of MSR instances from integral values.
This is beneficial, considering MSR values have an intended
representation while a regular magic value doesn't. So make these
conversions required to be explicit.
2018-05-05 17:59:45 -04:00
397b3fb976 CPUCoreBase: Make the GetName() member function const qualified
This function should have no need to modify internal class state.
2018-03-24 16:17:39 -04:00
50a476c371 Assert: Uppercase assertion macros
Macros should be all upper-cased. This is also kind of a wart that's
been sticking out for quite a while now (we avoid prefixing
underscores).
2018-03-14 22:03:12 -04:00
aac1b386b9 FifoPlayer: Implement IsPlaying() 2017-11-19 21:49:29 +01:00
5a372020ea FifoPlayer: Generate fake VideoInterface updates 2017-11-17 22:11:29 -06:00
dd4203bec8 Core: Remove unnecessary includes
Also moves a cpp file's related header file to the top of the inclusions if it isn't already there.
2017-06-15 18:52:22 -04:00
8d98ac6509 CPU: Convert state enum to an enum class
Gets enum constants out of the immediate namespace. Also makes it
strongly typed like the other state enums.
2017-03-28 11:48:28 -04:00
eda27ee397 FifoPlayer: In-class initialize member variables where applicable 2017-03-21 15:40:56 -04:00
18792b2328 FifoPlayer: Don't set BPMEM_PRELOAD_MODE on load
Since in this case we're setting it based on the state at record start
time, not when a register is loaded, UseMemory would not be called, so
this could potentially wipe out texture memory that was valid.
2017-01-03 21:16:05 +10:00
5f3c878ba2 FifoPlayer: Save/restore texture memory state for fifo logs 2017-01-03 21:16:05 +10:00
5b315b7bb4 FifoPlayer: Reload initial state when looping back to first frame
This should ensure that when playing with loop enabled, the first frame is
in the same state each time. There is potentially still issues when the
start frame is set to something other than zero, but I'm not sure how we
could work around this without capturing the entire state on each frame.
2017-01-03 17:32:45 +10:00
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
8b5e94a102 FifoPlayer: const correctness 2016-08-01 18:33:46 -04:00
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
7ad74832e6 Revert "Undo the addition of a translatable string during the string freeze" 2016-07-05 21:44:38 +12:00
06ccfef1c1 FifoPlayer: Get rid of unnecessary includes 2016-07-01 04:25:40 -04:00
396ae89e5c FifoDataFile: Convert FifoFrameInfo's fifoData member into a vector 2016-06-29 02:54:49 -04:00
437b1294bb FifoDataFile: Convert MemoryUpdate data member to std::vector 2016-06-29 02:29:34 -04:00
8943d23a4c FifoDataFile: Make Load return a unique_ptr 2016-06-28 21:23:55 -04:00
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
e5ffc91265 Undo the addition of a translatable string during the string freeze 2016-05-30 22:41:08 +02:00
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
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
a4a2928905 FifoPlayer: Sleep while high watermark is set. 2016-01-27 07:23:17 +01:00
159d83c5a9 FifoPlayer: Use more enums. 2016-01-26 19:19:21 +01:00
f45e1bff37 VideoInterface: Change a global into a translation-unit local variable 2016-01-21 00:39:24 -05:00
1656b2788d FifoAnalyzer: Convert FifoPlaybackAnalyzer to namespace 2015-11-23 23:02:38 +13:00
19ac565e0d Common: Move asserts to their own header 2015-09-26 18:51:27 -04:00
aa1fec6fc3 FifoPlayer: Fixup style of types. 2015-09-23 00:03:43 +12:00
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
ac467d9fb9 FifoPlayer: Don't check efb copy hashes when plaing back a broken dff 2015-09-07 05:20:25 +12:00
f6e4a8e680 FifoPlayer: Use VI derived timing, not hardcoded 60Hz 2015-09-01 20:24:42 +08:00
c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
c59bfd2b7f Fix building with PCH disabled. 2015-05-26 22:44:51 -05:00
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
56df9b7508 GPFifo: Remove unused parameters from Write[x] functions 2015-04-21 23:01:25 -04:00
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
b030d29067 Silence some -Wswitch-default warnings. 2014-12-11 22:23:05 -06:00
fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
043ea31f14 msvc: resolve all warnings in Core.
Note: vs14 will support empty macro parameter as used by MMIO.
2014-08-19 22:33:46 -07:00
b0b70381f7 Revert "Don't add segfault handler in interpreter mode" 2014-07-07 05:30:06 +02:00
20a16beabd enum CPUState: rename CPU_* to STATE_* 2014-07-05 11:01:49 +02:00
a40ae6883a Move CoreTiming::downcount to PowerPC::ppcState.
This isn't technically the correct place to have the downcount variable, but it is similar to what PPSSPP does to gain a bit of extra speed on ARM.
We access this variable quite a bit, with each exit in a block it is subtracted from.
On ARM this required four instructions to load and store the value, while now it only requires two.

This gives an average of 1FPS gain to most games.
Examples:
Crazy Taxi: 54FPS -> 55FPS
Luigi's Mansion: 20FPS -> 21FPS
Wind Waker(Save Screen): 27FPS -> 28FPS

This seems to average a 6mhz to 16mhz CPU core emulation improvement in the few games I've tested.
2014-06-26 01:48:00 +00:00
73a3a6726d Add the algorithm header to a few FifoPlayer cpp files.
Both of them use std::min and std::max, but this header wasn't included.
2014-03-29 10:42:28 -04:00
d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00