SI: Move MAX_SI_CHANNELS into the SerialInterface namespace

Given this constant is related to the serial interface, it shouldn't be
outside of the namespace.
This commit is contained in:
Lioncash committed 2017-03-16 01:57:57 -04:00
1 parent 3b1dae5642
commit a728d858b3
6 files changed
+16 -16

No files matched your search

+4 -4
View File
@@ -61,7 +61,7 @@ public:
bool bSetEmulationSpeed;
bool bSetVolume;
std::array<bool, MAX_BBMOTES> bSetWiimoteSource;
std::array<bool, MAX_SI_CHANNELS> bSetPads;
std::array<bool, SerialInterface::MAX_SI_CHANNELS> bSetPads;
std::array<bool, MAX_EXI_CHANNELS> bSetEXIDevice;
private:
@@ -92,7 +92,7 @@ private:
std::string sBackend;
std::string m_strGPUDeterminismMode;
std::array<int, MAX_BBMOTES> iWiimoteSource;
std::array<SIDevices, MAX_SI_CHANNELS> Pads;
std::array<SIDevices, SerialInterface::MAX_SI_CHANNELS> Pads;
std::array<TEXIDevices, MAX_EXI_CHANNELS> m_EXIDevice;
};
@@ -180,7 +180,7 @@ void ConfigCache::RestoreConfig(SConfig* config)
config->m_wii_language = m_wii_language;
}
for (unsigned int i = 0; i < MAX_SI_CHANNELS; ++i)
for (unsigned int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
if (bSetPads[i])
config->m_SIDevice[i] = Pads[i];
@@ -279,7 +279,7 @@ bool BootCore(const std::string& _rFilename)
core_section->Get("Overclock", &StartUp.m_OCFactor, StartUp.m_OCFactor);
core_section->Get("OverclockEnable", &StartUp.m_OCEnable, StartUp.m_OCEnable);
for (unsigned int i = 0; i < MAX_SI_CHANNELS; ++i)
for (unsigned int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
int source;
controls_section->Get(StringFromFormat("PadType%u", i), &source, -1);
+2 -2
View File
@@ -257,7 +257,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("SlotB", m_EXIDevice[1]);
core->Set("SerialPort1", m_EXIDevice[2]);
core->Set("BBA_MAC", m_bba_mac);
for (int i = 0; i < MAX_SI_CHANNELS; ++i)
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
core->Set(StringFromFormat("SIDevice%i", i), m_SIDevice[i]);
core->Set(StringFromFormat("AdapterRumble%i", i), m_AdapterRumble[i]);
@@ -577,7 +577,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("BBA_MAC", &m_bba_mac);
core->Get("TimeProfiling", &bJITILTimeProfiling, false);
core->Get("OutputIR", &bJITILOutputIR, false);
for (int i = 0; i < MAX_SI_CHANNELS; ++i)
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
core->Get(StringFromFormat("SIDevice%i", i), (u32*)&m_SIDevice[i],
(i == 0) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE);
+2 -2
View File
@@ -15,14 +15,14 @@ namespace MMIO
class Mapping;
}
namespace SerialInterface
{
// SI number of channels
enum
{
MAX_SI_CHANNELS = 0x04
};
namespace SerialInterface
{
void Init();
void Shutdown();
void DoState(PointerWrap& p);
+3 -3
View File
@@ -484,14 +484,14 @@ void ChangePads(bool instantly)
int controllers = 0;
for (int i = 0; i < MAX_SI_CHANNELS; ++i)
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
if (SIDevice_IsGCController(SConfig::GetInstance().m_SIDevice[i]))
controllers |= (1 << i);
if (instantly && (s_controllers & 0x0F) == controllers)
return;
for (int i = 0; i < MAX_SI_CHANNELS; ++i)
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
SIDevices device = SIDEVICE_NONE;
if (IsUsingPad(i))
@@ -563,7 +563,7 @@ bool BeginRecordingInput(int controllers)
s_rerecords = 0;
for (int i = 0; i < MAX_SI_CHANNELS; ++i)
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
s_bongos |= (1 << i);