Add Uthernet configuration.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
9aefc20d24
commit
f1b9232933
2 changed files with 50 additions and 7 deletions
|
@ -21,6 +21,9 @@
|
|||
#include "Debugger/Debug.h"
|
||||
#include "Debugger/DebugDefs.h"
|
||||
|
||||
#include "Tfe/tfe.h"
|
||||
#include "Tfe/tfesupp.h"
|
||||
|
||||
#include "imgui_internal.h"
|
||||
|
||||
namespace
|
||||
|
@ -548,6 +551,41 @@ namespace sa2
|
|||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Uthernet"))
|
||||
{
|
||||
standardLabelText("Status", tfe_enabled ? "enabled" : "disabled");
|
||||
if (ImGui::BeginCombo("Interface", static_cast<const char *>(get_tfe_interface())))
|
||||
{
|
||||
if (tfe_enumadapter_open())
|
||||
{
|
||||
char *pname;
|
||||
char *pdescription;
|
||||
|
||||
while (tfe_enumadapter(&pname, &pdescription))
|
||||
{
|
||||
// must call it each time
|
||||
// as update_tfe_interface() will invalidate it
|
||||
const char * current = static_cast<const char *>(get_tfe_interface());
|
||||
const bool isSelected = strcmp(pname, current) == 0;
|
||||
if (ImGui::Selectable(pname, isSelected))
|
||||
{
|
||||
update_tfe_interface(pname, nullptr);
|
||||
RegSaveString(TEXT(REG_CONFIG), TEXT(REGVALUE_UTHERNET_INTERFACE), 1, pname);
|
||||
}
|
||||
if (isSelected)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
lib_free(pname);
|
||||
lib_free(pdescription);
|
||||
}
|
||||
tfe_enumadapter_close();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Debugger"))
|
||||
{
|
||||
if (ImGui::RadioButton("Color", g_iColorScheme == SCHEME_COLOR)) { g_iColorScheme = SCHEME_COLOR; } ImGui::SameLine();
|
||||
|
|
|
@ -153,21 +153,26 @@ namespace sa2
|
|||
|
||||
switch (slot)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
const bool enabled = card == CT_Uthernet;
|
||||
REGSAVE(REGVALUE_UTHERNET_ACTIVE, enabled);
|
||||
// needs a reboot anyway
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
const bool enabled = card == CT_GenericHDD;
|
||||
REGSAVE(REGVALUE_HDD_ENABLED, enabled);
|
||||
HD_SetEnabled(enabled);
|
||||
}
|
||||
default:
|
||||
{
|
||||
// we do not use REGVALUE_SLOT5 as they are not "runtime friendly"
|
||||
const std::string label = "Slot " + std::to_string(slot);
|
||||
REGSAVE(label.c_str(), (DWORD)card);
|
||||
cardManager.Insert(slot, card);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
// we do not use REGVALUE_SLOT5 as they are not "runtime friendly"
|
||||
const std::string label = "Slot " + std::to_string(slot);
|
||||
REGSAVE(label.c_str(), (DWORD)card);
|
||||
cardManager.Insert(slot, card);
|
||||
}
|
||||
|
||||
void setVideoStyle(Video & video, const VideoStyle_e style, const bool enabled)
|
||||
|
|
Loading…
Add table
Reference in a new issue