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:
parent
3b1dae5642
commit
a728d858b3
|
@ -61,7 +61,7 @@ public:
|
||||||
bool bSetEmulationSpeed;
|
bool bSetEmulationSpeed;
|
||||||
bool bSetVolume;
|
bool bSetVolume;
|
||||||
std::array<bool, MAX_BBMOTES> bSetWiimoteSource;
|
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;
|
std::array<bool, MAX_EXI_CHANNELS> bSetEXIDevice;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -92,7 +92,7 @@ private:
|
||||||
std::string sBackend;
|
std::string sBackend;
|
||||||
std::string m_strGPUDeterminismMode;
|
std::string m_strGPUDeterminismMode;
|
||||||
std::array<int, MAX_BBMOTES> iWiimoteSource;
|
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;
|
std::array<TEXIDevices, MAX_EXI_CHANNELS> m_EXIDevice;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ void ConfigCache::RestoreConfig(SConfig* config)
|
||||||
config->m_wii_language = m_wii_language;
|
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])
|
if (bSetPads[i])
|
||||||
config->m_SIDevice[i] = Pads[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("Overclock", &StartUp.m_OCFactor, StartUp.m_OCFactor);
|
||||||
core_section->Get("OverclockEnable", &StartUp.m_OCEnable, StartUp.m_OCEnable);
|
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;
|
int source;
|
||||||
controls_section->Get(StringFromFormat("PadType%u", i), &source, -1);
|
controls_section->Get(StringFromFormat("PadType%u", i), &source, -1);
|
||||||
|
|
|
@ -257,7 +257,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
|
||||||
core->Set("SlotB", m_EXIDevice[1]);
|
core->Set("SlotB", m_EXIDevice[1]);
|
||||||
core->Set("SerialPort1", m_EXIDevice[2]);
|
core->Set("SerialPort1", m_EXIDevice[2]);
|
||||||
core->Set("BBA_MAC", m_bba_mac);
|
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("SIDevice%i", i), m_SIDevice[i]);
|
||||||
core->Set(StringFromFormat("AdapterRumble%i", i), m_AdapterRumble[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("BBA_MAC", &m_bba_mac);
|
||||||
core->Get("TimeProfiling", &bJITILTimeProfiling, false);
|
core->Get("TimeProfiling", &bJITILTimeProfiling, false);
|
||||||
core->Get("OutputIR", &bJITILOutputIR, 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],
|
core->Get(StringFromFormat("SIDevice%i", i), (u32*)&m_SIDevice[i],
|
||||||
(i == 0) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE);
|
(i == 0) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE);
|
||||||
|
|
|
@ -15,14 +15,14 @@ namespace MMIO
|
||||||
class Mapping;
|
class Mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace SerialInterface
|
||||||
|
{
|
||||||
// SI number of channels
|
// SI number of channels
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
MAX_SI_CHANNELS = 0x04
|
MAX_SI_CHANNELS = 0x04
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace SerialInterface
|
|
||||||
{
|
|
||||||
void Init();
|
void Init();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
void DoState(PointerWrap& p);
|
void DoState(PointerWrap& p);
|
||||||
|
|
|
@ -484,14 +484,14 @@ void ChangePads(bool instantly)
|
||||||
|
|
||||||
int controllers = 0;
|
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]))
|
if (SIDevice_IsGCController(SConfig::GetInstance().m_SIDevice[i]))
|
||||||
controllers |= (1 << i);
|
controllers |= (1 << i);
|
||||||
|
|
||||||
if (instantly && (s_controllers & 0x0F) == controllers)
|
if (instantly && (s_controllers & 0x0F) == controllers)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < MAX_SI_CHANNELS; ++i)
|
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
|
||||||
{
|
{
|
||||||
SIDevices device = SIDEVICE_NONE;
|
SIDevices device = SIDEVICE_NONE;
|
||||||
if (IsUsingPad(i))
|
if (IsUsingPad(i))
|
||||||
|
@ -563,7 +563,7 @@ bool BeginRecordingInput(int controllers)
|
||||||
|
|
||||||
s_rerecords = 0;
|
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)
|
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
|
||||||
s_bongos |= (1 << i);
|
s_bongos |= (1 << i);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ static void Setup();
|
||||||
|
|
||||||
static bool s_detected = false;
|
static bool s_detected = false;
|
||||||
static libusb_device_handle* s_handle = nullptr;
|
static libusb_device_handle* s_handle = nullptr;
|
||||||
static u8 s_controller_type[MAX_SI_CHANNELS] = {
|
static u8 s_controller_type[SerialInterface::MAX_SI_CHANNELS] = {
|
||||||
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE,
|
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE,
|
||||||
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE};
|
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE};
|
||||||
static u8 s_controller_rumble[4];
|
static u8 s_controller_rumble[4];
|
||||||
|
@ -199,7 +199,7 @@ static void Setup()
|
||||||
libusb_device** list;
|
libusb_device** list;
|
||||||
ssize_t cnt = libusb_get_device_list(s_libusb_context.get(), &list);
|
ssize_t cnt = libusb_get_device_list(s_libusb_context.get(), &list);
|
||||||
|
|
||||||
for (int i = 0; i < MAX_SI_CHANNELS; i++)
|
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; i++)
|
||||||
{
|
{
|
||||||
s_controller_type[i] = ControllerTypes::CONTROLLER_NONE;
|
s_controller_type[i] = ControllerTypes::CONTROLLER_NONE;
|
||||||
s_controller_rumble[i] = 0;
|
s_controller_rumble[i] = 0;
|
||||||
|
@ -350,7 +350,7 @@ static void Reset()
|
||||||
s_adapter_thread.join();
|
s_adapter_thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < MAX_SI_CHANNELS; i++)
|
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; i++)
|
||||||
s_controller_type[i] = ControllerTypes::CONTROLLER_NONE;
|
s_controller_type[i] = ControllerTypes::CONTROLLER_NONE;
|
||||||
|
|
||||||
s_detected = false;
|
s_detected = false;
|
||||||
|
|
|
@ -33,7 +33,7 @@ static jclass s_adapter_class;
|
||||||
|
|
||||||
static bool s_detected = false;
|
static bool s_detected = false;
|
||||||
static int s_fd = 0;
|
static int s_fd = 0;
|
||||||
static u8 s_controller_type[MAX_SI_CHANNELS] = {
|
static u8 s_controller_type[SerialInterface::MAX_SI_CHANNELS] = {
|
||||||
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE,
|
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE,
|
||||||
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE};
|
ControllerTypes::CONTROLLER_NONE, ControllerTypes::CONTROLLER_NONE};
|
||||||
static u8 s_controller_rumble[4];
|
static u8 s_controller_rumble[4];
|
||||||
|
@ -234,7 +234,7 @@ static void Reset()
|
||||||
if (s_read_adapter_thread_running.TestAndClear())
|
if (s_read_adapter_thread_running.TestAndClear())
|
||||||
s_read_adapter_thread.join();
|
s_read_adapter_thread.join();
|
||||||
|
|
||||||
for (int i = 0; i < MAX_SI_CHANNELS; i++)
|
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; i++)
|
||||||
s_controller_type[i] = ControllerTypes::CONTROLLER_NONE;
|
s_controller_type[i] = ControllerTypes::CONTROLLER_NONE;
|
||||||
|
|
||||||
s_detected = false;
|
s_detected = false;
|
||||||
|
|
Loading…
Reference in New Issue