mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Migrate SConfig::bWii to System.
This commit is contained in:
@ -14,7 +14,6 @@
|
||||
#include "Common/EnumMap.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/DolphinAnalytics.h"
|
||||
#include "Core/FifoPlayer/FifoPlayer.h"
|
||||
@ -389,7 +388,8 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
|
||||
u32 addr = bpmem.tmem_config.tlut_src << 5;
|
||||
|
||||
// The GameCube ignores the upper bits of this address. Some games (WW, MKDD) set them.
|
||||
if (!SConfig::GetInstance().bWii)
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (!system.IsWii())
|
||||
addr = addr & 0x01FFFFFF;
|
||||
|
||||
// The copy below will always be in bounds as tmem is bigger than the maximum address a TLUT can
|
||||
@ -400,7 +400,6 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager&
|
||||
(1 << bpmem.tmem_config.tlut_dest.tmem_line_count.NumBits()) * TMEM_LINE_SIZE;
|
||||
static_assert(MAX_LOADABLE_TMEM_ADDR + MAX_TMEM_LINE_COUNT < TMEM_SIZE);
|
||||
|
||||
auto& system = Core::System::GetInstance();
|
||||
auto& memory = system.GetMemory();
|
||||
memory.CopyFromEmu(texMem + tmem_addr, addr, tmem_transfer_count);
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "Common/EnumUtils.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/DolphinAnalytics.h"
|
||||
#include "Core/System.h"
|
||||
#include "VideoCommon/CommandProcessor.h"
|
||||
#include "VideoCommon/VertexLoaderManager.h"
|
||||
|
||||
@ -186,7 +187,7 @@ void CPState::LoadCPReg(u8 sub_cmd, u32 value)
|
||||
// Pointers to vertex arrays in GC RAM
|
||||
case ARRAY_BASE:
|
||||
array_bases[static_cast<CPArray>(sub_cmd & CP_ARRAY_MASK)] =
|
||||
value & CommandProcessor::GetPhysicalAddressMask();
|
||||
value & CommandProcessor::GetPhysicalAddressMask(Core::System::GetInstance().IsWii());
|
||||
break;
|
||||
|
||||
case ARRAY_STRIDE:
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "Common/Flag.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/HW/GPFifo.h"
|
||||
#include "Core/HW/MMIO.h"
|
||||
@ -137,19 +136,12 @@ void CommandProcessorManager::Init()
|
||||
m_system.GetCoreTiming().RegisterEvent("CPInterrupt", UpdateInterrupts_Wrapper);
|
||||
}
|
||||
|
||||
u32 GetPhysicalAddressMask()
|
||||
{
|
||||
// Physical addresses in CP seem to ignore some of the upper bits (depending on platform)
|
||||
// This can be observed in CP MMIO registers by setting to 0xffffffff and then reading back.
|
||||
return SConfig::GetInstance().bWii ? 0x1fffffff : 0x03ffffff;
|
||||
}
|
||||
|
||||
void CommandProcessorManager::RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
||||
{
|
||||
constexpr u16 WMASK_NONE = 0x0000;
|
||||
constexpr u16 WMASK_ALL = 0xffff;
|
||||
constexpr u16 WMASK_LO_ALIGN_32BIT = 0xffe0;
|
||||
const u16 WMASK_HI_RESTRICT = GetPhysicalAddressMask() >> 16;
|
||||
const u16 WMASK_HI_RESTRICT = GetPhysicalAddressMask(m_system.IsWii()) >> 16;
|
||||
|
||||
struct
|
||||
{
|
||||
|
@ -155,7 +155,12 @@ union UCPClearReg
|
||||
UCPClearReg(u16 _hex) { Hex = _hex; }
|
||||
};
|
||||
|
||||
u32 GetPhysicalAddressMask();
|
||||
constexpr u32 GetPhysicalAddressMask(bool is_wii)
|
||||
{
|
||||
// Physical addresses in CP seem to ignore some of the upper bits (depending on platform)
|
||||
// This can be observed in CP MMIO registers by setting to 0xffffffff and then reading back.
|
||||
return is_wii ? 0x1fffffff : 0x03ffffff;
|
||||
}
|
||||
|
||||
class CommandProcessorManager
|
||||
{
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "Common/MathUtil.h"
|
||||
#include "Common/SmallVector.h"
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/DolphinAnalytics.h"
|
||||
#include "Core/HW/SystemTimers.h"
|
||||
#include "Core/System.h"
|
||||
@ -511,7 +510,8 @@ void VertexManagerBase::Flush()
|
||||
#endif
|
||||
|
||||
// Track some stats used elsewhere by the anamorphic widescreen heuristic.
|
||||
if (!SConfig::GetInstance().bWii)
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (!system.IsWii())
|
||||
{
|
||||
const bool is_perspective = xfmem.projection.type == ProjectionType::Perspective;
|
||||
|
||||
@ -538,7 +538,6 @@ void VertexManagerBase::Flush()
|
||||
}
|
||||
}
|
||||
|
||||
auto& system = Core::System::GetInstance();
|
||||
auto& pixel_shader_manager = system.GetPixelShaderManager();
|
||||
auto& geometry_shader_manager = system.GetGeometryShaderManager();
|
||||
auto& vertex_shader_manager = system.GetVertexShaderManager();
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Core/Config/SYSCONFSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include "VideoCommon/VertexManagerBase.h"
|
||||
|
||||
@ -23,7 +23,8 @@ WidescreenManager::WidescreenManager()
|
||||
"Widescreen");
|
||||
|
||||
// VertexManager doesn't maintain statistics in Wii mode.
|
||||
if (!SConfig::GetInstance().bWii)
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (!system.IsWii())
|
||||
{
|
||||
m_update_widescreen =
|
||||
AfterFrameEvent::Register([this] { UpdateWidescreenHeuristic(); }, "WideScreen Heuristic");
|
||||
@ -32,7 +33,8 @@ WidescreenManager::WidescreenManager()
|
||||
|
||||
void WidescreenManager::Update()
|
||||
{
|
||||
if (SConfig::GetInstance().bWii)
|
||||
auto& system = Core::System::GetInstance();
|
||||
if (system.IsWii())
|
||||
m_is_game_widescreen = Config::Get(Config::SYSCONF_WIDESCREEN);
|
||||
|
||||
// suggested_aspect_mode overrides SYSCONF_WIDESCREEN
|
||||
|
Reference in New Issue
Block a user