summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/CommandProcessor.h
AgeCommit message (Collapse)Author
2025-06-24VideoCommon: remove unused struct fieldsTillmann Karras
2025-05-05VideoCommon: reset some CP registers during PI_FIFO_RESETTillmann Karras
This fixes the shutdown error in SpongeBob Globs of Doom.
2025-02-08VideoCommon: drop CP MMIO registers that were probably added in the wrong placeTillmann Karras
I think someone confused these with the actual token and bounding box registers in PE, which were added later. In CP they never did anything and it's suspicious that they have the same addresses as their PE counterparts. On real hardware they always read as zero.
2024-01-31Migrate SConfig::bWii to System.Admiral H. Curtiss
2023-12-20VideoCommon/CommandProcessor: Pass system instance through constructorLioncache
Makes the use of the interface a little less noisy, especially given how much of the interface depends on an instance being present.
2023-04-05VideoCommon/CommandProcessor: Pass System to HandleUnknownOpcode().Admiral H. Curtiss
2022-12-10VideoCommon/Fifo: Refactor to class, move to Core::System.Admiral H. Curtiss
2022-11-29VideoCommon/CommandProcessor: Refactor to class, move to Core::System.Admiral H. Curtiss
2022-02-12CommandProcessor: Remove redundant GATHER_PIPE_SIZE constantPokechu22
2021-12-18Refactor OpcodeDecoding and FIFO analyzer to use callbacksPokechu22
2021-11-02VideoCommon: Fix a -Wclass-memaccess in gcc 11Emmanuel Gil Peyrot
2021-10-13Fix all uninitialized variable warnings (C26495)Pokechu22
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-05-15Remove all remaining volatile qualifiersJosJuice
2021-05-13Remove Atomic.hJosJuice
The STL has everything we need nowadays. I have tried to not alter any behavior or semantics with this change wherever possible. In particular, WriteLow and WriteHigh in CommandProcessor retain the ability to accidentally undo another thread's write to the upper half or lower half respectively. If that should be fixed, it should be done in a separate commit for clarity. One thing did change: The places where we were using += on a volatile variable (not an atomic operation) are now using fetch_add (actually an atomic operation). Tested with single core and dual core on x86-64 and AArch64.
2019-05-31VideoCommon: Constrain the array_base registersbooto
The array_base registers as part of CP state do not seem to incorporate the upper bits in the physical address they try to access.
2017-11-13Call Do for every member of SCPFifoStruct individuallyJosJuice
We need this because VS currently doesn't consider std::is_trivially_copyable<typename std::remove_volatile<SCPFifoStruct>::type>::value to be true and because no compiler should consider it to be true if we replace the volatiles with atomics.
2017-09-02CommandProcessor: Remove unnecessary includeLioncash
Gets rid of some indirect inclusion.
2017-01-27CommandProcessor: Limit scope of ugly SCPFifoStruct.degasus
It's only used as an interface between two classes. So no need to declare it in the backend export header.
2017-01-05specify custom brace style to fix unionsBhaaL
BreakBeforeBraces: Allman apparently includes all styles, except for AfterUnion (which is false) when using clang-format -dump-config
2016-12-24CommandProcessor: Remove unimplemented prototypesLioncash
2016-06-26VideoBackends: Merge Initialize and Shutdown functions.degasus
2016-06-26CoreTiming: Drop ProcessFifoWaitEvents.degasus
globalTimer is only written in Advance, so this function has no function.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-01-17VideoCommon: Header cleanupLioncash
Also remedies places where the video backends and core rely on things being indirectly included.
2015-09-24CommandProcessor: Remove unused externLioncash
2015-06-08Fifo: Rewrite SyncGpudegasus
The new implementation has 3 options: SyncGpuMaxDistance SyncGpuMinDistance SyncGpuOverclock The MaxDistance controlls how many CPU cycles the CPU is allowed to be in front of the GPU. Too low values will slow down extremly, too high values are as unsynchronized and half of the games will crash. The -MinDistance (negative) set how many cycles the GPU is allowed to be in front of the CPU. As we are used to emulate an infinitiv fast GPU, this may be set to any high (negative) number. The last parameter is to hack a faster (>1.0) or slower(<1.0) GPU. As we don't emulate GPU timing very well (eg skip the timings of the pixel stage completely), an overclock factor of ~0.5 is often much more accurate than 1.0
2015-05-30Fifo: Extract syncing loopdegasus
It's now a new helper function within common.
2015-05-27CommandProcessor: Replace volatile usages with atomicsLioncash
Also remove said variables from being globals.
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras
2015-04-06Fifo: only sleep once within every ms of emulated timedegasus
2015-04-06Fifo: rewrite sync on idle skipping hackdegasus
Now it's done without a busy loop
2014-09-28Add the 'desynced GPU thread' mode.comex
It's a relatively big commit (less big with -w), but it's hard to test any of this separately... The basic problem is that in netplay or movies, the state of the CPU must be deterministic, including when the game receives notification that the GPU has processed FIFO data. Dual core mode notifies the game whenever the GPU thread actually gets around to doing the work, so it isn't deterministic. Single core mode is because it notifies the game 'instantly' (after processing the data synchronously), but it's too slow for many systems and games. My old dc-netplay branch worked as follows: everything worked as normal except the state of the CP registers was a lie, and the CPU thread only delivered results when idle detection triggered (waiting for the GPU if they weren't ready at that point). Usually, a game is idle iff all the work for the frame has been done, except for a small amount of work depending on the GPU result, so neither the CPU or the GPU waiting on the other affected performance much. However, it's possible that the game could be waiting for some earlier interrupt, and any of several games which, for whatever reason, never went into a detectable idle (even when I tried to improve the detection) would never receive results at all. (The current method should have better compatibility, but it also has slightly higher overhead and breaks some other things, so I want to reimplement this, hopefully with less impact on the code, in the future.) With this commit, the basic idea is that the CPU thread acts as if the work has been done instantly, like single core mode, but actually hands it off asynchronously to the GPU thread (after backing up some data that the game might change in memory before it's actually done). Since the work isn't done, any feedback from the GPU to the CPU, such as real XFB/EFB copies (virtual are OK), EFB pokes, performance queries, etc. is broken; but most games work with these options disabled, and there is no need to try to detect what the CPU thread is doing. Technically: when the flag g_use_deterministic_gpu_thread (currently stuck on) is on, the CPU thread calls RunGpu like in single core mode. This function synchronously copies the data from the FIFO to the internal video buffer and updates the CP registers, interrupts, etc. However, instead of the regular ReadDataFromFifo followed by running the opcode decoder, it runs ReadDataFromFifoOnCPU -> OpcodeDecoder_Preprocess, which relatively quickly scans through the FIFO data, detects SetFinish calls etc., which are immediately fired, and saves certain associated data from memory (e.g. display lists) in AuxBuffers (a parallel stream to the main FIFO, which is a bit slow at the moment), before handing the data off to the GPU thread to actually render. That makes up the bulk of this commit. In various circumstances, including the aforementioned EFB pokes and performance queries as well as swap requests (i.e. the end of a frame - we don't want the CPU potentially pumping out frames too quickly and the GPU falling behind*), SyncGPU is called to wait for actual completion. The overhead mainly comes from OpcodeDecoder_Preprocess (which is, again, synchronous), as well as the actual copying. Currently, display lists and such are escrowed from main memory even though they usually won't change over the course of a frame, and textures are not even though they might, resulting in a small chance of graphical glitches. When the texture locking (i.e. fault on write) code lands, I can make this all correct and maybe a little faster. * This suggests an alternate determinism method of just delaying results until a short time before the end of each frame. For all I know this might mostly work - I haven't tried it - but if any significant work hinges on the competion of render to texture etc., the frame will be missed.
2014-09-08Include CommonTypes.h instead of Common.h.Rohit Nirmal
2014-09-04PixelEngine: Remove unused AllowIdleSkipping and all references to itJasper St. Pierre
2014-08-26Refactor SetCpStatus into two functions for from-GPU and from-CPU mode ↵comex
rather than a boolean parameter. This shouldn't affect functionality. I'm not sure if the breakpoint distinction is actually necessary (my commit messages from the old dc-netplay last year claim that breakpoints are broken anyway, but I don't remember why), but I don't actually need to change this part of the code (yet), so I'll stick with the trimmings change for now.
2014-06-01Video backends: remove dead code.magumagu
2014-02-18Convert all includes to relative paths.Lioncash
2014-02-16Remove the old MMIO access "interface".Pierre Bourdon
2014-02-16MMIO: Port the VideoCommon CP MMIOs to the new interface (and provide ↵Pierre Bourdon
framework for other video related mappings).
2014-02-10Replace all include guard ifdefs with "#pragma once"lioncash
2014-02-09Clean up some struct indentationsLioncash
Also cleaned up the indentations of some variable declarations.
2014-02-09Cleanup enum indentations.Lioncash
2013-12-31Remove unnecessary Src/ foldersJasper St. Pierre