2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2021-12-10 02:22:16 +00:00
|
|
|
#include "VideoCommon/CommandProcessor.h"
|
|
|
|
|
2015-05-27 07:08:48 +00:00
|
|
|
#include <atomic>
|
2016-01-17 21:54:31 +00:00
|
|
|
#include <cstring>
|
2021-04-23 03:57:56 +00:00
|
|
|
#include <fmt/format.h>
|
2015-05-27 07:08:48 +00:00
|
|
|
|
2016-01-17 21:54:31 +00:00
|
|
|
#include "Common/Assert.h"
|
2014-02-19 01:27:20 +00:00
|
|
|
#include "Common/ChunkFile.h"
|
2014-09-08 01:06:58 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2016-08-05 14:04:39 +00:00
|
|
|
#include "Common/Flag.h"
|
2016-01-17 21:54:31 +00:00
|
|
|
#include "Common/Logging/Log.h"
|
2023-02-19 15:30:06 +00:00
|
|
|
#include "Common/MsgHandler.h"
|
2014-02-18 11:18:47 +00:00
|
|
|
#include "Core/CoreTiming.h"
|
|
|
|
#include "Core/HW/GPFifo.h"
|
|
|
|
#include "Core/HW/MMIO.h"
|
|
|
|
#include "Core/HW/ProcessorInterface.h"
|
2022-02-13 01:44:07 +00:00
|
|
|
#include "Core/PowerPC/PowerPC.h"
|
2022-01-07 02:50:18 +00:00
|
|
|
#include "Core/System.h"
|
2014-02-18 11:18:47 +00:00
|
|
|
#include "VideoCommon/Fifo.h"
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-10-10 21:19:39 +00:00
|
|
|
namespace CommandProcessor
|
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
static bool IsOnThread(const Core::System& system)
|
2011-02-08 10:37:47 +00:00
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
return system.IsDualCoreMode();
|
2011-02-08 10:37:47 +00:00
|
|
|
}
|
|
|
|
|
2022-11-06 16:54:58 +00:00
|
|
|
static void UpdateInterrupts_Wrapper(Core::System& system, u64 userdata, s64 cyclesLate)
|
2011-02-08 10:37:47 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
system.GetCommandProcessor().UpdateInterrupts(userdata);
|
2011-02-08 10:37:47 +00:00
|
|
|
}
|
|
|
|
|
2021-05-17 19:55:03 +00:00
|
|
|
void SCPFifoStruct::Init()
|
|
|
|
{
|
|
|
|
CPBase = 0;
|
|
|
|
CPEnd = 0;
|
|
|
|
CPHiWatermark = 0;
|
|
|
|
CPLoWatermark = 0;
|
|
|
|
CPReadWriteDistance = 0;
|
|
|
|
CPWritePointer = 0;
|
|
|
|
CPReadPointer = 0;
|
|
|
|
CPBreakpoint = 0;
|
|
|
|
SafeCPReadPointer = 0;
|
|
|
|
|
|
|
|
bFF_GPLinkEnable = 0;
|
|
|
|
bFF_GPReadEnable = 0;
|
|
|
|
bFF_BPEnable = 0;
|
|
|
|
bFF_BPInt = 0;
|
|
|
|
|
|
|
|
bFF_Breakpoint.store(0, std::memory_order_relaxed);
|
|
|
|
bFF_HiWatermark.store(0, std::memory_order_relaxed);
|
|
|
|
bFF_HiWatermarkInt.store(0, std::memory_order_relaxed);
|
|
|
|
bFF_LoWatermark.store(0, std::memory_order_relaxed);
|
|
|
|
bFF_LoWatermarkInt.store(0, std::memory_order_relaxed);
|
|
|
|
}
|
|
|
|
|
2017-11-12 16:20:59 +00:00
|
|
|
void SCPFifoStruct::DoState(PointerWrap& p)
|
|
|
|
{
|
|
|
|
p.Do(CPBase);
|
|
|
|
p.Do(CPEnd);
|
|
|
|
p.Do(CPHiWatermark);
|
|
|
|
p.Do(CPLoWatermark);
|
|
|
|
p.Do(CPReadWriteDistance);
|
|
|
|
p.Do(CPWritePointer);
|
|
|
|
p.Do(CPReadPointer);
|
|
|
|
p.Do(CPBreakpoint);
|
|
|
|
p.Do(SafeCPReadPointer);
|
|
|
|
|
|
|
|
p.Do(bFF_GPLinkEnable);
|
|
|
|
p.Do(bFF_GPReadEnable);
|
|
|
|
p.Do(bFF_BPEnable);
|
|
|
|
p.Do(bFF_BPInt);
|
|
|
|
p.Do(bFF_Breakpoint);
|
|
|
|
|
|
|
|
p.Do(bFF_LoWatermarkInt);
|
|
|
|
p.Do(bFF_HiWatermarkInt);
|
|
|
|
|
|
|
|
p.Do(bFF_LoWatermark);
|
|
|
|
p.Do(bFF_HiWatermark);
|
|
|
|
}
|
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
void CommandProcessorManager::DoState(PointerWrap& p)
|
2009-10-10 21:19:39 +00:00
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
p.Do(m_cp_status_reg);
|
|
|
|
p.Do(m_cp_ctrl_reg);
|
|
|
|
p.Do(m_cp_clear_reg);
|
|
|
|
p.Do(m_bbox_left);
|
|
|
|
p.Do(m_bbox_top);
|
|
|
|
p.Do(m_bbox_right);
|
|
|
|
p.Do(m_bbox_bottom);
|
|
|
|
p.Do(m_token_reg);
|
|
|
|
m_fifo.DoState(p);
|
|
|
|
|
|
|
|
p.Do(m_interrupt_set);
|
|
|
|
p.Do(m_interrupt_waiting);
|
2009-10-10 21:19:39 +00:00
|
|
|
}
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2021-05-13 16:44:59 +00:00
|
|
|
static inline void WriteHigh(std::atomic<u32>& reg, u16 highbits)
|
2014-08-25 19:09:26 +00:00
|
|
|
{
|
2021-05-13 16:44:59 +00:00
|
|
|
reg.store((reg.load(std::memory_order_relaxed) & 0x0000FFFF) | (static_cast<u32>(highbits) << 16),
|
|
|
|
std::memory_order_relaxed);
|
2014-08-25 19:09:26 +00:00
|
|
|
}
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
CommandProcessorManager::CommandProcessorManager(Core::System& system) : m_system{system}
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandProcessorManager::Init()
|
2009-10-10 21:19:39 +00:00
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
m_cp_status_reg.Hex = 0;
|
|
|
|
m_cp_status_reg.CommandIdle = 1;
|
|
|
|
m_cp_status_reg.ReadIdle = 1;
|
|
|
|
|
|
|
|
m_cp_ctrl_reg.Hex = 0;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
m_cp_clear_reg.Hex = 0;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
m_bbox_left = 0;
|
|
|
|
m_bbox_top = 0;
|
|
|
|
m_bbox_right = 640;
|
|
|
|
m_bbox_bottom = 480;
|
2012-01-02 10:20:22 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
m_token_reg = 0;
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
m_fifo.Init();
|
2013-10-29 05:23:17 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
m_is_fifo_error_seen = false;
|
2010-12-11 12:42:55 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
m_interrupt_set.Clear();
|
|
|
|
m_interrupt_waiting.Clear();
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
m_event_type_update_interrupts =
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetCoreTiming().RegisterEvent("CPInterrupt", UpdateInterrupts_Wrapper);
|
2009-10-10 21:19:39 +00:00
|
|
|
}
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
2009-10-10 21:19:39 +00:00
|
|
|
{
|
2018-07-12 07:08:30 +00:00
|
|
|
constexpr u16 WMASK_NONE = 0x0000;
|
|
|
|
constexpr u16 WMASK_ALL = 0xffff;
|
|
|
|
constexpr u16 WMASK_LO_ALIGN_32BIT = 0xffe0;
|
2024-01-31 01:56:56 +00:00
|
|
|
const u16 WMASK_HI_RESTRICT = GetPhysicalAddressMask(m_system.IsWii()) >> 16;
|
2018-07-12 07:08:30 +00:00
|
|
|
|
2014-02-02 13:16:43 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
u32 addr;
|
|
|
|
u16* ptr;
|
|
|
|
bool readonly;
|
2018-07-12 07:08:30 +00:00
|
|
|
// FIFO mmio regs in the range [cc000020-cc00003e] have certain bits that always read as 0
|
|
|
|
// For _LO registers in this range, only bits 0xffe0 can be set
|
|
|
|
// For _HI registers in this range, only bits 0x03ff can be set on GCN and 0x1fff on Wii
|
|
|
|
u16 wmask;
|
2014-02-02 13:16:43 +00:00
|
|
|
} directly_mapped_vars[] = {
|
2022-11-27 12:50:50 +00:00
|
|
|
{FIFO_TOKEN_REGISTER, &m_token_reg, false, WMASK_ALL},
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-02-02 13:16:43 +00:00
|
|
|
// Bounding box registers are read only.
|
2022-11-27 12:50:50 +00:00
|
|
|
{FIFO_BOUNDING_BOX_LEFT, &m_bbox_left, true, WMASK_NONE},
|
|
|
|
{FIFO_BOUNDING_BOX_RIGHT, &m_bbox_right, true, WMASK_NONE},
|
|
|
|
{FIFO_BOUNDING_BOX_TOP, &m_bbox_top, true, WMASK_NONE},
|
|
|
|
{FIFO_BOUNDING_BOX_BOTTOM, &m_bbox_bottom, true, WMASK_NONE},
|
2023-12-20 13:40:38 +00:00
|
|
|
{FIFO_BASE_LO, MMIO::Utils::LowPart(&m_fifo.CPBase), false, WMASK_LO_ALIGN_32BIT},
|
|
|
|
{FIFO_BASE_HI, MMIO::Utils::HighPart(&m_fifo.CPBase), false, WMASK_HI_RESTRICT},
|
|
|
|
{FIFO_END_LO, MMIO::Utils::LowPart(&m_fifo.CPEnd), false, WMASK_LO_ALIGN_32BIT},
|
|
|
|
{FIFO_END_HI, MMIO::Utils::HighPart(&m_fifo.CPEnd), false, WMASK_HI_RESTRICT},
|
|
|
|
{FIFO_HI_WATERMARK_LO, MMIO::Utils::LowPart(&m_fifo.CPHiWatermark), false,
|
2018-07-12 07:08:30 +00:00
|
|
|
WMASK_LO_ALIGN_32BIT},
|
2023-12-20 13:40:38 +00:00
|
|
|
{FIFO_HI_WATERMARK_HI, MMIO::Utils::HighPart(&m_fifo.CPHiWatermark), false,
|
|
|
|
WMASK_HI_RESTRICT},
|
|
|
|
{FIFO_LO_WATERMARK_LO, MMIO::Utils::LowPart(&m_fifo.CPLoWatermark), false,
|
2018-07-12 07:08:30 +00:00
|
|
|
WMASK_LO_ALIGN_32BIT},
|
2023-12-20 13:40:38 +00:00
|
|
|
{FIFO_LO_WATERMARK_HI, MMIO::Utils::HighPart(&m_fifo.CPLoWatermark), false,
|
|
|
|
WMASK_HI_RESTRICT},
|
2014-02-02 13:16:43 +00:00
|
|
|
// FIFO_RW_DISTANCE has some complex read code different for
|
|
|
|
// single/dual core.
|
2023-12-20 13:40:38 +00:00
|
|
|
{FIFO_WRITE_POINTER_LO, MMIO::Utils::LowPart(&m_fifo.CPWritePointer), false,
|
2018-07-12 07:08:30 +00:00
|
|
|
WMASK_LO_ALIGN_32BIT},
|
2023-12-20 13:40:38 +00:00
|
|
|
{FIFO_WRITE_POINTER_HI, MMIO::Utils::HighPart(&m_fifo.CPWritePointer), false,
|
2018-07-12 07:08:30 +00:00
|
|
|
WMASK_HI_RESTRICT},
|
2014-02-02 13:16:43 +00:00
|
|
|
// FIFO_READ_POINTER has different code for single/dual core.
|
2023-12-20 13:40:38 +00:00
|
|
|
{FIFO_BP_LO, MMIO::Utils::LowPart(&m_fifo.CPBreakpoint), false, WMASK_LO_ALIGN_32BIT},
|
|
|
|
{FIFO_BP_HI, MMIO::Utils::HighPart(&m_fifo.CPBreakpoint), false, WMASK_HI_RESTRICT},
|
2014-02-02 13:16:43 +00:00
|
|
|
};
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-02-02 13:16:43 +00:00
|
|
|
for (auto& mapped_var : directly_mapped_vars)
|
2009-10-10 21:19:39 +00:00
|
|
|
{
|
2014-02-02 13:16:43 +00:00
|
|
|
mmio->Register(base | mapped_var.addr, MMIO::DirectRead<u16>(mapped_var.ptr),
|
|
|
|
mapped_var.readonly ? MMIO::InvalidWrite<u16>() :
|
2018-07-12 07:08:30 +00:00
|
|
|
MMIO::DirectWrite<u16>(mapped_var.ptr, mapped_var.wmask));
|
2009-10-10 21:19:39 +00:00
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-02-02 13:16:43 +00:00
|
|
|
// Timing and metrics MMIOs are stubbed with fixed values.
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
u32 addr;
|
|
|
|
u16 value;
|
|
|
|
} metrics_mmios[] = {
|
|
|
|
{XF_RASBUSY_L, 0},
|
|
|
|
{XF_RASBUSY_H, 0},
|
|
|
|
{XF_CLKS_L, 0},
|
|
|
|
{XF_CLKS_H, 0},
|
|
|
|
{XF_WAIT_IN_L, 0},
|
|
|
|
{XF_WAIT_IN_H, 0},
|
|
|
|
{XF_WAIT_OUT_L, 0},
|
|
|
|
{XF_WAIT_OUT_H, 0},
|
|
|
|
{VCACHE_METRIC_CHECK_L, 0},
|
|
|
|
{VCACHE_METRIC_CHECK_H, 0},
|
|
|
|
{VCACHE_METRIC_MISS_L, 0},
|
|
|
|
{VCACHE_METRIC_MISS_H, 0},
|
|
|
|
{VCACHE_METRIC_STALL_L, 0},
|
|
|
|
{VCACHE_METRIC_STALL_H, 0},
|
|
|
|
{CLKS_PER_VTX_OUT, 4},
|
|
|
|
};
|
|
|
|
for (auto& metrics_mmio : metrics_mmios)
|
2009-10-10 21:19:39 +00:00
|
|
|
{
|
2014-02-02 13:16:43 +00:00
|
|
|
mmio->Register(base | metrics_mmio.addr, MMIO::Constant<u16>(metrics_mmio.value),
|
|
|
|
MMIO::InvalidWrite<u16>());
|
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2023-02-03 00:06:29 +00:00
|
|
|
mmio->Register(base | STATUS_REGISTER, MMIO::ComplexRead<u16>([](Core::System& system_, u32) {
|
|
|
|
auto& cp = system_.GetCommandProcessor();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-12-20 13:40:38 +00:00
|
|
|
cp.SetCpStatusRegister();
|
2022-11-27 12:50:50 +00:00
|
|
|
return cp.m_cp_status_reg.Hex;
|
2014-02-02 13:16:43 +00:00
|
|
|
}),
|
|
|
|
MMIO::InvalidWrite<u16>());
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
mmio->Register(base | CTRL_REGISTER, MMIO::DirectRead<u16>(&m_cp_ctrl_reg.Hex),
|
2023-02-03 00:06:29 +00:00
|
|
|
MMIO::ComplexWrite<u16>([](Core::System& system_, u32, u16 val) {
|
|
|
|
auto& cp = system_.GetCommandProcessor();
|
2014-02-02 13:16:43 +00:00
|
|
|
UCPCtrlReg tmp(val);
|
2022-11-27 12:50:50 +00:00
|
|
|
cp.m_cp_ctrl_reg.Hex = tmp.Hex;
|
2023-12-20 13:40:38 +00:00
|
|
|
cp.SetCpControlRegister();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().RunGpu();
|
2014-02-02 13:16:43 +00:00
|
|
|
}));
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
mmio->Register(base | CLEAR_REGISTER, MMIO::DirectRead<u16>(&m_cp_clear_reg.Hex),
|
2023-02-03 00:06:29 +00:00
|
|
|
MMIO::ComplexWrite<u16>([](Core::System& system_, u32, u16 val) {
|
|
|
|
auto& cp = system_.GetCommandProcessor();
|
2014-02-02 13:16:43 +00:00
|
|
|
UCPClearReg tmp(val);
|
2022-11-27 12:50:50 +00:00
|
|
|
cp.m_cp_clear_reg.Hex = tmp.Hex;
|
|
|
|
cp.SetCpClearRegister();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().RunGpu();
|
2014-02-02 13:16:43 +00:00
|
|
|
}));
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-02-02 13:16:43 +00:00
|
|
|
mmio->Register(base | PERF_SELECT, MMIO::InvalidRead<u16>(), MMIO::Nop<u16>());
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-02-02 13:16:43 +00:00
|
|
|
// Some MMIOs have different handlers for single core vs. dual core mode.
|
2023-12-20 13:40:38 +00:00
|
|
|
const bool is_on_thread = IsOnThread(m_system);
|
2022-11-23 20:58:18 +00:00
|
|
|
MMIO::ReadHandlingMethod<u16>* fifo_rw_distance_lo_r;
|
|
|
|
if (is_on_thread)
|
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
fifo_rw_distance_lo_r = MMIO::ComplexRead<u16>([](Core::System& system_, u32) {
|
|
|
|
const auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
|
|
|
if (fifo_.CPWritePointer.load(std::memory_order_relaxed) >=
|
|
|
|
fifo_.SafeCPReadPointer.load(std::memory_order_relaxed))
|
2022-11-23 20:58:18 +00:00
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
return static_cast<u16>(fifo_.CPWritePointer.load(std::memory_order_relaxed) -
|
|
|
|
fifo_.SafeCPReadPointer.load(std::memory_order_relaxed));
|
2022-11-23 20:58:18 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
return static_cast<u16>(fifo_.CPEnd.load(std::memory_order_relaxed) -
|
|
|
|
fifo_.SafeCPReadPointer.load(std::memory_order_relaxed) +
|
|
|
|
fifo_.CPWritePointer.load(std::memory_order_relaxed) -
|
|
|
|
fifo_.CPBase.load(std::memory_order_relaxed) + 32);
|
2022-11-23 20:58:18 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
fifo_rw_distance_lo_r =
|
|
|
|
MMIO::DirectRead<u16>(MMIO::Utils::LowPart(&m_fifo.CPReadWriteDistance));
|
2022-11-23 20:58:18 +00:00
|
|
|
}
|
|
|
|
mmio->Register(base | FIFO_RW_DISTANCE_LO, fifo_rw_distance_lo_r,
|
2023-12-20 13:40:38 +00:00
|
|
|
MMIO::DirectWrite<u16>(MMIO::Utils::LowPart(&m_fifo.CPReadWriteDistance),
|
2022-11-23 20:58:18 +00:00
|
|
|
WMASK_LO_ALIGN_32BIT));
|
|
|
|
|
|
|
|
MMIO::ReadHandlingMethod<u16>* fifo_rw_distance_hi_r;
|
|
|
|
if (is_on_thread)
|
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
fifo_rw_distance_hi_r = MMIO::ComplexRead<u16>([](Core::System& system_, u32) {
|
|
|
|
const auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-02-03 00:06:29 +00:00
|
|
|
if (fifo_.CPWritePointer.load(std::memory_order_relaxed) >=
|
|
|
|
fifo_.SafeCPReadPointer.load(std::memory_order_relaxed))
|
2022-11-23 20:58:18 +00:00
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
return (fifo_.CPWritePointer.load(std::memory_order_relaxed) -
|
|
|
|
fifo_.SafeCPReadPointer.load(std::memory_order_relaxed)) >>
|
2022-11-23 20:58:18 +00:00
|
|
|
16;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
return (fifo_.CPEnd.load(std::memory_order_relaxed) -
|
|
|
|
fifo_.SafeCPReadPointer.load(std::memory_order_relaxed) +
|
|
|
|
fifo_.CPWritePointer.load(std::memory_order_relaxed) -
|
|
|
|
fifo_.CPBase.load(std::memory_order_relaxed) + 32) >>
|
2022-11-23 20:58:18 +00:00
|
|
|
16;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
fifo_rw_distance_hi_r = MMIO::ComplexRead<u16>([](Core::System& system_, u32) {
|
|
|
|
const auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-02-03 00:06:29 +00:00
|
|
|
return fifo_.CPReadWriteDistance.load(std::memory_order_relaxed) >> 16;
|
2022-11-23 20:58:18 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
mmio->Register(base | FIFO_RW_DISTANCE_HI, fifo_rw_distance_hi_r,
|
2023-02-03 00:06:29 +00:00
|
|
|
MMIO::ComplexWrite<u16>([WMASK_HI_RESTRICT](Core::System& system_, u32, u16 val) {
|
|
|
|
auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-02-03 00:06:29 +00:00
|
|
|
WriteHigh(fifo_.CPReadWriteDistance, val & WMASK_HI_RESTRICT);
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().RunGpu();
|
2014-02-02 13:16:43 +00:00
|
|
|
}));
|
2022-11-23 20:58:18 +00:00
|
|
|
|
2018-07-12 07:08:30 +00:00
|
|
|
mmio->Register(
|
|
|
|
base | FIFO_READ_POINTER_LO,
|
2023-12-20 13:40:38 +00:00
|
|
|
is_on_thread ? MMIO::DirectRead<u16>(MMIO::Utils::LowPart(&m_fifo.SafeCPReadPointer)) :
|
|
|
|
MMIO::DirectRead<u16>(MMIO::Utils::LowPart(&m_fifo.CPReadPointer)),
|
|
|
|
MMIO::DirectWrite<u16>(MMIO::Utils::LowPart(&m_fifo.CPReadPointer), WMASK_LO_ALIGN_32BIT));
|
2022-11-23 20:58:18 +00:00
|
|
|
|
|
|
|
MMIO::ReadHandlingMethod<u16>* fifo_read_hi_r;
|
|
|
|
MMIO::WriteHandlingMethod<u16>* fifo_read_hi_w;
|
|
|
|
if (is_on_thread)
|
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
fifo_read_hi_r = MMIO::ComplexRead<u16>([](Core::System& system_, u32) {
|
|
|
|
auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-02-03 00:06:29 +00:00
|
|
|
return fifo_.SafeCPReadPointer.load(std::memory_order_relaxed) >> 16;
|
2022-11-23 20:58:18 +00:00
|
|
|
});
|
2023-02-03 00:06:29 +00:00
|
|
|
fifo_read_hi_w =
|
|
|
|
MMIO::ComplexWrite<u16>([WMASK_HI_RESTRICT](Core::System& system_, u32, u16 val) {
|
|
|
|
auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-02-03 00:06:29 +00:00
|
|
|
WriteHigh(fifo_.CPReadPointer, val & WMASK_HI_RESTRICT);
|
|
|
|
fifo_.SafeCPReadPointer.store(fifo_.CPReadPointer.load(std::memory_order_relaxed),
|
|
|
|
std::memory_order_relaxed);
|
|
|
|
});
|
2022-11-23 20:58:18 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-02-03 00:06:29 +00:00
|
|
|
fifo_read_hi_r = MMIO::ComplexRead<u16>([](Core::System& system_, u32) {
|
|
|
|
const auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-02-03 00:06:29 +00:00
|
|
|
return fifo_.CPReadPointer.load(std::memory_order_relaxed) >> 16;
|
2022-11-23 20:58:18 +00:00
|
|
|
});
|
2023-02-03 00:06:29 +00:00
|
|
|
fifo_read_hi_w =
|
|
|
|
MMIO::ComplexWrite<u16>([WMASK_HI_RESTRICT](Core::System& system_, u32, u16 val) {
|
|
|
|
auto& fifo_ = system_.GetCommandProcessor().GetFifo();
|
2023-12-19 02:31:32 +00:00
|
|
|
system_.GetFifo().SyncGPUForRegisterAccess();
|
2023-02-03 00:06:29 +00:00
|
|
|
WriteHigh(fifo_.CPReadPointer, val & WMASK_HI_RESTRICT);
|
|
|
|
});
|
2022-11-23 20:58:18 +00:00
|
|
|
}
|
|
|
|
mmio->Register(base | FIFO_READ_POINTER_HI, fifo_read_hi_r, fifo_read_hi_w);
|
2014-02-02 13:16:43 +00:00
|
|
|
}
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::GatherPipeBursted()
|
2009-10-10 21:19:39 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
SetCPStatusFromCPU();
|
2022-11-27 12:50:50 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
auto& processor_interface = m_system.GetProcessorInterface();
|
2023-01-04 01:52:40 +00:00
|
|
|
|
2009-10-10 21:19:39 +00:00
|
|
|
// if we aren't linked, we don't care about gather pipe data
|
2022-11-27 12:50:50 +00:00
|
|
|
if (!m_cp_ctrl_reg.GPLinkEnable)
|
2010-06-15 14:24:01 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
if (IsOnThread(m_system) && !m_system.GetFifo().UseDeterministicGPUThread())
|
2012-03-19 01:54:58 +00:00
|
|
|
{
|
2013-03-31 23:10:21 +00:00
|
|
|
// In multibuffer mode is not allowed write in the same FIFO attached to the GPU.
|
2012-03-19 01:54:58 +00:00
|
|
|
// Fix Pokemon XD in DC mode.
|
2023-12-20 13:40:38 +00:00
|
|
|
if ((processor_interface.m_fifo_cpu_end == m_fifo.CPEnd.load(std::memory_order_relaxed)) &&
|
|
|
|
(processor_interface.m_fifo_cpu_base == m_fifo.CPBase.load(std::memory_order_relaxed)) &&
|
|
|
|
m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) > 0)
|
2012-03-19 01:54:58 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetFifo().FlushGpu();
|
2016-06-24 08:43:46 +00:00
|
|
|
}
|
2012-03-19 01:54:58 +00:00
|
|
|
}
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetFifo().RunGpu();
|
2009-10-10 21:19:39 +00:00
|
|
|
return;
|
2010-06-15 14:24:01 +00:00
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2013-03-31 23:10:21 +00:00
|
|
|
// update the fifo pointer
|
2023-12-20 13:40:38 +00:00
|
|
|
if (m_fifo.CPWritePointer.load(std::memory_order_relaxed) ==
|
|
|
|
m_fifo.CPEnd.load(std::memory_order_relaxed))
|
2021-05-13 16:44:59 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPWritePointer.store(m_fifo.CPBase, std::memory_order_relaxed);
|
2021-05-13 16:44:59 +00:00
|
|
|
}
|
2009-10-10 21:19:39 +00:00
|
|
|
else
|
2021-05-13 16:44:59 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPWritePointer.fetch_add(GPFifo::GATHER_PIPE_SIZE, std::memory_order_relaxed);
|
2021-05-13 16:44:59 +00:00
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
if (m_cp_ctrl_reg.GPReadEnable && m_cp_ctrl_reg.GPLinkEnable)
|
2014-09-22 06:49:09 +00:00
|
|
|
{
|
2023-01-04 02:17:26 +00:00
|
|
|
processor_interface.m_fifo_cpu_write_pointer =
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPWritePointer.load(std::memory_order_relaxed);
|
|
|
|
processor_interface.m_fifo_cpu_base = m_fifo.CPBase.load(std::memory_order_relaxed);
|
|
|
|
processor_interface.m_fifo_cpu_end = m_fifo.CPEnd.load(std::memory_order_relaxed);
|
2014-09-22 06:49:09 +00:00
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-11-17 05:05:16 +00:00
|
|
|
// If the game is running close to overflowing, make the exception checking more frequent.
|
2023-12-20 13:40:38 +00:00
|
|
|
if (m_fifo.bFF_HiWatermark.load(std::memory_order_relaxed) != 0)
|
|
|
|
m_system.GetCoreTiming().ForceExceptionCheck(0);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPReadWriteDistance.fetch_add(GPFifo::GATHER_PIPE_SIZE, std::memory_order_seq_cst);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetFifo().RunGpu();
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2021-05-13 16:44:59 +00:00
|
|
|
ASSERT_MSG(COMMANDPROCESSOR,
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) <=
|
|
|
|
m_fifo.CPEnd.load(std::memory_order_relaxed) -
|
|
|
|
m_fifo.CPBase.load(std::memory_order_relaxed),
|
2018-03-15 00:34:35 +00:00
|
|
|
"FIFO is overflowed by GatherPipe !\nCPU thread is too fast!");
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2010-06-15 14:24:01 +00:00
|
|
|
// check if we are in sync
|
2021-05-13 16:44:59 +00:00
|
|
|
ASSERT_MSG(COMMANDPROCESSOR,
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPWritePointer.load(std::memory_order_relaxed) ==
|
2023-01-04 02:17:26 +00:00
|
|
|
processor_interface.m_fifo_cpu_write_pointer,
|
2018-03-15 00:34:35 +00:00
|
|
|
"FIFOs linked but out of sync");
|
2021-05-13 16:44:59 +00:00
|
|
|
ASSERT_MSG(COMMANDPROCESSOR,
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPBase.load(std::memory_order_relaxed) == processor_interface.m_fifo_cpu_base,
|
2018-03-15 00:34:35 +00:00
|
|
|
"FIFOs linked but out of sync");
|
2021-05-13 16:44:59 +00:00
|
|
|
ASSERT_MSG(COMMANDPROCESSOR,
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPEnd.load(std::memory_order_relaxed) == processor_interface.m_fifo_cpu_end,
|
2018-03-15 00:34:35 +00:00
|
|
|
"FIFOs linked but out of sync");
|
2009-10-10 21:19:39 +00:00
|
|
|
}
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::UpdateInterrupts(u64 userdata)
|
2010-12-11 12:42:55 +00:00
|
|
|
{
|
|
|
|
if (userdata)
|
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
m_interrupt_set.Set();
|
2020-11-14 03:33:26 +00:00
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "Interrupt set");
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetProcessorInterface().SetInterrupt(INT_CAUSE_CP, true);
|
2010-12-11 12:42:55 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
m_interrupt_set.Clear();
|
2020-11-14 03:33:26 +00:00
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "Interrupt cleared");
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetProcessorInterface().SetInterrupt(INT_CAUSE_CP, false);
|
2010-12-11 12:42:55 +00:00
|
|
|
}
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetCoreTiming().ForceExceptionCheck(0);
|
2022-11-27 12:50:50 +00:00
|
|
|
m_interrupt_waiting.Clear();
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetFifo().RunGpu();
|
2010-12-11 12:42:55 +00:00
|
|
|
}
|
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::UpdateInterruptsFromVideoBackend(u64 userdata)
|
2009-12-30 14:37:12 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
if (!m_system.GetFifo().UseDeterministicGPUThread())
|
2022-11-26 08:29:46 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetCoreTiming().ScheduleEvent(0, m_event_type_update_interrupts, userdata,
|
|
|
|
CoreTiming::FromThread::NON_CPU);
|
2022-11-26 08:29:46 +00:00
|
|
|
}
|
2009-12-30 14:37:12 +00:00
|
|
|
}
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
bool CommandProcessorManager::IsInterruptWaiting() const
|
2015-05-27 07:08:48 +00:00
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
return m_interrupt_waiting.IsSet();
|
2015-05-27 07:08:48 +00:00
|
|
|
}
|
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::SetCPStatusFromGPU()
|
2010-12-11 12:42:55 +00:00
|
|
|
{
|
|
|
|
// breakpoint
|
2023-12-20 13:40:38 +00:00
|
|
|
const bool breakpoint = m_fifo.bFF_Breakpoint.load(std::memory_order_relaxed);
|
|
|
|
if (m_fifo.bFF_BPEnable.load(std::memory_order_relaxed) != 0)
|
2013-02-16 01:51:09 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
if (m_fifo.CPBreakpoint.load(std::memory_order_relaxed) ==
|
|
|
|
m_fifo.CPReadPointer.load(std::memory_order_relaxed))
|
2013-02-16 01:51:09 +00:00
|
|
|
{
|
2021-05-13 17:30:30 +00:00
|
|
|
if (!breakpoint)
|
2013-02-16 01:51:09 +00:00
|
|
|
{
|
2021-05-13 16:44:59 +00:00
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "Hit breakpoint at {}",
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPReadPointer.load(std::memory_order_relaxed));
|
|
|
|
m_fifo.bFF_Breakpoint.store(1, std::memory_order_relaxed);
|
2013-02-16 01:51:09 +00:00
|
|
|
}
|
|
|
|
}
|
2010-12-11 12:42:55 +00:00
|
|
|
else
|
|
|
|
{
|
2021-05-13 17:30:30 +00:00
|
|
|
if (breakpoint)
|
2021-05-13 16:44:59 +00:00
|
|
|
{
|
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "Cleared breakpoint at {}",
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPReadPointer.load(std::memory_order_relaxed));
|
|
|
|
m_fifo.bFF_Breakpoint.store(0, std::memory_order_relaxed);
|
2021-05-13 16:44:59 +00:00
|
|
|
}
|
2010-12-11 12:42:55 +00:00
|
|
|
}
|
2013-02-16 01:51:09 +00:00
|
|
|
}
|
2014-08-24 20:27:32 +00:00
|
|
|
else
|
|
|
|
{
|
2021-05-13 17:30:30 +00:00
|
|
|
if (breakpoint)
|
2021-05-13 16:44:59 +00:00
|
|
|
{
|
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "Cleared breakpoint at {}",
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPReadPointer.load(std::memory_order_relaxed));
|
|
|
|
m_fifo.bFF_Breakpoint = false;
|
2021-05-13 16:44:59 +00:00
|
|
|
}
|
2014-08-24 20:27:32 +00:00
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2014-11-14 00:46:02 +00:00
|
|
|
// overflow & underflow check
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_HiWatermark.store(
|
|
|
|
(m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) > m_fifo.CPHiWatermark),
|
2021-05-13 17:30:30 +00:00
|
|
|
std::memory_order_relaxed);
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_LoWatermark.store(
|
|
|
|
(m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) < m_fifo.CPLoWatermark),
|
2021-05-13 17:30:30 +00:00
|
|
|
std::memory_order_relaxed);
|
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
bool bpInt = m_fifo.bFF_Breakpoint.load(std::memory_order_relaxed) &&
|
|
|
|
m_fifo.bFF_BPInt.load(std::memory_order_relaxed);
|
|
|
|
bool ovfInt = m_fifo.bFF_HiWatermark.load(std::memory_order_relaxed) &&
|
|
|
|
m_fifo.bFF_HiWatermarkInt.load(std::memory_order_relaxed);
|
|
|
|
bool undfInt = m_fifo.bFF_LoWatermark.load(std::memory_order_relaxed) &&
|
|
|
|
m_fifo.bFF_LoWatermarkInt.load(std::memory_order_relaxed);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
bool interrupt = (bpInt || ovfInt || undfInt) && m_cp_ctrl_reg.GPReadEnable;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
if (interrupt != m_interrupt_set.IsSet() && !m_interrupt_waiting.IsSet())
|
2014-11-14 00:46:02 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
const u64 userdata = interrupt ? 1 : 0;
|
|
|
|
if (IsOnThread(m_system))
|
2014-11-14 00:46:02 +00:00
|
|
|
{
|
|
|
|
if (!interrupt || bpInt || undfInt || ovfInt)
|
|
|
|
{
|
|
|
|
// Schedule the interrupt asynchronously
|
2022-11-27 12:50:50 +00:00
|
|
|
m_interrupt_waiting.Set();
|
2023-12-20 13:40:38 +00:00
|
|
|
UpdateInterruptsFromVideoBackend(userdata);
|
2014-11-14 00:46:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
UpdateInterrupts(userdata);
|
2014-11-14 00:46:02 +00:00
|
|
|
}
|
|
|
|
}
|
2014-08-24 20:27:32 +00:00
|
|
|
}
|
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::SetCPStatusFromCPU()
|
2014-08-24 20:27:32 +00:00
|
|
|
{
|
|
|
|
// overflow & underflow check
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_HiWatermark.store(
|
|
|
|
(m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) > m_fifo.CPHiWatermark),
|
2021-05-13 17:30:30 +00:00
|
|
|
std::memory_order_relaxed);
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_LoWatermark.store(
|
|
|
|
(m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) < m_fifo.CPLoWatermark),
|
2021-05-13 17:30:30 +00:00
|
|
|
std::memory_order_relaxed);
|
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
bool bpInt = m_fifo.bFF_Breakpoint.load(std::memory_order_relaxed) &&
|
|
|
|
m_fifo.bFF_BPInt.load(std::memory_order_relaxed);
|
|
|
|
bool ovfInt = m_fifo.bFF_HiWatermark.load(std::memory_order_relaxed) &&
|
|
|
|
m_fifo.bFF_HiWatermarkInt.load(std::memory_order_relaxed);
|
|
|
|
bool undfInt = m_fifo.bFF_LoWatermark.load(std::memory_order_relaxed) &&
|
|
|
|
m_fifo.bFF_LoWatermarkInt.load(std::memory_order_relaxed);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
bool interrupt = (bpInt || ovfInt || undfInt) && m_cp_ctrl_reg.GPReadEnable;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
if (interrupt != m_interrupt_set.IsSet() && !m_interrupt_waiting.IsSet())
|
2010-12-11 12:42:55 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
const u64 userdata = interrupt ? 1 : 0;
|
|
|
|
if (IsOnThread(m_system))
|
2010-12-11 12:42:55 +00:00
|
|
|
{
|
2013-03-14 06:08:26 +00:00
|
|
|
if (!interrupt || bpInt || undfInt || ovfInt)
|
2012-03-05 05:40:10 +00:00
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
m_interrupt_set.Set(interrupt);
|
2020-11-14 03:33:26 +00:00
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "Interrupt set");
|
2023-12-20 13:40:38 +00:00
|
|
|
m_system.GetProcessorInterface().SetInterrupt(INT_CAUSE_CP, interrupt);
|
2012-03-05 05:40:10 +00:00
|
|
|
}
|
2010-12-11 12:42:55 +00:00
|
|
|
}
|
|
|
|
else
|
2013-04-24 13:21:54 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
UpdateInterrupts(userdata);
|
2013-04-24 13:21:54 +00:00
|
|
|
}
|
2010-12-11 12:42:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::SetCpStatusRegister()
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
{
|
|
|
|
// Here always there is one fifo attached to the GPU
|
2023-12-20 13:40:38 +00:00
|
|
|
m_cp_status_reg.Breakpoint = m_fifo.bFF_Breakpoint.load(std::memory_order_relaxed);
|
|
|
|
m_cp_status_reg.ReadIdle = !m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) ||
|
|
|
|
(m_fifo.CPReadPointer.load(std::memory_order_relaxed) ==
|
|
|
|
m_fifo.CPWritePointer.load(std::memory_order_relaxed));
|
|
|
|
m_cp_status_reg.CommandIdle = !m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed) ||
|
|
|
|
Fifo::AtBreakpoint(m_system) ||
|
|
|
|
!m_fifo.bFF_GPReadEnable.load(std::memory_order_relaxed);
|
|
|
|
m_cp_status_reg.UnderflowLoWatermark = m_fifo.bFF_LoWatermark.load(std::memory_order_relaxed);
|
|
|
|
m_cp_status_reg.OverflowHiWatermark = m_fifo.bFF_HiWatermark.load(std::memory_order_relaxed);
|
2022-11-27 12:50:50 +00:00
|
|
|
|
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "\t Read from STATUS_REGISTER : {:04x}", m_cp_status_reg.Hex);
|
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR,
|
|
|
|
"(r) status: iBP {} | fReadIdle {} | fCmdIdle {} | iOvF {} | iUndF {}",
|
|
|
|
m_cp_status_reg.Breakpoint ? "ON" : "OFF", m_cp_status_reg.ReadIdle ? "ON" : "OFF",
|
|
|
|
m_cp_status_reg.CommandIdle ? "ON" : "OFF",
|
|
|
|
m_cp_status_reg.OverflowHiWatermark ? "ON" : "OFF",
|
|
|
|
m_cp_status_reg.UnderflowLoWatermark ? "ON" : "OFF");
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
}
|
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::SetCpControlRegister()
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_BPInt.store(m_cp_ctrl_reg.BPInt, std::memory_order_relaxed);
|
|
|
|
m_fifo.bFF_BPEnable.store(m_cp_ctrl_reg.BPEnable, std::memory_order_relaxed);
|
|
|
|
m_fifo.bFF_HiWatermarkInt.store(m_cp_ctrl_reg.FifoOverflowIntEnable, std::memory_order_relaxed);
|
|
|
|
m_fifo.bFF_LoWatermarkInt.store(m_cp_ctrl_reg.FifoUnderflowIntEnable, std::memory_order_relaxed);
|
|
|
|
m_fifo.bFF_GPLinkEnable.store(m_cp_ctrl_reg.GPLinkEnable, std::memory_order_relaxed);
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
if (m_fifo.bFF_GPReadEnable.load(std::memory_order_relaxed) && !m_cp_ctrl_reg.GPReadEnable)
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_GPReadEnable.store(m_cp_ctrl_reg.GPReadEnable, std::memory_order_relaxed);
|
|
|
|
m_system.GetFifo().FlushGpu();
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_GPReadEnable = m_cp_ctrl_reg.GPReadEnable;
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
}
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2020-11-14 03:33:26 +00:00
|
|
|
DEBUG_LOG_FMT(COMMANDPROCESSOR, "\t GPREAD {} | BP {} | Int {} | OvF {} | UndF {} | LINK {}",
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.bFF_GPReadEnable.load(std::memory_order_relaxed) ? "ON" : "OFF",
|
|
|
|
m_fifo.bFF_BPEnable.load(std::memory_order_relaxed) ? "ON" : "OFF",
|
|
|
|
m_fifo.bFF_BPInt.load(std::memory_order_relaxed) ? "ON" : "OFF",
|
2022-11-27 12:50:50 +00:00
|
|
|
m_cp_ctrl_reg.FifoOverflowIntEnable ? "ON" : "OFF",
|
|
|
|
m_cp_ctrl_reg.FifoUnderflowIntEnable ? "ON" : "OFF",
|
|
|
|
m_cp_ctrl_reg.GPLinkEnable ? "ON" : "OFF");
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
}
|
|
|
|
|
2014-06-01 08:56:09 +00:00
|
|
|
// NOTE: We intentionally don't emulate this function at the moment.
|
|
|
|
// We don't emulate proper GP timing anyway at the moment, so it would just slow down emulation.
|
2022-11-27 12:50:50 +00:00
|
|
|
void CommandProcessorManager::SetCpClearRegister()
|
Big Fifo Commit Part2: Now the fifo is more stable than my first commit, so is time...
- ReImplementing Single Core Mode like Dual Core Mode Style.
- Stage 1: My goal is, we have the Fifo, CommandProccessor code the more clear, maintenible and documented possible. When I quit dolphin I want any developer can continue with the work only reading the code.
* Big Refactoring: A lot of functions was changed the names, and modularized.
Now the FifoLoop and CatchUpGPU does not exist, was replaced by RunGpu() and RunGpuLoop().
The general idea is modeling the code like the real HW. The fifo is only a buffer where the Write Gather Pipe write the commands and from the Graphic Processor read these.
* Big Clean UP a lot of obsolete code and comments was deleted, like DcFakeWachDog, "Fifo very soon hack", etc.
In the stage 2, I will refactoring more code doing emphasis in the division of CommandProcessor, Fifo, Gpu Emulation. Beside I will comment all functions and variables in the code (Don't worry I will ask for English help for this part ;) )
Please test a lot SC mode and DC mode :)
Thank you so much for testing always and the patience. I don't like broke your favorite game but... you must believe me this part is very sensible, I only try to contribute for have a better and stable dolphin emulator.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7185 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-02-17 04:25:21 +00:00
|
|
|
{
|
|
|
|
}
|
2010-12-11 12:42:55 +00:00
|
|
|
|
2023-12-20 13:40:38 +00:00
|
|
|
void CommandProcessorManager::HandleUnknownOpcode(u8 cmd_byte, const u8* buffer, bool preprocess)
|
2017-01-27 08:44:31 +00:00
|
|
|
{
|
2022-02-13 02:29:59 +00:00
|
|
|
// Datel software uses 0x01 during startup, and Mario Party 5's Wiggler capsule accidentally uses
|
|
|
|
// 0x01-0x03 due to sending 4 more vertices than intended (see https://dolp.in/i8104).
|
|
|
|
// Prince of Persia: Rival Swords sends 0x3f if the home menu is opened during the intro cutscene
|
|
|
|
// due to a game bug resulting in an incorrect vertex desc that results in the float value 1.0,
|
|
|
|
// encoded as 0x3f800000, being parsed as an opcode (see https://dolp.in/i9203).
|
|
|
|
//
|
|
|
|
// Hardware testing indicates that these opcodes do nothing, so to avoid annoying the user with
|
2022-01-23 06:02:20 +00:00
|
|
|
// spurious popups, we don't create a panic alert in those cases. Other unknown opcodes
|
2022-02-13 02:29:59 +00:00
|
|
|
// (such as 0x18) seem to result in actual hangs on real hardware, so the alert still is important
|
|
|
|
// to keep around for unexpected cases.
|
|
|
|
const bool suppress_panic_alert = (cmd_byte <= 0x7) || (cmd_byte == 0x3f);
|
|
|
|
|
2022-02-13 22:14:46 +00:00
|
|
|
const auto log_level =
|
|
|
|
suppress_panic_alert ? Common::Log::LogLevel::LWARNING : Common::Log::LogLevel::LERROR;
|
|
|
|
|
2022-01-23 06:02:20 +00:00
|
|
|
// We always generate this log message, though we only generate the panic alerts once.
|
2022-02-13 01:44:07 +00:00
|
|
|
//
|
|
|
|
// PC and LR are generally inaccurate in dual-core and are still misleading in single-core
|
|
|
|
// due to the gather pipe queueing data. Changing GATHER_PIPE_SIZE to 1 and
|
|
|
|
// GATHER_PIPE_EXTRA_SIZE to 16 * 32 in GPFifo.h, and using the cached interpreter CPU emulation
|
|
|
|
// engine, can result in more accurate information (though it is still a bit delayed).
|
|
|
|
// PC and LR are meaningless when using the fifoplayer, and will generally not be helpful if the
|
|
|
|
// unknown opcode is inside of a display list. Also note that the changes in GPFifo.h are not
|
|
|
|
// accurate and may introduce timing issues.
|
2023-12-20 13:40:38 +00:00
|
|
|
const auto& ppc_state = m_system.GetPPCState();
|
2022-02-13 22:14:46 +00:00
|
|
|
GENERIC_LOG_FMT(
|
|
|
|
Common::Log::LogType::VIDEO, log_level,
|
|
|
|
"FIFO: Unknown Opcode {:#04x} @ {}, preprocessing = {}, CPBase: {:#010x}, CPEnd: "
|
|
|
|
"{:#010x}, CPHiWatermark: {:#010x}, CPLoWatermark: {:#010x}, CPReadWriteDistance: "
|
|
|
|
"{:#010x}, CPWritePointer: {:#010x}, CPReadPointer: {:#010x}, CPBreakpoint: "
|
|
|
|
"{:#010x}, bFF_GPReadEnable: {}, bFF_BPEnable: {}, bFF_BPInt: {}, bFF_Breakpoint: "
|
|
|
|
"{}, bFF_GPLinkEnable: {}, bFF_HiWatermarkInt: {}, bFF_LoWatermarkInt: {}, "
|
|
|
|
"approximate PC: {:08x}, approximate LR: {:08x}",
|
|
|
|
cmd_byte, fmt::ptr(buffer), preprocess ? "yes" : "no",
|
2023-12-20 13:40:38 +00:00
|
|
|
m_fifo.CPBase.load(std::memory_order_relaxed), m_fifo.CPEnd.load(std::memory_order_relaxed),
|
|
|
|
m_fifo.CPHiWatermark, m_fifo.CPLoWatermark,
|
|
|
|
m_fifo.CPReadWriteDistance.load(std::memory_order_relaxed),
|
|
|
|
m_fifo.CPWritePointer.load(std::memory_order_relaxed),
|
|
|
|
m_fifo.CPReadPointer.load(std::memory_order_relaxed),
|
|
|
|
m_fifo.CPBreakpoint.load(std::memory_order_relaxed),
|
|
|
|
m_fifo.bFF_GPReadEnable.load(std::memory_order_relaxed) ? "true" : "false",
|
|
|
|
m_fifo.bFF_BPEnable.load(std::memory_order_relaxed) ? "true" : "false",
|
|
|
|
m_fifo.bFF_BPInt.load(std::memory_order_relaxed) ? "true" : "false",
|
|
|
|
m_fifo.bFF_Breakpoint.load(std::memory_order_relaxed) ? "true" : "false",
|
|
|
|
m_fifo.bFF_GPLinkEnable.load(std::memory_order_relaxed) ? "true" : "false",
|
|
|
|
m_fifo.bFF_HiWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false",
|
|
|
|
m_fifo.bFF_LoWatermarkInt.load(std::memory_order_relaxed) ? "true" : "false", ppc_state.pc,
|
2023-03-28 20:07:50 +00:00
|
|
|
LR(ppc_state));
|
2022-02-13 22:08:16 +00:00
|
|
|
|
2022-11-27 12:50:50 +00:00
|
|
|
if (!m_is_fifo_error_seen && !suppress_panic_alert)
|
2022-02-13 22:08:16 +00:00
|
|
|
{
|
2022-11-27 12:50:50 +00:00
|
|
|
m_is_fifo_error_seen = true;
|
2022-02-13 22:08:16 +00:00
|
|
|
|
2023-02-19 15:30:06 +00:00
|
|
|
// The panic alert contains an explanatory part that's worded differently depending on the
|
|
|
|
// user's settings, so as to offer the most relevant advice to the user.
|
|
|
|
const char* advice;
|
2023-12-20 13:40:38 +00:00
|
|
|
if (IsOnThread(m_system) && !m_system.GetFifo().UseDeterministicGPUThread())
|
2023-02-19 15:30:06 +00:00
|
|
|
{
|
2023-12-20 13:40:38 +00:00
|
|
|
if (!m_system.GetCoreTiming().UseSyncOnSkipIdle() && !m_system.GetFifo().UseSyncGPU())
|
2023-02-19 15:30:06 +00:00
|
|
|
{
|
|
|
|
// The SyncOnSkipIdle setting is only in the Android GUI, so we use the INI name on other platforms.
|
|
|
|
//
|
|
|
|
// TODO: Mark the Android string as translatable once we have translations on Android. It's
|
|
|
|
// currently untranslatable so translators won't try to look up how they translated "Synchronize
|
|
|
|
// GPU Thread" and "On Idle Skipping" and then not find those strings and become confused.
|
|
|
|
#ifdef ANDROID
|
|
|
|
advice = "Please change the \"Synchronize GPU Thread\" setting to \"On Idle Skipping\"! "
|
|
|
|
"It's currently set to \"Never\", which makes this problem very likely to happen.";
|
|
|
|
#else
|
|
|
|
// i18n: Please leave SyncOnSkipIdle and True untranslated.
|
|
|
|
// The user needs to enter these terms as-is in an INI file.
|
|
|
|
advice = _trans("Please change the \"SyncOnSkipIdle\" setting to \"True\"! "
|
|
|
|
"It's currently disabled, which makes this problem very likely to happen.");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
advice = _trans(
|
|
|
|
"This error is usually caused by the emulated GPU desyncing with the emulated CPU. "
|
|
|
|
"Turn off the \"Dual Core\" setting to avoid this.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
advice = _trans(
|
|
|
|
"This error is usually caused by the emulated GPU desyncing with the emulated CPU, "
|
|
|
|
"but your current settings make this unlikely to happen. If this error is stopping the "
|
|
|
|
"game from working, please report it to the developers.");
|
|
|
|
}
|
|
|
|
|
2022-02-13 22:08:16 +00:00
|
|
|
PanicAlertFmtT("GFX FIFO: Unknown Opcode ({0:#04x} @ {1}, preprocess={2}).\n"
|
2023-02-19 15:30:06 +00:00
|
|
|
"\n"
|
|
|
|
"{3}\n"
|
|
|
|
"\n"
|
|
|
|
"Further errors will be sent to the Video Backend log and "
|
2022-08-23 02:52:13 +00:00
|
|
|
"Dolphin will now likely crash or hang.",
|
2023-02-19 15:30:06 +00:00
|
|
|
cmd_byte, fmt::ptr(buffer), preprocess, Common::GetStringT(advice));
|
2022-02-13 22:08:16 +00:00
|
|
|
}
|
2017-01-27 08:44:31 +00:00
|
|
|
}
|
|
|
|
|
2021-06-07 08:55:52 +00:00
|
|
|
} // namespace CommandProcessor
|