mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-03 11:32:43 +01:00
Allow configuring SP2
Note that the default was AD16 before, and I've now changed it to None.
This commit is contained in:
parent
76d4fc4541
commit
8d7d7ab5e9
@ -117,6 +117,8 @@ const Info<ExpansionInterface::EXIDeviceType> MAIN_SLOT_B{{System::Main, "Core",
|
||||
ExpansionInterface::EXIDeviceType::None};
|
||||
const Info<ExpansionInterface::EXIDeviceType> MAIN_SERIAL_PORT_1{
|
||||
{System::Main, "Core", "SerialPort1"}, ExpansionInterface::EXIDeviceType::None};
|
||||
const Info<ExpansionInterface::EXIDeviceType> MAIN_SERIAL_PORT_2{
|
||||
{System::Main, "Core", "SerialPort2"}, ExpansionInterface::EXIDeviceType::None};
|
||||
|
||||
const Info<ExpansionInterface::EXIDeviceType>& GetInfoForEXIDevice(ExpansionInterface::Slot slot)
|
||||
{
|
||||
@ -126,6 +128,7 @@ const Info<ExpansionInterface::EXIDeviceType>& GetInfoForEXIDevice(ExpansionInte
|
||||
&MAIN_SLOT_A,
|
||||
&MAIN_SLOT_B,
|
||||
&MAIN_SERIAL_PORT_1,
|
||||
&MAIN_SERIAL_PORT_2,
|
||||
};
|
||||
return *infos[slot];
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ extern const Info<int> MAIN_MEMORY_CARD_SIZE;
|
||||
extern const Info<ExpansionInterface::EXIDeviceType> MAIN_SLOT_A;
|
||||
extern const Info<ExpansionInterface::EXIDeviceType> MAIN_SLOT_B;
|
||||
extern const Info<ExpansionInterface::EXIDeviceType> MAIN_SERIAL_PORT_1;
|
||||
extern const Info<ExpansionInterface::EXIDeviceType> MAIN_SERIAL_PORT_2;
|
||||
const Info<ExpansionInterface::EXIDeviceType>& GetInfoForEXIDevice(ExpansionInterface::Slot slot);
|
||||
extern const Info<std::string> MAIN_BBA_MAC;
|
||||
extern const Info<std::string> MAIN_BBA_XLINK_IP;
|
||||
|
@ -76,6 +76,8 @@ u8 SlotToEXIChannel(Slot slot)
|
||||
return 1;
|
||||
case Slot::SP1:
|
||||
return 0;
|
||||
case Slot::SP2:
|
||||
return 2;
|
||||
default:
|
||||
PanicAlertFmt("Unhandled slot {}", slot);
|
||||
return 0;
|
||||
@ -92,6 +94,8 @@ u8 SlotToEXIDevice(Slot slot)
|
||||
return 0;
|
||||
case Slot::SP1:
|
||||
return 2;
|
||||
case Slot::SP2:
|
||||
return 0;
|
||||
default:
|
||||
PanicAlertFmt("Unhandled slot {}", slot);
|
||||
return 0;
|
||||
@ -143,7 +147,8 @@ void ExpansionInterfaceManager::Init(const Sram* override_sram)
|
||||
m_channels[0]->AddDevice(EXIDeviceType::MaskROM, 1);
|
||||
m_channels[SlotToEXIChannel(Slot::SP1)]->AddDevice(Config::Get(Config::MAIN_SERIAL_PORT_1),
|
||||
SlotToEXIDevice(Slot::SP1));
|
||||
m_channels[2]->AddDevice(EXIDeviceType::AD16, 0);
|
||||
m_channels[SlotToEXIChannel(Slot::SP2)]->AddDevice(Config::Get(Config::MAIN_SERIAL_PORT_2),
|
||||
SlotToEXIDevice(Slot::SP2));
|
||||
|
||||
m_event_type_change_device = core_timing.RegisterEvent("ChangeEXIDevice", ChangeDeviceCallback);
|
||||
m_event_type_update_interrupts =
|
||||
|
@ -44,11 +44,12 @@ enum class Slot : int
|
||||
A,
|
||||
B,
|
||||
SP1,
|
||||
SP2,
|
||||
};
|
||||
// Note: using auto here results in a false warning on GCC
|
||||
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80351
|
||||
constexpr std::initializer_list<Slot> SLOTS = {Slot::A, Slot::B, Slot::SP1};
|
||||
constexpr auto MAX_SLOT = Slot::SP1;
|
||||
constexpr std::initializer_list<Slot> SLOTS = {Slot::A, Slot::B, Slot::SP1, Slot::SP2};
|
||||
constexpr auto MAX_SLOT = Slot::SP2;
|
||||
constexpr std::initializer_list<Slot> MEMCARD_SLOTS = {Slot::A, Slot::B};
|
||||
constexpr auto MAX_MEMCARD_SLOT = Slot::B;
|
||||
constexpr bool IsMemcardSlot(Slot slot)
|
||||
@ -106,5 +107,5 @@ private:
|
||||
template <>
|
||||
struct fmt::formatter<ExpansionInterface::Slot> : EnumFormatter<ExpansionInterface::MAX_SLOT>
|
||||
{
|
||||
constexpr formatter() : EnumFormatter({"Slot A", "Slot B", "Serial Port 1"}) {}
|
||||
constexpr formatter() : EnumFormatter({"Slot A", "Slot B", "Serial Port 1", "Serial Port 2"}) {}
|
||||
};
|
||||
|
@ -1378,6 +1378,11 @@ bool NetPlayServer::SetupNetSettings()
|
||||
// There's no way the BBA is going to sync, disable it
|
||||
device = ExpansionInterface::EXIDeviceType::None;
|
||||
}
|
||||
else if (slot == ExpansionInterface::Slot::SP2)
|
||||
{
|
||||
// SD cards probably won't sync either
|
||||
device = ExpansionInterface::EXIDeviceType::None;
|
||||
}
|
||||
else
|
||||
{
|
||||
device = Config::Get(Config::GetInfoForEXIDevice(slot));
|
||||
|
@ -158,6 +158,14 @@ void GameCubePane::CreateWidgets()
|
||||
static_cast<int>(device));
|
||||
}
|
||||
|
||||
// Add SP2 devices
|
||||
for (const auto device :
|
||||
{EXIDeviceType::None, EXIDeviceType::Dummy, EXIDeviceType::AD16, EXIDeviceType::SD})
|
||||
{
|
||||
m_slot_combos[ExpansionInterface::Slot::SP2]->addItem(tr(fmt::format("{:n}", device).c_str()),
|
||||
static_cast<int>(device));
|
||||
}
|
||||
|
||||
{
|
||||
int row = 0;
|
||||
device_layout->addWidget(new QLabel(tr("Slot A:")), row, 0);
|
||||
@ -191,6 +199,11 @@ void GameCubePane::CreateWidgets()
|
||||
device_layout->addWidget(new QLabel(tr("SP1:")), row, 0);
|
||||
device_layout->addWidget(m_slot_combos[ExpansionInterface::Slot::SP1], row, 1);
|
||||
device_layout->addWidget(m_slot_buttons[ExpansionInterface::Slot::SP1], row, 2);
|
||||
|
||||
++row;
|
||||
device_layout->addWidget(new QLabel(tr("SP2:")), row, 0);
|
||||
device_layout->addWidget(m_slot_combos[ExpansionInterface::Slot::SP2], row, 1);
|
||||
device_layout->addWidget(m_slot_buttons[ExpansionInterface::Slot::SP2], row, 2);
|
||||
}
|
||||
|
||||
#ifdef HAS_LIBMGBA
|
||||
@ -358,6 +371,9 @@ void GameCubePane::UpdateButton(ExpansionInterface::Slot slot)
|
||||
device == ExpansionInterface::EXIDeviceType::EthernetBuiltIn ||
|
||||
device == ExpansionInterface::EXIDeviceType::ModemTapServer);
|
||||
break;
|
||||
case ExpansionInterface::Slot::SP2:
|
||||
has_config = false; // TODO
|
||||
break;
|
||||
}
|
||||
|
||||
m_slot_buttons[slot]->setEnabled(has_config);
|
||||
|
Loading…
x
Reference in New Issue
Block a user